This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/19803] __builtin_expect doesnt modify branch prediction for power4 target


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]