diff options
author | Jan Beulich <jbeulich@novell.com> | 2008-08-28 09:42:11 +0000 |
---|---|---|
committer | Jan Beulich <jbeulich@novell.com> | 2008-08-28 09:42:11 +0000 |
commit | fc0763e65af9240d302c14f3bbab5e3e0f3b7364 (patch) | |
tree | c3a3f767048ce397556d20f3c20cad35e79b86e5 /gas/testsuite | |
parent | 6bba1048d63e0476b94b9934527defd81c590a13 (diff) | |
download | gdb-fc0763e65af9240d302c14f3bbab5e3e0f3b7364.zip gdb-fc0763e65af9240d302c14f3bbab5e3e0f3b7364.tar.gz gdb-fc0763e65af9240d302c14f3bbab5e3e0f3b7364.tar.bz2 |
gas/
2008-08-28 Jan Beulich <jbeulich@novell.com>
* config/tc-i386.c (md_assemble): Force number of displacement
operands to zero when processing string instruction.
(i386_index_check): Special-case string instruction operands. Don't
fudge address prefix if there already was a memory operand. Fix
error message to correctly reflect the addressing mode used.
(i386_att_operand): Fix comment.
(i386_intel_operand): Snapshot, clear, and restore base and index
reg for each operand processed. Increment count of memory operands
later.
gas/testsuite/
2008-08-28 Jan Beulich <jbeulich@novell.com>
* gas/i386/string-bad.{l,s}, gas/i386/string-ok.{d,e,s}: New.
* gas/i386/i386.exp: Run new tests.
Diffstat (limited to 'gas/testsuite')
-rw-r--r-- | gas/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/i386.exp | 5 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/string-bad.l | 17 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/string-bad.s | 22 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/string-ok.d | 80 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/string-ok.e | 30 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/string-ok.s | 93 |
7 files changed, 252 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 5dc3e50..d0cd9d2 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-08-28 Jan Beulich <jbeulich@novell.com> + + * gas/i386/string-bad.{l,s}, gas/i386/string-ok.{d,e,s}: New. + * gas/i386/i386.exp: Run new tests. + 2008-08-27 H.J. Lu <hongjiu.lu@intel.com> * gas/i386/intel.s: Add tests for fidivr. diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp index fde61bd..c8cef20 100644 --- a/gas/testsuite/gas/i386/i386.exp +++ b/gas/testsuite/gas/i386/i386.exp @@ -184,6 +184,11 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_32_check]] set ASFLAGS "$old_ASFLAGS" } +if [expr [istarget "i*86-*-*"] || [istarget "x86_64-*-*"]] then { + run_dump_test "string-ok" + run_list_test "string-bad" "" +} + if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] then { global ASFLAGS diff --git a/gas/testsuite/gas/i386/string-bad.l b/gas/testsuite/gas/i386/string-bad.l new file mode 100644 index 0000000..0230bbe --- /dev/null +++ b/gas/testsuite/gas/i386/string-bad.l @@ -0,0 +1,17 @@ +.*: Assembler messages: +.*:4: Error: .* +.*:5: Error: .* +.*:6: Error: .* +.*:7: Error: .* +.*:8: Error: .* +.*:9: Error: .* +.*:10: Error: .* +.*:14: Error: .* +.*:15: Error: .* +.*:16: Error: .* +.*:17: Error: .* +.*:18: Error: .* +.*:19: Error: .* +.*:20: Error: .* +.*:21: Error: .* +.*:22: Error: .* diff --git a/gas/testsuite/gas/i386/string-bad.s b/gas/testsuite/gas/i386/string-bad.s new file mode 100644 index 0000000..7c739a1 --- /dev/null +++ b/gas/testsuite/gas/i386/string-bad.s @@ -0,0 +1,22 @@ + .text + .code32 +start: + movsb (%esi), (%di) + movsb (%si), (%edi) + movsb (%esi), %ds:(%edi) + stosb %ds:(%edi) + cmpsb %ds:(%edi), (%esi) + scasb %ds:(%edi) + insb (%dx), %ds:(%edi) + + .intel_syntax noprefix + + movs byte ptr [edi], [si] + movs byte ptr [di], [esi] + movs byte ptr ds:[edi], [esi] + movs byte ptr [edi], word ptr [esi] + stos byte ptr ds:[edi] + cmps byte ptr [esi], ds:[edi] + cmps byte ptr [esi], dword ptr [edi] + scas byte ptr ds:[edi] + ins byte ptr ds:[edi], dx diff --git a/gas/testsuite/gas/i386/string-ok.d b/gas/testsuite/gas/i386/string-ok.d new file mode 100644 index 0000000..80e0b67 --- /dev/null +++ b/gas/testsuite/gas/i386/string-ok.d @@ -0,0 +1,80 @@ +#as: -J +#objdump: -dw -mi386 +#name: string insn operands +#stderr: string-ok.e +.*: +file format .* + +Disassembly of section .text: + +0+ <.*start32>: +[ ]+[0-9a-f]+: 2e a6[ ]+cmpsb (%es:)?\(%edi\),%cs:\(%esi\) +[ ]+[0-9a-f]+: a6[ ]+cmpsb (%es:)?\(%edi\),(%ds:)?\(%esi\) +[ ]+[0-9a-f]+: 67 a6[ ]+(addr16 )?cmpsb (%es:)?\(%di\),(%ds:)?\(%si\) +[ ]+[0-9a-f]+: a6[ ]+cmpsb (%es:)?\(%edi\),(%ds:)?\(%esi\) +[ ]+[0-9a-f]+: 6c[ ]+insb \(%dx\),(%es:)?\(%edi\) +[ ]+[0-9a-f]+: 6c[ ]+insb \(%dx\),(%es:)?\(%edi\) +[ ]+[0-9a-f]+: 2e ac[ ]+lods %cs:\(%esi\),%al +[ ]+[0-9a-f]+: ac[ ]+lods (%ds:)?\(%esi\),%al +[ ]+[0-9a-f]+: 2e a4[ ]+movsb %cs:\(%esi\),(%es:)?\(%edi\) +[ ]+[0-9a-f]+: a4[ ]+movsb (%ds:)?\(%esi\),(%es:)?\(%edi\) +[ ]+[0-9a-f]+: 67 a4[ ]+(addr16 )?movsb (%ds:)?\(%si\),(%es:)?\(%di\) +[ ]+[0-9a-f]+: a4[ ]+movsb (%ds:)?\(%esi\),(%es:)?\(%edi\) +[ ]+[0-9a-f]+: a4[ ]+movsb (%ds:)?\(%esi\),(%es:)?\(%edi\) +[ ]+[0-9a-f]+: 2e 6e[ ]+outsb %cs:\(%esi\),\(%dx\) +[ ]+[0-9a-f]+: 6e[ ]+outsb (%ds:)?\(%esi\),\(%dx\) +[ ]+[0-9a-f]+: ae[ ]+scas (%es:)?\(%edi\),%al +[ ]+[0-9a-f]+: ae[ ]+scas (%es:)?\(%edi\),%al +[ ]+[0-9a-f]+: aa[ ]+stos %al,(%es:)?\(%edi\) +[ ]+[0-9a-f]+: aa[ ]+stos %al,(%es:)?\(%edi\) +[ ]+[0-9a-f]+: 2e d7[ ]+xlat %cs:\(%ebx\) +[ ]+[0-9a-f]+: d7[ ]+xlat (%ds:)?\(%ebx\) +[ ]+[0-9a-f]+: d7[ ]+xlat (%ds:)?\(%ebx\) +[ ]+[0-9a-f]+: d7[ ]+xlat (%ds:)?\(%ebx\) +[ ]+[0-9a-f]+: d7[ ]+xlat (%ds:)?\(%ebx\) +[ ]+[0-9a-f]+: d7[ ]+xlat (%ds:)?\(%ebx\) + +[0-9a-f]+ <.*start16>: +[ ]+[0-9a-f]+: a6[ ]+cmpsb (%es:)?\(%edi\),(%ds:)?\(%esi\) +[ ]+[0-9a-f]+: 67 a4[ ]+(addr16 )?movsb (%ds:)?\(%si\),(%es:)?\(%di\) + +[0-9a-f]+ <.*start64>: +[ ]+[0-9a-f]+: a6[ ]+cmpsb (%es:)?\(%edi\),(%ds:)?\(%esi\) +[ ]+[0-9a-f]+: 67 a4[ ]+(addr16 )?movsb (%ds:)?\(%si\),(%es:)?\(%di\) + +[0-9a-f]+ <.*intel32>: +[ ]+[0-9a-f]+: 2e a6[ ]+cmpsb (%es:)?\(%edi\),%cs:\(%esi\) +[ ]+[0-9a-f]+: a6[ ]+cmpsb (%es:)?\(%edi\),(%ds:)?\(%esi\) +[ ]+[0-9a-f]+: a6[ ]+cmpsb (%es:)?\(%edi\),(%ds:)?\(%esi\) +[ ]+[0-9a-f]+: 67 a6[ ]+(addr16 )?cmpsb (%es:)?\(%di\),(%ds:)?\(%si\) +[ ]+[0-9a-f]+: a6[ ]+cmpsb (%es:)?\(%edi\),(%ds:)?\(%esi\) +[ ]+[0-9a-f]+: 6c[ ]+insb \(%dx\),(%es:)?\(%edi\) +[ ]+[0-9a-f]+: 6c[ ]+insb \(%dx\),(%es:)?\(%edi\) +[ ]+[0-9a-f]+: 2e ac[ ]+lods %cs:\(%esi\),%al +[ ]+[0-9a-f]+: ac[ ]+lods (%ds:)?\(%esi\),%al +[ ]+[0-9a-f]+: 2e a4[ ]+movsb %cs:\(%esi\),(%es:)?\(%edi\) +[ ]+[0-9a-f]+: a4[ ]+movsb (%ds:)?\(%esi\),(%es:)?\(%edi\) +[ ]+[0-9a-f]+: a4[ ]+movsb (%ds:)?\(%esi\),(%es:)?\(%edi\) +[ ]+[0-9a-f]+: 67 a4[ ]+(addr16 )?movsb (%ds:)?\(%si\),(%es:)?\(%di\) +[ ]+[0-9a-f]+: a4[ ]+movsb (%ds:)?\(%esi\),(%es:)?\(%edi\) +[ ]+[0-9a-f]+: a4[ ]+movsb (%ds:)?\(%esi\),(%es:)?\(%edi\) +[ ]+[0-9a-f]+: 2e 6e[ ]+outsb %cs:\(%esi\),\(%dx\) +[ ]+[0-9a-f]+: 6e[ ]+outsb (%ds:)?\(%esi\),\(%dx\) +[ ]+[0-9a-f]+: ae[ ]+scas (%es:)?\(%edi\),%al +[ ]+[0-9a-f]+: ae[ ]+scas (%es:)?\(%edi\),%al +[ ]+[0-9a-f]+: aa[ ]+stos %al,(%es:)?\(%edi\) +[ ]+[0-9a-f]+: aa[ ]+stos %al,(%es:)?\(%edi\) +[ ]+[0-9a-f]+: 2e d7[ ]+xlat %cs:\(%ebx\) +[ ]+[0-9a-f]+: d7[ ]+xlat (%ds:)?\(%ebx\) +[ ]+[0-9a-f]+: d7[ ]+xlat (%ds:)?\(%ebx\) +[ ]+[0-9a-f]+: d7[ ]+xlat (%ds:)?\(%ebx\) +[ ]+[0-9a-f]+: d7[ ]+xlat (%ds:)?\(%ebx\) +[ ]+[0-9a-f]+: d7[ ]+xlat (%ds:)?\(%ebx\) + +[0-9a-f]+ <.*intel16>: +[ ]+[0-9a-f]+: a6[ ]+cmpsb (%es:)?\(%edi\),(%ds:)?\(%esi\) +[ ]+[0-9a-f]+: 67 a4[ ]+(addr16 )?movsb (%ds:)?\(%si\),(%es:)?\(%di\) + +[0-9a-f]+ <.*intel64>: +[ ]+[0-9a-f]+: a6[ ]+cmpsb (%es:)?\(%edi\),(%ds:)?\(%esi\) +[ ]+[0-9a-f]+: 67 a4[ ]+(addr16 )?movsb (%ds:)?\(%si\),(%es:)?\(%di\) +#pass diff --git a/gas/testsuite/gas/i386/string-ok.e b/gas/testsuite/gas/i386/string-ok.e new file mode 100644 index 0000000..95dc4d2 --- /dev/null +++ b/gas/testsuite/gas/i386/string-ok.e @@ -0,0 +1,30 @@ +.*: Assembler messages: +.*:7: Warning: .* +.*:7: Warning: .* +.*:10: Warning: .* +.*:13: Warning: .* +.*:18: Warning: .* +.*:19: Warning: .* +.*:22: Warning: .* +.*:25: Warning: .* +.*:28: Warning: .* +.*:31: Warning: .* +.*:32: Warning: .* +.*:33: Warning: .* +.*:34: Warning: .* +.*:35: Warning: .* + +.*:54: Warning: .* +.*:54: Warning: .* +.*:57: Warning: .* +.*:60: Warning: .* +.*:66: Warning: .* +.*:67: Warning: .* +.*:70: Warning: .* +.*:73: Warning: .* +.*:76: Warning: .* +.*:79: Warning: .* +.*:80: Warning: .* +.*:81: Warning: .* +.*:82: Warning: .* +.*:83: Warning: .* diff --git a/gas/testsuite/gas/i386/string-ok.s b/gas/testsuite/gas/i386/string-ok.s new file mode 100644 index 0000000..c7217bc --- /dev/null +++ b/gas/testsuite/gas/i386/string-ok.s @@ -0,0 +1,93 @@ + .text + .code32 +start32: + cmpsb (%edi), %cs:(%esi) + cmpsb %es:(%edi), (%esi) + cmpsb (%di), (%si) + cmpsb (%esi), (%edi) + + insb (%dx), %es:(%edi) + insb (%dx), (%esi) + + lodsb %cs:(%esi) + lodsb (%edi) + + movsb %cs:(%esi), (%edi) + movsb (%esi), %es:(%edi) + movsb (%si), (%di) + movsb (%ebx), (%edi) + movsb (%esi), (%ebx) + + outsb %cs:(%esi), (%dx) + outsb (%edi), (%dx) + + scasb %es:(%edi) + scasb (%esi) + + stosb %es:(%edi) + stosb (%esi) + + xlatb %cs:(%ebx) + xlatb (%esi) + xlatb (,%ebx) + xlatb 1(%ebx) + xlatb x(%ebx) + xlatb 0 + + .code16 +start16: + cmpsb (%di), (%si) + movsb (%esi), (%edi) + + .code64 +start64: + cmpsb (%rdi), (%rsi) + movsb (%esi), (%edi) + + .intel_syntax noprefix + .code32 +intel32: + cmps byte ptr cs:[esi], [edi] + cmps byte ptr [esi], es:[edi] + cmps byte ptr [esi], byte ptr [edi] + cmps byte ptr [si], [di] + cmps byte ptr [edi], [esi] + + ins byte ptr es:[edi], dx + ins byte ptr [esi], dx + + lods byte ptr cs:[esi] + lods byte ptr [edi] + + movs byte ptr [edi], cs:[esi] + movs byte ptr es:[edi], [esi] + movs byte ptr [edi], byte ptr [esi] + movs byte ptr [di], [si] + movs byte ptr [edi], [ebx] + movs byte ptr [ebx], [esi] + + outs dx, byte ptr cs:[esi] + outs dx, byte ptr [edi] + + scas byte ptr es:[edi] + scas byte ptr [esi] + + stos byte ptr es:[edi] + stos byte ptr [esi] + + xlat byte ptr cs:[ebx] + xlat byte ptr [esi] + xlat byte ptr [%ebx*1] + xlat byte ptr [ebx+1] + xlat byte ptr x[ebx] + xlat byte ptr FLAT:0 + + .code16 +intel16: + cmps byte ptr [si], [di] + movs byte ptr [edi], [esi] + + .code64 +intel64: + cmps byte ptr [rsi], [rdi] + movs byte ptr [edi], [esi] |