Re:The Aggregate Magic Algorithms (2015)
by usefulcat on Tuesday June 20, 2017 @10:00AM
(#14594664)
In some cases I suspect it depends a lot on the hardware. I did a bit of research into the "Integer minimum" algorithm. Given the following straightforward implementation:
..most compilers will produce something very much like the following for x86-64 (from Compiler Explorer https://gcc.godbolt.org using -Ofast -march=haswell):
Compare that to the generated instructions for the algorithm listed in the "Integer minimum or maximum" section (x+(((y-x)>>(WORDBITS-1))&(y-x))):
It's not immediately obvious to me which one is likely to be faster (I'm not an expert on x86-64 assembly).
[ Parent
| on HN ]
There are no comments on this comment yet.