diff --git a/CMakeLists.txt b/CMakeLists.txt index 047c3caa1..36a5bef26 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,7 @@ option(DEBUG_OUTPUT "Print debug messages" OFF) option(SANITIZE_ADDRESS "Activate memory address sanitization" OFF) option(HOST_RPI "Compiling on RPi" OFF) option(RX_SAMPLE_24BIT "Internal 24 bit Rx DSP" OFF) +option(NO_DSP_SIMD "Do not ese SIMD instructions for DSP even if available" OFF) list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) @@ -203,6 +204,13 @@ if (SANITIZE_ADDRESS) set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} -fsanitize=address") endif() +if (NO_DSP_SIMD) + message(STATUS "Not compiling with SIMD instructions for DSP even if available") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNO_DSP_SIMD") +else() + message(STATUS "Compiling with SIMD instructions for DSP if available") +endif() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wvla -Woverloaded-virtual -ffast-math -ftree-vectorize ${EXTRA_FLAGS}") if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") diff --git a/sdrbase/dsp/decimators.h b/sdrbase/dsp/decimators.h index c5affe6f0..567ea5852 100644 --- a/sdrbase/dsp/decimators.h +++ b/sdrbase/dsp/decimators.h @@ -18,7 +18,7 @@ #define INCLUDE_GPL_DSP_DECIMATORS_H_ #include "dsp/dsptypes.h" -#ifdef SDR_RX_SAMPLE_24BIT +#if defined(SDR_RX_SAMPLE_24BIT) || defined(NO_SIMD_DSP) #include "dsp/inthalfbandfilterdb.h" #else #ifdef USE_SSE4_1 @@ -331,7 +331,7 @@ public: void decimate64_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len); private: -#ifdef SDR_RX_SAMPLE_24BIT +#if defined(SDR_RX_SAMPLE_24BIT) || defined(NO_SIMD_DSP) IntHalfbandFilterDB m_decimator2; // 1st stages IntHalfbandFilterDB m_decimator4; // 2nd stages IntHalfbandFilterDB m_decimator8; // 3rd stages