From patchwork Sat Feb 22 16:48:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omair Javaid X-Patchwork-Id: 25140 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f199.google.com (mail-ob0-f199.google.com [209.85.214.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AF6D2203C6 for ; Sat, 22 Feb 2014 16:49:39 +0000 (UTC) Received: by mail-ob0-f199.google.com with SMTP id uz6sf21911403obc.2 for ; Sat, 22 Feb 2014 08:49:39 -0800 (PST) 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=O/qKeBv4WlX9B+XRnbnxI2aYX3PhDnsTC199K1cNj48=; b=LogCfoLv1+DwnwHQL4irGd1EKKJ8X/F6Udfbk9DbJJbEWugQ/r1ZMxUOVZbGqWseoM LDjuOJGXeI3bdrRfRXmgka8nE3g7QFOtv1oyRPWVZI+RpgVlm6xA9j4zc03hjYUyZszT NH8onvQUTCpOC5AKPrBWBymrvCHyQpsKRh6FZAmgAcC1ERSgvwwhXPQ1GsgbFTmDojwu Yl6//BqVxKWj3i7aSJaUvlk8h49jHKC5xpKC6Ofz9IDPgmzaKmFrIO71oBRHtnf3Jjkz 2XiNYfkrfo6zM/a9lfIePa5O3mrsjeWRlIj4nuCQdgk3XgVX7QsMv5ENiBHg+bmy3Z3S sPkQ== X-Gm-Message-State: ALoCoQkSPU0bEmAuwdEizSrPsSQ8s4+9WaQeqED8RjlxRAoU+XByHyngoKLg6177X7lztZLLx7wc X-Received: by 10.182.104.70 with SMTP id gc6mr4614081obb.35.1393087779262; Sat, 22 Feb 2014 08:49:39 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.31.72 with SMTP id e66ls1430425qge.67.gmail; Sat, 22 Feb 2014 08:49:39 -0800 (PST) X-Received: by 10.221.29.137 with SMTP id ry9mr8256024vcb.6.1393087779045; Sat, 22 Feb 2014 08:49:39 -0800 (PST) Received: from mail-ve0-f179.google.com (mail-ve0-f179.google.com [209.85.128.179]) by mx.google.com with ESMTPS id tr5si4263535vdc.65.2014.02.22.08.49.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 22 Feb 2014 08:49:39 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.179; Received: by mail-ve0-f179.google.com with SMTP id jx11so4450798veb.10 for ; Sat, 22 Feb 2014 08:49:39 -0800 (PST) X-Received: by 10.52.107.35 with SMTP id gz3mr6816306vdb.8.1393087778958; Sat, 22 Feb 2014 08:49:38 -0800 (PST) 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.220.174.196 with SMTP id u4csp114933vcz; Sat, 22 Feb 2014 08:49:38 -0800 (PST) X-Received: by 10.14.177.135 with SMTP id d7mr3563760eem.33.1393087778043; Sat, 22 Feb 2014 08:49:38 -0800 (PST) Received: from mail-ee0-f41.google.com (mail-ee0-f41.google.com [74.125.83.41]) by mx.google.com with ESMTPS id b4si23427024eew.208.2014.02.22.08.49.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 22 Feb 2014 08:49:38 -0800 (PST) Received-SPF: neutral (google.com: 74.125.83.41 is neither permitted nor denied by best guess record for domain of omair.javaid@linaro.org) client-ip=74.125.83.41; Received: by mail-ee0-f41.google.com with SMTP id b15so69197eek.0 for ; Sat, 22 Feb 2014 08:49:37 -0800 (PST) X-Received: by 10.15.99.201 with SMTP id bl49mr15196758eeb.53.1393087777618; Sat, 22 Feb 2014 08:49:37 -0800 (PST) Received: from localhost.localdomain ([175.110.189.84]) by mx.google.com with ESMTPSA id a2sm25596112eem.18.2014.02.22.08.49.34 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 22 Feb 2014 08:49:36 -0800 (PST) From: Omair Javaid To: gdb-patches@sourceware.org Cc: patches@linaro.org, Omair Javaid Subject: [PATCH 5/5] Support for recording vector data transfer instructions Date: Sat, 22 Feb 2014 21:48:55 +0500 Message-Id: <1393087735-19261-6-git-send-email-omair.javaid@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1393087735-19261-1-git-send-email-omair.javaid@linaro.org> References: <1393087735-19261-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=neutral (google.com: 209.85.128.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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: 2013-02-22 Omair Javaid * arm-tdep.c (arm_record_coproc_data_proc): Updated. (arm_record_vdata_transfer_insn): New function. --- 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 a92e37a..21962bd 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -11915,6 +11915,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 @@ -12394,7 +12490,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 {