1 #ifndef INCLUDED_volk_16ic_deinterleave_16i_x2_a_H
2 #define INCLUDED_volk_16ic_deinterleave_16i_x2_a_H
16 static inline void volk_16ic_deinterleave_16i_x2_a_ssse3(
int16_t* iBuffer,
int16_t* qBuffer,
const lv_16sc_t* complexVector,
unsigned int num_points){
17 unsigned int number = 0;
22 __m128i iMoveMask1 = _mm_set_epi8(0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 13, 12, 9, 8, 5, 4, 1, 0);
23 __m128i iMoveMask2 = _mm_set_epi8(13, 12, 9, 8, 5, 4, 1, 0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80);
25 __m128i qMoveMask1 = _mm_set_epi8(0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 15, 14, 11, 10, 7, 6, 3, 2);
26 __m128i qMoveMask2 = _mm_set_epi8(15, 14, 11, 10, 7, 6, 3, 2, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80);
28 __m128i complexVal1, complexVal2, iOutputVal, qOutputVal;
30 unsigned int eighthPoints = num_points / 8;
32 for(number = 0; number < eighthPoints; number++){
33 complexVal1 = _mm_load_si128((__m128i*)complexVectorPtr); complexVectorPtr += 16;
34 complexVal2 = _mm_load_si128((__m128i*)complexVectorPtr); complexVectorPtr += 16;
36 iOutputVal = _mm_or_si128( _mm_shuffle_epi8(complexVal1, iMoveMask1) , _mm_shuffle_epi8(complexVal2, iMoveMask2));
37 qOutputVal = _mm_or_si128( _mm_shuffle_epi8(complexVal1, qMoveMask1) , _mm_shuffle_epi8(complexVal2, qMoveMask2));
39 _mm_store_si128((__m128i*)iBufferPtr, iOutputVal);
40 _mm_store_si128((__m128i*)qBufferPtr, qOutputVal);
46 number = eighthPoints * 8;
48 for(; number < num_points; number++){
49 *iBufferPtr++ = *int16ComplexVectorPtr++;
50 *qBufferPtr++ = *int16ComplexVectorPtr++;
56 #include <emmintrin.h>
64 static inline void volk_16ic_deinterleave_16i_x2_a_sse2(
int16_t* iBuffer,
int16_t* qBuffer,
const lv_16sc_t* complexVector,
unsigned int num_points){
65 unsigned int number = 0;
69 __m128i complexVal1, complexVal2, iComplexVal1, iComplexVal2, qComplexVal1, qComplexVal2, iOutputVal, qOutputVal;
70 __m128i lowMask = _mm_set_epi32(0x0, 0x0, 0xFFFFFFFF, 0xFFFFFFFF);
71 __m128i highMask = _mm_set_epi32(0xFFFFFFFF, 0xFFFFFFFF, 0x0, 0x0);
73 unsigned int eighthPoints = num_points / 8;
75 for(number = 0; number < eighthPoints; number++){
76 complexVal1 = _mm_load_si128((__m128i*)complexVectorPtr); complexVectorPtr += 8;
77 complexVal2 = _mm_load_si128((__m128i*)complexVectorPtr); complexVectorPtr += 8;
79 iComplexVal1 = _mm_shufflelo_epi16(complexVal1, _MM_SHUFFLE(3,1,2,0));
81 iComplexVal1 = _mm_shufflehi_epi16(iComplexVal1, _MM_SHUFFLE(3,1,2,0));
83 iComplexVal1 = _mm_shuffle_epi32(iComplexVal1, _MM_SHUFFLE(3,1,2,0));
85 iComplexVal2 = _mm_shufflelo_epi16(complexVal2, _MM_SHUFFLE(3,1,2,0));
87 iComplexVal2 = _mm_shufflehi_epi16(iComplexVal2, _MM_SHUFFLE(3,1,2,0));
89 iComplexVal2 = _mm_shuffle_epi32(iComplexVal2, _MM_SHUFFLE(2,0,3,1));
91 iOutputVal = _mm_or_si128(_mm_and_si128(iComplexVal1, lowMask), _mm_and_si128(iComplexVal2, highMask));
93 _mm_store_si128((__m128i*)iBufferPtr, iOutputVal);
95 qComplexVal1 = _mm_shufflelo_epi16(complexVal1, _MM_SHUFFLE(2,0,3,1));
97 qComplexVal1 = _mm_shufflehi_epi16(qComplexVal1, _MM_SHUFFLE(2,0,3,1));
99 qComplexVal1 = _mm_shuffle_epi32(qComplexVal1, _MM_SHUFFLE(3,1,2,0));
101 qComplexVal2 = _mm_shufflelo_epi16(complexVal2, _MM_SHUFFLE(2,0,3,1));
103 qComplexVal2 = _mm_shufflehi_epi16(qComplexVal2, _MM_SHUFFLE(2,0,3,1));
105 qComplexVal2 = _mm_shuffle_epi32(qComplexVal2, _MM_SHUFFLE(2,0,3,1));
107 qOutputVal = _mm_or_si128(_mm_and_si128(qComplexVal1, lowMask), _mm_and_si128(qComplexVal2, highMask));
109 _mm_store_si128((__m128i*)qBufferPtr, qOutputVal);
115 number = eighthPoints * 8;
116 for(; number < num_points; number++){
117 *iBufferPtr++ = *complexVectorPtr++;
118 *qBufferPtr++ = *complexVectorPtr++;
123 #ifdef LV_HAVE_GENERIC
131 static inline void volk_16ic_deinterleave_16i_x2_generic(
int16_t* iBuffer,
int16_t* qBuffer,
const lv_16sc_t* complexVector,
unsigned int num_points){
136 for(number = 0; number < num_points; number++){
137 *iBufferPtr++ = *complexVectorPtr++;
138 *qBufferPtr++ = *complexVectorPtr++;
151 extern void volk_16ic_deinterleave_16i_x2_a_orc_impl(
int16_t* iBuffer,
int16_t* qBuffer,
const lv_16sc_t* complexVector,
unsigned int num_points);
152 static inline void volk_16ic_deinterleave_16i_x2_u_orc(
int16_t* iBuffer,
int16_t* qBuffer,
const lv_16sc_t* complexVector,
unsigned int num_points){
153 volk_16ic_deinterleave_16i_x2_a_orc_impl(iBuffer, qBuffer, complexVector, num_points);
short complex lv_16sc_t
Definition: volk_complex.h:53
signed short int16_t
Definition: stdint.h:76
signed char int8_t
Definition: stdint.h:75