Re:How to check if any word is zero
by poorlyknit on Thursday October 20, 2022 @03:25PM
(#33279423)
In a similar vein you could turn
into
If we don't need short-circuit evaluation of b == 0 and c == 0 (which the article assumes), we can turn this into
which yields similar assembly (n + 1 instructions without branches):
Would make an interesting benchmark.
[ Parent
| on HN ]
!(a & b & c) is not equivalent to !(a && b && c) for int values of a b and c.
I think a = 1, b = 2 would mean !(a & b) = true implying one of them is zero?