diff options
author | Jan Beulich <jbeulich@suse.com> | 2020-07-14 10:26:51 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2020-07-14 10:26:51 +0200 |
commit | 9ab00b61a9d7d84313b1793255a1bc63b97fd9b7 (patch) | |
tree | ae53c9173c9172dcf50282c39d1f20a7c1c8a9d6 /opcodes | |
parent | 2875b28aa871395dc17182f0bacfe40a68b1ad05 (diff) | |
download | gdb-9ab00b61a9d7d84313b1793255a1bc63b97fd9b7.zip gdb-9ab00b61a9d7d84313b1793255a1bc63b97fd9b7.tar.gz gdb-9ab00b61a9d7d84313b1793255a1bc63b97fd9b7.tar.bz2 |
x86: don't disassemble MOVBE with two suffixes
MOVBE_Fixup() is entirely redundant with the S macro already used on the
mnemonics, leading to double suffixes in suffix-always mode. Drop the
function.
Diffstat (limited to 'opcodes')
-rw-r--r-- | opcodes/ChangeLog | 6 | ||||
-rw-r--r-- | opcodes/i386-dis.c | 48 |
2 files changed, 11 insertions, 43 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 42a2cc6..0e9e75b 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,5 +1,11 @@ 2020-07-14 Jan Beulich <jbeulich@suse.com> + * i386-dis.c (MOVBE_Fixup): Delete. + (Mv): Define. + (prefix_table): Use Mv for movbe entries. + +2020-07-14 Jan Beulich <jbeulich@suse.com> + * i386-dis.c (CRC32_Fixup): Delete. (prefix_table): Use Eb/Ev for crc32 entries. diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index 3199a17..aa36ef5 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -118,7 +118,6 @@ static void XMM_Fixup (int, int); static void FXSAVE_Fixup (int, int); static void PCMPESTR_Fixup (int, int); -static void MOVBE_Fixup (int, int); static void MOVSXD_Fixup (int, int); static void OP_Mask (int, int); @@ -266,6 +265,7 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr) #define Mo { OP_M, o_mode } #define Mp { OP_M, f_mode } /* 32 or 48 bit memory operand for LDS, LES etc */ #define Mq { OP_M, q_mode } +#define Mv { OP_M, v_mode } #define Mv_bnd { OP_M, v_bndmk_mode } #define Mx { OP_M, x_mode } #define Mxmm { OP_M, xmm_mode } @@ -4422,17 +4422,17 @@ static const struct dis386 prefix_table[][4] = { /* PREFIX_0F38F0 */ { - { "movbeS", { Gv, { MOVBE_Fixup, v_mode } }, PREFIX_OPCODE }, + { "movbeS", { Gv, Mv }, PREFIX_OPCODE }, { Bad_Opcode }, - { "movbeS", { Gv, { MOVBE_Fixup, v_mode } }, PREFIX_OPCODE }, + { "movbeS", { Gv, Mv }, PREFIX_OPCODE }, { "crc32A", { Gdq, Eb }, PREFIX_OPCODE }, }, /* PREFIX_0F38F1 */ { - { "movbeS", { { MOVBE_Fixup, v_mode }, Gv }, PREFIX_OPCODE }, + { "movbeS", { Mv, Gv }, PREFIX_OPCODE }, { Bad_Opcode }, - { "movbeS", { { MOVBE_Fixup, v_mode }, Gv }, PREFIX_OPCODE }, + { "movbeS", { Mv, Gv }, PREFIX_OPCODE }, { "crc32Q", { Gdq, Ev }, PREFIX_OPCODE }, }, @@ -16808,44 +16808,6 @@ PCLMUL_Fixup (int bytemode ATTRIBUTE_UNUSED, } static void -MOVBE_Fixup (int bytemode, int sizeflag) -{ - /* Add proper suffix to "movbe". */ - char *p = mnemonicendp; - - switch (bytemode) - { - case v_mode: - if (intel_syntax) - goto skip; - - USED_REX (REX_W); - if (sizeflag & SUFFIX_ALWAYS) - { - if (rex & REX_W) - *p++ = 'q'; - else - { - if (sizeflag & DFLAG) - *p++ = 'l'; - else - *p++ = 'w'; - used_prefixes |= (prefixes & PREFIX_DATA); - } - } - break; - default: - oappend (INTERNAL_DISASSEMBLER_ERROR); - break; - } - mnemonicendp = p; - *p = '\0'; - - skip: - OP_M (bytemode, sizeflag); -} - -static void MOVSXD_Fixup (int bytemode, int sizeflag) { /* Add proper suffix to "movsxd". */ |