4 ms·
> Keep in mind that this doesn't use the fact that we know that the input is between 0 to 63. You can use __builtin_assume for this: https://godbolt.org/z/K4jK
by workaccount1 4y ago
> Keep in mind that this doesn't use the fact that we know that the input is between 0 to 63.
You can use __builtin_assume for this: https://godbolt.org/z/K4jKhxnTq https://godbolt.org/z/K4jKhxnTq
- pantalaimon 4y agoAn assert() also does the trick: https://godbolt.org/z/MecvMGPdW https://godbolt.org/z/MecvMGPdW edit uh but when asserts are disabled it won't work: https://godbolt.org/z/4TMs1Wc5z https://godbolt.org/z/4TMs1Wc5z unless you roll your own assert: https://godbolt.org/z/4v35rrTvn https://godbolt.org/z/4v35rrTvn
- RenThraysk 4y ago9*x/64 still reduces to 2 instructions https://godbolt.org/z/6WsWqh4ah https://godbolt.org/z/6WsWqh4ah