diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2018-09-14 10:49:43 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2018-09-14 10:49:53 -0700 |
commit | d20dee9efad3c23c9098f03ac785037572258483 (patch) | |
tree | 170cde5009a0f2cd1b07497e36b3140251d62b46 /opcodes/i386-dis.c | |
parent | 5074ad8a66ab2e955cf3ae4dba5773d5aa67b29b (diff) | |
download | gdb-d20dee9efad3c23c9098f03ac785037572258483.zip gdb-d20dee9efad3c23c9098f03ac785037572258483.tar.gz gdb-d20dee9efad3c23c9098f03ac785037572258483.tar.bz2 |
x86: Properly decode EVEX.W in vcvt[u]si2s[sd] in 32-bit mode
Update x86 disassembler to ignore the EVEX.W bit in EVEX vcvt[u]si2s[sd]
instructions in 32-bit mode.
gas/
PR binutils/23655
* testsuite/gas/i386/evex.d: New file.
* testsuite/gas/i386/evex.s: Likewise.
* testsuite/gas/i386/i386.exp: Run evex.
opcodes/
PR binutils/23655
* i386-dis-evex.h (evex_table): Replace Eq with Edqa for
vcvtsi2ss%LQ, vcvtsi2sd%LQ, vcvtusi2ss%LQ and vcvtusi2sd%LQ.
* i386-dis.c (Edqa): New.
(dqa_mode): Likewise.
(intel_operand_size): Handle dqa_mode as m_mode.
(OP_E_register): Handle dqa_mode as dq_mode.
(OP_E_memory): Set shift for dqa_mode based on address_mode.
Diffstat (limited to 'opcodes/i386-dis.c')
-rw-r--r-- | opcodes/i386-dis.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index f453989..83c6107 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -260,6 +260,7 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr) #define Edb { OP_E, db_mode } #define Edw { OP_E, dw_mode } #define Edqd { OP_E, dqd_mode } +#define Edqa { OP_E, dqa_mode } #define Eq { OP_E, q_mode } #define indirEv { OP_indirE, indir_v_mode } #define indirEp { OP_indirE, f_mode } @@ -591,6 +592,8 @@ enum dw_mode, /* registers like dq_mode, memory like d_mode. */ dqd_mode, + /* operand size depends on the W bit as well as address mode. */ + dqa_mode, /* normal vex mode */ vex_mode, /* 128bit vex mode */ @@ -14805,6 +14808,7 @@ intel_operand_size (int bytemode, int sizeflag) case q_swap_mode: oappend ("QWORD PTR "); break; + case dqa_mode: case m_mode: if (address_mode == mode_64bit) oappend ("QWORD PTR "); @@ -15163,6 +15167,7 @@ OP_E_register (int bytemode, int sizeflag) case dqb_mode: case dqd_mode: case dqw_mode: + case dqa_mode: USED_REX (REX_W); if (rex & REX_W) names = names64; @@ -15305,6 +15310,9 @@ OP_E_memory (int bytemode, int sizeflag) case xmm_mb_mode: shift = 0; break; + case dqa_mode: + shift = address_mode == mode_64bit ? 3 : 2; + break; default: abort (); } |