From patchwork Fri Sep 13 19:18:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Newton X-Patchwork-Id: 20297 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f70.google.com (mail-qe0-f70.google.com [209.85.128.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 80C5E20F2F for ; Fri, 13 Sep 2013 19:18:06 +0000 (UTC) Received: by mail-qe0-f70.google.com with SMTP id b4sf1732948qen.5 for ; Fri, 13 Sep 2013 12:18:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:cc:subject:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=xtkMFe4LktcGITpkQHuIODBEfkwp41jlANXSUNqLV1E=; b=GA97uQyhaQrE6qVetc6YQNPI3u7L3dik5rKb2HSp6ubGyyMTLxhx++TUwfS6bpWf1Z CfvIQOjcp90JUwi2kJr4p/vKO5XCWskbp6Hhk4rnL3LWVw5YqK/p7gt1Rt3lwbDdpzjn GjCbQKiApJTgraq6xQ1FMTI0y2saQZk4mYPBRlXlE8HisfpTxqXYnrBPWa1Rl6rJk75z gRiej5LLgr66SveZXgXZiX7h8/sxDvAb4mx1dTxSxa2b9jcmaDNxdFqvvHEmbLSQZVUH sKU+OGKdFsnQvBsA5ISklf9HLsJ5iMfO4l5r3Z/KuTFGrUHeAJKWluJErt3fd+/FKfcM r3fA== X-Gm-Message-State: ALoCoQnZ1y7Qh8Ozx3C2ECbFbsY8MRROyd70qhU3GEhcNFN4zx/rdxKXdj8y1BuKBlBBv5wgkzmw X-Received: by 10.236.13.36 with SMTP id a24mr1250000yha.50.1379099886324; Fri, 13 Sep 2013 12:18:06 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.0.41 with SMTP id 9ls1391400qeb.15.gmail; Fri, 13 Sep 2013 12:18:06 -0700 (PDT) X-Received: by 10.220.164.202 with SMTP id f10mr3080207vcy.25.1379099886092; Fri, 13 Sep 2013 12:18:06 -0700 (PDT) Received: from mail-vb0-f51.google.com (mail-vb0-f51.google.com [209.85.212.51]) by mx.google.com with ESMTPS id o5si3582984vdw.76.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 12:18:06 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.51 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.51; Received: by mail-vb0-f51.google.com with SMTP id x16so1254273vbf.38 for ; Fri, 13 Sep 2013 12:18:06 -0700 (PDT) X-Received: by 10.58.76.199 with SMTP id m7mr103455vew.35.1379099885972; Fri, 13 Sep 2013 12:18:05 -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.220.174.196 with SMTP id u4csp96711vcz; Fri, 13 Sep 2013 12:18:05 -0700 (PDT) X-Received: by 10.14.219.198 with SMTP id m46mr19997327eep.41.1379099885009; Fri, 13 Sep 2013 12:18:05 -0700 (PDT) Received: from mail-ea0-f180.google.com (mail-ea0-f180.google.com [209.85.215.180]) by mx.google.com with ESMTPS id i5si8845831eeg.55.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 12:18:05 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.180 is neither permitted nor denied by best guess record for domain of will.newton@linaro.org) client-ip=209.85.215.180; Received: by mail-ea0-f180.google.com with SMTP id h10so769912eaj.39 for ; Fri, 13 Sep 2013 12:18:04 -0700 (PDT) X-Received: by 10.14.182.137 with SMTP id o9mr5066557eem.59.1379099884357; Fri, 13 Sep 2013 12:18:04 -0700 (PDT) Received: from localhost.localdomain (cpc6-seac21-2-0-cust453.7-2.cable.virginmedia.com. [82.1.113.198]) by mx.google.com with ESMTPSA id f49sm17620164eec.7.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 12:18:03 -0700 (PDT) Message-ID: <523364E9.6030604@linaro.org> Date: Fri, 13 Sep 2013 20:18:01 +0100 From: Will Newton User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8 MIME-Version: 1.0 To: binutils@sourceware.org CC: patches@linaro.org Subject: [PATCH] gas/config/tc-arm.c: Fix parsing of NEON load/store element sizes. X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: will.newton@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.51 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: , The existing code would accept VLD2.64 and similar undefined instructions. gas/ChangeLog: 2013-09-13 Will Newton * config/tc-arm.c (do_neon_ld_st_interleave): Add constraint disallowing element size 64 with interleave other than 1. gas/testsuite/ChangeLog: 2013-09-13 Will Newton * gas/arm/neon-ldst-es.d: Add VLD1.64 instructions. * gas/arm/neon-ldst-es.s: Likewise. * testsuite/gas/arm/neon-ldst-es-bad.d: New file. * testsuite/gas/arm/neon-ldst-es-bad.l: Likewise. * testsuite/gas/arm/neon-ldst-es-bad.s: Likewise. --- gas/config/tc-arm.c | 2 ++ gas/testsuite/gas/arm/neon-ldst-es-bad.d | 3 +++ gas/testsuite/gas/arm/neon-ldst-es-bad.l | 12 ++++++++++++ gas/testsuite/gas/arm/neon-ldst-es-bad.s | 12 ++++++++++++ gas/testsuite/gas/arm/neon-ldst-es.d | 2 ++ gas/testsuite/gas/arm/neon-ldst-es.s | 3 +++ 6 files changed, 34 insertions(+) create mode 100644 gas/testsuite/gas/arm/neon-ldst-es-bad.d create mode 100644 gas/testsuite/gas/arm/neon-ldst-es-bad.l create mode 100644 gas/testsuite/gas/arm/neon-ldst-es-bad.s diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 8c405a8..9c8211d 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -15783,6 +15783,8 @@ do_neon_ld_st_interleave (void) typebits = typetable[idx]; constraint (typebits == -1, _("bad list type for instruction")); + constraint (((inst.instruction >> 8) & 3) && et.size == 64, + _("bad element type for instruction")); inst.instruction &= ~0xf00; inst.instruction |= typebits << 8; diff --git a/gas/testsuite/gas/arm/neon-ldst-es-bad.d b/gas/testsuite/gas/arm/neon-ldst-es-bad.d new file mode 100644 index 0000000..576ee7a --- /dev/null +++ b/gas/testsuite/gas/arm/neon-ldst-es-bad.d @@ -0,0 +1,3 @@ +# name: Bad element size combinations in Neon load/store instructions +# as: -mfpu=neon +# error-output: neon-ldst-es-bad.l diff --git a/gas/testsuite/gas/arm/neon-ldst-es-bad.l b/gas/testsuite/gas/arm/neon-ldst-es-bad.l new file mode 100644 index 0000000..b0c854e --- /dev/null +++ b/gas/testsuite/gas/arm/neon-ldst-es-bad.l @@ -0,0 +1,12 @@ +[^:]*: Assembler messages: +[^:]*:2: Error: bad type in Neon instruction -- `vld1\.64 {d0\[1\]},\[r0\]' +[^:]*:3: Error: bad type in Neon instruction -- `vld1\.64 {d0\[\]},\[r0\]' +[^:]*:4: Error: bad type in Neon instruction -- `vld2\.64 {d0\[1\]},\[r0\]' +[^:]*:5: Error: bad type in Neon instruction -- `vld2\.64 {d0\[\]},\[r0\]' +[^:]*:6: Error: bad element type for instruction -- `vld2\.64 {d0-d1},\[r0\]' +[^:]*:7: Error: bad type in Neon instruction -- `vld3\.64 {d0\[1\]},\[r0\]' +[^:]*:8: Error: bad type in Neon instruction -- `vld3\.64 {d0\[\]},\[r0\]' +[^:]*:9: Error: bad element type for instruction -- `vld3\.64 {d0-d2},\[r0\]' +[^:]*:10: Error: bad type in Neon instruction -- `vld4\.64 {d0\[1\]},\[r0\]' +[^:]*:11: Error: bad type in Neon instruction -- `vld4\.64 {d0\[\]},\[r0\]' +[^:]*:12: Error: bad element type for instruction -- `vld4\.64 {d0-d3},\[r0\]' diff --git a/gas/testsuite/gas/arm/neon-ldst-es-bad.s b/gas/testsuite/gas/arm/neon-ldst-es-bad.s new file mode 100644 index 0000000..f7e335e --- /dev/null +++ b/gas/testsuite/gas/arm/neon-ldst-es-bad.s @@ -0,0 +1,12 @@ + .text + vld1.64 {d0[1]}, [r0] + vld1.64 {d0[]}, [r0] + vld2.64 {d0[1]}, [r0] + vld2.64 {d0[]}, [r0] + vld2.64 {d0-d1}, [r0] + vld3.64 {d0[1]}, [r0] + vld3.64 {d0[]}, [r0] + vld3.64 {d0-d2}, [r0] + vld4.64 {d0[1]}, [r0] + vld4.64 {d0[]}, [r0] + vld4.64 {d0-d3}, [r0] diff --git a/gas/testsuite/gas/arm/neon-ldst-es.d b/gas/testsuite/gas/arm/neon-ldst-es.d index 6c22c69..e9c0734 100644 --- a/gas/testsuite/gas/arm/neon-ldst-es.d +++ b/gas/testsuite/gas/arm/neon-ldst-es.d @@ -56,3 +56,5 @@ Disassembly of section \.text: 0[0-9a-f]+ <[^>]+> f427208f vld4\.32 {d2-d5}, \[r7\] 0[0-9a-f]+ <[^>]+> f467c08f vld4\.32 {d28-d31}, \[r7\] 0[0-9a-f]+ <[^>]+> f4a21c83 vld1\.32 {d1\[\]}, \[r2\], r3 +0[0-9a-f]+ <[^>]+> f42007cf vld1\.64 {d0}, \[r0\] +0[0-9a-f]+ <[^>]+> f42002cf vld1\.64 {d0-d3}, \[r0\] diff --git a/gas/testsuite/gas/arm/neon-ldst-es.s b/gas/testsuite/gas/arm/neon-ldst-es.s index 79f4b0c..cb93f06 100644 --- a/gas/testsuite/gas/arm/neon-ldst-es.s +++ b/gas/testsuite/gas/arm/neon-ldst-es.s @@ -60,3 +60,6 @@ @ PR 14987 and 14887: Allow for whitespace in the instruction. vld1.32 { d1 [ ] } , [ r2 ] , r3 + + vld1.64 {d0}, [r0] + vld1.64 {d0-d3}, [r0]