x86: flag EVEX.z set when destination is memory
authorJan Beulich <jbeulich@suse.com>
Tue, 4 Jul 2023 15:01:10 +0000 (17:01 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 4 Jul 2023 15:01:10 +0000 (17:01 +0200)
Zeroing-masking is not permitted in this case. See the code comment for
how this is being dealt with.

gas/testsuite/gas/i386/avx512f-nondef.d
gas/testsuite/gas/i386/avx512f-nondef.s
opcodes/i386-dis.c

index efa3f58a621af91729490f4bcd41c4a5e941eb31..9c1d3272669a0118e3ae382dabfda1996b371081 100644 (file)
@@ -21,4 +21,5 @@ Disassembly of section .text:
 [      ]*[a-f0-9]+:    62 f2 7d cf 92 04 08    vgatherdps \(%eax,%zmm1(,1)?\),%zmm0\{%k7\}\{z\}/\(bad\)
 [      ]*[a-f0-9]+:    62 f2 7d 48 92 04 08    vgatherdps \(%eax,%zmm1(,1)?\),%zmm0/\(bad\)
 [      ]*[a-f0-9]+:    62 f1 7c cf c2 c0 00    vcmpeqps %zmm0,%zmm0,%k0\{%k7\}\{z\}/\(bad\)
+[      ]*[a-f0-9]+:    62 f1 7c cf 29 00       vmovaps %zmm0,\(%eax\)\{%k7\}\{z\}/\(bad\)
 #pass
index 0216003f347d2b4be3a6f00742bfc55afae6ae01..77426b1b7f5c055b908bbd806aa084520e0de27f 100644 (file)
@@ -29,3 +29,6 @@
 
        # vcmpeqps %zmm0, %zmm0, %k0{%k7} with EVEX.z set
        .insn EVEX.0f 0xc2, $0, %zmm0, %zmm0, %k0{%k7}{z}
+
+       # vmovaps %zmm0, (%eax){%k7} with EVEX.z set
+       .insn EVEX.0f 0x29, %zmm0, (%eax){%k7}{z}
index e440b694f1abbd8cafb91e726b00476cabc16327..7c4130245e1931c1c07cb9fcefdc57746eeee54f 100644 (file)
@@ -11855,6 +11855,13 @@ OP_E_memory (instr_info *ins, int bytemode, int sizeflag)
 
   if (ins->vex.evex)
     {
+
+      /* Zeroing-masking is invalid for memory destinations. Set the flag
+        uniformly, as the consumer will inspect it only for the destination
+        operand.  */
+      if (ins->vex.zeroing)
+       ins->illegal_masking = true;
+
       switch (bytemode)
        {
        case dw_mode: