5 ms·
I took that and check out what Clang does with 32-bit ints: https://godbolt.org/g/ORsX5h https://godbolt.org/g/ORsX5h vs. what it does with 64-bit ints: http
by jdcarter 10y ago
I took that and check out what Clang does with 32-bit ints:
https://godbolt.org/g/ORsX5h https://godbolt.org/g/ORsX5h
vs. what it does with 64-bit ints:
https://godbolt.org/g/2wBzn3 https://godbolt.org/g/2wBzn3
Can anybody explain the 32 bit version?
- user2994cb 10y agoHarder to vectorize 64-bit arithmetic?
- CorvusCrypto 10y agowas going to say this. It probably only does SSE and not SSE2. Therefore vectorization only happens for 32 bit ints.
- user2994cb 10y agoSeems to need -mavx2 to really go to town with 64 bit: https://godbolt.org/g/6EFYeY https://godbolt.org/g/6EFYeY
- jdcarter 10y agoThank you both, I appreciate the insight!
- CorvusCrypto 10y agoIt'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