I perceive this may be realy too much to ask, but...

Would it be possible to put Intel P4 branch hints in the if statement (hint branch likely taken, not likely taken).

eg. if (eac=num) then_nl {statements} endif;

Of course, compile this:

cmp (eax, num);
(hint likely taken) jne xxx; // that is eax not likely=num
{statements};
xxx:

You see, on the Pentum 4, the branch to xxx is assumed not to be taken, so if it should be taken, there should be a way to hint this (and save quite a couple of clock cycles from misprediction).

Thanks.
Posted on 2003-10-12 22:51:31 by V Coder

I perceive this may be realy too much to ask, but...

Would it be possible to put Intel P4 branch hints in the if statement (hint branch likely taken, not likely taken).

eg. if (eac=num) then_nl {statements} endif;

Of course, compile this:

cmp (eax, num);
(hint likely taken) jne xxx; // that is eax not likely=num
{statements};
xxx:

You see, on the Pentum 4, the branch to xxx is assumed not to be taken, so if it should be taken, there should be a way to hint this (and save quite a couple of clock cycles from misprediction).

Thanks.


This doesn't seem like it would be that hard to do with macros in HLA.
What is the exact output you'd like to produce for these hints?
Cheers,
Randy Hyde
Posted on 2003-10-13 10:50:21 by rhyde