aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/x86/convert.c
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2017-03-16 14:50:25 +0100
committerTom Tsou <tom@tsou.cc>2017-05-19 17:16:37 +0000
commitfe9769833fa74ea841f78c0e931130a70fc3aca9 (patch)
tree5145cf70925bec2f634551ee0d7b1c8134078c4a /Transceiver52M/x86/convert.c
parent7e07cf23464532ca156fe4ea4430928da2cbbff1 (diff)
cosmetic: remove code duplication
The ARM and the X86 implementation of the conversion functions share the same, non cpu specific implementation in separate files. This commit removes the code duplication by putting the generic implementation into a convert_base.c, similar to to convolve_base.c Change-Id: Ic8d8534a343e27cde79ddc85be4998ebd0cb6e5c
Diffstat (limited to 'Transceiver52M/x86/convert.c')
-rw-r--r--Transceiver52M/x86/convert.c25
1 files changed, 5 insertions, 20 deletions
diff --git a/Transceiver52M/x86/convert.c b/Transceiver52M/x86/convert.c
index db1c0fc..3f76b65 100644
--- a/Transceiver52M/x86/convert.c
+++ b/Transceiver52M/x86/convert.c
@@ -170,28 +170,13 @@ static void _sse_convert_scale_ps_si16_16n(short *restrict out,
}
#endif
-__attribute__((optimize("no-tree-vectorize")))
-static void convert_scale_ps_si16(short *out, const float *in,
- float scale, int len)
-{
- for (int i = 0; i < len; i++)
- out[i] = in[i] * scale;
-}
-
-__attribute__((optimize("no-tree-vectorize")))
-static void convert_si16_ps(float *out, const short *in, int len)
-{
- for (int i = 0; i < len; i++)
- out[i] = in[i];
-}
-
void convert_init(void)
{
- c.convert_scale_ps_si16_16n = convert_scale_ps_si16;
- c.convert_scale_ps_si16_8n = convert_scale_ps_si16;
- c.convert_scale_ps_si16 = convert_scale_ps_si16;
- c.convert_si16_ps_16n = convert_si16_ps;
- c.convert_si16_ps = convert_si16_ps;
+ c.convert_scale_ps_si16_16n = base_convert_float_short;
+ c.convert_scale_ps_si16_8n = base_convert_float_short;
+ c.convert_scale_ps_si16 = base_convert_float_short;
+ c.convert_si16_ps_16n = base_convert_short_float;
+ c.convert_si16_ps = base_convert_short_float;
#ifdef HAVE_SSE4_1
if (__builtin_cpu_supports("sse4.1")) {