GNU Radio 3.6.5 C++ API

volk_8ic_deinterleave_real_8i_a.h

Go to the documentation of this file.
00001 #ifndef INCLUDED_VOLK_8sc_DEINTERLEAVE_REAL_8s_ALIGNED8_H
00002 #define INCLUDED_VOLK_8sc_DEINTERLEAVE_REAL_8s_ALIGNED8_H
00003 
00004 #include <inttypes.h>
00005 #include <stdio.h>
00006 
00007 #ifdef LV_HAVE_SSSE3
00008 #include <tmmintrin.h>
00009 /*!
00010   \brief Deinterleaves the complex 8 bit vector into I vector data
00011   \param complexVector The complex input vector
00012   \param iBuffer The I buffer output data
00013   \param num_points The number of complex data values to be deinterleaved
00014 */
00015 static inline void volk_8ic_deinterleave_real_8i_a_ssse3(int8_t* iBuffer, const lv_8sc_t* complexVector, unsigned int num_points){
00016   unsigned int number = 0;
00017   const int8_t* complexVectorPtr = (int8_t*)complexVector;
00018   int8_t* iBufferPtr = iBuffer;
00019   __m128i moveMask1 = _mm_set_epi8(0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 14, 12, 10, 8, 6, 4, 2, 0);
00020   __m128i moveMask2 = _mm_set_epi8(14, 12, 10, 8, 6, 4, 2, 0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80);
00021   __m128i complexVal1, complexVal2, outputVal;
00022 
00023   unsigned int sixteenthPoints = num_points / 16;
00024 
00025   for(number = 0; number < sixteenthPoints; number++){
00026     complexVal1 = _mm_load_si128((__m128i*)complexVectorPtr);  complexVectorPtr += 16;
00027     complexVal2 = _mm_load_si128((__m128i*)complexVectorPtr);  complexVectorPtr += 16;
00028 
00029     complexVal1 = _mm_shuffle_epi8(complexVal1, moveMask1);
00030     complexVal2 = _mm_shuffle_epi8(complexVal2, moveMask2);
00031 
00032     outputVal = _mm_or_si128(complexVal1, complexVal2);
00033 
00034     _mm_store_si128((__m128i*)iBufferPtr, outputVal);
00035     iBufferPtr += 16;
00036   }
00037 
00038   number = sixteenthPoints * 16;
00039   for(; number < num_points; number++){
00040     *iBufferPtr++ = *complexVectorPtr++;
00041     complexVectorPtr++;
00042   }
00043 }
00044 #endif /* LV_HAVE_SSSE3 */
00045 
00046 #ifdef LV_HAVE_GENERIC
00047 /*!
00048   \brief Deinterleaves the complex 8 bit vector into I vector data
00049   \param complexVector The complex input vector
00050   \param iBuffer The I buffer output data
00051   \param num_points The number of complex data values to be deinterleaved
00052 */
00053 static inline void volk_8ic_deinterleave_real_8i_a_generic(int8_t* iBuffer, const lv_8sc_t* complexVector, unsigned int num_points){
00054   unsigned int number = 0;
00055   const int8_t* complexVectorPtr = (int8_t*)complexVector;
00056   int8_t* iBufferPtr = iBuffer;
00057   for(number = 0; number < num_points; number++){
00058     *iBufferPtr++ = *complexVectorPtr++;
00059     complexVectorPtr++;
00060   }
00061 }
00062 #endif /* LV_HAVE_GENERIC */
00063 
00064 
00065 
00066 
00067 #endif /* INCLUDED_VOLK_8sc_DEINTERLEAVE_REAL_8s_ALIGNED8_H */