mirror of
				https://github.com/f4exb/sdrangel.git
				synced 2025-11-03 13:11:20 -05:00 
			
		
		
		
	Changed USE_SIMD flag to USE_SSE
This commit is contained in:
		
							parent
							
								
									af0a0896d4
								
							
						
					
					
						commit
						dbbbfa12ee
					
				@ -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()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -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
 | 
			
		||||
 | 
			
		||||
@ -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)
 | 
			
		||||
 | 
			
		||||
@ -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
 | 
			
		||||
 | 
			
		||||
@ -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<DECIMATORS_HB_FILTER_ORDER> m_decimator2;  // 1st stages
 | 
			
		||||
    IntHalfbandFilterEO1<DECIMATORS_HB_FILTER_ORDER> m_decimator4;  // 2nd stages
 | 
			
		||||
    IntHalfbandFilterEO1<DECIMATORS_HB_FILTER_ORDER> m_decimator8;  // 3rd stages
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
#ifndef INCLUDE_INTERPOLATOR_H
 | 
			
		||||
#define INCLUDE_INTERPOLATOR_H
 | 
			
		||||
 | 
			
		||||
#ifdef USE_SIMD
 | 
			
		||||
#ifdef USE_SSE
 | 
			
		||||
#include <immintrin.h>
 | 
			
		||||
#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
 | 
			
		||||
 | 
			
		||||
@ -22,7 +22,7 @@
 | 
			
		||||
#ifndef SDRBASE_DSP_INTHALFBANDFILTEREO_H_
 | 
			
		||||
#define SDRBASE_DSP_INTHALFBANDFILTEREO_H_
 | 
			
		||||
 | 
			
		||||
#ifdef USE_SIMD
 | 
			
		||||
#ifdef USE_SSE
 | 
			
		||||
#include <smmintrin.h>
 | 
			
		||||
#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<HBFilterOrder>::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<HBFilterOrder>::hbCoeffs;
 | 
			
		||||
        __m128i sumI = _mm_setzero_si128();
 | 
			
		||||
        __m128i sumQ = _mm_setzero_si128();
 | 
			
		||||
 | 
			
		||||
@ -22,7 +22,7 @@
 | 
			
		||||
#ifndef SDRBASE_DSP_INTHALFBANDFILTEREO2_H_
 | 
			
		||||
#define SDRBASE_DSP_INTHALFBANDFILTEREO2_H_
 | 
			
		||||
 | 
			
		||||
#ifdef USE_SIMD
 | 
			
		||||
#ifdef USE_SSE
 | 
			
		||||
#include <smmintrin.h>
 | 
			
		||||
#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<HBFilterOrder>::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<HBFilterOrder>::hbCoeffs;
 | 
			
		||||
        __m128i sumI = _mm_setzero_si128();
 | 
			
		||||
 | 
			
		||||
@ -201,7 +201,7 @@ void UpChannelizer::applyConfiguration()
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#ifdef USE_SIMD
 | 
			
		||||
#ifdef USE_SSE
 | 
			
		||||
UpChannelizer::FilterStage::FilterStage(Mode mode) :
 | 
			
		||||
    m_filter(new IntHalfbandFilterEO2<UPCHANNELIZER_HB_FILTER_ORDER>),
 | 
			
		||||
    m_workFunction(0)
 | 
			
		||||
 | 
			
		||||
@ -23,7 +23,7 @@
 | 
			
		||||
#include <QMutex>
 | 
			
		||||
#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<UPCHANNELIZER_HB_FILTER_ORDER>::*WorkFunction)(Sample* sIn, Sample *sOut);
 | 
			
		||||
        IntHalfbandFilterEO2<UPCHANNELIZER_HB_FILTER_ORDER>* m_filter;
 | 
			
		||||
#else
 | 
			
		||||
 | 
			
		||||
@ -15,7 +15,7 @@
 | 
			
		||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.          //
 | 
			
		||||
///////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
#ifdef USE_SIMD
 | 
			
		||||
#ifdef USE_SSE
 | 
			
		||||
#include <immintrin.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@ -381,7 +381,7 @@ void GLSpectrum::updateHistogram(const std::vector<Real>& 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);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -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
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user