]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
x86: Ignore rounding for vcvt[,u]si2sd under r32 and vcvt[,u]dq2pd instead of reporti...
authorHaochen Jiang <haochen.jiang@intel.com>
Tue, 14 Jan 2025 08:18:50 +0000 (16:18 +0800)
committerHaochen Jiang <haochen.jiang@intel.com>
Fri, 17 Jan 2025 02:17:12 +0000 (10:17 +0800)
According to SDM, vcvt[,u]si2sd under r32 and vcvt[,u]dq2pd treat
Rounding as Ignored when trying to using them. Thus, disassembler
should accept bytecode with rounding instead of reporting bad.

For assembler, it needs some more time to decide how to deal
with that.

gas/ChangeLog:

* testsuite/gas/i386/evex.d: Add new testcase for vcvt[,u]dq2pd.
Change the output for vcvt[,u]si2sd.
* testsuite/gas/i386/evex.s: Ditto.
* testsuite/gas/i386/x86-64-evex.d: Ditto.

opcodes/ChangeLog:

* i386-dis-evex-w.h: Add EXxEVexR64 for vcvt[,u]dq2pd.
* i386-dis.c (OP_Rounding): Mark EVEX_b as used to change the handle
for ignored rounding.

gas/testsuite/gas/i386/evex.d
gas/testsuite/gas/i386/evex.s
gas/testsuite/gas/i386/x86-64-evex.d
opcodes/i386-dis-evex-w.h
opcodes/i386-dis.c

index 52670f82736b7f6a1bd1fb4dd613b507bb34f401..a352340cae6594183ad6877f77f811d27a60a52d 100644 (file)
@@ -8,14 +8,18 @@ Disassembly of section .text:
 
 0+ <_start>:
  +[a-f0-9]+:   62 f1 d6 38 2a f0       vcvtsi2ssl %eax,\{rd-sae\},%xmm5,%xmm6
- +[a-f0-9]+:   62 f1 57 38 2a f0       vcvtsi2sdl %eax,\{rd-bad\},%xmm5,%xmm6
- +[a-f0-9]+:   62 f1 d7 38 2a f0       vcvtsi2sdl %eax,\{rd-bad\},%xmm5,%xmm6
+ +[a-f0-9]+:   62 f1 57 38 2a f0       vcvtsi2sdl %eax,%xmm5,%xmm6
+ +[a-f0-9]+:   62 f1 d7 38 2a f0       vcvtsi2sdl %eax,%xmm5,%xmm6
  +[a-f0-9]+:   62 f1 d6 08 7b f0       vcvtusi2ssl %eax,%xmm5,%xmm6
  +[a-f0-9]+:   62 f1 57 08 7b f0       vcvtusi2sdl %eax,%xmm5,%xmm6
  +[a-f0-9]+:   62 f1 d7 08 7b f0       vcvtusi2sdl %eax,%xmm5,%xmm6
  +[a-f0-9]+:   62 f1 d6 38 7b f0       vcvtusi2ssl %eax,\{rd-sae\},%xmm5,%xmm6
- +[a-f0-9]+:   62 f1 57 38 7b f0       vcvtusi2sdl %eax,\{rd-bad\},%xmm5,%xmm6
- +[a-f0-9]+:   62 f1 d7 38 7b f0       vcvtusi2sdl %eax,\{rd-bad\},%xmm5,%xmm6
+ +[a-f0-9]+:   62 f1 57 38 7b f0       vcvtusi2sdl %eax,%xmm5,%xmm6
+ +[a-f0-9]+:   62 f1 d7 38 7b f0       vcvtusi2sdl %eax,%xmm5,%xmm6
  +[a-f0-9]+:   62 e1 7e 08 2d c0       \{evex\} vcvtss2si %xmm0,%eax
  +[a-f0-9]+:   62 e1 7c 08 c2 c0 00    vcmpeqps %xmm0,%xmm0,%k0
+ +[a-f0-9]+:   62 f1 7e 38 e6 f5       vcvtdq2pd %ymm5,%zmm6
+ +[a-f0-9]+:   62 f1 7a 38 e6 f5       vcvtdq2pd %xmm5,%ymm6
+ +[a-f0-9]+:   62 f1 7e 38 7a f5       vcvtudq2pd %ymm5,%zmm6
+ +[a-f0-9]+:   62 f1 7a 38 7a f5       vcvtudq2pd %xmm5,%ymm6
 #pass
index b72e1cd1e4fc1643e3ac257533dfd3db0815be25..473ea8a241821167c25e8350529e2dc016b62da2 100644 (file)
@@ -13,3 +13,7 @@ _start:
        .insn EVEX.LIG.F2.0F.W1 0x7b, %eax,{rd-sae},%xmm5,%xmm6
        .byte 0x62, 0xe1, 0x7e, 0x08, 0x2d, 0xc0
        .byte 0x62, 0xe1, 0x7c, 0x08, 0xc2, 0xc0, 0x00
