aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/pa/pa.c
diff options
context:
space:
mode:
authorJeff Law <law@gcc.gnu.org>1994-11-15 10:12:02 -0700
committerJeff Law <law@gcc.gnu.org>1994-11-15 10:12:02 -0700
commit923f781d832a9ac82e0013d035a7b7afb108f6ff (patch)
tree336ae188b1c9db092db528aad6a8349da39af8c6 /gcc/config/pa/pa.c
parent8329b5ec7ebc12f94f03a60ecb2e026bb2ebe9bf (diff)
downloadgcc-923f781d832a9ac82e0013d035a7b7afb108f6ff.zip
gcc-923f781d832a9ac82e0013d035a7b7afb108f6ff.tar.gz
gcc-923f781d832a9ac82e0013d035a7b7afb108f6ff.tar.bz2
pa.c (output_cbranch): Improve code for short backwards branch with an unfilled delay slot.
* pa.c (output_cbranch): Improve code for short backwards branch with an unfilled delay slot. (output_bb, output_dbra, output_movb): Likewise. From-SVN: r8441
Diffstat (limited to 'gcc/config/pa/pa.c')
-rw-r--r--gcc/config/pa/pa.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index a458203..d70dad6 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -3444,6 +3444,21 @@ output_cbranch (operands, nullify, length, negated, insn)
strcat (buf, "%B3");
strcat (buf, ",n %2,%1,.+12\n\tbl %0,0");
}
+ /* Handle short backwards branch with an unfilled delay slot.
+ Using a comb;nop rather than comiclr;bl saves 1 cycle for both
+ taken and untaken branches. */
+ else if (dbr_sequence_length () == 0
+ && ! forward_branch_p (insn)
+ && insn_addresses
+ && VAL_14_BITS_P (insn_addresses[INSN_UID (JUMP_LABEL (insn))]
+ - insn_addresses[INSN_UID (insn)]))
+ {
+ strcpy (buf, "com%I2b,");
+ if (negated)
+ strcat (buf, "%B3 %2,%1,%0%#");
+ else
+ strcat (buf, "%S3 %2,%1,%0%#");
+ }
else
{
strcpy (buf, "com%I2clr,");
@@ -3556,6 +3571,26 @@ output_bb (operands, nullify, length, negated, insn, which)
else
strcat (buf, " %0,%1,.+12\n\tbl %2,0");
}
+ /* Handle short backwards branch with an unfilled delay slot.
+ Using a bb;nop rather than extrs;bl saves 1 cycle for both
+ taken and untaken branches. */
+ else if (dbr_sequence_length () == 0
+ && ! forward_branch_p (insn)
+ && insn_addresses
+ && VAL_14_BITS_P (insn_addresses[INSN_UID (JUMP_LABEL (insn))]
+ - insn_addresses[INSN_UID (insn)]))
+ {
+ strcpy (buf, "bb,");
+ if ((which == 0 && negated)
+ || (which == 1 && ! negated))
+ strcat (buf, ">=");
+ else
+ strcat (buf, "<");
+ if (negated)
+ strcat (buf, " %0,%1,%3%#");
+ else
+ strcat (buf, " %0,%1,%2%#");
+ }
else
{
strcpy (buf, "extrs,");
@@ -3641,6 +3676,15 @@ output_dbra (operands, insn, which_alternative)
&& ! forward_branch_p (insn)
&& nullify)
return "addib,%N2,n %1,%0,.+12\n\tbl %3,0";
+ /* Handle short backwards branch with an unfilled delay slot.
+ Using a addb;nop rather than addi;bl saves 1 cycle for both
+ taken and untaken branches. */
+ else if (dbr_sequence_length () == 0
+ && ! forward_branch_p (insn)
+ && insn_addresses
+ && VAL_14_BITS_P (insn_addresses[INSN_UID (JUMP_LABEL (insn))]
+ - insn_addresses[INSN_UID (insn)]))
+ return "addib,%C2 %1,%0,%3%#";
/* Handle normal cases. */
if (nullify)
@@ -3738,6 +3782,15 @@ output_movb (operands, insn, which_alternative, reverse_comparison)
&& nullify)
return "movb,%N2,n %1,%0,.+12\n\ttbl %3,0";
+ /* Handle short backwards branch with an unfilled delay slot.
+ Using a movb;nop rather than or;bl saves 1 cycle for both
+ taken and untaken branches. */
+ else if (dbr_sequence_length () == 0
+ && ! forward_branch_p (insn)
+ && insn_addresses
+ && VAL_14_BITS_P (insn_addresses[INSN_UID (JUMP_LABEL (insn))]
+ - insn_addresses[INSN_UID (insn)]))
+ return "movb,%C2 %1,%0,%3%#";
/* Handle normal cases. */
if (nullify)
return "or,%N2 %1,%%r0,%0\n\tbl,n %3,0";