summaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorPhilip Balister <philip@opensdr.com>2010-09-25 11:51:04 -0400
committerPhilip Balister <philip@opensdr.com>2010-09-25 11:51:04 -0400
commitc75286df4689369aa9a3f4148b964d66109e085e (patch)
treec5d6ba904aba0abe6ed576f718ac3bbbbdfd44f7 /host
parent082715d0c90b615874fe6bbe93069fa696b3d47a (diff)
downloaduhd-c75286df4689369aa9a3f4148b964d66109e085e.tar.gz
uhd-c75286df4689369aa9a3f4148b964d66109e085e.tar.bz2
uhd-c75286df4689369aa9a3f4148b964d66109e085e.zip
Add more NEON for type conversion.
Diffstat (limited to 'host')
-rw-r--r--host/lib/transport/convert_types_impl.hpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/host/lib/transport/convert_types_impl.hpp b/host/lib/transport/convert_types_impl.hpp
index b9a47eb0e..48ff99725 100644
--- a/host/lib/transport/convert_types_impl.hpp
+++ b/host/lib/transport/convert_types_impl.hpp
@@ -266,6 +266,26 @@ static UHD_INLINE void item32_to_fc32_nswap(
}
}
+#elif defined(USE_ARM_NEON_H)
+static UHD_INLINE void item32_to_fc32_nswap(
+ const item32_t *input, fc32_t *output, size_t nsamps)
+{
+ size_t i;
+
+ float32x4_t Q1 = vdupq_n_f32(floats_per_short);
+ for (i=0; i < (nsamps & ~0x03); i+=2) {
+ int16x4_t D0 = vld1_s16(reinterpret_cast<const int16_t *>(&input[i]));
+ int16x4_t D1 = vrev32_s16(D0);
+ int32x4_t Q2 = vmovl_s16(D1);
+ float32x4_t Q3 = vcvtq_f32_s32(Q2);
+ float32x4_t Q4 = vmulq_f32(Q3, Q1);
+ vst1q_f32((reinterpret_cast<float *>(&output[i])), Q4);
+ }
+
+ for (; i < nsamps; i++)
+ output[i] = item32_to_fc32(input[i]);
+}
+
#else
static UHD_INLINE void item32_to_fc32_nswap(
const item32_t *input, fc32_t *output, size_t nsamps