4 ms·
Have you considered arr[max(i, arr.len)] instead of AND?
by br1 9y ago
Have you considered arr[max(i, arr.len)] instead of AND?
- tetromino_ 9y agoMax() is not a CPU instruction. It's an abstraction, a function that could be implemented either using a branch (which defeats the whole purpose) or, on some architectures, with something like cmovXX. Perhaps they wanted a solution that works on Arm, which I think doesn't have cmovXX. Or maybe Intel does speculation with cmovXX used on array index.