+       .insn EVEX.512.F3.0F.W0 0xe6, {rd-sae},%zmm5,%ymm6
+       .insn EVEX.256.F3.0F.W0 0xe6, {rd-sae},%ymm5,%xmm6
+       .insn EVEX.512.F3.0F.W0 0x7a, {rd-sae},%zmm5,%ymm6
+       .insn EVEX.256.F3.0F.W0 0x7a, {rd-sae},%ymm5,%xmm6
index 5d974c312da8fa9f0ee860ad5d1bc270f4485fcf..6fb4bf8786379e7593cec79037b1e9595e81dcc7 100644 (file)
@@ -9,14 +9,18 @@ Disassembly of section .text:
 
 0+ <_start>:
  +[a-f0-9]+:   62 f1 d6 38 2a f0       vcvtsi2ss %rax,\{rd-sae\},%xmm5,%xmm6
- +[a-f0-9]+:   62 f1 57 38 2a f0       vcvtsi2sd %eax,\{rd-bad\},%xmm5,%xmm6
+ +[a-f0-9]+:   62 f1 57 38 2a f0       vcvtsi2sd %eax,%xmm5,%xmm6
  +[a-f0-9]+:   62 f1 d7 38 2a f0       vcvtsi2sd %rax,\{rd-sae\},%xmm5,%xmm6
  +[a-f0-9]+:   62 f1 d6 08 7b f0       vcvtusi2ss %rax,%xmm5,%xmm6
  +[a-f0-9]+:   62 f1 57 08 7b f0       vcvtusi2sd %eax,%xmm5,%xmm6
  +[a-f0-9]+:   62 f1 d7 08 7b f0       vcvtusi2sd %rax,%xmm5,%xmm6
  +[a-f0-9]+:   62 f1 d6 38 7b f0       vcvtusi2ss %rax,\{rd-sae\},%xmm5,%xmm6
- +[a-f0-9]+:   62 f1 57 38 7b f0       vcvtusi2sd %eax,\{rd-bad\},%xmm5,%xmm6
+ +[a-f0-9]+:   62 f1 57 38 7b f0       vcvtusi2sd %eax,%xmm5,%xmm6
  +[a-f0-9]+:   62 f1 d7 38 7b f0       vcvtusi2sd %rax,\{rd-sae\},%xmm5,%xmm6
  +[a-f0-9]+:   62 e1 7e 08 2d c0       vcvtss2si %xmm0,%r16d
  +[a-f0-9]+:   62 e1 7c 08 c2 c0 00    vcmpeqps %xmm0,%xmm0,\(bad\)
+ +[a-f0-9]+:   62 f1 7e 38 e6 f5       vcvtdq2pd %ymm5,%zmm6
+ +[a-f0-9]+:   62 f1 7a 38 e6 f5       vcvtdq2pd %xmm5,%ymm6
+ +[a-f0-9]+:   62 f1 7e 38 7a f5       vcvtudq2pd %ymm5,%zmm6
+ +[a-f0-9]+:   62 f1 7a 38 7a f5       vcvtudq2pd %xmm5,%ymm6
 #pass
index c15469210a537dcf09ebb9d87e88310997407644..bfdcfb29fdd33b919e8e6c840e0f5ca9c36d0f12 100644 (file)
@@ -97,7 +97,7 @@
   },
   /* EVEX_W_0F7A_P_1 */
   {
-    { "vcvtudq2pd",    { XM, EXEvexHalfBcstXmmq }, 0 },
+    { "vcvtudq2pd",    { XM, EXEvexHalfBcstXmmq, EXxEVexR64 }, 0 },
     { "vcvtuqq2pd",    { XM, EXx, EXxEVexR }, 0 },
   },
   /* EVEX_W_0F7A_P_2 */
   },
   /* EVEX_W_0FE6_P_1 */
   {
-    { "%XEvcvtdq2pd",  { XM, EXEvexHalfBcstXmmq }, 0 },
+    { "%XEvcvtdq2pd",  { XM, EXEvexHalfBcstXmmq, EXxEVexR64 }, 0 },
     { "vcvtqq2pd",     { XM, EXx, EXxEVexR }, 0 },
   },
   /* EVEX_W_0FE7 */
index 06bd1e0f7124c147f7e70cb05f989a192a85a358..2eb2c42629d3f5bb7748b0048092cd4f10768466 100644 (file)
@@ -14412,6 +14412,7 @@ OP_Rounding (instr_info *ins, int bytemode, int sizeflag ATTRIBUTE_UNUSED)
   if (ins->modrm.mod != 3 || !ins->vex.b)
     return true;
 
+  ins->evex_used |= EVEX_b_used;
   switch (bytemode)
     {
     case evex_rounding_64_mode:
@@ -14419,11 +14420,9 @@ OP_Rounding (instr_info *ins, int bytemode, int sizeflag ATTRIBUTE_UNUSED)
         return true;
       /* Fall through.  */
     case evex_rounding_mode:
-      ins->evex_used |= EVEX_b_used;
       oappend (ins, names_rounding[ins->vex.ll]);
       break;
     case evex_sae_mode:
-      ins->evex_used |= EVEX_b_used;
       oappend (ins, "{");
       break;
     default: