aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2019-12-04 10:40:02 +0100
committerJan Beulich <jbeulich@suse.com>2019-12-04 10:40:02 +0100
commit3036c8991964674ca2407c543645d841ad431267 (patch)
tree89dce4cc7e0b04d33f770f0b28f388bc7172a5d7 /gas/testsuite
parent508559397632e046a1f734f27d2b1971b1d172d1 (diff)
downloadgdb-3036c8991964674ca2407c543645d841ad431267.zip
gdb-3036c8991964674ca2407c543645d841ad431267.tar.gz
gdb-3036c8991964674ca2407c543645d841ad431267.tar.bz2
x86: drop some stray/bogus DefaultSize
Insns permitting only GPR operands (and hence implicit sizing when there's no suffix) don't ever have their DefaultSize attribute inspected, so it shouldn't be there in the first place. Additionally XBEGIN is like JMP, not CALL, and hence shouldn't be converted to 32-bit operand size in .code16gcc mode. While the same is true for SYSRET, it permitting more than one suffix makes it FLDENV- like, and hence rather than dropping the attribute, for now add it to the exclusion list to avoid it getting an operand size prefix emitted in .code16gcc mode. (This will be dealt with later, perhaps together with FLDENV and friends.)
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/gas/i386/general.l55
-rw-r--r--gas/testsuite/gas/i386/general.s37
2 files changed, 84 insertions, 8 deletions
diff --git a/gas/testsuite/gas/i386/general.l b/gas/testsuite/gas/i386/general.l
index ac17096..d5f74d1 100644
--- a/gas/testsuite/gas/i386/general.l
+++ b/gas/testsuite/gas/i386/general.l
@@ -31,6 +31,7 @@
.*:143: Warning:.*
.*:144: Warning:.*
.*:178: Warning:.*
+.*:224: Warning:.*
1 .psize 0
2 .text
3 #test jumps and calls
@@ -283,11 +284,49 @@
217 022a 0FB6C8 movzb %al,%ecx
218
219 .code16gcc
- 220 # Use 16-bit layout by default for fldenv.
- 221 022d 67D920 fldenv \(%eax\)
- 222 0230 67D920 fldenvs \(%eax\)
- 223 0233 6766D920 fldenvl \(%eax\)
- 224
- 225 # Force a good alignment.
- 226 0237 00000000 00000000 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l \(%eax\)
+[ ]*[1-9][0-9]*[ ]*
+[ ]*[1-9][0-9]*[ ]*# Force a good alignment.
+[ ]*[1-9][0-9]*[ ]+[0-9a-f ]+\.p2align 4,0
+#pass
diff --git a/gas/testsuite/gas/i386/general.s b/gas/testsuite/gas/i386/general.s
index e4b2530..add14fd 100644
--- a/gas/testsuite/gas/i386/general.s
+++ b/gas/testsuite/gas/i386/general.s
@@ -217,6 +217,43 @@
movzb %al,%ecx
.code16gcc
+# Except for IRET use 32-bit implicit stack accesses by default.
+ call .
+ call *(%bx)
+ enter $0,$0
+ iret
+ lcall *(%bx)
+ lcall $0,$0
+ leave
+ lret
+ lret $0
+ push $0
+ push $0x1234
+ push (%bx)
+ pusha
+ pushf
+ pop (%bx)
+ popa
+ popf
+ ret
+ ret $0
+
+# However use 16-bit branches not accessing the stack by default.
+ ja .
+ ja .+0x1234
+ jcxz .
+ jmp .
+ jmp .+0x1234
+ jmp *(%bx)
+ ljmp *(%bx)
+ ljmp $0,$0
+ loop .
+ syscall
+ sysenter
+ sysexit
+ sysret
+ xbegin .
+
# Use 16-bit layout by default for fldenv.
fldenv (%eax)
fldenvs (%eax)