By: Wilco (Wilco.Dijkstra.delete@this.ntlworld.com), February 17, 2013 12:07 pm
Room: Moderated Discussions
⚛ (0xe2.0x9a.0x9b.delete@this.gmail.com) on February 17, 2013 10:49 am wrote:
> Linus Torvalds (torvalds.delete@this.linux-foundation.org) on February 14, 2013 4:44 pm wrote:
> > In contrast, multiple CC registers are just stupid.
>
> Isn't it true that the following code could run faster with 2 CC registers:
>
>
No, it's not only not faster, but you don't need 2 CC registers either if you want to expand that with a single branch:
You never need multiple condition code registers if you want to combine several comparisons. So adding multiple condition codes and special instructions to combine them is just wasteful.
Wilco
> Linus Torvalds (torvalds.delete@this.linux-foundation.org) on February 14, 2013 4:44 pm wrote:
> > In contrast, multiple CC registers are just stupid.
>
> Isn't it true that the following code could run faster with 2 CC registers:
>
>
if a==b && c==d { ... }
No, it's not only not faster, but you don't need 2 CC registers either if you want to expand that with a single branch:
if ((a ^ b) | (c ^ d)) == 0) { ... }
You never need multiple condition code registers if you want to combine several comparisons. So adding multiple condition codes and special instructions to combine them is just wasteful.
Wilco