diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2014-09-10 09:38:31 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2014-09-10 09:39:24 -0700 |
commit | 4b4c407a349620e4a6b9cb36b77778fccb7ff00f (patch) | |
tree | 5b55e7862c8bd1c6e9d31b86a9f3446caf89e421 /gas | |
parent | a485e98ea0cbb61ea9da1e7858da545e0bcf1a46 (diff) | |
download | gdb-4b4c407a349620e4a6b9cb36b77778fccb7ff00f.zip gdb-4b4c407a349620e4a6b9cb36b77778fccb7ff00f.tar.gz gdb-4b4c407a349620e4a6b9cb36b77778fccb7ff00f.tar.bz2 |
Properly handle suffix for iret and sysret
gas/testsuite/
* gas/i386/i386.exp: Run suffix-intel, x86-64-suffix and
x86-64-suffix-intel.
* gas/i386/suffix.s: Add tests for iret and sysret.
* gas/i386/suffix.d: Updated.
* gas/i386/suffix-intel.d: New file.
* gas/i386/x86-64-suffix-intel.d: Likewise.
* gas/i386/x86-64-suffix.d: Likewise.
* gas/i386/x86-64-suffix.s: Likewise.
opcodes/
* i386-dis.c (dis386): Replace "P" with "%LP" for iret and sysret.
(putop): Handle "%LP".
Diffstat (limited to 'gas')
-rw-r--r-- | gas/testsuite/ChangeLog | 13 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/i386.exp | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/suffix-intel.d | 26 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/suffix.d | 26 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/suffix.s | 13 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-suffix-intel.d | 30 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-suffix.d | 29 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-suffix.s | 28 |
8 files changed, 159 insertions, 9 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index d705f8a..f67448b 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,16 @@ +2014-09-10 H.J. Lu <hongjiu.lu@intel.com> + + * gas/i386/i386.exp: Run suffix-intel, x86-64-suffix and + x86-64-suffix-intel. + + * gas/i386/suffix.s: Add tests for iret and sysret. + * gas/i386/suffix.d: Updated. + + * gas/i386/suffix-intel.d: New file. + * gas/i386/x86-64-suffix-intel.d: Likewise. + * gas/i386/x86-64-suffix.d: Likewise. + * gas/i386/x86-64-suffix.s: Likewise. + 2014-09-10 Alan Modra <amodra@gmail.com> * gas/arm/got_prel.d: Adjust for changed section header placement. diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp index 680d28c..4446426 100644 --- a/gas/testsuite/gas/i386/i386.exp +++ b/gas/testsuite/gas/i386/i386.exp @@ -73,6 +73,7 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_32_check]] run_dump_test "vmfunc" run_dump_test "smx" run_dump_test "suffix" + run_dump_test "suffix-intel" run_dump_test "immed32" run_dump_test "equ" run_dump_test "divide" @@ -627,6 +628,8 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] t run_dump_test "x86-64-avx512dq" run_dump_test "x86-64-avx512dq_vl-intel" run_dump_test "x86-64-avx512dq_vl" + run_dump_test "x86-64-suffix" + run_dump_test "x86-64-suffix-intel" if { ![istarget "*-*-aix*"] && ![istarget "*-*-beos*"] diff --git a/gas/testsuite/gas/i386/suffix-intel.d b/gas/testsuite/gas/i386/suffix-intel.d new file mode 100644 index 0000000..b20d927 --- /dev/null +++ b/gas/testsuite/gas/i386/suffix-intel.d @@ -0,0 +1,26 @@ +#source: suffix.s +#objdump: -dw -Msuffix,intel +#name: i386 suffix (Intel mode) + +.*: +file format .* + +Disassembly of section .text: + +0+ <foo>: +[ ]*[a-f0-9]+: 0f 01 c8 monitor +[ ]*[a-f0-9]+: 0f 01 c9 mwait +[ ]*[a-f0-9]+: 0f 01 c1 vmcall +[ ]*[a-f0-9]+: 0f 01 c2 vmlaunch +[ ]*[a-f0-9]+: 0f 01 c3 vmresume +[ ]*[a-f0-9]+: 0f 01 c4 vmxoff +[ ]*[a-f0-9]+: 66 cf iretw +[ ]*[a-f0-9]+: cf iretd +[ ]*[a-f0-9]+: cf iretd +[ ]*[a-f0-9]+: 0f 07 sysretd +[ ]*[a-f0-9]+: 0f 07 sysretd +[ ]*[a-f0-9]+: 66 cf iretw +[ ]*[a-f0-9]+: cf iretd +[ ]*[a-f0-9]+: cf iretd +[ ]*[a-f0-9]+: 0f 07 sysretd +[ ]*[a-f0-9]+: 0f 07 sysretd +#pass diff --git a/gas/testsuite/gas/i386/suffix.d b/gas/testsuite/gas/i386/suffix.d index fa57bb7..44be5ed 100644 --- a/gas/testsuite/gas/i386/suffix.d +++ b/gas/testsuite/gas/i386/suffix.d @@ -5,11 +5,21 @@ Disassembly of section .text: -0+000 <foo>: - 0: 0f 01 c8 [ ]*monitor %eax,%ecx,%edx - 3: 0f 01 c9 [ ]*mwait %eax,%ecx - 6: 0f 01 c1 [ ]*vmcall - 9: 0f 01 c2 [ ]*vmlaunch - c: 0f 01 c3 [ ]*vmresume - f: 0f 01 c4 [ ]*vmxoff - ... +0+ <foo>: +[ ]*[a-f0-9]+: 0f 01 c8 monitor %eax,%ecx,%edx +[ ]*[a-f0-9]+: 0f 01 c9 mwait %eax,%ecx +[ ]*[a-f0-9]+: 0f 01 c1 vmcall +[ ]*[a-f0-9]+: 0f 01 c2 vmlaunch +[ ]*[a-f0-9]+: 0f 01 c3 vmresume +[ ]*[a-f0-9]+: 0f 01 c4 vmxoff +[ ]*[a-f0-9]+: 66 cf iretw +[ ]*[a-f0-9]+: cf iretl +[ ]*[a-f0-9]+: cf iretl +[ ]*[a-f0-9]+: 0f 07 sysretl +[ ]*[a-f0-9]+: 0f 07 sysretl +[ ]*[a-f0-9]+: 66 cf iretw +[ ]*[a-f0-9]+: cf iretl +[ ]*[a-f0-9]+: cf iretl +[ ]*[a-f0-9]+: 0f 07 sysretl +[ ]*[a-f0-9]+: 0f 07 sysretl +#pass diff --git a/gas/testsuite/gas/i386/suffix.s b/gas/testsuite/gas/i386/suffix.s index 2ce1c3d..7f2864d 100644 --- a/gas/testsuite/gas/i386/suffix.s +++ b/gas/testsuite/gas/i386/suffix.s @@ -10,4 +10,15 @@ foo: vmresume vmxoff - .p2align 4,0 + iretw + iretl + iret + sysretl + sysret + + .intel_syntax noprefix + iretw + iretd + iret + sysretd + sysret diff --git a/gas/testsuite/gas/i386/x86-64-suffix-intel.d b/gas/testsuite/gas/i386/x86-64-suffix-intel.d new file mode 100644 index 0000000..32fcb19 --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-suffix-intel.d @@ -0,0 +1,30 @@ +#source: x86-64-suffix.s +#objdump: -dw -Msuffix,intel +#name: x86-64 suffix (Intel mode) + +.*: +file format .* + +Disassembly of section .text: + +0+ <foo>: +[ ]*[a-f0-9]+: 0f 01 c8 monitor +[ ]*[a-f0-9]+: 0f 01 c9 mwait +[ ]*[a-f0-9]+: 0f 01 c1 vmcall +[ ]*[a-f0-9]+: 0f 01 c2 vmlaunch +[ ]*[a-f0-9]+: 0f 01 c3 vmresume +[ ]*[a-f0-9]+: 0f 01 c4 vmxoff +[ ]*[a-f0-9]+: 66 cf iretw +[ ]*[a-f0-9]+: cf iretd +[ ]*[a-f0-9]+: cf iretd +[ ]*[a-f0-9]+: 48 cf iretq +[ ]*[a-f0-9]+: 0f 07 sysretd +[ ]*[a-f0-9]+: 0f 07 sysretd +[ ]*[a-f0-9]+: 48 0f 07 sysretq +[ ]*[a-f0-9]+: 66 cf iretw +[ ]*[a-f0-9]+: cf iretd +[ ]*[a-f0-9]+: cf iretd +[ ]*[a-f0-9]+: 48 cf iretq +[ ]*[a-f0-9]+: 0f 07 sysretd +[ ]*[a-f0-9]+: 0f 07 sysretd +[ ]*[a-f0-9]+: 48 0f 07 sysretq +#pass diff --git a/gas/testsuite/gas/i386/x86-64-suffix.d b/gas/testsuite/gas/i386/x86-64-suffix.d new file mode 100644 index 0000000..f0b645c --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-suffix.d @@ -0,0 +1,29 @@ +#objdump: -dwMsuffix +#name: x86-64 rep prefix (with suffixes) + +.*: +file format .* + +Disassembly of section .text: + +0+ <foo>: +[ ]*[a-f0-9]+: 0f 01 c8 monitor %rax,%rcx,%rdx +[ ]*[a-f0-9]+: 0f 01 c9 mwait %rax,%rcx +[ ]*[a-f0-9]+: 0f 01 c1 vmcall +[ ]*[a-f0-9]+: 0f 01 c2 vmlaunch +[ ]*[a-f0-9]+: 0f 01 c3 vmresume +[ ]*[a-f0-9]+: 0f 01 c4 vmxoff +[ ]*[a-f0-9]+: 66 cf iretw +[ ]*[a-f0-9]+: cf iretl +[ ]*[a-f0-9]+: cf iretl +[ ]*[a-f0-9]+: 48 cf iretq +[ ]*[a-f0-9]+: 0f 07 sysretl +[ ]*[a-f0-9]+: 0f 07 sysretl +[ ]*[a-f0-9]+: 48 0f 07 sysretq +[ ]*[a-f0-9]+: 66 cf iretw +[ ]*[a-f0-9]+: cf iretl +[ ]*[a-f0-9]+: cf iretl +[ ]*[a-f0-9]+: 48 cf iretq +[ ]*[a-f0-9]+: 0f 07 sysretl +[ ]*[a-f0-9]+: 0f 07 sysretl +[ ]*[a-f0-9]+: 48 0f 07 sysretq +#pass diff --git a/gas/testsuite/gas/i386/x86-64-suffix.s b/gas/testsuite/gas/i386/x86-64-suffix.s new file mode 100644 index 0000000..d583821 --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-suffix.s @@ -0,0 +1,28 @@ +# Disassembling with -Msuffix. + + .text +foo: + monitor + mwait + + vmcall + vmlaunch + vmresume + vmxoff + + iretw + iretl + iret + iretq + sysretl + sysret + sysretq + + .intel_syntax noprefix + iretw + iretd + iret + iretq + sysretd + sysret + sysretq |