This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/19803] __builtin_expect doesnt modify branch prediction for power4 target
- From: "amodra at bigpond dot net dot au" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Feb 2005 03:28:19 -0000
- Subject: [Bug tree-optimization/19803] __builtin_expect doesnt modify branch prediction for power4 target
- References: <20050207032408.19803.anton@samba.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From amodra at bigpond dot net dot au 2005-02-07 03:28 -------
builtin_expect uses PROB_VERY_LIKELY.
>From predict.c
#define PROB_VERY_UNLIKELY (REG_BR_PROB_BASE / 10 - 1)
#define PROB_EVEN (REG_BR_PROB_BASE / 2)
#define PROB_VERY_LIKELY (REG_BR_PROB_BASE - PROB_VERY_UNLIKELY)
#define PROB_ALWAYS (REG_BR_PROB_BASE)
In other words, builtin_expect is using 10% / 90%
But powerpc64 only emits branch prediction hints when at 2% / 98%. See
rs6000.c:output_cbranch
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-02-07 03:28:18
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19803