aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2011-02-28 16:34:39 +0000
committerMaciej W. Rozycki <macro@linux-mips.org>2011-02-28 16:34:39 +0000
commit0067d8fc73d10d58fe707bdbe8c5970ed80d2751 (patch)
tree2e319e7db3a27f02a45c3d17dd8141f2b6b9408c /gas
parentd455268f737c65cc7c12aadaf93001d6bcbb20ba (diff)
downloadgdb-0067d8fc73d10d58fe707bdbe8c5970ed80d2751.zip
gdb-0067d8fc73d10d58fe707bdbe8c5970ed80d2751.tar.gz
gdb-0067d8fc73d10d58fe707bdbe8c5970ed80d2751.tar.bz2
opcodes/
* mips-opc.c (mips_builtin_opcodes): Correct register use annotation of "alnv.ps". gas/testsuite/ * gas/mips/alnv_ps-swap.d: New test for ALNV.PS instruction branch swapping. * gas/mips/alnv_ps-swap.s: Source for the new test. * gas/mips/mips.exp: Run the new test.
Diffstat (limited to 'gas')
-rw-r--r--gas/testsuite/ChangeLog7
-rw-r--r--gas/testsuite/gas/mips/alnv_ps-swap.d39
-rw-r--r--gas/testsuite/gas/mips/alnv_ps-swap.s33
-rw-r--r--gas/testsuite/gas/mips/mips.exp3
4 files changed, 82 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index c3cb1e3..c4fbd0a 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,5 +1,12 @@
2011-02-28 Maciej W. Rozycki <macro@codesourcery.com>
+ * gas/mips/alnv_ps-swap.d: New test for ALNV.PS instruction
+ branch swapping.
+ * gas/mips/alnv_ps-swap.s: Source for the new test.
+ * gas/mips/mips.exp: Run the new test.
+
+2011-02-28 Maciej W. Rozycki <macro@codesourcery.com>
+
* gas/mips/relax-bposge.l: New test for DSP branch relaxation.
* gas/mips/relax-bposge.s: Source for the new test.
* gas/mips/mips.exp: Run the new test.
diff --git a/gas/testsuite/gas/mips/alnv_ps-swap.d b/gas/testsuite/gas/mips/alnv_ps-swap.d
new file mode 100644
index 0000000..97dd1cb
--- /dev/null
+++ b/gas/testsuite/gas/mips/alnv_ps-swap.d
@@ -0,0 +1,39 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: MIPS ALNV.PS instruction branch swapping
+#as: -32
+
+# Check that a register dependency between ALNV.PS and the following
+# branch prevents from branch swapping.
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+[0-9a-f]+ <[^>]*> 1000ffff b 0+0000 <foo>
+[0-9a-f]+ <[^>]*> 4c60111e alnv\.ps \$f4,\$f2,\$f0,v1
+[0-9a-f]+ <[^>]*> 0411fffd bal 0+0000 <foo>
+[0-9a-f]+ <[^>]*> 4c60111e alnv\.ps \$f4,\$f2,\$f0,v1
+[0-9a-f]+ <[^>]*> 0470fffb bltzal v1,0+0000 <foo>
+[0-9a-f]+ <[^>]*> 4c60111e alnv\.ps \$f4,\$f2,\$f0,v1
+[0-9a-f]+ <[^>]*> 0060f809 jalr v1
+[0-9a-f]+ <[^>]*> 4c60111e alnv\.ps \$f4,\$f2,\$f0,v1
+[0-9a-f]+ <[^>]*> 00602009 jalr a0,v1
+[0-9a-f]+ <[^>]*> 4c60111e alnv\.ps \$f4,\$f2,\$f0,v1
+[0-9a-f]+ <[^>]*> 4c60111e alnv\.ps \$f4,\$f2,\$f0,v1
+[0-9a-f]+ <[^>]*> 03e01809 jalr v1,ra
+[0-9a-f]+ <[^>]*> 00000000 nop
+[0-9a-f]+ <[^>]*> 1000fff2 b 0+0000 <foo>
+[0-9a-f]+ <[^>]*> 4fe0111e alnv\.ps \$f4,\$f2,\$f0,ra
+[0-9a-f]+ <[^>]*> 4fe0111e alnv\.ps \$f4,\$f2,\$f0,ra
+[0-9a-f]+ <[^>]*> 0411ffef bal 0+0000 <foo>
+[0-9a-f]+ <[^>]*> 00000000 nop
+[0-9a-f]+ <[^>]*> 4fe0111e alnv\.ps \$f4,\$f2,\$f0,ra
+[0-9a-f]+ <[^>]*> 0470ffec bltzal v1,0+0000 <foo>
+[0-9a-f]+ <[^>]*> 00000000 nop
+[0-9a-f]+ <[^>]*> 4fe0111e alnv\.ps \$f4,\$f2,\$f0,ra
+[0-9a-f]+ <[^>]*> 0060f809 jalr v1
+[0-9a-f]+ <[^>]*> 00000000 nop
+[0-9a-f]+ <[^>]*> 00602009 jalr a0,v1
+[0-9a-f]+ <[^>]*> 4fe0111e alnv\.ps \$f4,\$f2,\$f0,ra
+[0-9a-f]+ <[^>]*> 03e01809 jalr v1,ra
+[0-9a-f]+ <[^>]*> 4fe0111e alnv\.ps \$f4,\$f2,\$f0,ra
+ \.\.\.
diff --git a/gas/testsuite/gas/mips/alnv_ps-swap.s b/gas/testsuite/gas/mips/alnv_ps-swap.s
new file mode 100644
index 0000000..9d46c85
--- /dev/null
+++ b/gas/testsuite/gas/mips/alnv_ps-swap.s
@@ -0,0 +1,33 @@
+# Source file to test branch swapping with the ALNV.PS instruction.
+
+ .text
+foo:
+ alnv.ps $f4, $f2, $f0, $3
+ b foo
+ alnv.ps $f4, $f2, $f0, $3
+ bal foo
+ alnv.ps $f4, $f2, $f0, $3
+ bltzal $3, foo
+ alnv.ps $f4, $f2, $f0, $3
+ jalr $3
+ alnv.ps $f4, $f2, $f0, $3
+ jalr $4, $3
+ alnv.ps $f4, $f2, $f0, $3
+ jalr $3, $31
+
+ alnv.ps $f4, $f2, $f0, $31
+ b foo
+ alnv.ps $f4, $f2, $f0, $31
+ bal foo
+ alnv.ps $f4, $f2, $f0, $31
+ bltzal $3, foo
+ alnv.ps $f4, $f2, $f0, $31
+ jalr $3
+ alnv.ps $f4, $f2, $f0, $31
+ jalr $4, $3
+ alnv.ps $f4, $f2, $f0, $31
+ jalr $3, $31
+
+# Force at least 8 (non-delay-slot) zero bytes, to make 'objdump' print ...
+ .align 2
+ .space 8
diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
index 3fc5b61..f143ac3 100644
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -979,6 +979,9 @@ if { [istarget mips*-*-vxworks*] } {
run_dump_test "mips32-sync"
run_dump_test_arches "mips32r2-sync" \
[mips_arch_list_matching mips32r2]
+ run_dump_test_arches "alnv_ps-swap" [lsort -dictionary -unique [concat \
+ [mips_arch_list_matching mips5] \
+ [mips_arch_list_matching mips32r2] ] ]
if $has_newabi { run_dump_test "cfi-n64-1" }
}