GNU Radio 3.6.5 C++ API

volk_32i_x2_or_32i_a.h

Go to the documentation of this file.
00001 #ifndef INCLUDED_volk_32i_x2_or_32i_a_H
00002 #define INCLUDED_volk_32i_x2_or_32i_a_H
00003 
00004 #include <inttypes.h>
00005 #include <stdio.h>
00006 
00007 #ifdef LV_HAVE_SSE
00008 #include <xmmintrin.h>
00009 /*!
00010   \brief Ors the two input vectors and store their results in the third vector
00011   \param cVector The vector where the results will be stored
00012   \param aVector One of the vectors to be ored
00013   \param bVector One of the vectors to be ored
00014   \param num_points The number of values in aVector and bVector to be ored together and stored into cVector
00015 */
00016 static inline void volk_32i_x2_or_32i_a_sse(int32_t* cVector, const int32_t* aVector, const int32_t* bVector, unsigned int num_points){
00017     unsigned int number = 0;
00018     const unsigned int quarterPoints = num_points / 4;
00019 
00020     float* cPtr = (float*)cVector;
00021     const float* aPtr = (float*)aVector;
00022     const float* bPtr = (float*)bVector;
00023 
00024     __m128 aVal, bVal, cVal;
00025     for(;number < quarterPoints; number++){
00026 
00027       aVal = _mm_load_ps(aPtr);
00028       bVal = _mm_load_ps(bPtr);
00029 
00030       cVal = _mm_or_ps(aVal, bVal);
00031 
00032       _mm_store_ps(cPtr,cVal); // Store the results back into the C container
00033 
00034       aPtr += 4;
00035       bPtr += 4;
00036       cPtr += 4;
00037     }
00038 
00039     number = quarterPoints * 4;
00040     for(;number < num_points; number++){
00041       cVector[number] = aVector[number] | bVector[number];
00042     }
00043 }
00044 #endif /* LV_HAVE_SSE */
00045 
00046 #ifdef LV_HAVE_GENERIC
00047 /*!
00048   \brief Ors the two input vectors and store their results in the third vector
00049   \param cVector The vector where the results will be stored
00050   \param aVector One of the vectors to be ored
00051   \param bVector One of the vectors to be ored
00052   \param num_points The number of values in aVector and bVector to be ored together and stored into cVector
00053 */
00054 static inline void volk_32i_x2_or_32i_a_generic(int32_t* cVector, const int32_t* aVector, const int32_t* bVector, unsigned int num_points){
00055     int32_t* cPtr = cVector;
00056     const int32_t* aPtr = aVector;
00057     const int32_t* bPtr=  bVector;
00058     unsigned int number = 0;
00059 
00060     for(number = 0; number < num_points; number++){
00061       *cPtr++ = (*aPtr++) | (*bPtr++);
00062     }
00063 }
00064 #endif /* LV_HAVE_GENERIC */
00065 
00066 #ifdef LV_HAVE_ORC
00067 /*!
00068   \brief Ors the two input vectors and store their results in the third vector
00069   \param cVector The vector where the results will be stored
00070   \param aVector One of the vectors to be ored
00071   \param bVector One of the vectors to be ored
00072   \param num_points The number of values in aVector and bVector to be ored together and stored into cVector
00073 */
00074 extern void volk_32i_x2_or_32i_a_orc_impl(int32_t* cVector, const int32_t* aVector, const int32_t* bVector, unsigned int num_points);
00075 static inline void volk_32i_x2_or_32i_a_orc(int32_t* cVector, const int32_t* aVector, const int32_t* bVector, unsigned int num_points){
00076     volk_32i_x2_or_32i_a_orc_impl(cVector, aVector, bVector, num_points);
00077 }
00078 #endif /* LV_HAVE_ORC */
00079 
00080 
00081 #endif /* INCLUDED_volk_32i_x2_or_32i_a_H */