vectorscan/cmake/cflags-loongarch64.cmake
Leslie Zhai 6255055df5 Initial loongarch port
Co-authored-by: yangwenqing <yangwenqing@loongson.cn>

Signed-off-by: Leslie Zhai <zhaixiang@loongson.cn>
Signed-off-by: yangwenqing <yangwenqing@loongson.cn>
2023-12-12 12:48:59 +08:00

20 lines
484 B
CMake

CHECK_INCLUDE_FILE_CXX(lsxintrin.h HAVE_C_LOONGARCH64_LSXINTRIN_H)
if (HAVE_C_LOONGARCH64_LSXINTRIN_H)
set (INTRIN_INC_H "lsxintrin.h")
else()
message (FATAL_ERROR "No intrinsics header found for LSX")
endif ()
set(CMAKE_REQUIRED_FLAGS "-mlsx")
CHECK_C_SOURCE_COMPILES("#include <${INTRIN_INC_H}>
int main() {
__m128i a = __lsx_vreplgr2vr_w(1);
(void)a;
}" HAVE_LSX)
if (NOT HAVE_LSX)
message(FATAL_ERROR "LSX support required for LoongArch support")
endif ()