[libc][NFC] Detect host CPU features using try_compile instead of try_run.
authorGuillaume Chatelet <gchatelet@google.com>
Thu, 19 Jan 2023 14:02:51 +0000 (14:02 +0000)
committerGuillaume Chatelet <gchatelet@google.com>
Mon, 23 Jan 2023 09:05:53 +0000 (09:05 +0000)
commit9acc2f37bdfce08ca0c2faec03392db10d1bb7a9
tree5aa341966adc38f9fdb9ff41e703e9156201e4d5
parent262dad4a8133c2befd6dae4cef5cee5b602f85cb
[libc][NFC] Detect host CPU features using try_compile instead of try_run.

This implements the same behavior as D141997 but makes sure that the same detection mechanism is used between CMake and source code.

Differential Revision: https://reviews.llvm.org/D142108
24 files changed:
libc/cmake/modules/LLVMLibCCheckCpuFeatures.cmake
libc/cmake/modules/cpu_features/check_AVX2.cpp [new file with mode: 0644]
libc/cmake/modules/cpu_features/check_AVX512BW.cpp [new file with mode: 0644]
libc/cmake/modules/cpu_features/check_AVX512F.cpp [new file with mode: 0644]
libc/cmake/modules/cpu_features/check_FMA.cpp [new file with mode: 0644]
libc/cmake/modules/cpu_features/check_SSE2.cpp [new file with mode: 0644]
libc/cmake/modules/cpu_features/check_SSE4_2.cpp [new file with mode: 0644]
libc/cmake/modules/cpu_features/check_cpu_features.cpp.in [deleted file]
libc/src/__support/CMakeLists.txt
libc/src/__support/FPUtil/FMA.h
libc/src/__support/FPUtil/aarch64/FMA.h
libc/src/__support/FPUtil/multiply_add.h
libc/src/__support/FPUtil/x86_64/FMA.h
libc/src/__support/architectures.h
libc/src/__support/cpu_features.h [new file with mode: 0644]
libc/src/math/generic/asinf.cpp
libc/src/math/generic/cosf.cpp
libc/src/math/generic/expm1f.cpp
libc/src/math/generic/sincosf.cpp
libc/src/math/generic/sincosf_utils.h
libc/src/math/generic/sinf.cpp
libc/src/math/generic/tanf.cpp
libc/src/math/generic/tanhf.cpp
utils/bazel/llvm-project-overlay/libc/BUILD.bazel