Any way to do branch hints?

Jan Hubicka hubicka@ucw.cz
Thu May 27 13:43:00 GMT 2004


> Andrew Pinski <pinskia@physics.uc.edu> writes:
> 
> > Yes,
> >
> > __builtin_expect.
> 
> Intel P4 has a new branch hint prefix for conditional jumps, but afaik
> gcc doesn't generate it right now even with -march=pentium4 and
> __builtin_expect. I think that is what Kean asked about.

GCC should generate these on __builtin_expect and friends even on
-mcpu=pentium4, but we usually manage to redirect things in a way so the
prefixes are not needed.

Honza
> 
> Of course you get some part of this from the block reordering
> and the "if it jumps backwards it must be taken" heuristics,
> but telling the CPU explicitely may be a stronger hint.
> 
> -Andi



More information about the Gcc mailing list