aboutsummaryrefslogtreecommitdiff
path: root/opcodes/i386-dis.c
diff options
context:
space:
mode:
authorSebastian Pop <sebastian.pop@amd.com>2009-11-19 07:08:39 +0000
committerSebastian Pop <sebastian.pop@amd.com>2009-11-19 07:08:39 +0000
commit41effecb2d9c160e205069396729e7c64191698c (patch)
tree2a7fa9da4dacfa3a95b2d5bda6d30335655d0ea9 /opcodes/i386-dis.c
parent7984f34977aac50bb1383f66d4c318145f4123ce (diff)
downloadgdb-41effecb2d9c160e205069396729e7c64191698c.zip
gdb-41effecb2d9c160e205069396729e7c64191698c.tar.gz
gdb-41effecb2d9c160e205069396729e7c64191698c.tar.bz2
2009-11-18 Sebastian Pop <sebastian.pop@amd.com>
opcodes/ PR binutils/10973 * i386-dis.c (get_vex_imm8): Do not increment codep. Avoid incrementing bytes_before_imm when OP_E_memory has already forwarded the codep pointer. (OP_EX_VexW): Increment codep to skip mod/rm byte. gas/testsuite/ * gas/i386/x86-64-xop.d: Update patterns.
Diffstat (limited to 'opcodes/i386-dis.c')
-rw-r--r--opcodes/i386-dis.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index 23ea6af..a69f34f 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -13695,10 +13695,6 @@ get_vex_imm8 (int sizeflag)
{
int bytes_before_imm = 0;
- /* Skip mod/rm byte. */
- MODRM_CHECK;
- codep++;
-
if (modrm.mod != 3)
{
/* There are SIB/displacement bytes. */
@@ -13712,7 +13708,8 @@ get_vex_imm8 (int sizeflag)
{
FETCH_DATA (the_info, codep + 1);
base = *codep & 7;
- bytes_before_imm++;
+ /* Don't increase bytes_before_imm as this has already
+ been done in OP_E_memory. */
}
switch (modrm.mod)
@@ -13728,8 +13725,8 @@ get_vex_imm8 (int sizeflag)
bytes_before_imm += 4;
break;
case 1:
- /* 1 byte displacement. */
- bytes_before_imm++;
+ /* 1 byte displacement: codep has already been
+ incremented by 1 in OP_E_memory. */
break;
}
}
@@ -13747,8 +13744,8 @@ get_vex_imm8 (int sizeflag)
bytes_before_imm += 2;
break;
case 1:
- /* 1 byte displacement. */
- bytes_before_imm++;
+ /* 1 byte displacement: codep has already been
+ incremented by 1 in OP_E_memory. */
break;
}
}
@@ -13853,6 +13850,11 @@ OP_EX_VexW (int bytemode, int sizeflag)
if (!vex_w_done)
{
vex_w_done = 1;
+
+ /* Skip mod/rm byte. */
+ MODRM_CHECK;
+ codep++;
+
if (vex.w)
reg = get_vex_imm8 (sizeflag) >> 4;
}