summaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2017-11-15 08:52:05 +0100
committerJan Beulich <jbeulich@suse.com>2017-11-15 08:52:05 +0100
commit390a67891e4f1ed334e266cf084ba8948da5fcdf (patch)
treec44d73c8947c5d475f0e3edadd799c1e22441858 /opcodes
parent3a2430e05b1503653ae09cb21feb2a0d4ea51ec7 (diff)
x86: use correct register names
VEX.W may be legitimately set (and is then ignored by the CPU) for non-64-bit code. Don't print 64-bit register names in such a case, by utilizing that REX_W would never be set for non-64-bit code, and that it is being set from VEX.W by generic decoding. A test for this is going to be introduced in the next patch of this series.
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog5
-rw-r--r--opcodes/i386-dis.c6
2 files changed, 8 insertions, 3 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 674736ba84..2cc35947bd 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,5 +1,10 @@
2017-11-15 Jan Beulich <jbeulich@suse.com>
+ * i386-dis.c (OP_VEX, OP_LWPCB_E, OP_LWP_E): Use rex to
+ determine GPR register set.
+
+2017-11-15 Jan Beulich <jbeulich@suse.com>
+
* i386-dis.c (VEXI4_Fixup, VexI4): Delete.
(prefix_table, xop_table, vex_len_table): Remove VexI4 uses.
(OP_EX_VexW): Move setting of vex_w_done. Update codep on 2nd
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index 6a5a7f1bd6..78a685ee47 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -17122,7 +17122,7 @@ OP_VEX (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
names = names_xmm;
break;
case dq_mode:
- if (vex.w)
+ if (rex & REX_W)
names = names64;
else
names = names32;
@@ -17758,7 +17758,7 @@ OP_LWPCB_E (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
MODRM_CHECK;
codep++;
- if (vex.w)
+ if (rex & REX_W)
names = names64;
else
names = names32;
@@ -17776,7 +17776,7 @@ OP_LWP_E (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
{
const char **names;
- if (vex.w)
+ if (rex & REX_W)
names = names64;
else
names = names32;