x86: Handle unsupported static rounding in vcvt[u]si2sd in 32-bit mode
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 14 Sep 2018 18:25:01 +0000 (11:25 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 14 Sep 2018 18:25:13 +0000 (11:25 -0700)
Update x86 disassembler to handle the unsupported static rounding in
vcvt[u]si2sd in 32-bit mode.

gas/

PR binutils/23655
* testsuite/gas/i386/evex.d: Updated.

opcodes/

PR binutils/23655
* i386-dis-evex.h: Replace EXxEVexR with EXxEVexR64 for
vcvtsi2sd%LQ and vcvtusi2sd%LQ.
* i386-dis.c (EXxEVexR64): New.
(evex_rounding_64_mode): Likewise.
(OP_Rounding): Handle evex_rounding_64_mode.

gas/ChangeLog
gas/testsuite/gas/i386/evex.d
opcodes/ChangeLog
opcodes/i386-dis-evex.h
opcodes/i386-dis.c

index 52346d74cd3712d076362ebf5692c72cd6338848..7b24076a03bbd965d95f4ff7a925ba67adc019e4 100644 (file)
@@ -1,3 +1,8 @@
+2018-09-14  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR binutils/23655
+       * testsuite/gas/i386/evex.d: Updated.
+
 2018-09-14  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR binutils/23655
index ffbcdc1c09ab079b4e68ccf78831f2c0b6553164..2fbe295b86be3f7ffbb99f13d386c3cf1924ef72 100644 (file)
@@ -8,9 +8,9 @@ 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 d7 38 2a f0       vcvtsi2sdl %eax,\{rd-sae\},%xmm5,%xmm6
+ +[a-f0-9]+:   62 f1 d7 38 2a f0       vcvtsi2sdl %eax,\(bad\),%xmm5,%xmm6
  +[a-f0-9]+:   62 f1 d6 08 7b f0       vcvtusi2ssl %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 d7 38 7b f0       vcvtusi2sdl %eax,\{rd-sae\},%xmm5,%xmm6
+ +[a-f0-9]+:   62 f1 d7 38 7b f0       vcvtusi2sdl %eax,\(bad\),%xmm5,%xmm6
 #pass
index 7def411b049027dcda330f6415480a994d23b9ba..571aa6c7791ffe0a580bf244fdb0850194bf9680 100644 (file)
@@ -1,3 +1,12 @@
+2018-09-14  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR binutils/23655
+       * i386-dis-evex.h: Replace EXxEVexR with EXxEVexR64 for
+       vcvtsi2sd%LQ and vcvtusi2sd%LQ.
+       * i386-dis.c (EXxEVexR64): New.
+       (evex_rounding_64_mode): Likewise.
+       (OP_Rounding): Handle evex_rounding_64_mode.
+
 2018-09-14  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR binutils/23655
index f59c7cc8722524d7f5b396da2b6a8374a45c848d..932f10a5f14ac1a63685257f0034a21f402a135e 100644 (file)
@@ -3051,7 +3051,7 @@ static const struct dis386 evex_table[][256] = {
   /* EVEX_W_0F2A_P_3 */
   {
     { "vcvtsi2sd%LQ",  { XMScalar, VexScalar, Ed }, 0 },
-    { "vcvtsi2sd%LQ",  { XMScalar, VexScalar, EXxEVexR, Edqa }, 0 },
+    { "vcvtsi2sd%LQ",  { XMScalar, VexScalar, EXxEVexR64, Edqa }, 0 },
   },
   /* EVEX_W_0F2B_P_0 */
   {
@@ -3393,7 +3393,7 @@ static const struct dis386 evex_table[][256] = {
   /* EVEX_W_0F7B_P_3 */
   {
     { "vcvtusi2sd%LQ", { XMScalar, VexScalar, Ed }, 0 },
-    { "vcvtusi2sd%LQ", { XMScalar, VexScalar, EXxEVexR, Edqa }, 0 },
+    { "vcvtusi2sd%LQ", { XMScalar, VexScalar, EXxEVexR64, Edqa }, 0 },
   },
   /* EVEX_W_0F7E_P_1 */
   {
index 83c610703dc81a843cf741888cbc356f2be49809..9453e52d64308b1475c2827af7f53ce5b4e2c55b 100644 (file)
@@ -448,6 +448,7 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define VPCOM { VPCOM_Fixup, 0 }
 
 #define EXxEVexR { OP_Rounding, evex_rounding_mode }
+#define EXxEVexR64 { OP_Rounding, evex_rounding_64_mode }
 #define EXxEVexS { OP_Rounding, evex_sae_mode }
 
 #define XMask { OP_Mask, mask_mode }
@@ -633,6 +634,8 @@ enum
 
   /* Static rounding.  */
   evex_rounding_mode,
+  /* Static rounding, 64-bit mode only.  */
+  evex_rounding_64_mode,
   /* Supress all exceptions.  */
   evex_sae_mode,
 
@@ -17950,11 +17953,19 @@ OP_Rounding (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
 {
   if (!vex.evex
       || (bytemode != evex_rounding_mode
+         && bytemode != evex_rounding_64_mode
          && bytemode != evex_sae_mode))
     abort ();
   if (modrm.mod == 3 && vex.b)
     switch (bytemode)
       {
+      case evex_rounding_64_mode:
+       if (address_mode != mode_64bit)
+         {
+           oappend ("(bad)");
+           break;
+         }
+       /* Fall through.  */
       case evex_rounding_mode:
        oappend (names_rounding[vex.ll]);
        break;
This page took 0.03468 seconds and 4 git commands to generate.