Open
Description
Clang seems to accept (with a warning) -msse4
for any target, not just x86.
No problem, as expected:
clang-18 --target=amd64 -msse2 -c -xc /dev/null
clang-18 --target=amd64 -msse3 -c -xc /dev/null
clang-18 --target=amd64 -msse4 -c -xc /dev/null
clang-18 --target=amd64 -msse4.2 -c -xc /dev/null
Error, as expected:
$ clang-18 --target=arm64 -msse2 -c -xc /dev/null
clang-18: error: unsupported option '-msse2' for target 'arm64'
$ clang-18 --target=arm64 -msse3 -c -xc /dev/null
clang-18: error: unsupported option '-msse3' for target 'arm64'
Warning, this is unexpected behaviour:
$ clang-18 --target=arm64 -msse4 -c -xc /dev/null
clang-18: warning: argument unused during compilation: '-msse4' [-Wunused-command-line-argument]
$ clang-18 --target=arm64 -msse4.2 -c -xc /dev/null
clang-18: warning: argument unused during compilation: '-msse4.2' [-Wunused-command-line-argument]
This breaks feature detection in some cmake files which do not see a failure from clang, meaning sse4.2 appears to be available for the compilation target.
(unexpected behaviour exists for arm64 and riscv64 at least; I haven't tested others)