Feature request: CMake module to detect Compiler + OS support of Streaming SIMD Extensions (SSE)
With CMake version
3.10, the cmake_host_system_information acquired the capability of detecting SSE support up to version 2 (plus some extensions).
It would be nice to support more recent SSE versions and also provide a way to get the associated compiler flags (e.g. clang flags, MSVC flags) (that in turn they also define some macros).
Looking around over internet, I could not find anything ready and most of all scalable to be imported or used (plug-and-play CMake module). Further, even if a CPU may support a specific feature (e.g. SSE4.1), the host OS and the compiler may not support it. As a consequence, the (apparently) best way to test a CPU/OS/compiler feature is by compiling small examples through CMake and set proper variables.
As a use case, quite some scientific libraries are supporting SSE extension and they set compiler flags either using their own CMake module (e.g. OpenCV, PCL) or expecting users to provide them (e.g. Eigen3).
I think there is room to provide a standardized way to check SSE extensions and set flags via CMake to also ease the exploitation of such instructions inside projects and in a (possibly) parotable way. What it is your opinion and view about this?