[libc] Add more robust compile time architecture detection
authorGuillaume Chatelet <gchatelet@google.com>
Fri, 29 Oct 2021 20:13:57 +0000 (20:13 +0000)
committerGuillaume Chatelet <gchatelet@google.com>
Fri, 29 Oct 2021 20:15:12 +0000 (20:15 +0000)
commita72e2499865b55cb007b63673100c06cc85faf97
tree3fc50257f8823f32215549622899b12703c35fcd
parent39e5dd113f5c00de21f8071142fccbb5e08025e7
[libc] Add more robust compile time architecture detection

We may want to restrict the detected platforms to only `x86_64` and `aarch64`.
There are still custom detection in api.td but I don't think we can handle these:
 - config/linux/api.td:205
 - config/linux/api.td:199

Differential Revision: https://reviews.llvm.org/D112818
15 files changed:
libc/src/__support/CMakeLists.txt
libc/src/__support/FPUtil/FEnvUtils.h
libc/src/__support/FPUtil/FMA.h
libc/src/__support/FPUtil/PlatformDefs.h
libc/src/__support/FPUtil/PolyEval.h
libc/src/__support/architectures.h [new file with mode: 0644]
libc/src/string/memcmp.cpp
libc/src/string/memory_utils/elements_aarch64.h
libc/src/string/memory_utils/elements_x86.h
libc/src/string/memory_utils/memset_utils.h
libc/src/string/memory_utils/utils.h
libc/test/src/fenv/enabled_exceptions_test.cpp
libc/test/src/fenv/feenableexcept_test.cpp
libc/test/src/fenv/feholdexcept_test.cpp
libc/utils/MPFRWrapper/MPFRUtils.cpp