mirror of
https://github.com/intel/llvm.git
synced 2026-02-04 11:38:04 +08:00
There are some basic vectorization features in standard architecture specifications. Such as SSE/SSE2 for x86-64, or NEON for aarch64. Even though such features are almost always available, we still need some methods to test fallback routines without any vectorization. Previous attempt in hsearch adds a DISABLE_SSE2_OPT flag that tries to compile the code with -mno-sse2 in order to test specific table scanning routines. However, it turns out that such flag may have some unwanted side effects hindering portability. This PR introduces PREFER_GENERIC as an alternative. When a target is built with PREFER_GENERIC, cmake will define a macro __LIBC_PREFER_GENERIC such that developers can selectively choose the fallback routine based on the macro.