Commit f4857b9b by Alan Modra Committed by Alan Modra

* config/rs6000/rs6000.c (output_cbranch): Hint differently for power4.

From-SVN: r55967
parent 77ca7b2e
2002-08-02 Alan Modra <amodra@bigpond.net.au>
* config/rs6000/rs6000.c (output_cbranch): Hint differently for power4.
2002-08-01 Daniel Jacobowitz <drow@mvista.com> 2002-08-01 Daniel Jacobowitz <drow@mvista.com>
* Makefile.in ($(BUILD_PREFIX_1)ggc-none.o): Use $(GGC_H). * Makefile.in ($(BUILD_PREFIX_1)ggc-none.o): Use $(GGC_H).
......
...@@ -8438,21 +8438,30 @@ output_cbranch (op, label, reversed, insn) ...@@ -8438,21 +8438,30 @@ output_cbranch (op, label, reversed, insn)
/* Maybe we have a guess as to how likely the branch is. /* Maybe we have a guess as to how likely the branch is.
The old mnemonics don't have a way to specify this information. */ The old mnemonics don't have a way to specify this information. */
pred = "";
note = find_reg_note (insn, REG_BR_PROB, NULL_RTX); note = find_reg_note (insn, REG_BR_PROB, NULL_RTX);
if (note != NULL_RTX) if (note != NULL_RTX)
{ {
/* PROB is the difference from 50%. */ /* PROB is the difference from 50%. */
int prob = INTVAL (XEXP (note, 0)) - REG_BR_PROB_BASE / 2; int prob = INTVAL (XEXP (note, 0)) - REG_BR_PROB_BASE / 2;
bool always_hint = rs6000_cpu != PROCESSOR_POWER4;
/* For branches that are very close to 50%, assume not-taken. */
if (abs (prob) > REG_BR_PROB_BASE / 20 /* Only hint for highly probable/improbable branches on newer
&& ((prob > 0) ^ need_longbranch)) cpus as static prediction overrides processor dynamic
pred = "+"; prediction. For older cpus we may as well always hint, but
else assume not taken for branches that are very close to 50% as a
pred = "-"; mispredicted taken branch is more expensive than a
mispredicted not-taken branch. */
if (always_hint
|| abs (prob) > REG_BR_PROB_BASE / 100 * 48)
{
if (abs (prob) > REG_BR_PROB_BASE / 20
&& ((prob > 0) ^ need_longbranch))
pred = "+";
else
pred = "-";
}
} }
else
pred = "";
if (label == NULL) if (label == NULL)
s += sprintf (s, "{b%sr|b%slr%s} ", ccode, ccode, pred); s += sprintf (s, "{b%sr|b%slr%s} ", ccode, ccode, pred);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment