aboutsummaryrefslogtreecommitdiff
path: root/opcodes/i386-dis.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2019-06-25 09:27:05 +0200
committerJan Beulich <jbeulich@suse.com>2019-06-25 09:35:17 +0200
commita280ab8e81498c6049dca79f64bd0cc02ead01ab (patch)
tree267b67b4cc5219cf4486772142cd79b2c5f9de4e /opcodes/i386-dis.c
parente1a1babdad9d14b935cbddc7d63fb76a580a16c5 (diff)
downloadgdb-a280ab8e81498c6049dca79f64bd0cc02ead01ab.zip
gdb-a280ab8e81498c6049dca79f64bd0cc02ead01ab.tar.gz
gdb-a280ab8e81498c6049dca79f64bd0cc02ead01ab.tar.bz2
x86: simplify OP_I64()
The only meaningful difference from OP_I() is the handling of the VEX.W=1 case in 64-bit mode for bytemode being v_mode. Funnel everything else into OP_I(), and drop no longer needed local variables.
Diffstat (limited to 'opcodes/i386-dis.c')
-rw-r--r--opcodes/i386-dis.c43
1 files changed, 3 insertions, 40 deletions
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index f7d9641..b9527ae 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -14788,53 +14788,16 @@ OP_I (int bytemode, int sizeflag)
static void
OP_I64 (int bytemode, int sizeflag)
{
- bfd_signed_vma op;
- bfd_signed_vma mask = -1;
-
- if (address_mode != mode_64bit)
+ if (bytemode != v_mode || address_mode != mode_64bit || !(rex & REX_W))
{
OP_I (bytemode, sizeflag);
return;
}
- switch (bytemode)
- {
- case b_mode:
- FETCH_DATA (the_info, codep + 1);
- op = *codep++;
- mask = 0xff;
- break;
- case v_mode:
- USED_REX (REX_W);
- if (rex & REX_W)
- op = get64 ();
- else
- {
- if (sizeflag & DFLAG)
- {
- op = get32 ();
- mask = 0xffffffff;
- }
- else
- {
- op = get16 ();
- mask = 0xfffff;
- }
- used_prefixes |= (prefixes & PREFIX_DATA);
- }
- break;
- case w_mode:
- mask = 0xfffff;
- op = get16 ();
- break;
- default:
- oappend (INTERNAL_DISASSEMBLER_ERROR);
- return;
- }
+ USED_REX (REX_W);
- op &= mask;
scratchbuf[0] = '$';
- print_operand_value (scratchbuf + 1, 1, op);
+ print_operand_value (scratchbuf + 1, 1, get64 ());
oappend_maybe_intel (scratchbuf);
scratchbuf[0] = '\0';
}