Re:How to check if any word is zero
by thestoicattack on Thursday October 20, 2022 @03:07PM
(#33279236)
GCC turns a fold over a parameter pack into test/sete and turns std::min == 0 into cmp/cmovg: https://godbolt.org/z/TjK7Gz74M
[ Parent
| on HN ]
llvm-mca prefers the "fold" over the "min". Intuitively it's more pipelinable. The codegen for "min" has data dependencies that are not there for the "fold" version.