x86: Allow 32-bit registers for tpause and umwait
authorH.J. Lu <hjl.tools@gmail.com>
Sun, 15 Apr 2018 15:38:23 +0000 (08:38 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Sun, 15 Apr 2018 15:38:36 +0000 (08:38 -0700)
Since only the first 32 bits of input operand are used for tpause and
umwait, the REX.W bit is skipped.  Both 32-bit registers and 64-bit
registers are allowed.

gas/

* testsuite/gas/i386/x86-64-waitpkg.s: Add 32-bit registers
tests for tpause and umwait.
* testsuite/gas/i386/x86-64-waitpkg-intel.d: Updated.
* testsuite/gas/i386/x86-64-waitpkg.d: Likewise.

opcodes/

* i386-dis.c (prefix_table): Replace Em with Edq on tpause and
umwait.
* i386-opc.tbl: Allow 32-bit registers for tpause and umwait in
64-bit mode.
* i386-tbl.h: Regenerated.

gas/ChangeLog
gas/testsuite/gas/i386/x86-64-waitpkg-intel.d
gas/testsuite/gas/i386/x86-64-waitpkg.d
gas/testsuite/gas/i386/x86-64-waitpkg.s
opcodes/ChangeLog
opcodes/i386-dis.c
opcodes/i386-opc.tbl
opcodes/i386-tbl.h

index d87d3e793a928442f5b26b5e7eea4075e916fe1b..ad99365661e4387e1eef1c96319d35e4ebd2e40c 100644 (file)
@@ -1,3 +1,10 @@
+2018-04-15  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * testsuite/gas/i386/x86-64-waitpkg.s: Add 32-bit registers
+       tests for tpause and umwait.
+       * testsuite/gas/i386/x86-64-waitpkg-intel.d: Updated.
+       * testsuite/gas/i386/x86-64-waitpkg.d: Likewise.
+
 2018-04-12  John Darrington  <john@darrington.wattle.id.au>
 
        * as.c (main): Fail if the output is the same as one of the input
index e70be23c498300f12040e7ca57a1ea1880cf09c4..e0387dd1ad795faa5a5dcd459ef84314176f06df 100644 (file)
@@ -12,8 +12,12 @@ Disassembly of section \.text:
 [      ]*[a-f0-9]+:[   ]*f3 0f ae f0[  ]*umonitor rax
 [      ]*[a-f0-9]+:[   ]*f3 41 0f ae f2[       ]*umonitor r10
 [      ]*[a-f0-9]+:[   ]*67 f3 41 0f ae f2[    ]*umonitor r10d
-[      ]*[a-f0-9]+:[   ]*f2 0f ae f1[  ]*umwait rcx
-[      ]*[a-f0-9]+:[   ]*f2 41 0f ae f2[       ]*umwait r10
-[      ]*[a-f0-9]+:[   ]*66 0f ae f1[  ]*tpause rcx
-[      ]*[a-f0-9]+:[   ]*66 41 0f ae f2[       ]*tpause r10
+[      ]*[a-f0-9]+:[   ]*f2 0f ae f1[  ]*umwait ecx
+[      ]*[a-f0-9]+:[   ]*f2 0f ae f1[  ]*umwait ecx
+[      ]*[a-f0-9]+:[   ]*f2 41 0f ae f2[       ]*umwait r10d
+[      ]*[a-f0-9]+:[   ]*f2 41 0f ae f2[       ]*umwait r10d
+[      ]*[a-f0-9]+:[   ]*66 0f ae f1[  ]*tpause ecx
+[      ]*[a-f0-9]+:[   ]*66 0f ae f1[  ]*tpause ecx
+[      ]*[a-f0-9]+:[   ]*66 41 0f ae f2[       ]*tpause r10d
+[      ]*[a-f0-9]+:[   ]*66 41 0f ae f2[       ]*tpause r10d
 #pass
index 0930aa28293d5a0d7da80d6e4e226b16710fd8a4..a10a8cde31fafae51ef463c3aed0e4ee8489d478 100644 (file)
@@ -12,8 +12,12 @@ Disassembly of section \.text:
 [      ]*[a-f0-9]+:[   ]*f3 0f ae f0[  ]*umonitor %rax
 [      ]*[a-f0-9]+:[   ]*f3 41 0f ae f2[       ]*umonitor %r10
 [      ]*[a-f0-9]+:[   ]*67 f3 41 0f ae f2[    ]*umonitor %r10d
-[      ]*[a-f0-9]+:[   ]*f2 0f ae f1[  ]*umwait %rcx
-[      ]*[a-f0-9]+:[   ]*f2 41 0f ae f2[       ]*umwait %r10
-[      ]*[a-f0-9]+:[   ]*66 0f ae f1[  ]*tpause %rcx
-[      ]*[a-f0-9]+:[   ]*66 41 0f ae f2[       ]*tpause %r10
+[      ]*[a-f0-9]+:[   ]*f2 0f ae f1[  ]*umwait %ecx
+[      ]*[a-f0-9]+:[   ]*f2 0f ae f1[  ]*umwait %ecx
+[      ]*[a-f0-9]+:[   ]*f2 41 0f ae f2[       ]*umwait %r10d
+[      ]*[a-f0-9]+:[   ]*f2 41 0f ae f2[       ]*umwait %r10d
+[      ]*[a-f0-9]+:[   ]*66 0f ae f1[  ]*tpause %ecx
+[      ]*[a-f0-9]+:[   ]*66 0f ae f1[  ]*tpause %ecx
+[      ]*[a-f0-9]+:[   ]*66 41 0f ae f2[       ]*tpause %r10d
+[      ]*[a-f0-9]+:[   ]*66 41 0f ae f2[       ]*tpause %r10d
 #pass
index 7899c39ba87bae0ce6a0be5ac30b88bda72fc069..9c6484894b66ed4106ea764c80ccb1bf2dae9d7a 100644 (file)
@@ -5,7 +5,11 @@ _start:
        umonitor %rax
        umonitor %r10
        umonitor %r10d
+       umwait %ecx
        umwait %rcx
        umwait %r10
+       umwait %r10d
+       tpause %ecx
        tpause %rcx
        tpause %r10
+       tpause %r10d
index dca9192341ecabb22682f08f2d72d2dce0fd765e..0934467ed33139050f28560d634de9fe0888f9e7 100644 (file)
@@ -1,3 +1,11 @@
+2018-04-15  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * i386-dis.c (prefix_table): Replace Em with Edq on tpause and
+       umwait.
+       * i386-opc.tbl: Allow 32-bit registers for tpause and umwait in
+       64-bit mode.
+       * i386-tbl.h: Regenerated.
+
 2018-04-11  Igor Tsimbalist  <igor.v.tsimbalist@intel.com>
 
        * i386-dis.c (enum): Add PREFIX_MOD_0_0FAE_REG_6,
index d6fb42a1de9ccb1af2f47362c058f66f268c6895..7416569d0d6a6740732d617f83afeb3a29d2bb4f 100644 (file)
@@ -4206,8 +4206,8 @@ static const struct dis386 prefix_table[][4] = {
   {
     { RM_TABLE (RM_0FAE_REG_6) },
     { "umonitor",      { Eva }, PREFIX_OPCODE },
-    { "tpause",        { Em }, PREFIX_OPCODE },
-    { "umwait",        { Em }, PREFIX_OPCODE },
+    { "tpause",        { Edq }, PREFIX_OPCODE },
+    { "umwait",        { Edq }, PREFIX_OPCODE },
   },
 
   /* PREFIX_0FAE_REG_7 */
index 279a69762ed6f7e3694015b52c5ed0b3509d63af..0f7c64d08b8864e279d4b614483d20cd694a44a8 100644 (file)
@@ -5904,10 +5904,8 @@ pconfig, 0, 0x0f01c5, None, 3, CpuPCONFIG, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qS
 umonitor, 1, 0xf30fae, 0x6, 2, CpuWAITPKG|CpuNo64, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf|AddrPrefixOp0, { Reg16|Reg32 }
 umonitor, 1, 0xf30fae, 0x6, 2, CpuWAITPKG|Cpu64, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf|AddrPrefixOp0|NoRex64, { Reg32|Reg64 }
 
-tpause, 1, 0x660fae, 0x6, 2, CpuWAITPKG|CpuNo64, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf, { Reg32 }
-tpause, 1, 0x660fae, 0x6, 2, CpuWAITPKG|Cpu64, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf|NoRex64, { Reg64 }
+tpause, 1, 0x660fae, 0x6, 2, CpuWAITPKG, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf|NoRex64, { Reg32|Reg64 }
 
-umwait, 1, 0xf20fae, 0x6, 2, CpuWAITPKG|CpuNo64, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf, { Reg32 }
-umwait, 1, 0xf20fae, 0x6, 2, CpuWAITPKG|Cpu64, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf|NoRex64, { Reg64 }
+umwait, 1, 0xf20fae, 0x6, 2, CpuWAITPKG, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf|NoRex64, { Reg32|Reg64 }
 
 // WAITPKG instructions end.
index f4bd25e8b042bb26a0566194622d31543de26627..0eb123a3a66b39c02db5a688da99775c2e4e7588 100644 (file)
@@ -93810,41 +93810,13 @@ const insn_template i386_optab[] =
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
-        0, 0, 0, 0, 0, 1, 0 } },
-    { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1,
-      1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0 },
-    { { { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
-         0, 0, 0 } } } },
-  { "tpause", 1, 0x660fae, 0x6, 2,
-    { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
-        0, 0, 0, 0, 1, 0, 0 } },
+        0, 0, 0, 0, 0, 0, 0 } },
     { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1,
       1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
       0, 0, 0 },
     { { { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
-         0, 0, 0 } } } },
-  { "umwait", 1, 0xf20fae, 0x6, 2,
-    { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
-        0, 0, 0, 0, 0, 1, 0 } },
-    { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1,
-      1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0 },
-    { { { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
+         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0,
          0, 0, 0 } } } },
   { "umwait", 1, 0xf20fae, 0x6, 2,
     { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -93852,13 +93824,13 @@ const insn_template i386_optab[] =
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
-        0, 0, 0, 0, 1, 0, 0 } },
+        0, 0, 0, 0, 0, 0, 0 } },
     { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1,
       1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
       0, 0, 0 },
     { { { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
+         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0,
          0, 0, 0 } } } },
   { NULL, 0, 0, 0, 0,
     { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
This page took 0.076327 seconds and 4 git commands to generate.