Any way to do branch hints?
Andi Kleen
ak@muc.de
Tue May 25 16:56: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.
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