From 34e228a9bcf3ac37287bb5e684ace46818740f3b Mon Sep 17 00:00:00 2001 From: Tom Tsou Date: Sat, 29 Apr 2017 00:16:43 +0700 Subject: core/conv: add x86 SSE support for Viterbi decoder Fast convolutional decoding is provided through x86 intrinsic based SSE operations. SSE3, found on virtually all modern x86 processors, is the minimal requirement. SSE4.1 and AVX2 are used if available. Also, the original code was extended with runtime SIMD detection, so only supported extensions will be used by target CPU. It makes the library more partable, what is very important for binary packages distribution. Runtime SIMD detection is currently implemented through the __builtin_cpu_supports call. Change-Id: I1da6d71ed0564f1d684f3a836e998d09de5f0351 --- src/viterbi_gen.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/viterbi_gen.c') diff --git a/src/viterbi_gen.c b/src/viterbi_gen.c index 7972c396..2ced6152 100644 --- a/src/viterbi_gen.c +++ b/src/viterbi_gen.c @@ -20,6 +20,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include #include #include @@ -126,6 +127,19 @@ static void gen_path_metrics(int num_states, int16_t *sums, memcpy(sums, new_sums, num_states * sizeof(int16_t)); } +/* Not-aligned Memory Allocator */ +__attribute__ ((visibility("hidden"))) +int16_t *osmo_conv_vdec_malloc(size_t n) +{ + return (int16_t *) malloc(sizeof(int16_t) * n); +} + +__attribute__ ((visibility("hidden"))) +void osmo_conv_vdec_free(int16_t *ptr) +{ + free(ptr); +} + /* 16-state branch-path metrics units (K=5) */ __attribute__ ((visibility("hidden"))) void osmo_conv_gen_metrics_k5_n2(const int8_t *seq, const int16_t *out, -- cgit v1.2.3