diff options
author | Fredrik Noring <noring@nocrew.org> | 2018-10-19 09:47:55 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2018-10-19 09:47:55 +0100 |
commit | 33d64ca5db656f1f377de18f94403d8b3b91e3a1 (patch) | |
tree | 898e440de0a4f6763f3a17b8c9cc0391b43304cc /gas/testsuite/gas/mips | |
parent | 08acaf5caf47225ff94dc5e64ce8edce6664615a (diff) | |
download | binutils-gdb-33d64ca5db656f1f377de18f94403d8b3b91e3a1.tar.gz |
This set of changes clarifies the conditions for the R5900 short loop fix and extends its test with the border cases of six and seven instructions.
* testsuite/gas/mips/r5900.s: Extend the R5900 short loop fix
test with border cases.
* testsuite/gas/mips/r5900.d: Add extra expected disassembly.
* config/tc-mips.c (can_swap_branch_p): Clarify the R5900 short
loop hardware bug conditions. Correct note on the R5900
instruction count short loop fix.
Diffstat (limited to 'gas/testsuite/gas/mips')
-rw-r--r-- | gas/testsuite/gas/mips/r5900.d | 18 | ||||
-rw-r--r-- | gas/testsuite/gas/mips/r5900.s | 32 |
2 files changed, 45 insertions, 5 deletions
diff --git a/gas/testsuite/gas/mips/r5900.d b/gas/testsuite/gas/mips/r5900.d index 7ef9a8a96ea..082c204a6fc 100644 --- a/gas/testsuite/gas/mips/r5900.d +++ b/gas/testsuite/gas/mips/r5900.d @@ -87,7 +87,23 @@ Disassembly of section \.text: [0-9a-f]+ <[^>]*> 2403012c li \$3,300 [0-9a-f]+ <[^>]*> 2063ffff addi \$3,\$3,-1 [0-9a-f]+ <[^>]*> 2084ffff addi \$4,\$4,-1 -[0-9a-f]+ <[^>]*> 1460fffd bnez \$3,[0-9a-f]+ <short_loop1> +[0-9a-f]+ <[^>]*> 1460fffd bnez \$3,[0-9a-f]+ <short_loop3> [0-9a-f]+ <[^>]*> 00000000 nop +[0-9a-f]+ <[^>]*> 2403012c li \$3,300 +[0-9a-f]+ <[^>]*> 2063ffff addi \$3,\$3,-1 +[0-9a-f]+ <[^>]*> 2084ffff addi \$4,\$4,-1 +[0-9a-f]+ <[^>]*> 20a5ffff addi \$5,\$5,-1 +[0-9a-f]+ <[^>]*> 20c6ffff addi \$6,\$6,-1 +[0-9a-f]+ <[^>]*> 20e7ffff addi \$7,\$7,-1 +[0-9a-f]+ <[^>]*> 1460fffa bnez \$3,[0-9a-f]+ <short_loop6> +[0-9a-f]+ <[^>]*> 00000000 nop +[0-9a-f]+ <[^>]*> 2403012c li \$3,300 +[0-9a-f]+ <[^>]*> 2063ffff addi \$3,\$3,-1 +[0-9a-f]+ <[^>]*> 2084ffff addi \$4,\$4,-1 +[0-9a-f]+ <[^>]*> 20a5ffff addi \$5,\$5,-1 +[0-9a-f]+ <[^>]*> 20c6ffff addi \$6,\$6,-1 +[0-9a-f]+ <[^>]*> 20e7ffff addi \$7,\$7,-1 +[0-9a-f]+ <[^>]*> 1460fffa bnez \$3,[0-9a-f]+ <short_loop7> +[0-9a-f]+ <[^>]*> 2108ffff addi \$8,\$8,-1 [0-9a-f]+ <[^>]*> 24040003 li \$4,3 \.\.\. diff --git a/gas/testsuite/gas/mips/r5900.s b/gas/testsuite/gas/mips/r5900.s index 3a16e28f28a..9d16b25ece6 100644 --- a/gas/testsuite/gas/mips/r5900.s +++ b/gas/testsuite/gas/mips/r5900.s @@ -120,13 +120,37 @@ stuff: .set pop .set push .set reorder - # Short loop fix. + # Test the short loop fix with 3 loop instructions. li $3, 300 -short_loop1: +short_loop3: addi $3, -1 addi $4, -1 - # NOP should be inserted in branch delay. - bne $3, $0, short_loop1 + # A NOP will be inserted in the branch delay slot. + bne $3, $0, short_loop3 + + # Test the short loop fix with 6 loop instructions. + li $3, 300 +short_loop6: + addi $3, -1 + addi $4, -1 + addi $5, -1 + addi $6, -1 + addi $7, -1 + # A NOP will be inserted in the branch delay slot. + bne $3, $0, short_loop6 + + # Test the short loop fix with 7 loop instructions. + li $3, 300 +short_loop7: + addi $3, -1 + addi $4, -1 + addi $5, -1 + addi $6, -1 + addi $7, -1 + addi $8, -1 + # The short loop fix does not apply for loops with + # more than 6 instructions. + bne $3, $0, short_loop7 li $4, 3 .set pop |