aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorTasos Sahanidis <[email protected]>2021-04-30 12:04:32 +0300
committerTasos Sahanidis <[email protected]>2021-04-30 13:29:39 +0300
commitb40272d256442a02c1843a69114f470513062246 (patch)
tree9fb555fafdd173807888c40a974797334d43912d /CMakeLists.txt
parentae4eacf147e2c2340cc4e02a790df04c793ed0a9 (diff)
Allow enabling SSE without SSE2
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt25
1 files changed, 17 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0cf0613d..53b325db 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -369,20 +369,25 @@ set(HAVE_SSE3 0)
set(HAVE_SSE4_1 0)
set(HAVE_NEON 0)
-# Check for SSE+SSE2 support
+# Check for SSE support
option(ALSOFT_REQUIRE_SSE "Require SSE support" OFF)
-option(ALSOFT_REQUIRE_SSE2 "Require SSE2 support" OFF)
-if(HAVE_XMMINTRIN_H AND HAVE_EMMINTRIN_H)
+if(HAVE_XMMINTRIN_H)
option(ALSOFT_CPUEXT_SSE "Enable SSE support" ON)
- option(ALSOFT_CPUEXT_SSE2 "Enable SSE2 support" ON)
- if(ALSOFT_CPUEXT_SSE AND ALSOFT_CPUEXT_SSE2)
+ if(ALSOFT_CPUEXT_SSE)
set(HAVE_SSE 1)
- set(HAVE_SSE2 1)
endif()
endif()
if(ALSOFT_REQUIRE_SSE AND NOT HAVE_SSE)
message(FATAL_ERROR "Failed to enabled required SSE CPU extensions")
endif()
+
+option(ALSOFT_REQUIRE_SSE2 "Require SSE2 support" OFF)
+if(HAVE_EMMINTRIN_H)
+ option(ALSOFT_CPUEXT_SSE2 "Enable SSE2 support" ON)
+ if(HAVE_SSE AND ALSOFT_CPUEXT_SSE2)
+ set(HAVE_SSE2 1)
+ endif()
+endif()
if(ALSOFT_REQUIRE_SSE2 AND NOT HAVE_SSE2)
message(FATAL_ERROR "Failed to enable required SSE2 CPU extensions")
endif()
@@ -758,9 +763,13 @@ set(ALC_OBJS
# Include SIMD mixers
set(CPU_EXTS "Default")
+if(HAVE_SSE)
+ set(CORE_OBJS ${CORE_OBJS} core/mixer/mixer_sse.cpp)
+ set(CPU_EXTS "${CPU_EXTS}, SSE")
+endif()
if(HAVE_SSE2)
- set(CORE_OBJS ${CORE_OBJS} core/mixer/mixer_sse.cpp core/mixer/mixer_sse2.cpp)
- set(CPU_EXTS "${CPU_EXTS}, SSE, SSE2")
+ set(CORE_OBJS ${CORE_OBJS} core/mixer/mixer_sse2.cpp)
+ set(CPU_EXTS "${CPU_EXTS}, SSE2")
endif()
if(HAVE_SSE3)
set(CORE_OBJS ${CORE_OBJS} core/mixer/mixer_sse3.cpp)