aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2011-02-28 16:26:46 +0000
committerMaciej W. Rozycki <macro@linux-mips.org>2011-02-28 16:26:46 +0000
commitd455268f737c65cc7c12aadaf93001d6bcbb20ba (patch)
treeb9920dd2da059d070088ff513185c89ec054d0e1
parent12c5a436a828ea809e4af3946a47c0f59cc77e92 (diff)
downloadgdb-d455268f737c65cc7c12aadaf93001d6bcbb20ba.zip
gdb-d455268f737c65cc7c12aadaf93001d6bcbb20ba.tar.gz
gdb-d455268f737c65cc7c12aadaf93001d6bcbb20ba.tar.bz2
gas/
* 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.
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-mips.c2
-rw-r--r--gas/testsuite/ChangeLog6
-rw-r--r--gas/testsuite/gas/mips/mips.exp2
-rw-r--r--gas/testsuite/gas/mips/relax-bposge.l5
-rw-r--r--gas/testsuite/gas/mips/relax-bposge.s12
6 files changed, 32 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 17ec424..29f3684 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,10 @@
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.
2011-02-28 Maciej W. Rozycki <macro@codesourcery.com>
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 1c3010b..4374ed9 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -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;
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 564e627..c3cb1e3 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,5 +1,11 @@
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
at.
* gas/mips/relax.s: Update to support the new test.
diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
index 67ee44c..3fc5b61 100644
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -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
index 0000000..ab3c846
--- /dev/null
+++ b/gas/testsuite/gas/mips/relax-bposge.l
@@ -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
index 0000000..028ae05
--- /dev/null
+++ b/gas/testsuite/gas/mips/relax-bposge.s
@@ -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: