4 ms·
Presumably cmp.Or is short enough that it will usually be inlined by the compiler, at which point any side-effect-free calculations can be short circuited. I do
by HALtheWise 2y ago
Presumably cmp.Or is short enough that it will usually be inlined by the compiler, at which point any side-effect-free calculations can be short circuited. I don't know in what circumstances cgo actually will perform both of those optimizations.
- earthboundkid 2y agoHere is the Godbolt. My assembly is weak, but AFAICT, it does not shortcircuit. https://godbolt.org/z/4z4Tr9Gjv https://godbolt.org/z/4z4Tr9Gjv