[PATCH] x86: reject all invalid SAE variants

Jan Beulich jbeulich@suse.com
Tue Apr 19 07:31:03 GMT 2022
So far an SAE-only specifier was accepted for static-rounding insns,
while SAE-only insns didn't accept static rounding specifiers. If
anything it would make sense the other way around, allowing SAE-only
insns to have the (ignored) rounding mode specified individually rather
than globally via -mevexrcig=. But for now make things match the SDM.

--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -6270,7 +6270,7 @@ check_VecOperands (const insn_template *
   if (i.rounding.type != rc_none)
     {
       if (!t->opcode_modifier.sae
-	  || (i.rounding.type != saeonly && !t->opcode_modifier.staticrounding))
+	  || ((i.rounding.type != saeonly) != t->opcode_modifier.staticrounding))
 	{
 	  i.error = unsupported_rc_sae;
 	  return 1;
--- a/gas/testsuite/gas/i386/inval-avx512f.l
+++ b/gas/testsuite/gas/i386/inval-avx512f.l
@@ -220,6 +220,8 @@
 .*:319: Error: .*unsupported broadcast for `vcvtneps2bf16'
 .*:321: Error: .*vaddps.*
 .*:322: Error: .*vcmpss.*
+.*:324: Error: .*vaddss.*
+.*:325: Error: .*vcmpps.*
 GAS LISTING .*
 
 
@@ -574,4 +576,9 @@ GAS LISTING .*
 [ 	]*320[ 	]*
 [ 	]*321[ 	]+vaddps \$0xcc, %zmm0, %zmm0, %zmm0
 [ 	]*322[ 	]+vcmpss \$0, \$0xcc, %xmm0, %xmm0, %k0
+[ 	]*323[ 	]*
+
GAS LISTING .*
+#...
+[ 	]*324[ 	]+vaddss \{sae\}, %zmm0, %zmm0, %zmm0
+[ 	]*325[ 	]+vcmpps \$0, \{rn-sae\}, %xmm0, %xmm0, %k0
 #pass
--- a/gas/testsuite/gas/i386/inval-avx512f.s
+++ b/gas/testsuite/gas/i386/inval-avx512f.s
@@ -321,4 +321,7 @@ _start:
 	vaddps $0xcc, %zmm0, %zmm0, %zmm0
 	vcmpss $0, $0xcc, %xmm0, %xmm0, %k0
 
+	vaddss {sae}, %zmm0, %zmm0, %zmm0
+	vcmpps $0, {rn-sae}, %xmm0, %xmm0, %k0
+
 	.p2align 4



More information about the Binutils mailing list