Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (2.4 kB)

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