aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Eckhardt <jle@rice.edu>2001-11-09 22:00:08 +0000
committerRichard Henderson <rth@gcc.gnu.org>2001-11-09 14:00:08 -0800
commit53c12e8dfc994f0fabccfb8c94cb35f1b59b7f2f (patch)
treed07feee8fe84917b35c1d2eb47940dc52339d7f5 /gcc
parent9db5bf711354f3a947027abedb151f77b54a4bce (diff)
downloadgcc-53c12e8dfc994f0fabccfb8c94cb35f1b59b7f2f.zip
gcc-53c12e8dfc994f0fabccfb8c94cb35f1b59b7f2f.tar.gz
gcc-53c12e8dfc994f0fabccfb8c94cb35f1b59b7f2f.tar.bz2
mips.c (mips_output_conditional_branch): Do not hard code the branch target as ".+16/.+12", but rather use labels.
* config/mips/mips.c (mips_output_conditional_branch): Do not hard code the branch target as ".+16/.+12", but rather use labels. From-SVN: r46893
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/mips/mips.c62
2 files changed, 35 insertions, 32 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 54c7a97..0066156 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2001-11-08 Jason Eckhardt <jle@rice.edu>
+
+ * config/mips/mips.c (mips_output_conditional_branch): Do not hard
+ code the branch target as ".+16/.+12", but rather use labels.
+
Fri Nov 9 11:27:42 2001 Jeffrey A Law (law@cygnus.com)
* config/pa/milli64.S: Use %r25 and %r0 instead of arg1 and r0
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 23491ca..cab2aa1 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -9676,46 +9676,44 @@ mips_output_conditional_branch (insn,
.set reorder
l:
- Because we have to jump four bytes *past* the following
- instruction if this branch was annulled, we can't just use
- a label, as in the picture above; there's no way to put the
- label after the next instruction, as the assembler does not
- accept `.L+4' as the target of a branch. (We can't just
- wait until the next instruction is output; it might be a
- macro and take up more than four bytes. Once again, we see
- why we want to eliminate macros.)
-
- If the branch is annulled, we jump four more bytes that we
- would otherwise; that way we skip the annulled instruction
- in the delay slot. */
+ */
- const char *const target
- = ((mips_branch_likely || length == 16) ? ".+16" : ".+12");
- char *c;
+ rtx orig_target;
+ rtx target = gen_label_rtx ();
- strcpy (buffer, "%(%<");
- c = strchr (buffer, '\0');
- /* Generate the reversed comparision. This takes four
+ output_asm_insn ("%(%<", 0);
+ orig_target = operands[1];
+ operands[1] = target;
+ /* Generate the reversed comparison. This takes four
bytes. */
if (float_p)
- sprintf (c, "%%*b%s\t%%Z2%s",
- inverted_p ? comp : inverted_comp,
- target);
+ sprintf (buffer, "%%*b%s\t%%Z2%%1",
+ inverted_p ? comp : inverted_comp);
else
- sprintf (c, "%%*b%s%s\t%s%s,%s",
+ sprintf (buffer, "%%*b%s%s\t%s%s,%%1",
inverted_p ? comp : inverted_comp,
need_z_p ? "z" : "",
op1,
- op2,
- target);
- strcat (c, "\n\tnop\n\tj\t%1");
- if (length == 16)
- /* The delay slot was unfilled. Since we're inside
- .noreorder, the assembler will not fill in the NOP for
- us, so we must do it ourselves. */
- strcat (buffer, "\n\tnop");
- strcat (buffer, "%>%)");
- return buffer;
+ op2);
+ output_asm_insn (buffer, operands);
+ operands[1] = orig_target;
+
+ output_asm_insn ("nop\n\tj\t%1", operands);
+
+ if (length == 16)
+ output_asm_insn ("nop", 0);
+ else
+ {
+ /* Output delay slot instruction. */
+ rtx insn = final_sequence;
+ final_scan_insn (XVECEXP (insn, 0, 1), asm_out_file,
+ optimize, 0, 1);
+ INSN_DELETED_P (XVECEXP (insn, 0, 1)) = 1;
+ }
+ output_asm_insn ("%>%)", 0);
+ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
+ CODE_LABEL_NUMBER (target));
+ return "";
}
/* We do not currently use this code. It handles jumps to