diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2024-01-07 11:58:53 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2024-01-07 11:58:53 -0800 |
commit | f322084c7c842fbfd8c3291ff3f8d114173b4674 (patch) | |
tree | 43d0859a32a401ae413e792d549a0a0f42e6461f /opcodes | |
parent | f6c714d65b7296b466089f7d0d0270a12d51742f (diff) |
i386: Correct adcx suffix in disassembler
Since 0x66 is the opcode prefix for adcx, it is wrong to use the 'S'
prefix:
'S' => print 'w', 'l' or 'q' if suffix_always is true
on adcx. Add
'L' => print 'l' or 'q' if suffix_always is true
replace S with L on adcx and adox.
gas/
PR binutils/31219
* testsuite/gas/i386/suffix.d: Updated.
* testsuite/gas/i386/x86-64-suffix.d: Likewise.
* testsuite/gas/i386/suffix.s: Add tests for adcx and adox.
* testsuite/gas/i386/x86-64-suffix.s: Likewise.
opcodes/
PR binutils/31219
* i386-dis.c: Add the 'L' suffix.
(prefix_table): Replace S with L on adcx and adox.
(putop): Handle the 'L' suffix.
Diffstat (limited to 'opcodes')
-rw-r--r-- | opcodes/i386-dis.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index 51bf7922694..7edae20c323 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -1778,7 +1778,7 @@ struct dis386 { 'I' unused. 'J' unused. 'K' => print 'd' or 'q' if rex prefix is present. - 'L' unused. + 'L' => print 'l' or 'q' if suffix_always is true 'M' => print 'r' if intel_mnemonic is false. 'N' => print 'n' if instruction has no wait "prefix" 'O' => print 'd' or 'o' (or 'q' in Intel mode) @@ -3654,8 +3654,8 @@ static const struct dis386 prefix_table[][4] = { /* PREFIX_0F38F6 */ { { "wrssK", { M, Gdq }, 0 }, - { "adoxS", { VexGdq, Gdq, Edq}, 0 }, - { "adcxS", { VexGdq, Gdq, Edq}, 0 }, + { "adoxL", { VexGdq, Gdq, Edq }, 0 }, + { "adcxL", { VexGdq, Gdq, Edq }, 0 }, { Bad_Opcode }, }, @@ -10602,7 +10602,16 @@ putop (instr_info *ins, const char *in_template, int sizeflag) *ins->obufp++ = 'd'; break; case 'L': - abort (); + if (ins->intel_syntax) + break; + if (sizeflag & SUFFIX_ALWAYS) + { + if (ins->rex & REX_W) + *ins->obufp++ = 'q'; + else + *ins->obufp++ = 'l'; + } + break; case 'M': if (ins->intel_mnemonic != cond) *ins->obufp++ = 'r'; |