aboutsummaryrefslogtreecommitdiffstats
path: root/src/Makefile.am
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-05-28 18:20:02 +0700
committerMax <msuraev@sysmocom.de>2017-05-29 14:07:25 +0000
commit0d49f47aeb5a38273c4a356dc4780e3819747d60 (patch)
tree70cb2852a4044ef0fcb799e1187411e225045102 /src/Makefile.am
parentb51d51b29c647584d95cc62dbe88f869ba5bf5d5 (diff)
core/conv: do not mix up AVX and SSE code
According to GCC's wiki: If you specify command-line switches such as -msse, the compiler could use the extended instruction sets even if the built-ins are not used explicitly in the program. For this reason, applications that perform run-time CPU detection must compile separate files for each supported architecture, using the appropriate flags. In particular, the file containing the CPU detection code should be compiled without these options. So, this change introduces a separate Viterbi implementation, which is almost the same as previous one, but is being compiled with -mavx2. This implementation will be only used by CPUs with both SSE and AVX support: SSE3 and AVX2: viterbi_sse_avx.c SSE3 only: viterbi_sse.c Generic: viterbi_generic.c Change-Id: I042cc76258df7e4c6c90a73af3d0a6e75999b2b0
Diffstat (limited to 'src/Makefile.am')
-rw-r--r--src/Makefile.am17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index e3a0f001..e98c623c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -25,11 +25,24 @@ libosmocore_la_SOURCES = timer.c timer_gettimeofday.c select.c signal.c msgb.c b
if HAVE_SSE3
libosmocore_la_SOURCES += viterbi_sse.c
-# Per-object flags hack
-viterbi_sse.lo : CFLAGS += $(SIMD_FLAGS)
+if HAVE_SSE4_1
+viterbi_sse.lo : CFLAGS += -msse3 -msse4.1
+else
+viterbi_sse.lo : CFLAGS += -msse3
+endif
+
+if HAVE_AVX2
+libosmocore_la_SOURCES += viterbi_sse_avx.c
+if HAVE_SSE4_1
+viterbi_sse_avx.lo : CFLAGS += -msse3 -mavx2 -msse4.1
+else
+viterbi_sse_avx.lo : CFLAGS += -msse3 -mavx2
+endif
+endif
endif
BUILT_SOURCES = crc8gen.c crc16gen.c crc32gen.c crc64gen.c
+EXTRA_DIST = viterbi_sse_common.h
if ENABLE_PLUGIN
libosmocore_la_SOURCES += plugin.c