From e8ab4ce24dc1b25a56b5f1b69488d75c5a44e262 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Wed, 8 Mar 2017 11:53:55 +0100 Subject: [PATCH] workaround for simd lut in debug mode --- CMakeLists.txt | 2 +- srslte/lib/fec/rm_turbo.c | 5 +++++ srslte/lib/utils/vector.c | 5 +++++ srslte/lib/utils/vector_simd.c | 2 ++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index faf11be37..8453f7b56 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/srslte/lib/fec/rm_turbo.c b/srslte/lib/fec/rm_turbo.c index 5856a4e46..1d250ff43 100644 --- a/srslte/lib/fec/rm_turbo.c +++ b/srslte/lib/fec/rm_turbo.c @@ -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 diff --git a/srslte/lib/utils/vector.c b/srslte/lib/utils/vector.c index 469320177..f42c75b0e 100644 --- a/srslte/lib/utils/vector.c +++ b/srslte/lib/utils/vector.c @@ -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