mirror of
https://github.com/intel/llvm.git
synced 2026-01-16 05:32:28 +08:00
Clang translates most implementations of has_single_bit to `(v ^ (v-1)) > v-1` - except the one definition libc++ actually uses. Proof of correctness: https://godbolt.org/z/d61bxW4r1 (Could also be fixed by teaching Clang to optimize better, but making source match output feels clearer to me. And it improves unoptimized performance.)