]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
x86: reject all invalid SAE variants
authorJan Beulich <jbeulich@suse.com>
Wed, 20 Apr 2022 14:56:05 +0000 (16:56 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 20 Apr 2022 14:56:05 +0000 (16:56 +0200)
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.

gas/config/tc-i386.c
gas/testsuite/gas/i386/inval-avx512f.l
gas/testsuite/gas/i386/inval-avx512f.s

index b8e3c24c25d33958394ff08496dce69b17560897..61b9af1c24bbee36b21b4c949bea2825ce3dccd8 100644 (file)
@@ -6272,7 +6272,7 @@ check_VecOperands (const insn_template *t)
   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;
index d45ae250ba0c8d4c296db75b0acbe2c0bce02b04..d46e61a9a9ae33ffb1f93e1c92b8863503ee5166 100644 (file)
 .*: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[  ]*
+\fGAS LISTING .*
+#...
+[      ]*324[  ]+vaddss \{sae\}, %xmm0, %xmm0, %xmm0
+[      ]*325[  ]+vcmpps \$0, \{rn-sae\}, %zmm0, %zmm0, %k0
 #pass
index 841992bbd790a916595de0f0416db23249027210..d9a85e005b33cde3e33437ed7623e27037038604 100644 (file)
@@ -321,4 +321,7 @@ _start:
        vaddps $0xcc, %zmm0, %zmm0, %zmm0
        vcmpss $0, $0xcc, %xmm0, %xmm0, %k0
 
+       vaddss {sae}, %xmm0, %xmm0, %xmm0
+       vcmpps $0, {rn-sae}, %zmm0, %zmm0, %k0
+
        .p2align 4