Hacker News new | ask | show | jobs
by jdcarter 3477 days ago
I took that and check out what Clang does with 32-bit ints:

https://godbolt.org/g/ORsX5h

vs. what it does with 64-bit ints:

https://godbolt.org/g/2wBzn3

Can anybody explain the 32 bit version?

2 comments

It's just vectorizing calculations so that it's faster than pure iterative calculation. 64 bit version doesn't get this probably because that optimizer isn't SSE2 aware yet (just a guess I actually don't know) and can't do SIMD arithmetic with 2 64 bit floats
Harder to vectorize 64-bit arithmetic?
was going to say this. It probably only does SSE and not SSE2. Therefore vectorization only happens for 32 bit ints.
Seems to need -mavx2 to really go to town with 64 bit: https://godbolt.org/g/6EFYeY
Thank you both, I appreciate the insight!