branch-likely instructions.
* gas/mips/bge.d, gas/mips/bge.s: Likewise.
* gas/mips/bgeu.d, gas/mips/bgeu.s: Likewise.
* gas/mips/blt.d, gas/mips/blt.s: Likewise.
* gas/mips/bltu.d, gas/mips/bltu.s: Likewise.
* gas/mips/branch-likely.d, gas/mips/branch-likely.s: New test,
collecting checks for branch-likely instructions removed from
the above.
* gas/mips/mips.exp: Run the new test and update the
constraints for the updated tests to include MIPS I.
+2010-07-05 Maciej W. Rozycki <macro@codesourcery.com>
+
+ * gas/mips/beq.d, gas/mips/beq.s: Remove checks for
+ branch-likely instructions.
+ * gas/mips/bge.d, gas/mips/bge.s: Likewise.
+ * gas/mips/bgeu.d, gas/mips/bgeu.s: Likewise.
+ * gas/mips/blt.d, gas/mips/blt.s: Likewise.
+ * gas/mips/bltu.d, gas/mips/bltu.s: Likewise.
+ * gas/mips/branch-likely.d, gas/mips/branch-likely.s: New test,
+ collecting checks for branch-likely instructions removed from
+ the above.
+ * gas/mips/mips.exp: Run the new test and update the
+ constraints for the updated tests to include MIPS I.
+
2010-07-05 Maciej W. Rozycki <macro@codesourcery.com>
* gas/mips/mips4-fp.d: Reformat.
[0-9a-f]+ <[^>]*> beq a0,at,0+0000 <.*>
[0-9a-f]+ <[^>]*> nop
[0-9a-f]+ <[^>]*> bnez a0,0+0000 <.*>
-[0-9a-f]+ <[^>]*> nop
-[0-9a-f]+ <[^>]*> beqzl a0,0+0000 <.*>
-[0-9a-f]+ <[^>]*> nop
-[0-9a-f]+ <[^>]*> bnezl a0,0+0000 <.*>
[0-9a-f]+ <[^>]*> nop
\.\.\.
[0-9a-f]+ <[^>]*> j 0+0000 <.*>
-[ ]*20068: (MIPS_JMP|JMPADDR|R_MIPS_26) \.text
+[ ]*20058: (MIPS_JMP|JMPADDR|R_MIPS_26) \.text
[0-9a-f]+ <[^>]*> nop
[0-9a-f]+ <[^>]*> jal 0+0000 <.*>
-[ ]*20070: (MIPS_JMP|JMPADDR|R_MIPS_26) \.text
+[ ]*20060: (MIPS_JMP|JMPADDR|R_MIPS_26) \.text
[0-9a-f]+ <[^>]*> nop
-#[0-9a-f]+ <[^>]*> b 0+20078 <.*\+0x20078>
-#[ ]*20078: .*16 external_label
+#[0-9a-f]+ <[^>]*> b 0+20068 <.*\+0x20068>
+#[ ]*20068: .*16 external_label
#[0-9a-f]+ <[^>]*> nop
-#[0-9a-f]+ <[^>]*> bal 0+20080 <.*\+0x20080>
-#[ ]*20080: .*16 external_label
+#[0-9a-f]+ <[^>]*> bal 0+20070 <.*\+0x20070>
+#[ ]*20070: .*16 external_label
#[0-9a-f]+ <[^>]*> nop
\.\.\.
# bne is handled by the same code as beq. Just sanity check.
bne $4,0,text_label
-# Sanity check beql and bnel
- .set mips2
- beql $4,0,text_label
- bnel $4,0,text_label
-
# Test that branches which overflow are converted to jumps.
.space 0x20000
b text_label
[0-9a-f]+ <[^>]*> bgtz a0,0+0000 <.*>
[0-9a-f]+ <[^>]*> nop
[0-9a-f]+ <[^>]*> slt at,a0,a1
-[0-9a-f]+ <[^>]*> beqzl at,0+0000 <.*>
+[0-9a-f]+ <[^>]*> beqz at,0+00a0 <.*\+0xa0>
+[ ]*a0: .*16 external_label
[0-9a-f]+ <[^>]*> nop
[0-9a-f]+ <[^>]*> slt at,a1,a0
-[0-9a-f]+ <[^>]*> bnezl at,0+0000 <.*>
-[0-9a-f]+ <[^>]*> nop
-[0-9a-f]+ <[^>]*> slt at,a0,a1
-[0-9a-f]+ <[^>]*> beqz at,0+00b8 <.*\+0xb8>
-[ ]*b8: .*16 external_label
-[0-9a-f]+ <[^>]*> nop
-[0-9a-f]+ <[^>]*> slt at,a1,a0
-[0-9a-f]+ <[^>]*> bnez at,0+00c4 <.*\+0xc4>
-[ ]*c4: .*16 external_label
-[0-9a-f]+ <[^>]*> nop
-[0-9a-f]+ <[^>]*> slt at,a0,a1
-[0-9a-f]+ <[^>]*> beqzl at,0+00d0 <.*\+0xd0>
-[ ]*d0: .*16 external_label
-[0-9a-f]+ <[^>]*> nop
-[0-9a-f]+ <[^>]*> slt at,a1,a0
-[0-9a-f]+ <[^>]*> bnezl at,0+00dc <.*\+0xdc>
-[ ]*dc: .*16 external_label
+[0-9a-f]+ <[^>]*> bnez at,0+00ac <.*\+0xac>
+[ ]*ac: .*16 external_label
[0-9a-f]+ <[^>]*> nop
\.\.\.
bgt $0,$5,text_label
bgt $4,0,text_label
-# Sanity test bgel and bgtl
- .set mips2
- bgel $4,$5,text_label
- bgtl $4,$5,text_label
-
# Branch to an external label.
bge $4,$5,external_label
bgt $4,$5,external_label
- bgel $4,$5,external_label
- bgtl $4,$5,external_label
# Round to a 16 byte boundary, for ease in testing multiple targets.
nop
[0-9a-f]+ <[^>]*> bnez a0,0+0000 <.*>
[0-9a-f]+ <[^>]*> nop
[0-9a-f]+ <[^>]*> sltu at,a0,a1
-[0-9a-f]+ <[^>]*> beqzl at,0+0000 <.*>
+[0-9a-f]+ <[^>]*> beqz at,0+0088 <.*\+0x88>
+[ ]*88: .*16 external_label
[0-9a-f]+ <[^>]*> nop
[0-9a-f]+ <[^>]*> sltu at,a1,a0
-[0-9a-f]+ <[^>]*> bnezl at,0+0000 <.*>
-[0-9a-f]+ <[^>]*> nop
-[0-9a-f]+ <[^>]*> sltu at,a0,a1
-[0-9a-f]+ <[^>]*> beqz at,0+00a0 <.*\+0xa0>
-[ ]*a0: .*16 external_label
-[0-9a-f]+ <[^>]*> nop
-[0-9a-f]+ <[^>]*> sltu at,a1,a0
-[0-9a-f]+ <[^>]*> bnez at,0+00ac <.*\+0xac>
-[ ]*ac: .*16 external_label
-[0-9a-f]+ <[^>]*> nop
-[0-9a-f]+ <[^>]*> sltu at,a0,a1
-[0-9a-f]+ <[^>]*> beqzl at,0+00b8 <.*\+0xb8>
-[ ]*b8: .*16 external_label
-[0-9a-f]+ <[^>]*> nop
-[0-9a-f]+ <[^>]*> sltu at,a1,a0
-[0-9a-f]+ <[^>]*> bnezl at,0+00c4 <.*\+0xc4>
-[ ]*c4: .*16 external_label
+[0-9a-f]+ <[^>]*> bnez at,0+0094 <.*\+0x94>
+[ ]*94: .*16 external_label
[0-9a-f]+ <[^>]*> nop
\.\.\.
bgtu $4,$0,text_label
bgtu $4,0,text_label
-# Sanity test bgeul and bgtul
- .set mips2
- bgeul $4,$5,text_label
- bgtul $4,$5,text_label
-
# Branch to an external label.
bgeu $4,$5,external_label
bgtu $4,$5,external_label
- bgeul $4,$5,external_label
- bgtul $4,$5,external_label
# Round to a 16 byte boundary, for ease in testing multiple targets.
nop
[0-9a-f]+ <[^>]*> blez a0,0+0000 <.*>
[0-9a-f]+ <[^>]*> nop
[0-9a-f]+ <[^>]*> slt at,a0,a1
-[0-9a-f]+ <[^>]*> bnezl at,0+0000 <.*>
+[0-9a-f]+ <[^>]*> bnez at,0+00a0 <.*\+0xa0>
+[ ]*a0: .*16 external_label
[0-9a-f]+ <[^>]*> nop
[0-9a-f]+ <[^>]*> slt at,a1,a0
-[0-9a-f]+ <[^>]*> beqzl at,0+0000 <.*>
-[0-9a-f]+ <[^>]*> nop
-[0-9a-f]+ <[^>]*> slt at,a0,a1
-[0-9a-f]+ <[^>]*> bnez at,0+00b8 <.*\+0xb8>
-[ ]*b8: .*16 external_label
-[0-9a-f]+ <[^>]*> nop
-[0-9a-f]+ <[^>]*> slt at,a1,a0
-[0-9a-f]+ <[^>]*> beqz at,0+00c4 <.*\+0xc4>
-[ ]*c4: .*16 external_label
-[0-9a-f]+ <[^>]*> nop
-[0-9a-f]+ <[^>]*> slt at,a0,a1
-[0-9a-f]+ <[^>]*> bnezl at,0+00d0 <.*\+0xd0>
-[ ]*d0: .*16 external_label
-[0-9a-f]+ <[^>]*> nop
-[0-9a-f]+ <[^>]*> slt at,a1,a0
-[0-9a-f]+ <[^>]*> beqzl at,0+00dc <.*\+0xdc>
-[ ]*dc: .*16 external_label
+[0-9a-f]+ <[^>]*> beqz at,0+00ac <.*\+0xac>
+[ ]*ac: .*16 external_label
[0-9a-f]+ <[^>]*> nop
\.\.\.
ble $0,$5,text_label
ble $4,0,text_label
-# Sanity test bltl and blel
- .set mips2
- bltl $4,$5,text_label
- blel $4,$5,text_label
-
# Branch to an external label.
blt $4,$5,external_label
ble $4,$5,external_label
- bltl $4,$5,external_label
- blel $4,$5,external_label
# Round to a 16 byte boundary, for ease in testing multiple targets.
nop
[0-9a-f]+ <[^>]*> beqz a0,0+0000 <.*>
[0-9a-f]+ <[^>]*> nop
[0-9a-f]+ <[^>]*> sltu at,a0,a1
-[0-9a-f]+ <[^>]*> bnezl at,0+0000 <.*>
+[0-9a-f]+ <[^>]*> bnez at,0+0088 <.*\+0x88>
+[ ]*88: .*16 external_label
[0-9a-f]+ <[^>]*> nop
[0-9a-f]+ <[^>]*> sltu at,a1,a0
-[0-9a-f]+ <[^>]*> beqzl at,0+0000 <.*>
-[0-9a-f]+ <[^>]*> nop
-[0-9a-f]+ <[^>]*> sltu at,a0,a1
-[0-9a-f]+ <[^>]*> bnez at,0+00a0 <.*\+0xa0>
-[ ]*a0: .*16 external_label
-[0-9a-f]+ <[^>]*> nop
-[0-9a-f]+ <[^>]*> sltu at,a1,a0
-[0-9a-f]+ <[^>]*> beqz at,0+00ac <.*\+0xac>
-[ ]*ac: .*16 external_label
-[0-9a-f]+ <[^>]*> nop
-[0-9a-f]+ <[^>]*> sltu at,a0,a1
-[0-9a-f]+ <[^>]*> bnezl at,0+00b8 <.*\+0xb8>
-[ ]*b8: .*16 external_label
-[0-9a-f]+ <[^>]*> nop
-[0-9a-f]+ <[^>]*> sltu at,a1,a0
-[0-9a-f]+ <[^>]*> beqzl at,0+00c4 <.*\+0xc4>
-[ ]*c4: .*16 external_label
+[0-9a-f]+ <[^>]*> beqz at,0+0094 <.*\+0x94>
+[ ]*94: .*16 external_label
[0-9a-f]+ <[^>]*> nop
\.\.\.
bleu $4,$0,text_label
bleu $4,0,text_label
-# Sanity test bltul and bleul
- .set mips2
- bltul $4,$5,text_label
- bleul $4,$5,text_label
-
# Branch to an external label.
bltu $4,$5,external_label
bleu $4,$5,external_label
- bltul $4,$5,external_label
- bleul $4,$5,external_label
# Round to a 16 byte boundary, for ease in testing multiple targets.
nop
--- /dev/null
+#objdump: -dr --prefix-addresses -m mips:4000
+#name: MIPS branch-likely instructions
+#as: -32
+
+# Check branch-likely instructions
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+[0-9a-f]+ <[^>]*> beqzl a0,0+0000 <.*>
+[0-9a-f]+ <[^>]*> nop
+[0-9a-f]+ <[^>]*> bnezl a0,0+0000 <.*>
+[0-9a-f]+ <[^>]*> nop
+[0-9a-f]+ <[^>]*> beqzl a0,0+0010 <.*\+0x10>
+[ ]*10: .*16 external_label
+[0-9a-f]+ <[^>]*> nop
+[0-9a-f]+ <[^>]*> bnezl a0,0+0018 <.*\+0x18>
+[ ]*18: .*16 external_label
+[0-9a-f]+ <[^>]*> nop
+[0-9a-f]+ <[^>]*> slt at,a0,a1
+[0-9a-f]+ <[^>]*> beqzl at,0+0000 <.*>
+[0-9a-f]+ <[^>]*> nop
+[0-9a-f]+ <[^>]*> slt at,a1,a0
+[0-9a-f]+ <[^>]*> bnezl at,0+0000 <.*>
+[0-9a-f]+ <[^>]*> nop
+[0-9a-f]+ <[^>]*> slt at,a0,a1
+[0-9a-f]+ <[^>]*> beqzl at,0+003c <.*\+0x3c>
+[ ]*3c: .*16 external_label
+[0-9a-f]+ <[^>]*> nop
+[0-9a-f]+ <[^>]*> slt at,a1,a0
+[0-9a-f]+ <[^>]*> bnezl at,0+0048 <.*\+0x48>
+[ ]*48: .*16 external_label
+[0-9a-f]+ <[^>]*> nop
+[0-9a-f]+ <[^>]*> sltu at,a0,a1
+[0-9a-f]+ <[^>]*> beqzl at,0+0000 <.*>
+[0-9a-f]+ <[^>]*> nop
+[0-9a-f]+ <[^>]*> sltu at,a1,a0
+[0-9a-f]+ <[^>]*> bnezl at,0+0000 <.*>
+[0-9a-f]+ <[^>]*> nop
+[0-9a-f]+ <[^>]*> sltu at,a0,a1
+[0-9a-f]+ <[^>]*> beqzl at,0+006c <.*\+0x6c>
+[ ]*6c: .*16 external_label
+[0-9a-f]+ <[^>]*> nop
+[0-9a-f]+ <[^>]*> sltu at,a1,a0
+[0-9a-f]+ <[^>]*> bnezl at,0+0078 <.*\+0x78>
+[ ]*78: .*16 external_label
+[0-9a-f]+ <[^>]*> nop
+[0-9a-f]+ <[^>]*> slt at,a0,a1
+[0-9a-f]+ <[^>]*> bnezl at,0+0000 <.*>
+[0-9a-f]+ <[^>]*> nop
+[0-9a-f]+ <[^>]*> slt at,a1,a0
+[0-9a-f]+ <[^>]*> beqzl at,0+0000 <.*>
+[0-9a-f]+ <[^>]*> nop
+[0-9a-f]+ <[^>]*> slt at,a0,a1
+[0-9a-f]+ <[^>]*> bnezl at,0+009c <.*\+0x9c>
+[ ]*9c: .*16 external_label
+[0-9a-f]+ <[^>]*> nop
+[0-9a-f]+ <[^>]*> slt at,a1,a0
+[0-9a-f]+ <[^>]*> beqzl at,0+00a8 <.*\+0xa8>
+[ ]*a8: .*16 external_label
+[0-9a-f]+ <[^>]*> nop
+[0-9a-f]+ <[^>]*> sltu at,a0,a1
+[0-9a-f]+ <[^>]*> bnezl at,0+0000 <.*>
+[0-9a-f]+ <[^>]*> nop
+[0-9a-f]+ <[^>]*> sltu at,a1,a0
+[0-9a-f]+ <[^>]*> beqzl at,0+0000 <.*>
+[0-9a-f]+ <[^>]*> nop
+[0-9a-f]+ <[^>]*> sltu at,a0,a1
+[0-9a-f]+ <[^>]*> bnezl at,0+00cc <.*\+0xcc>
+[ ]*cc: .*16 external_label
+[0-9a-f]+ <[^>]*> nop
+[0-9a-f]+ <[^>]*> sltu at,a1,a0
+[0-9a-f]+ <[^>]*> beqzl at,0+00d8 <.*\+0xd8>
+[ ]*d8: .*16 external_label
+[0-9a-f]+ <[^>]*> nop
+ \.\.\.
--- /dev/null
+# Source file used to test the branch-likely macros.
+
+ .text
+text_label:
+# Sanity check beql and bnel
+ beql $4,0,text_label
+ bnel $4,0,text_label
+ beql $4,0,external_label
+ bnel $4,0,external_label
+
+# Sanity test bgel and bgtl
+ bgel $4,$5,text_label
+ bgtl $4,$5,text_label
+ bgel $4,$5,external_label
+ bgtl $4,$5,external_label
+
+# Sanity test bgeul and bgtul
+ bgeul $4,$5,text_label
+ bgtul $4,$5,text_label
+ bgeul $4,$5,external_label
+ bgtul $4,$5,external_label
+
+# Sanity test bltl and blel
+ bltl $4,$5,text_label
+ blel $4,$5,text_label
+ bltl $4,$5,external_label
+ blel $4,$5,external_label
+
+# Sanity test bltul and bleul
+ bltul $4,$5,text_label
+ bleul $4,$5,text_label
+ bltul $4,$5,external_label
+ bleul $4,$5,external_label
+
+# Force at least 8 (non-delay-slot) zero bytes, to make 'objdump' print ...
+ .space 8
# See http://sources.redhat.com/ml/binutils/2001-10/msg00418.html for
# more information. Not sure if the fixes there are correct; should
# branches to external labels be allowed for ECOFF?
- # XXX FIXME: the following tests require -mips2 disasm for
- # branch-likely instructions. They should be split.
- run_dump_test_arches "beq" [mips_arch_list_matching mips2]
- run_dump_test_arches "bge" [mips_arch_list_matching mips2]
- run_dump_test_arches "bgeu" [mips_arch_list_matching mips2]
- run_dump_test_arches "blt" [mips_arch_list_matching mips2]
- run_dump_test_arches "bltu" [mips_arch_list_matching mips2]
+ run_dump_test_arches "beq" [mips_arch_list_matching mips1]
+ run_dump_test_arches "bge" [mips_arch_list_matching mips1]
+ run_dump_test_arches "bgeu" [mips_arch_list_matching mips1]
+ run_dump_test_arches "blt" [mips_arch_list_matching mips1]
+ run_dump_test_arches "bltu" [mips_arch_list_matching mips1]
+ run_dump_test_arches "branch-likely" [mips_arch_list_matching mips2]
run_dump_test_arches "branch-misc-1" [mips_arch_list_matching mips1]
run_dump_test_arches "branch-misc-2" [mips_arch_list_matching mips1]
run_dump_test_arches "branch-misc-2pic" [mips_arch_list_matching mips1]