From dbbbfa12eed1f2a9c82589ce56a9b51e9ac113f4 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 6 Nov 2016 02:08:38 +0100 Subject: [PATCH] Changed USE_SIMD flag to USE_SSE --- CMakeLists.txt | 12 ++++++------ plugins/channeltx/modam/modam.pro | 2 +- plugins/samplesource/sdrdaemonfec/CMakeLists.txt | 2 ++ plugins/samplesource/sdrdaemonfec/sdrdaemonfec.pro | 1 + sdrbase/dsp/decimators.h | 4 ++-- sdrbase/dsp/interpolator.h | 4 ++-- sdrbase/dsp/inthalfbandfiltereo1.h | 6 +++--- sdrbase/dsp/inthalfbandfiltereo2.h | 6 +++--- sdrbase/dsp/upchannelizer.cpp | 2 +- sdrbase/dsp/upchannelizer.h | 4 ++-- sdrbase/gui/glspectrum.cpp | 4 ++-- sdrbase/sdrbase.pro | 2 +- 12 files changed, 26 insertions(+), 23 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b96bea72a..5a5afa16c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -62,7 +62,7 @@ if (NOT BUILD_DEBIAN) endif() IF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64|x86") - SET(USE_SIMD "SSE2" CACHE STRING "Use SIMD instructions") + SET(USE_SSE "SSE4_1" CACHE STRING "Use SSE 4.1 SIMD instructions") ENDIF() # MacOS Compatibility @@ -411,17 +411,17 @@ include_directories( ${OPENGL_INCLUDE_DIR} ) -if(USE_SIMD MATCHES SSE2) +if(USE_SSE MATCHES SSE4_1) if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX) set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -msse4.1" ) set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -msse4.1" ) - add_definitions(-DUSE_SIMD) + add_definitions(-DUSE_SSE) elseif(MSVC) - set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /arch:SSE2" ) - set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi /GL /Ot /Ox /arch:SSE2" ) + set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /arch:SSE4_1" ) + set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi /GL /Ot /Ox /arch:SSE4_1" ) set( CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG" ) add_definitions (/D "_CRT_SECURE_NO_WARNINGS") - add_definitions(-DUSE_SIMD) + add_definitions(-DUSE_SSE) endif() endif() diff --git a/plugins/channeltx/modam/modam.pro b/plugins/channeltx/modam/modam.pro index 869ccd034..7fd04a043 100644 --- a/plugins/channeltx/modam/modam.pro +++ b/plugins/channeltx/modam/modam.pro @@ -13,7 +13,7 @@ TARGET = modam INCLUDEPATH += $$PWD INCLUDEPATH += ../../../sdrbase -DEFINES += USE_SIMD=1 +DEFINES += USE_SSE=1 QMAKE_CXXFLAGS += -msse4.1 CONFIG(Release):build_subdir = release diff --git a/plugins/samplesource/sdrdaemonfec/CMakeLists.txt b/plugins/samplesource/sdrdaemonfec/CMakeLists.txt index 89e2181c6..69ae74ff2 100644 --- a/plugins/samplesource/sdrdaemonfec/CMakeLists.txt +++ b/plugins/samplesource/sdrdaemonfec/CMakeLists.txt @@ -19,6 +19,7 @@ if(USE_SIMD MATCHES SSSE3) set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -mssse3" ) message(STATUS "SDRdaemonFEC: g++ SSSE3") add_definitions(-DUSE_SIMD) + add_definitions(-DUSE_SSE) elseif(MSVC) set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /arch:SSSE3" ) set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi /GL /Ot /Ox /arch:SSSE3" ) @@ -26,6 +27,7 @@ if(USE_SIMD MATCHES SSSE3) message(STATUS "SDRdaemonFEC: MSVC SSSE3") add_definitions (/D "_CRT_SECURE_NO_WARNINGS") add_definitions(-DUSE_SIMD) + add_definitions(-DUSE_SSE) endif() elseif(USE_SIMD MATCHES NEON) if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX) diff --git a/plugins/samplesource/sdrdaemonfec/sdrdaemonfec.pro b/plugins/samplesource/sdrdaemonfec/sdrdaemonfec.pro index 975be2fcb..cfe657edf 100644 --- a/plugins/samplesource/sdrdaemonfec/sdrdaemonfec.pro +++ b/plugins/samplesource/sdrdaemonfec/sdrdaemonfec.pro @@ -24,6 +24,7 @@ INCLUDEPATH += $$LIBNANOMSGSRC/src INCLUDEPATH += $$LIBCM256CCSRC DEFINES += USE_SIMD=1 +DEFINES += USE_SSE=1 QMAKE_CXXFLAGS += -msse4.1 CONFIG(Release):build_subdir = release diff --git a/sdrbase/dsp/decimators.h b/sdrbase/dsp/decimators.h index c09c94210..fdee166b4 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 USE_SIMD +#ifdef USE_SSE #include "dsp/inthalfbandfiltereo1.h" #else #include "dsp/inthalfbandfilterdb.h" @@ -124,7 +124,7 @@ public: void decimate64_cen(SampleVector::iterator* it, const T* buf, qint32 len); private: -#ifdef USE_SIMD +#ifdef USE_SSE IntHalfbandFilterEO1 m_decimator2; // 1st stages IntHalfbandFilterEO1 m_decimator4; // 2nd stages IntHalfbandFilterEO1 m_decimator8; // 3rd stages diff --git a/sdrbase/dsp/interpolator.h b/sdrbase/dsp/interpolator.h index 9e3e8c602..8cf3f29a0 100644 --- a/sdrbase/dsp/interpolator.h +++ b/sdrbase/dsp/interpolator.h @@ -1,7 +1,7 @@ #ifndef INCLUDE_INTERPOLATOR_H #define INCLUDE_INTERPOLATOR_H -#ifdef USE_SIMD +#ifdef USE_SSE #include #endif #include "dsp/dsptypes.h" @@ -125,7 +125,7 @@ private: { if (phase < 0) phase = 0; -#if USE_SIMD +#if USE_SSE // beware of the ringbuffer if(m_ptr == 0) { // only one straight block diff --git a/sdrbase/dsp/inthalfbandfiltereo1.h b/sdrbase/dsp/inthalfbandfiltereo1.h index c9e050a90..7eb77db07 100644 --- a/sdrbase/dsp/inthalfbandfiltereo1.h +++ b/sdrbase/dsp/inthalfbandfiltereo1.h @@ -22,7 +22,7 @@ #ifndef SDRBASE_DSP_INTHALFBANDFILTEREO_H_ #define SDRBASE_DSP_INTHALFBANDFILTEREO_H_ -#ifdef USE_SIMD +#ifdef USE_SSE #include #endif @@ -464,7 +464,7 @@ protected: qint32 iAcc = 0; qint32 qAcc = 0; -#ifdef USE_SIMD +#ifdef USE_SSE //#warning "IntHalfbandFiler SIMD" const __m128i* h = (const __m128i*) HBFIRFilterTraits::hbCoeffs; __m128i sumI = _mm_setzero_si128(); @@ -551,7 +551,7 @@ protected: qint32 iAcc = 0; qint32 qAcc = 0; -#ifdef USE_SIMD +#ifdef USE_SSE const __m128i* h = (const __m128i*) HBFIRFilterTraits::hbCoeffs; __m128i sumI = _mm_setzero_si128(); __m128i sumQ = _mm_setzero_si128(); diff --git a/sdrbase/dsp/inthalfbandfiltereo2.h b/sdrbase/dsp/inthalfbandfiltereo2.h index fd518552c..e58d7cf88 100644 --- a/sdrbase/dsp/inthalfbandfiltereo2.h +++ b/sdrbase/dsp/inthalfbandfiltereo2.h @@ -22,7 +22,7 @@ #ifndef SDRBASE_DSP_INTHALFBANDFILTEREO2_H_ #define SDRBASE_DSP_INTHALFBANDFILTEREO2_H_ -#ifdef USE_SIMD +#ifdef USE_SSE #include #endif @@ -484,7 +484,7 @@ protected: qint32 iAcc = 0; qint32 qAcc = 0; -#ifdef USE_SIMD +#ifdef USE_SSE //#warning "IntHalfbandFiler SIMD" const __m128i* h = (const __m128i*) HBFIRFilterTraits::hbCoeffs; __m128i sumI = _mm_setzero_si128(); @@ -570,7 +570,7 @@ protected: qint32 iAcc = 0; qint32 qAcc = 0; -#ifdef USE_SIMD +#ifdef USE_SSE //#warning "IntHalfbandFiler SIMD" const __m128i* h = (const __m128i*) HBFIRFilterTraits::hbCoeffs; __m128i sumI = _mm_setzero_si128(); diff --git a/sdrbase/dsp/upchannelizer.cpp b/sdrbase/dsp/upchannelizer.cpp index 580f1d968..a7eeb6d47 100644 --- a/sdrbase/dsp/upchannelizer.cpp +++ b/sdrbase/dsp/upchannelizer.cpp @@ -201,7 +201,7 @@ void UpChannelizer::applyConfiguration() } } -#ifdef USE_SIMD +#ifdef USE_SSE UpChannelizer::FilterStage::FilterStage(Mode mode) : m_filter(new IntHalfbandFilterEO2), m_workFunction(0) diff --git a/sdrbase/dsp/upchannelizer.h b/sdrbase/dsp/upchannelizer.h index 1e1ef69e2..80d290d35 100644 --- a/sdrbase/dsp/upchannelizer.h +++ b/sdrbase/dsp/upchannelizer.h @@ -23,7 +23,7 @@ #include #include "util/export.h" #include "util/message.h" -#ifdef USE_SIMD +#ifdef USE_SSE #include "dsp/inthalfbandfiltereo2.h" #else #include "dsp/inthalfbandfilterdb.h" @@ -73,7 +73,7 @@ protected: ModeUpperHalf }; -#ifdef USE_SIMD +#ifdef USE_SSE typedef bool (IntHalfbandFilterEO2::*WorkFunction)(Sample* sIn, Sample *sOut); IntHalfbandFilterEO2* m_filter; #else diff --git a/sdrbase/gui/glspectrum.cpp b/sdrbase/gui/glspectrum.cpp index e3bdd78d4..27381cbf7 100644 --- a/sdrbase/gui/glspectrum.cpp +++ b/sdrbase/gui/glspectrum.cpp @@ -15,7 +15,7 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// -#ifdef USE_SIMD +#ifdef USE_SSE #include #endif @@ -381,7 +381,7 @@ void GLSpectrum::updateHistogram(const std::vector& spectrum) m_currentSpectrum = &spectrum; // Store spectrum for current spectrum line display -#ifndef USE_SIMD +#ifndef USE_SSE for(int i = 0; i < m_fftSize; i++) { int v = (int)((spectrum[i] - m_referenceLevel) * 100.0 / m_powerRange + 100.0); diff --git a/sdrbase/sdrbase.pro b/sdrbase/sdrbase.pro index 20d0a2dc7..6efd0895d 100644 --- a/sdrbase/sdrbase.pro +++ b/sdrbase/sdrbase.pro @@ -14,7 +14,7 @@ INCLUDEPATH += $$PWD DEFINES += USE_KISSFFT=1 DEFINES += __WINDOWS__=1 DEFINES += DSD_USE_SERIALDV=1 -DEFINES += USE_SIMD=1 +DEFINES += USE_SSE=1 QMAKE_CXXFLAGS += -msse4.1 CONFIG(Release):build_subdir = release