This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [AVX512] Whitespace issue on zeroing-masking specifier


On Fri, Mar 9, 2018 at 1:13 AM, Jan Beulich <JBeulich@suse.com> wrote:
>>>> On 08.03.18 at 18:04, <cameron.mcinally@nyu.edu> wrote:
>> I'm currently upgrading from GAS 2.26.0 to 2.30.0 and have hit a
>> strange whitespace issue:
>>
>> #scrubbed#> cat test.s
>> .globl main
>> .type main,@function
>> main:
>>         vmovdqa32       %zmm0, %zmm0 {%k1}{z}
>>         vmovdqa32       %zmm0, %zmm0 {%k1} {z} # <-- This one
>> retq
>> #scrubbed#> as test.s
>> test.s: Assembler messages:
>> test.s:5: Error: unknown vector operation: ` {z}'
>>
>> GAS 2.26.0 accepted the whitespace variant, however 2.30.0 does not.
>
> Hmm, indeed, this changed from 2.28 to 2.29. I would guess this is
> an unintended side effect of the addition of pseudo prefixes, which
> changed how the scrubber treats '{'. I suppose we now need to
> explicitly strip whitespace in check_VecOperations().
>
>

I am checking in this patch.

-- 
H.J.
From 92c20650d2d384280b7f78759de6e56c121fb0b4 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Fri, 9 Mar 2018 03:42:14 -0800
Subject: [PATCH] x86: Strip whitespace in check_VecOperations

Since the addition of pseudo prefixes changed how the scrubber treats
'{', we need to explicitly strip whitespace in check_VecOperations ().

	* config/tc-i386.c (check_VecOperations): Strip whitespace.
	* testsuite/gas/i386/optimize-1.s: Add whitespaces before
	{%k7} and {z},
	* testsuite/gas/i386/x86-64-optimize-2.s: Likewise.
---
 gas/config/tc-i386.c                       | 6 ++++++
 gas/testsuite/gas/i386/optimize-1.s        | 2 +-
 gas/testsuite/gas/i386/x86-64-optimize-2.s | 2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index ef7b64b40b..724376096f 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -8524,6 +8524,12 @@ check_VecOperations (char *op_string, char *op_end)
 	      return NULL;
 	    }
 	  op_string++;
+
+	  /* Strip whitespace since the addition of pseudo prefixes
+	     changed how the scrubber treats '{'.  */
+	  if (is_space_char (*op_string))
+	    ++op_string;
+
 	  continue;
 	}
     unknown_vec_op:
diff --git a/gas/testsuite/gas/i386/optimize-1.s b/gas/testsuite/gas/i386/optimize-1.s
index f875f92db8..21b9594034 100644
--- a/gas/testsuite/gas/i386/optimize-1.s
+++ b/gas/testsuite/gas/i386/optimize-1.s
@@ -4,7 +4,7 @@
 	.text
 _start:
 	vandnpd %zmm1, %zmm1, %zmm5{%k7}
-	vandnpd %ymm1, %ymm1, %ymm5{z}{%k7}
+	vandnpd %ymm1, %ymm1, %ymm5	 {%k7}		{z}
 	vandnpd %zmm1, %zmm1, %zmm5
 	vandnpd %ymm1, %ymm1, %ymm5
 
diff --git a/gas/testsuite/gas/i386/x86-64-optimize-2.s b/gas/testsuite/gas/i386/x86-64-optimize-2.s
index 4461c099ea..10ce788ffb 100644
--- a/gas/testsuite/gas/i386/x86-64-optimize-2.s
+++ b/gas/testsuite/gas/i386/x86-64-optimize-2.s
@@ -4,7 +4,7 @@
 	.text
 _start:
 	vandnpd %zmm1, %zmm1, %zmm15{%k7}
-	vandnpd %ymm1, %ymm1, %ymm15{z}{%k7}
+	vandnpd %ymm1, %ymm1, %ymm15	 {%k7}		{z}
 	vandnpd %zmm1, %zmm1, %zmm15
 	vandnpd %ymm1, %ymm1, %ymm15
 	vandnpd %zmm1, %zmm1, %zmm16
-- 
2.14.3


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]