workaround for simd lut in debug mode

master
Ismael Gomez 8 years ago
parent 631c5b18e2
commit e8ab4ce24d

@ -100,7 +100,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
find_package(SSE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -DDEBUG_MODE")
if(HAVE_AVX)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native -mfpmath=sse -mavx -DLV_HAVE_AVX -DLV_HAVE_SSE")
elseif(HAVE_SSE)

@ -36,6 +36,11 @@
#include "srslte/utils/vector.h"
#include "srslte/fec/cbsegm.h"
#ifdef DEBUG_MODE
#warning FIXME: Disabling SSE/AVX turbo rate matching
#undef LV_HAVE_SSE
#undef LV_HAVE_AVX
#endif
#ifdef LV_HAVE_SSE
#include <smmintrin.h>

@ -285,6 +285,10 @@ void srslte_vec_lut_fuf(float *x, uint32_t *lut, float *y, uint32_t len) {
}
void srslte_vec_lut_sss(short *x, unsigned short *lut, short *y, uint32_t len) {
#ifdef DEBUG_MODE
#warning FIXME: Disabling SSE/AVX in srslte_vec_lut_sss
srslte_vec_lut_sss_simd(x, lut, y, len);
#else
#ifndef LV_HAVE_SSE
for (int i=0;i<len;i++) {
y[lut[i]] = x[i];
@ -292,6 +296,7 @@ void srslte_vec_lut_sss(short *x, unsigned short *lut, short *y, uint32_t len) {
#else
srslte_vec_lut_sss_simd(x, lut, y, len);
#endif
#endif
}
void srslte_vec_interleave_cf(float *real, float *imag, cf_t *x, uint32_t len) {

@ -213,6 +213,7 @@ void srslte_vec_sc_div2_sss_simd(short *x, int k, short *z, uint32_t len)
/* No improvement with AVX */
void srslte_vec_lut_sss_simd(short *x, unsigned short *lut, short *y, uint32_t len)
{
#ifndef DEBUG_MODE
#ifdef LV_HAVE_SSE
unsigned int number = 0;
const unsigned int points = len / 8;
@ -240,6 +241,7 @@ void srslte_vec_lut_sss_simd(short *x, unsigned short *lut, short *y, uint32_t l
y[lut[number]] = x[number];
}
#endif
#endif
}
/* Modified from volk_32f_s32f_convert_16i_a_simd2. Removed clipping */

Loading…
Cancel
Save