From patchwork Wed Aug 13 13:12:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omair Javaid X-Patchwork-Id: 35357 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f199.google.com (mail-pd0-f199.google.com [209.85.192.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id ECB7D203C5 for ; Wed, 13 Aug 2014 13:13:41 +0000 (UTC) Received: by mail-pd0-f199.google.com with SMTP id v10sf46352160pde.2 for ; Wed, 13 Aug 2014 06:13:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=oTXUFykSYMUWh8SBKkqEacaG9iNHD5IOf3Z3TaB4J2g=; b=YRLzJjhlE2cfJP5gyMDcP4e+wxJQj3yThVw97SenQlkwKdDdJGWZLs6K8eci8meyl3 M3OyRaA7SimUhFBPDSl5Xn2qlmEAc0BTyJDwtyUu7AtCShvOAbUrrh9iywu0BZH3DqfD SFLerYyhYjD6yUKULOkIRgQnFG4pqfLKL8JwsnqKYlUHG4jOqs+1FtfUgd65k3w9w3fh pftvtYzTIn7iM5GLTSWLX+n9jXpSMCZk5Kfo8v9Jm3HCdSUqj3NqVeRoKjCOXq5Vw5JZ zdJOZypJ2vg1ke6xts6cQG7qYzsAoJrAqVNGJtmjev269nhQFCip9KeUu2Iq4IiHh6yg njaA== X-Gm-Message-State: ALoCoQnL/Us4G638F7jPN+Y6t6DgGWWSfvjozB3JdRYWHexAB9hdPGyMXrP1ouzV6r1ll0vsUVNY X-Received: by 10.66.141.48 with SMTP id rl16mr2313731pab.1.1407935621250; Wed, 13 Aug 2014 06:13:41 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.25.80 with SMTP id 74ls595655qgs.63.gmail; Wed, 13 Aug 2014 06:13:41 -0700 (PDT) X-Received: by 10.221.28.67 with SMTP id rt3mr91453vcb.78.1407935621104; Wed, 13 Aug 2014 06:13:41 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id kq6si1064862vcb.88.2014.08.13.06.13.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 13 Aug 2014 06:13:41 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.181 as permitted sender) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id lf12so14717951vcb.40 for ; Wed, 13 Aug 2014 06:13:41 -0700 (PDT) X-Received: by 10.52.119.229 with SMTP id kx5mr989292vdb.40.1407935621025; Wed, 13 Aug 2014 06:13:41 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp329777vcb; Wed, 13 Aug 2014 06:13:40 -0700 (PDT) X-Received: by 10.194.90.4 with SMTP id bs4mr4458273wjb.71.1407935619623; Wed, 13 Aug 2014 06:13:39 -0700 (PDT) Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by mx.google.com with ESMTPS id a4si2517553wic.29.2014.08.13.06.13.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 13 Aug 2014 06:13:39 -0700 (PDT) Received-SPF: pass (google.com: domain of omair.javaid@linaro.org designates 209.85.212.179 as permitted sender) client-ip=209.85.212.179; Received: by mail-wi0-f179.google.com with SMTP id f8so768237wiw.12 for ; Wed, 13 Aug 2014 06:13:39 -0700 (PDT) X-Received: by 10.180.12.239 with SMTP id b15mr38158244wic.75.1407935619138; Wed, 13 Aug 2014 06:13:39 -0700 (PDT) Received: from localhost.localdomain ([182.185.185.192]) by mx.google.com with ESMTPSA id w14sm50806711wij.2.2014.08.13.06.13.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Aug 2014 06:13:38 -0700 (PDT) From: Omair Javaid To: gdb-patches@sourceware.org Cc: patches@linaro.org Subject: [PATCH v3 5/6] Implement support for recording vector data transfer instructions Date: Wed, 13 Aug 2014 18:12:14 +0500 Message-Id: <1407935535-27978-6-git-send-email-omair.javaid@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1407935535-27978-1-git-send-email-omair.javaid@linaro.org> References: <1407935535-27978-1-git-send-email-omair.javaid@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: omair.javaid@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.181 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , gdb: 2014-08-13 Omair Javaid * arm-tdep.c (arm_record_vdata_transfer_insn): Added record handler for vector data transfer instructions. (arm_record_coproc_data_proc): Updated. --- gdb/arm-tdep.c | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 97 insertions(+), 1 deletion(-) diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 315b5b0..7f651bc 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -11990,6 +11990,102 @@ arm_record_unsupported_insn (insn_decode_record *arm_insn_r) return -1; } +/* Record handler for vector data transfer instructions. */ + +static int +arm_record_vdata_transfer_insn (insn_decode_record *arm_insn_r) +{ + uint32_t bits_a, bit_c, bit_l, reg_t, reg_v; + uint32_t record_buf[4]; + + const int num_regs = gdbarch_num_regs (arm_insn_r->gdbarch); + reg_t = bits (arm_insn_r->arm_insn, 12, 15); + reg_v = bits (arm_insn_r->arm_insn, 21, 23); + bits_a = bits (arm_insn_r->arm_insn, 21, 23); + bit_l = bit (arm_insn_r->arm_insn, 20); + bit_c = bit (arm_insn_r->arm_insn, 8); + + /* Handle VMOV instruction. */ + if (bit_l && bit_c) + { + record_buf[0] = reg_t; + arm_insn_r->reg_rec_count = 1; + } + else if (bit_l && !bit_c) + { + /* Handle VMOV instruction. */ + if (bits_a == 0x00) + { + if (bit (arm_insn_r->arm_insn, 20)) + record_buf[0] = reg_t; + else + record_buf[0] = num_regs + (bit (arm_insn_r->arm_insn, 7) | + (reg_v << 1)); + + arm_insn_r->reg_rec_count = 1; + } + /* Handle VMRS instruction. */ + else if (bits_a == 0x07) + { + if (reg_t == 15) + reg_t = ARM_PS_REGNUM; + + record_buf[0] = reg_t; + arm_insn_r->reg_rec_count = 1; + } + } + else if (!bit_l && !bit_c) + { + /* Handle VMOV instruction. */ + if (bits_a == 0x00) + { + if (bit (arm_insn_r->arm_insn, 20)) + record_buf[0] = reg_t; + else + record_buf[0] = num_regs + (bit (arm_insn_r->arm_insn, 7) | + (reg_v << 1)); + + arm_insn_r->reg_rec_count = 1; + } + /* Handle VMSR instruction. */ + else if (bits_a == 0x07) + { + record_buf[0] = ARM_FPSCR_REGNUM; + arm_insn_r->reg_rec_count = 1; + } + } + else if (!bit_l && bit_c) + { + /* Handle VMOV instruction. */ + if (!(bits_a & 0x04)) + { + record_buf[0] = (reg_v | (bit (arm_insn_r->arm_insn, 7) << 4)) + + ARM_D0_REGNUM; + arm_insn_r->reg_rec_count = 1; + } + /* Handle VDUP instruction. */ + else + { + if (bit (arm_insn_r->arm_insn, 21)) + { + reg_v = reg_v | (bit (arm_insn_r->arm_insn, 7) << 4); + record_buf[0] = reg_v + ARM_D0_REGNUM; + record_buf[1] = reg_v + ARM_D0_REGNUM + 1; + arm_insn_r->reg_rec_count = 2; + } + else + { + reg_v = reg_v | (bit (arm_insn_r->arm_insn, 7) << 4); + record_buf[0] = reg_v + ARM_D0_REGNUM; + arm_insn_r->reg_rec_count = 1; + } + } + } + + REG_ALLOC (arm_insn_r->arm_regs, arm_insn_r->reg_rec_count, record_buf); + return 0; +} + /* Record handler for extension register load/store instructions. */ static int @@ -12467,7 +12563,7 @@ arm_record_coproc_data_proc (insn_decode_record *arm_insn_r) /* Advanced SIMD, VFP instructions. */ if (!op1_sbit && op) - return arm_record_unsupported_insn (arm_insn_r); + return arm_record_vdata_transfer_insn (arm_insn_r); } else {