gas/
authorMaciej W. Rozycki <macro@linux-mips.org>
Mon, 28 Feb 2011 16:26:46 +0000 (16:26 +0000)
committerMaciej W. Rozycki <macro@linux-mips.org>
Mon, 28 Feb 2011 16:26:46 +0000 (16:26 +0000)
* config/tc-mips.c (append_insn): Disable branch relaxation for
DSP instructions.

gas/testsuite/
* 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.

gas/ChangeLog
gas/config/tc-mips.c
gas/testsuite/ChangeLog
gas/testsuite/gas/mips/mips.exp
gas/testsuite/gas/mips/relax-bposge.l [new file with mode: 0644]
gas/testsuite/gas/mips/relax-bposge.s [new file with mode: 0644]

index 17ec424d1a36d9710381fb07665ff9f027a3972b..29f36845d09180013bc7996f14d3f8fb5ef9b407 100644 (file)
@@ -1,3 +1,8 @@
+2011-02-28  Maciej W. Rozycki  <macro@codesourcery.com>
+
+       * config/tc-mips.c (append_insn): Disable branch relaxation for
+       DSP instructions.
+
 2011-02-28  Maciej W. Rozycki  <macro@codesourcery.com>
 
        * config/tc-mips.c (macro): Handle M_PREF_AB.
index 1c3010b0a1066433c24e1b05faaf7920291cfd8d..4374ed92c99ddd1715bd000d6d9141c9eb667b84 100644 (file)
@@ -2933,6 +2933,8 @@ append_insn (struct mips_cl_insn *ip, expressionS *address_expr,
         out that the branch was out-of-range, we'll get an error.  */
       && !mips_opts.warn_about_macros
       && (mips_opts.at || mips_pic == NO_PIC)
+      /* Don't relax BPOSGE32/64 as they have no complementing branches.  */
+      && !(ip->insn_mo->membership & (INSN_DSP64 | INSN_DSP))
       && !mips_opts.mips16)
     {
       relaxed_branch = TRUE;
index 564e6279e6ca816da675357f4e0ae1fe52929b53..c3cb1e387e73e821cb0adfa7a420adacf7bc10c6 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2011-02-28  Maciej W. Rozycki  <macro@codesourcery.com>
 
        * gas/mips/relax-at.d: New test for branch relaxation with .set
index 67ee44c7e963b3e3c7c6e387c69a6c5dc5d54763..3fc5b61f808f56068d046af049655fa7c54e2aeb 100644 (file)
@@ -707,6 +707,8 @@ if { [istarget mips*-*-vxworks*] } {
     run_dump_test "relax-swap1-mips1"
     run_dump_test "relax-swap1-mips2"
     run_dump_test "relax-swap2"
+    run_list_test_arches "relax-bposge" "-mdsp -relax-branch" \
+                                       [mips_arch_list_matching mips64r2]
 
     run_list_test "illegal" "-32"
     run_list_test "baddata1" "-32"
diff --git a/gas/testsuite/gas/mips/relax-bposge.l b/gas/testsuite/gas/mips/relax-bposge.l
new file mode 100644 (file)
index 0000000..ab3c846
--- /dev/null
@@ -0,0 +1,5 @@
+.*: Assembler messages:
+.*:6: Warning: Relaxed out-of-range branch into a jump
+.*:9: Warning: Relaxed out-of-range branch into a jump
+.*:7: Error: Branch out of range
+.*:8: Error: Branch out of range
diff --git a/gas/testsuite/gas/mips/relax-bposge.s b/gas/testsuite/gas/mips/relax-bposge.s
new file mode 100644 (file)
index 0000000..028ae05
--- /dev/null
@@ -0,0 +1,12 @@
+# Source file to test branch relaxation with the BPOSGE32 and BPOSGE64
+# instructions.
+
+       .text
+foo:
+       b       bar
+       bposge32 bar
+       bposge64 bar
+       bal     bar
+
+       .space  0x20000
+bar: