diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ea2d5150..af9e961a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -325,6 +325,10 @@ IF(NOT MSVC) IF(HAVE_MSSE2_SWITCH) SET(SSE2_SWITCH "-msse2") ENDIF() + CHECK_C_COMPILER_FLAG(-msse3 HAVE_MSSE3_SWITCH) + IF(HAVE_MSSE3_SWITCH) + SET(SSE3_SWITCH "-msse3") + ENDIF() CHECK_C_COMPILER_FLAG(-msse4.1 HAVE_MSSE4_1_SWITCH) IF(HAVE_MSSE4_1_SWITCH) SET(SSE4_1_SWITCH "-msse4.1") @@ -592,6 +596,7 @@ SET(ALC_OBJS Alc/ALc.c SET(CPU_EXTS "Default") SET(HAVE_SSE 0) SET(HAVE_SSE2 0) +SET(HAVE_SSE3 0) SET(HAVE_SSE4_1 0) SET(HAVE_NEON 0) @@ -652,6 +657,26 @@ IF(ALSOFT_REQUIRE_SSE2 AND NOT HAVE_SSE2) MESSAGE(FATAL_ERROR "Failed to enable required SSE2 CPU extensions") ENDIF() +OPTION(ALSOFT_REQUIRE_SSE2 "Require SSE3 support" OFF) +CHECK_INCLUDE_FILE(pmmintrin.h HAVE_PMMINTRIN_H "${SSE3_SWITCH}") +IF(HAVE_EMMINTRIN_H) + OPTION(ALSOFT_CPUEXT_SSE3 "Enable SSE3 support" ON) + IF(HAVE_SSE2 AND ALSOFT_CPUEXT_SSE3) + IF(ALIGN_DECL OR HAVE_C11_ALIGNAS) + SET(HAVE_SSE3 1) + SET(ALC_OBJS ${ALC_OBJS} Alc/mixer_sse3.c) + IF(SSE2_SWITCH) + SET_SOURCE_FILES_PROPERTIES(Alc/mixer_sse3.c PROPERTIES + COMPILE_FLAGS "${SSE3_SWITCH}") + ENDIF() + SET(CPU_EXTS "${CPU_EXTS}, SSE3") + ENDIF() + ENDIF() +ENDIF() +IF(ALSOFT_REQUIRE_SSE3 AND NOT HAVE_SSE3) + MESSAGE(FATAL_ERROR "Failed to enable required SSE3 CPU extensions") +ENDIF() + OPTION(ALSOFT_REQUIRE_SSE4_1 "Require SSE4.1 support" OFF) CHECK_INCLUDE_FILE(smmintrin.h HAVE_SMMINTRIN_H "${SSE4_1_SWITCH}") IF(HAVE_SMMINTRIN_H) |