x86: correctly handle VMOVD with EVEX.W set outside of 64-bit mode
authorJan Beulich <jbeulich@novell.com>
Tue, 6 Nov 2018 10:45:11 +0000 (11:45 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 6 Nov 2018 10:45:11 +0000 (11:45 +0100)
For the flavors having a GPR operand EVEX.W is ignored outside of 64-bit
mode. The mnemonic should therefore not be KMOVQ, the GPR operand should
not name a non-existing 64-bit register, just like is already the case
for the AVX counterparts, and the Disp8 scaling factor should be 4
rather than 8.

gas/ChangeLog
gas/testsuite/gas/i386/evex-wig.s
gas/testsuite/gas/i386/evex-wig1-intel.d
gas/testsuite/gas/i386/evex-wig1.d
opcodes/ChangeLog
opcodes/i386-dis-evex.h
opcodes/i386-dis.c

index 967f6bc968305e85cca0419825c056770a2e6cd3..d3300acb9da00193f330112d60253fa06be6f996 100644 (file)
@@ -1,3 +1,9 @@
+2018-11-06  Jan Beulich  <jbeulich@suse.com>
+
+       * testsuite/gas/i386/evex-wig.s: Add vmovd cases.
+       * testsuite/gas/i386/evex-wig.d,
+       testsuite/gas/i386/evex-wig1-intel.d: Adjust expectations.
+
 2018-11-06  Jan Beulich  <jbeulich@suse.com>
 
        * testsuite/gas/i386/avx-wig.s: Add kmovd cases.
index 0694f9645ca4e4d4418da76ae53554b49193f535..593b6fdb2d5465d2c16ab1f923da05fe51f46b5d 100644 (file)
@@ -35,6 +35,12 @@ _start:
        {evex} vextractps $0, %xmm0, %eax
        {evex} vextractps $0, %xmm0, 4(%eax)
 
+       {evex} vmovd %eax, %xmm0
+       {evex} vmovd 4(%eax), %xmm0
+
+       {evex} vmovd %xmm0, %eax
+       {evex} vmovd %xmm0, 4(%eax)
+
        {evex} vpextrb $0, %xmm0, %eax
        {evex} vpextrb $0, %xmm0, 1(%eax)
 
index f6a28e8f76b4bc3a12fda4e32477290dc6b02060..7d020f60044d73e3756ebc2560aea5046cded9ab 100644 (file)
@@ -27,6 +27,10 @@ Disassembly of section .text:
 [      ]*[a-f0-9]+:    62 f1 ff 08 78 c0       vcvttsd2usi eax,xmm0
 [      ]*[a-f0-9]+:    62 f3 fd 08 17 c0 00    vextractps eax,xmm0,0x0
 [      ]*[a-f0-9]+:    62 f3 fd 08 17 40 01 00         vextractps DWORD PTR \[eax\+0x4\],xmm0,0x0
+[      ]*[a-f0-9]+:    62 f1 fd 08 6e c0       vmovd  xmm0,eax
+[      ]*[a-f0-9]+:    62 f1 fd 08 6e 40 01    vmovd  xmm0,DWORD PTR \[eax\+0x4\]
+[      ]*[a-f0-9]+:    62 f1 fd 08 7e c0       vmovd  eax,xmm0
+[      ]*[a-f0-9]+:    62 f1 fd 08 7e 40 01    vmovd  DWORD PTR \[eax\+0x4\],xmm0
 [      ]*[a-f0-9]+:    62 f3 fd 08 14 c0 00    vpextrb eax,xmm0,0x0
 [      ]*[a-f0-9]+:    62 f3 fd 08 14 40 01 00         vpextrb BYTE PTR \[eax\+0x1\],xmm0,0x0
 [      ]*[a-f0-9]+:    62 f3 fd 08 16 c0 00    vpextrd eax,xmm0,0x0
index c69f54c492d04bf654eb16a08ed0d9eecefcb10b..bb2408377d25aa65aa93f7dcc275bba980f523df 100644 (file)
@@ -27,6 +27,10 @@ Disassembly of section .text:
 [      ]*[a-f0-9]+:    62 f1 ff 08 78 c0       vcvttsd2usi %xmm0,%eax
 [      ]*[a-f0-9]+:    62 f3 fd 08 17 c0 00    vextractps \$0x0,%xmm0,%eax
 [      ]*[a-f0-9]+:    62 f3 fd 08 17 40 01 00         vextractps \$0x0,%xmm0,0x4\(%eax\)
+[      ]*[a-f0-9]+:    62 f1 fd 08 6e c0       vmovd  %eax,%xmm0
+[      ]*[a-f0-9]+:    62 f1 fd 08 6e 40 01    vmovd  0x4\(%eax\),%xmm0
+[      ]*[a-f0-9]+:    62 f1 fd 08 7e c0       vmovd  %xmm0,%eax
+[      ]*[a-f0-9]+:    62 f1 fd 08 7e 40 01    vmovd  %xmm0,0x4\(%eax\)
 [      ]*[a-f0-9]+:    62 f3 fd 08 14 c0 00    vpextrb \$0x0,%xmm0,%eax
 [      ]*[a-f0-9]+:    62 f3 fd 08 14 40 01 00         vpextrb \$0x0,%xmm0,0x1\(%eax\)
 [      ]*[a-f0-9]+:    62 f3 fd 08 16 c0 00    vpextrd \$0x0,%xmm0,%eax
index 2212d8ec85597b46c5c0bfa26f42bb1bfc57605f..70b95f3caca61f08cbe0b4404437748b06f89fe8 100644 (file)
@@ -1,3 +1,9 @@
+2018-11-06  Jan Beulich  <jbeulich@suse.com>
+
+       * i386-dis.c (EVEX_W_0F6E_P_2, EVEX_W_0F7E_P_2): Delete.
+       * i386-dis-evex.h (evex_table): Move vmov[dq} with GPR operand
+       cases up one level in the hierarchy.
+
 2018-11-06  Jan Beulich  <jbeulich@suse.com>
 
        * i386-dis.c (MOD_VEX_W_0_0F92_P_3_LEN_0,
index 22c9165ac7fb9f647720d645ba8454f66a772f56..84eaf83c09d7fb9c4207dc8b7b420241690faf11 100644 (file)
@@ -3299,11 +3299,6 @@ static const struct dis386 evex_table[][256] = {
     { Bad_Opcode },
     { "vpunpckhqdq",   { XM, Vex, EXx }, 0 },
   },
-  /* EVEX_W_0F6E_P_2 */
-  {
-    { "vmovd", { XMScalar, Ed }, 0 },
-    { "vmovq", { XMScalar, Eq }, 0 },
-  },
   /* EVEX_W_0F6F_P_1 */
   {
     { "vmovdqu32",     { XM, EXEvexXNoBcst }, 0 },
@@ -3400,11 +3395,6 @@ static const struct dis386 evex_table[][256] = {
     { Bad_Opcode },
     { "vmovq", { XMScalar, EXxmm_mq }, 0 },
   },
-  /* EVEX_W_0F7E_P_2 */
-  {
-    { "vmovd", { Ed, XMScalar }, 0 },
-    { "vmovq", { Eq, XMScalar }, 0 },
-  },
   /* EVEX_W_0F7F_P_1 */
   {
     { "vmovdqu32",     { EXxS, XM }, 0 },
@@ -4093,7 +4083,7 @@ static const struct dis386 evex_table[][256] = {
 #ifdef NEED_EVEX_LEN_TABLE
   /* EVEX_LEN_0F6E_P_2 */
   {
-    { VEX_W_TABLE (EVEX_W_0F6E_P_2) },
+    { "vmovK", { XMScalar, Edq }, 0 },
   },
 
   /* EVEX_LEN_0F7E_P_1 */
@@ -4103,7 +4093,7 @@ static const struct dis386 evex_table[][256] = {
 
   /* EVEX_LEN_0F7E_P_2 */
   {
-    { VEX_W_TABLE (EVEX_W_0F7E_P_2) },
+    { "vmovK", { Edq, XMScalar }, 0 },
   },
 
   /* EVEX_LEN_0FD6_P_2 */
index f3fbf1969c3e69087125d4d2407c91fbecf0f584..3f3fd36bcd12a0062edd0e640c3cb00938da090a 100644 (file)
@@ -2100,7 +2100,6 @@ enum
   EVEX_W_0F6B_P_2,
   EVEX_W_0F6C_P_2,
   EVEX_W_0F6D_P_2,
-  EVEX_W_0F6E_P_2,
   EVEX_W_0F6F_P_1,
   EVEX_W_0F6F_P_2,
   EVEX_W_0F6F_P_3,
@@ -2121,7 +2120,6 @@ enum
   EVEX_W_0F7B_P_2,
   EVEX_W_0F7B_P_3,
   EVEX_W_0F7E_P_1,
-  EVEX_W_0F7E_P_2,
   EVEX_W_0F7F_P_1,
   EVEX_W_0F7F_P_2,
   EVEX_W_0F7F_P_3,
This page took 0.03135 seconds and 4 git commands to generate.