News for hackers. Stuff that matters.
Re:How to check if any word is zero by dzaima on Thursday October 20, 2022 @05:19PM (#33280889)
The operation being done based on the result matters - returning 0 or 1 can be done branchlessly, so it's worth making the whole operation branchless. However, if the operation requires a branch one way or another, both gcc and clang do branches for some of the intermediate checks:

https://cpp.godbolt.org/z/7j4qj1aPY

There are no comments on this comment yet.