4 ms·
What are you talking about? Intrinsics don't force the compiler to use a specific instruction. It's not even a 1:1 mapping. I think all compilers will fuse sep
by mkbosmans 7y ago
What are you talking about?
Intrinsics don't force the compiler to use a specific instruction. It's not even a 1:1 mapping.
I think all compilers will fuse separate add and mul instrinsics to fmadd.
Both GCC and Clang will convert the _mm256_div_ps to a vmulps.
GCC calculates the scaling factor by combining vsqrtps and vrcpps.
Clang will emit a vrsqrtps instruction, but as that has only 12 bits of guaranteed accuracy, it fixes the result up before using it to scale x, y and z.
https://godbolt.org/z/rG2rH8 https://godbolt.org/z/rG2rH8