vectorscan/cmake/cflags-loongarch64.cmake
Leslie Zhai 5ae6ca7275 Revert cmake_minimum_required and PCRE_REQUIRED_MINOR_VERSION change.
Move ARCH_C_FLAGS and ARCH_CXX_FLAGS to LoongArch respective cmake file.
Move vpmax_loongarch to loongarch64/simd_utils.h.
2023-12-14 09:38:03 +08:00

22 lines
548 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(ARCH_C_FLAGS "-mlsx")
set(ARCH_CXX_FLAGS "-mlsx")
set(CMAKE_REQUIRED_FLAGS "${ARCH_C_FLAGS}")
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 ()