3 ms·
Clang knows what’s up: https://godbolt.org/z/7zKffz https://godbolt.org/z/7zKffz. GCC is adding the numbers four at a time by stuffing 0, 1, 2, 3 in an XMM regi
by saagarjha 6y ago
Clang knows what’s up: https://godbolt.org/z/7zKffz https://godbolt.org/z/7zKffz. GCC is adding the numbers four at a time by stuffing 0, 1, 2, 3 in an XMM register, taking a packed addition within the register, and then doing a pairwise packed addition of the register with 4, 4, 4, 4 to get the next four numbers.