By: Andi Kleen (x.delete@this.y.z), March 3, 2013 7:15 pm
Room: Moderated Discussions
> (negatve: -3, zero: -2, carry: -1, positive: 0)
>
> Ok, I made that one up so maybe it's broken, but people used tricks like that if you know your
> set of values is limited to some particular ones. Overflow can be useful too (eg -12[7-8]).
Yes no doubt there is more. I considered running a super optimizer to find all the best combinations, but never got to that.
But I think parity is an useful addition to get even more. It's a useful tool.
>
> Of course, with modern microarchitectures that combine compare and branch into
> one uop, the upside is more questionable (possibly smaller I$ footprint?).
>
> Also, one thing to look out for with multiple conditional branches is that sometimes the branch prediction
I covered that in the writeup. Yes there are various limits with branch prediction.
On Sandy Bridge the decoded icache is one limiter, as it can only handle a limited number of branches per line. But even falling out of it is not too bad.
You probably do not want to go above 4 branches without additional padding.
-Andi
Speaking for myself only
>
> Ok, I made that one up so maybe it's broken, but people used tricks like that if you know your
> set of values is limited to some particular ones. Overflow can be useful too (eg -12[7-8]).
Yes no doubt there is more. I considered running a super optimizer to find all the best combinations, but never got to that.
But I think parity is an useful addition to get even more. It's a useful tool.
>
> Of course, with modern microarchitectures that combine compare and branch into
> one uop, the upside is more questionable (possibly smaller I$ footprint?).
>
> Also, one thing to look out for with multiple conditional branches is that sometimes the branch prediction
I covered that in the writeup. Yes there are various limits with branch prediction.
On Sandy Bridge the decoded icache is one limiter, as it can only handle a limited number of branches per line. But even falling out of it is not too bad.
You probably do not want to go above 4 branches without additional padding.
-Andi
Speaking for myself only