Statistics
| Branch: | Tag: | Revision:

root / volk / include / volk / volk_8sc_deinterleave_real_8s_aligned16.h @ 74f206ed

History | View | Annotate | Download (2.4 kB)

1 23914465 Tom Rondeau
#ifndef INCLUDED_VOLK_8sc_DEINTERLEAVE_REAL_8s_ALIGNED8_H
2 23914465 Tom Rondeau
#define INCLUDED_VOLK_8sc_DEINTERLEAVE_REAL_8s_ALIGNED8_H
3 23914465 Tom Rondeau
4 23914465 Tom Rondeau
#include <inttypes.h>
5 23914465 Tom Rondeau
#include <stdio.h>
6 23914465 Tom Rondeau
7 23914465 Tom Rondeau
#if LV_HAVE_SSSE3
8 23914465 Tom Rondeau
#include <tmmintrin.h>
9 23914465 Tom Rondeau
/*!
10 23914465 Tom Rondeau
  \brief Deinterleaves the complex 8 bit vector into I vector data
11 23914465 Tom Rondeau
  \param complexVector The complex input vector
12 23914465 Tom Rondeau
  \param iBuffer The I buffer output data
13 23914465 Tom Rondeau
  \param num_points The number of complex data values to be deinterleaved
14 23914465 Tom Rondeau
*/
15 23914465 Tom Rondeau
static inline void volk_8sc_deinterleave_real_8s_aligned16_ssse3(int8_t* iBuffer, const lv_8sc_t* complexVector, unsigned int num_points){
16 23914465 Tom Rondeau
  unsigned int number = 0;
17 23914465 Tom Rondeau
  const int8_t* complexVectorPtr = (int8_t*)complexVector;
18 23914465 Tom Rondeau
  int8_t* iBufferPtr = iBuffer;
19 23914465 Tom Rondeau
  __m128i moveMask1 = _mm_set_epi8(0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 14, 12, 10, 8, 6, 4, 2, 0);
20 23914465 Tom Rondeau
  __m128i moveMask2 = _mm_set_epi8(14, 12, 10, 8, 6, 4, 2, 0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80);
21 23914465 Tom Rondeau
  __m128i complexVal1, complexVal2, outputVal;
22 23914465 Tom Rondeau
23 23914465 Tom Rondeau
  unsigned int sixteenthPoints = num_points / 16;
24 23914465 Tom Rondeau
25 23914465 Tom Rondeau
  for(number = 0; number < sixteenthPoints; number++){
26 23914465 Tom Rondeau
    complexVal1 = _mm_load_si128((__m128i*)complexVectorPtr);  complexVectorPtr += 16;
27 23914465 Tom Rondeau
    complexVal2 = _mm_load_si128((__m128i*)complexVectorPtr);  complexVectorPtr += 16;
28 23914465 Tom Rondeau
29 23914465 Tom Rondeau
    complexVal1 = _mm_shuffle_epi8(complexVal1, moveMask1);
30 23914465 Tom Rondeau
    complexVal2 = _mm_shuffle_epi8(complexVal2, moveMask2);
31 23914465 Tom Rondeau
32 23914465 Tom Rondeau
    outputVal = _mm_or_si128(complexVal1, complexVal2);
33 23914465 Tom Rondeau
34 23914465 Tom Rondeau
    _mm_store_si128((__m128i*)iBufferPtr, outputVal);
35 23914465 Tom Rondeau
    iBufferPtr += 16;
36 23914465 Tom Rondeau
  }
37 23914465 Tom Rondeau
38 23914465 Tom Rondeau
  number = sixteenthPoints * 16;
39 23914465 Tom Rondeau
  for(; number < num_points; number++){
40 23914465 Tom Rondeau
    *iBufferPtr++ = *complexVectorPtr++;
41 23914465 Tom Rondeau
    complexVectorPtr++;
42 23914465 Tom Rondeau
  }
43 23914465 Tom Rondeau
}
44 23914465 Tom Rondeau
#endif /* LV_HAVE_SSSE3 */
45 23914465 Tom Rondeau
46 23914465 Tom Rondeau
#if LV_HAVE_GENERIC
47 23914465 Tom Rondeau
/*!
48 23914465 Tom Rondeau
  \brief Deinterleaves the complex 8 bit vector into I vector data
49 23914465 Tom Rondeau
  \param complexVector The complex input vector
50 23914465 Tom Rondeau
  \param iBuffer The I buffer output data
51 23914465 Tom Rondeau
  \param num_points The number of complex data values to be deinterleaved
52 23914465 Tom Rondeau
*/
53 23914465 Tom Rondeau
static inline void volk_8sc_deinterleave_real_8s_aligned16_generic(int8_t* iBuffer, const lv_8sc_t* complexVector, unsigned int num_points){
54 23914465 Tom Rondeau
  unsigned int number = 0;
55 23914465 Tom Rondeau
  const int8_t* complexVectorPtr = (int8_t*)complexVector;
56 23914465 Tom Rondeau
  int8_t* iBufferPtr = iBuffer;
57 23914465 Tom Rondeau
  for(number = 0; number < num_points; number++){
58 23914465 Tom Rondeau
    *iBufferPtr++ = *complexVectorPtr++;
59 23914465 Tom Rondeau
    complexVectorPtr++;
60 23914465 Tom Rondeau
  }
61 23914465 Tom Rondeau
}
62 23914465 Tom Rondeau
#endif /* LV_HAVE_GENERIC */
63 23914465 Tom Rondeau
64 23914465 Tom Rondeau
65 23914465 Tom Rondeau
66 23914465 Tom Rondeau
67 23914465 Tom Rondeau
#endif /* INCLUDED_VOLK_8sc_DEINTERLEAVE_REAL_8s_ALIGNED8_H */