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
This commit is contained in:
Jason Eckhardt 2001-11-09 22:00:08 +00:00 committed by Richard Henderson
parent 9db5bf7113
commit 53c12e8dfc
2 changed files with 35 additions and 32 deletions

View File

@ -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

View File

@ -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. */
rtx orig_target;
rtx target = gen_label_rtx ();
const char *const target
= ((mips_branch_likely || length == 16) ? ".+16" : ".+12");
char *c;
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