diff options
author | Jan Beulich <jbeulich@suse.com> | 2022-04-19 09:23:49 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2022-04-19 09:23:49 +0200 |
commit | 2f399d995b59a522c2739c0ab163c501c082cafb (patch) | |
tree | a44cb461c11fc3b0f25c4646223cdbb0af908c0f /gas/testsuite | |
parent | a17a212139296b7b0f32d4535640d779c396acef (diff) | |
download | gdb-2f399d995b59a522c2739c0ab163c501c082cafb.zip gdb-2f399d995b59a522c2739c0ab163c501c082cafb.tar.gz gdb-2f399d995b59a522c2739c0ab163c501c082cafb.tar.bz2 |
x86: correct and simplify NOP disassembly
It's not just REX.W which is ignored with opcode 0x90. The same goes for
REX.R and REX.X as well as empty REX. None of these are forms of
"xchg %eax,%eax" (which would mean zero-extending %eax to %rax), so they
also shouldn't be disassembled this way.
While there simplify things: A single hook function suffices, thus
making it unnecessary to keep two expressions in sync. And checking
ins->address_mode for mode_64bit also is unnecessary, as "rex" can be
non-zero only in that case anyway.
Diffstat (limited to 'gas/testsuite')
-rw-r--r-- | gas/testsuite/gas/i386/ilp32/rex.d | 44 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/rex.d | 5 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/rex.s | 6 |
3 files changed, 12 insertions, 43 deletions
diff --git a/gas/testsuite/gas/i386/ilp32/rex.d b/gas/testsuite/gas/i386/ilp32/rex.d index d8bc1b5..63b696f 100644 --- a/gas/testsuite/gas/i386/ilp32/rex.d +++ b/gas/testsuite/gas/i386/ilp32/rex.d @@ -2,46 +2,4 @@ #objdump: -dw #name: x86-64 (ILP32) manual rex prefix use #notarget: x86_64-*-elf* - -.*: +file format .* - -Disassembly of section .text: - -0+ <_start>: -[ ]*[0-9a-f]+:[ ]+40 0f ae 00[ ]+rex fxsave[ ]+\(%rax\) -[ ]*[0-9a-f]+:[ ]+48 0f ae 00[ ]+fxsave64[ ]+\(%rax\) -[ ]*[0-9a-f]+:[ ]+41 0f ae 00[ ]+fxs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 ]+41[ ]+rex.B -[ ]*[0-9a-f]+:[ ]+42[ ]+rex.X -[ ]*[0-9a-f]+:[ ]+43[ ]+rex.XB -[ ]*[0-9a-f]+:[ ]+44[ ]+rex.R -[ ]*[0-9a-f]+:[ ]+45[ ]+rex.RB -[ ]*[0-9a-f]+:[ ]+46[ ]+rex.RX -[ ]*[0-9a-f]+:[ ]+47[ ]+rex.RXB -[ ]*[0-9a-f]+:[ ]+48[ ]+rex.W -[ ]*[0-9a-f]+:[ ]+49[ ]+rex.WB -[ ]*[0-9a-f]+:[ ]+4a[ ]+rex.WX -[ ]*[0-9a-f]+:[ ]+4b[ ]+rex.WXB -[ ]*[0-9a-f]+:[ ]+4c[ ]+rex.WR -[ ]*[0-9a-f]+:[ ]+4d[ ]+rex.WRB -[ ]*[0-9a-f]+:[ ]+4e[ ]+rex.WRX -[ ]*[0-9a-f]+:[ ]+4f[ ]+rex.WRXB -#pass +#dump: ../rex.d diff --git a/gas/testsuite/gas/i386/rex.d b/gas/testsuite/gas/i386/rex.d index 22c0c7f..87856be 100644 --- a/gas/testsuite/gas/i386/rex.d +++ b/gas/testsuite/gas/i386/rex.d @@ -23,6 +23,11 @@ Disassembly of section .text: [ ]*[0-9a-f]+:[ ]+46 03 04 00[ ]+add[ ]+\(%rax,%r8(,1)?\),%r8d [ ]*[0-9a-f]+:[ ]+45 03 04 00[ ]+add[ ]+\(%r8,%rax(,1)?\),%r8d [ ]*[0-9a-f]+:[ ]+4a 03 04 00[ ]+add[ ]+\(%rax,%r8(,1)?\),%rax +[ ]*[0-9a-f]+:[ ]+40 90[ ]+rex nop +[ ]*[0-9a-f]+:[ ]+48 90[ ]+rex\.W nop +[ ]*[0-9a-f]+:[ ]+44 90[ ]+rex\.R nop +[ ]*[0-9a-f]+:[ ]+42 90[ ]+rex\.X nop +[ ]*[0-9a-f]+:[ ]+41 90[ ]+xchg[ ]+%eax,%r8d [ ]*[0-9a-f]+:[ ]+41\s+rex\.B [ ]*[0-9a-f]+:[ ]+9b dd 30\s+fsave\s+\(%rax\) [ ]*[0-9a-f]+:[ ]+9b 41 dd 30\s+fsave\s+\(%r8\) diff --git a/gas/testsuite/gas/i386/rex.s b/gas/testsuite/gas/i386/rex.s index c1490cc..2a861be 100644 --- a/gas/testsuite/gas/i386/rex.s +++ b/gas/testsuite/gas/i386/rex.s @@ -20,6 +20,12 @@ _start: rex.b add (%rax,%rax), %r8d rex.x add (%rax,%rax), %rax + rex nop + rex.w nop + rex.r nop + rex.x nop + rex.b nop + .byte 0x41,0x9b,0xdd,0x30 fsave (%r8) |