Open
Description
-march=x86-64-v3
is very fashionable now, and GAS and IAS support -Wa,-msse2avx
to convert old-style SSE to VEX prefix variants to avoid AVX-SSE transition penalties, but this approach has some limitations:
- If the assembly code is built with NASM instead of gcc/clang, there is no sse2avx support
- If the assembly code is hand-coded using .byte, sse2avx does not work, see openssl should prefer standard aesni instructions over .byte openssl/openssl#27054
- Some runtime libraries may be built without
-Wa,-msse2avx
, but then used to build x86-64-v3 programs
The result is that old-style SSE code is still present in typical x86-64-v3 builds, leading to potential penalties, so I propose to implement link-time SSE2AVX in LLD for generality and reliability.