[libc] Add CMake script to check host cpu features
authorGuillaume Chatelet <gchatelet@google.com>
Thu, 20 Feb 2020 14:00:45 +0000 (15:00 +0100)
committerGuillaume Chatelet <gchatelet@google.com>
Thu, 27 Feb 2020 08:52:26 +0000 (09:52 +0100)
commit1aab055dd8ecd1ce8dcc0fe21da95e08b288b24e
tree3527777dca38bf1f0cd3260af6758a1dfbcf589e
parent2bb7774ddf002668816fdb7c4a5b8da322fe284e
[libc] Add CMake script to check host cpu features

Summary:
Tested on MacOSX and Linux.
For robustness we can go the OpenCV way and add individual c++ files with intrinsics.
https://github.com/opencv/opencv/blob/master/cmake/checks/cpu_avx2.cpp

Reviewers: sivachandra, abrachet

Subscribers: mgorny, MaskRay, tschuett, libc-commits

Tags: #libc-project

Differential Revision: https://reviews.llvm.org/D74897
libc/cmake/modules/LLVMLibCCheckCpuFeatures.cmake [new file with mode: 0644]
libc/cmake/modules/cpu_features/check_avx.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_sse.cpp [new file with mode: 0644]
libc/cmake/modules/cpu_features/check_sse2.cpp [new file with mode: 0644]