From: Maciej W. Rozycki Date: Mon, 5 Jul 2010 23:46:21 +0000 (+0000) Subject: * gas/mips/beq.d, gas/mips/beq.s: Remove checks for X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8404fc53764113582a90215efd56dda4c62ad138;p=binutils-gdb.git * 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. --- diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 7a8f664995e..d839fdc587a 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,17 @@ +2010-07-05 Maciej W. Rozycki + + * 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 * gas/mips/mips4-fp.d: Reformat. diff --git a/gas/testsuite/gas/mips/beq.d b/gas/testsuite/gas/mips/beq.d index 09971dc565f..4da3d126d7a 100644 --- a/gas/testsuite/gas/mips/beq.d +++ b/gas/testsuite/gas/mips/beq.d @@ -28,22 +28,18 @@ Disassembly of section \.text: [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 \.\.\. diff --git a/gas/testsuite/gas/mips/beq.s b/gas/testsuite/gas/mips/beq.s index ae7c7507885..b3205f93fa9 100644 --- a/gas/testsuite/gas/mips/beq.s +++ b/gas/testsuite/gas/mips/beq.s @@ -12,11 +12,6 @@ text_label: # 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 diff --git a/gas/testsuite/gas/mips/bge.d b/gas/testsuite/gas/mips/bge.d index 56041287d94..a1d04fd36c0 100644 --- a/gas/testsuite/gas/mips/bge.d +++ b/gas/testsuite/gas/mips/bge.d @@ -47,25 +47,11 @@ Disassembly of section \.text: [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 \.\.\. diff --git a/gas/testsuite/gas/mips/bge.s b/gas/testsuite/gas/mips/bge.s index 4b4e58f6d69..6dc0ce1cf8f 100644 --- a/gas/testsuite/gas/mips/bge.s +++ b/gas/testsuite/gas/mips/bge.s @@ -19,16 +19,9 @@ text_label: 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 diff --git a/gas/testsuite/gas/mips/bgeu.d b/gas/testsuite/gas/mips/bgeu.d index 4fb9770f479..8b14fe8c276 100644 --- a/gas/testsuite/gas/mips/bgeu.d +++ b/gas/testsuite/gas/mips/bgeu.d @@ -41,25 +41,11 @@ Disassembly of section \.text: [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 \.\.\. diff --git a/gas/testsuite/gas/mips/bgeu.s b/gas/testsuite/gas/mips/bgeu.s index cccd584f780..dcfbfdb81fe 100644 --- a/gas/testsuite/gas/mips/bgeu.s +++ b/gas/testsuite/gas/mips/bgeu.s @@ -17,16 +17,9 @@ text_label: 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 diff --git a/gas/testsuite/gas/mips/blt.d b/gas/testsuite/gas/mips/blt.d index 919a786fab6..b0158f40497 100644 --- a/gas/testsuite/gas/mips/blt.d +++ b/gas/testsuite/gas/mips/blt.d @@ -47,25 +47,11 @@ Disassembly of section \.text: [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 \.\.\. diff --git a/gas/testsuite/gas/mips/blt.s b/gas/testsuite/gas/mips/blt.s index 9b2ed08524f..2efebfa3efc 100644 --- a/gas/testsuite/gas/mips/blt.s +++ b/gas/testsuite/gas/mips/blt.s @@ -19,16 +19,9 @@ text_label: 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 diff --git a/gas/testsuite/gas/mips/bltu.d b/gas/testsuite/gas/mips/bltu.d index 607809b2e8c..bf6f19c859c 100644 --- a/gas/testsuite/gas/mips/bltu.d +++ b/gas/testsuite/gas/mips/bltu.d @@ -41,25 +41,11 @@ Disassembly of section \.text: [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 \.\.\. diff --git a/gas/testsuite/gas/mips/bltu.s b/gas/testsuite/gas/mips/bltu.s index 602b7b283d6..dd0d3a29e2b 100644 --- a/gas/testsuite/gas/mips/bltu.s +++ b/gas/testsuite/gas/mips/bltu.s @@ -17,16 +17,9 @@ text_label: 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 diff --git a/gas/testsuite/gas/mips/branch-likely.d b/gas/testsuite/gas/mips/branch-likely.d new file mode 100644 index 00000000000..b391ad98e45 --- /dev/null +++ b/gas/testsuite/gas/mips/branch-likely.d @@ -0,0 +1,76 @@ +#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 + \.\.\. diff --git a/gas/testsuite/gas/mips/branch-likely.s b/gas/testsuite/gas/mips/branch-likely.s new file mode 100644 index 00000000000..d45b1fa748c --- /dev/null +++ b/gas/testsuite/gas/mips/branch-likely.s @@ -0,0 +1,36 @@ +# 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 diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp index 3a541fe1521..53748754622 100644 --- a/gas/testsuite/gas/mips/mips.exp +++ b/gas/testsuite/gas/mips/mips.exp @@ -412,13 +412,12 @@ if { [istarget mips*-*-vxworks*] } { # 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]