by gopalv · 9y ago · 0 comments
I'm actually curious to see what the output assembly of LLVM is for that loop, because JDK8 does not optimize a branch in a loop.
But the JVM does do a pretty decent job using ymm<n> registers if you write the loops without branches.
But you end up with really obscure java code like
"(((a - b) ^ (b - a)) >>> 63) ^ 1"
To convert a branch into an integer.
Enjoy!