aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2010-10-14 13:31:13 +0000
committerH.J. Lu <hjl.tools@gmail.com>2010-10-14 13:31:13 +0000
commitf8a5c266971d7b5b96f973805551c6e88669cada (patch)
treee8ffd91e8e6a02b3cb06ef44dfee189d2bef72dd /gas/testsuite
parent5d3236eea075e471b90b4d89bc459645abe9f50c (diff)
downloadgdb-f8a5c266971d7b5b96f973805551c6e88669cada.zip
gdb-f8a5c266971d7b5b96f973805551c6e88669cada.tar.gz
gdb-f8a5c266971d7b5b96f973805551c6e88669cada.tar.bz2
Add .d32 encoding suffix.
gas/ 2010-10-14 H.J. Lu <hongjiu.lu@intel.com> * config/tc-i386.c (_i386_insn): Add disp32_encoding. (md_assemble): Don't call optimize_disp if disp32_encoding is set. (parse_insn): Support .d32 to force 32bit displacement. (output_branch): Use BIG if disp32_encoding is set. * doc/c-i386.texi: Document .d32 encoding suffix. gas/testsuite/ 2010-10-14 H.J. Lu <hongjiu.lu@intel.com> * gas/i386/disp32.d: New. * gas/i386/disp32.s: Likewise. * gas/i386/x86-64-disp32.d: Likewise. * gas/i386/x86-64-disp32.s: Likewise. * gas/i386/i386.exp: Run disp32 and x86-64-disp32.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/ChangeLog9
-rw-r--r--gas/testsuite/gas/i386/disp32.d19
-rw-r--r--gas/testsuite/gas/i386/disp32.s11
-rw-r--r--gas/testsuite/gas/i386/i386.exp2
-rw-r--r--gas/testsuite/gas/i386/x86-64-disp32.d19
-rw-r--r--gas/testsuite/gas/i386/x86-64-disp32.s11
6 files changed, 71 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 26aff5c..acd3d21 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,12 @@
+2010-10-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ * gas/i386/disp32.d: New.
+ * gas/i386/disp32.s: Likewise.
+ * gas/i386/x86-64-disp32.d: Likewise.
+ * gas/i386/x86-64-disp32.s: Likewise.
+
+ * gas/i386/i386.exp: Run disp32 and x86-64-disp32.
+
2010-10-11 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* gas/s390/zarch-z196.d: Adjust the load/store on condition
diff --git a/gas/testsuite/gas/i386/disp32.d b/gas/testsuite/gas/i386/disp32.d
new file mode 100644
index 0000000..c1f59b6
--- /dev/null
+++ b/gas/testsuite/gas/i386/disp32.d
@@ -0,0 +1,19 @@
+#as:
+#objdump: -drw
+#name: i386 32bit displacement
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+0+ <foo-0x10>:
+[ ]*[a-f0-9]+: 8b 58 03 mov 0x3\(%eax\),%ebx
+[ ]*[a-f0-9]+: 8b 98 03 00 00 00 mov 0x3\(%eax\),%ebx
+[ ]*[a-f0-9]+: eb 05 jmp 10 <foo>
+[ ]*[a-f0-9]+: e9 00 00 00 00 jmp 10 <foo>
+
+0+10 <foo>:
+[ ]*[a-f0-9]+: 89 58 03 mov %ebx,0x3\(%eax\)
+[ ]*[a-f0-9]+: 89 98 03 00 00 00 mov %ebx,0x3\(%eax\)
+#pass
diff --git a/gas/testsuite/gas/i386/disp32.s b/gas/testsuite/gas/i386/disp32.s
new file mode 100644
index 0000000..de34f41
--- /dev/null
+++ b/gas/testsuite/gas/i386/disp32.s
@@ -0,0 +1,11 @@
+ .text
+ mov 3(%eax),%ebx
+ mov.d32 3(%eax),%ebx
+
+ jmp foo
+ jmp.d32 foo
+foo:
+
+ .intel_syntax noprefix
+ mov DWORD PTR [eax+3], ebx
+ mov.d32 DWORD PTR [eax+3], ebx
diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp
index c8d88d0..9027355 100644
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -49,6 +49,7 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_32_check]]
run_dump_test "sib-intel"
run_dump_test "disp"
run_dump_test "disp-intel"
+ run_dump_test "disp32"
run_dump_test "vmx"
run_dump_test "smx"
run_dump_test "suffix"
@@ -323,6 +324,7 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] t
run_dump_test "x86-64-sib-intel"
run_dump_test "x86-64-disp"
run_dump_test "x86-64-disp-intel"
+ run_dump_test "x86-64-disp32"
run_dump_test "rexw"
run_dump_test "x86-64-fxsave"
run_dump_test "x86-64-fxsave-intel"
diff --git a/gas/testsuite/gas/i386/x86-64-disp32.d b/gas/testsuite/gas/i386/x86-64-disp32.d
new file mode 100644
index 0000000..4d02063
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-disp32.d
@@ -0,0 +1,19 @@
+#as:
+#objdump: -drw
+#name: x86-64 32bit displacement
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+0+ <foo-0x10>:
+[ ]*[a-f0-9]+: 8b 58 03 mov 0x3\(%rax\),%ebx
+[ ]*[a-f0-9]+: 8b 98 03 00 00 00 mov 0x3\(%rax\),%ebx
+[ ]*[a-f0-9]+: eb 05 jmp 10 <foo>
+[ ]*[a-f0-9]+: e9 00 00 00 00 jmpq 10 <foo>
+
+0+10 <foo>:
+[ ]*[a-f0-9]+: 89 58 03 mov %ebx,0x3\(%rax\)
+[ ]*[a-f0-9]+: 89 98 03 00 00 00 mov %ebx,0x3\(%rax\)
+#pass
diff --git a/gas/testsuite/gas/i386/x86-64-disp32.s b/gas/testsuite/gas/i386/x86-64-disp32.s
new file mode 100644
index 0000000..b0e83e1
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-disp32.s
@@ -0,0 +1,11 @@
+ .text
+ mov 3(%rax),%ebx
+ mov.d32 3(%rax),%ebx
+
+ jmp foo
+ jmp.d32 foo
+foo:
+
+ .intel_syntax noprefix
+ mov DWORD PTR [rax+3], ebx
+ mov.d32 DWORD PTR [rax+3], ebx