Commit 6421754b authored by wu.jing's avatar wu.jing

fix OXGRF lib.c for arm

parent 01ec201f
...@@ -26,6 +26,10 @@ ...@@ -26,6 +26,10 @@
# include <immintrin.h> # include <immintrin.h>
#endif #endif
#ifdef __aarch64__
#include <arm_neon.h>
#endif
//! Number of OXGRF devices //! Number of OXGRF devices
int num_devices = 0; int num_devices = 0;
#ifdef __GNUC__ #ifdef __GNUC__
...@@ -110,15 +114,15 @@ static int trx_oxgrf_write(openair0_device *device,openair0_timestamp timestamp, ...@@ -110,15 +114,15 @@ static int trx_oxgrf_write(openair0_device *device,openair0_timestamp timestamp,
iq += 16; iq += 16;
len -= 16; len -= 16;
} }
#else #elif defined(__arm__) || defined(__aarch64__)
__m128i a, *b; __m128i a, *b;
int len = nsamps * 2; int len = nsamps * 2;
int16_t *iq = buff[0]; int16_t *iq = buff[0];
while (len >= 8) { while (len >= 8) {
a = *(__m128i *)&iq[0]; a = *(int16x8_t *)&iq[0];
b = (__m128i *)&iq[0]; b = (int16x8_t *)&iq[0];
*b = _mm_slli_epi16(a, 4); *b = vshlq_n_s16(a, 4);
iq += 8; iq += 8;
len -= 8; len -= 8;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment