[Solved] Comparing 2 different scenarios on 2 different architectures when finding the max element of an array
I think you’re really trying to ask about branchless vs. branching ways to do m = max(m, array[i]). C compilers will already compile the if() version to branchless code (using cmov) depending on optimization settings. It can even auto-vectorize to a packed compare or packed-max function. Your 0.5 * abs() version is obviously terrible (a … Read more