GNU Radio Manual and C++ API Reference  3.7.4
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
volk_32i_x2_or_32i.h
Go to the documentation of this file.
1 #ifndef INCLUDED_volk_32i_x2_or_32i_a_H
2 #define INCLUDED_volk_32i_x2_or_32i_a_H
3 
4 #include <inttypes.h>
5 #include <stdio.h>
6 
7 #ifdef LV_HAVE_SSE
8 #include <xmmintrin.h>
9 /*!
10  \brief Ors the two input vectors and store their results in the third vector
11  \param cVector The vector where the results will be stored
12  \param aVector One of the vectors to be ored
13  \param bVector One of the vectors to be ored
14  \param num_points The number of values in aVector and bVector to be ored together and stored into cVector
15 */
16 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){
17  unsigned int number = 0;
18  const unsigned int quarterPoints = num_points / 4;
19 
20  float* cPtr = (float*)cVector;
21  const float* aPtr = (float*)aVector;
22  const float* bPtr = (float*)bVector;
23 
24  __m128 aVal, bVal, cVal;
25  for(;number < quarterPoints; number++){
26 
27  aVal = _mm_load_ps(aPtr);
28  bVal = _mm_load_ps(bPtr);
29 
30  cVal = _mm_or_ps(aVal, bVal);
31 
32  _mm_store_ps(cPtr,cVal); // Store the results back into the C container
33 
34  aPtr += 4;
35  bPtr += 4;
36  cPtr += 4;
37  }
38 
39  number = quarterPoints * 4;
40  for(;number < num_points; number++){
41  cVector[number] = aVector[number] | bVector[number];
42  }
43 }
44 #endif /* LV_HAVE_SSE */
45 
46 #ifdef LV_HAVE_GENERIC
47 /*!
48  \brief Ors the two input vectors and store their results in the third vector
49  \param cVector The vector where the results will be stored
50  \param aVector One of the vectors to be ored
51  \param bVector One of the vectors to be ored
52  \param num_points The number of values in aVector and bVector to be ored together and stored into cVector
53 */
54 static inline void volk_32i_x2_or_32i_generic(int32_t* cVector, const int32_t* aVector, const int32_t* bVector, unsigned int num_points){
55  int32_t* cPtr = cVector;
56  const int32_t* aPtr = aVector;
57  const int32_t* bPtr= bVector;
58  unsigned int number = 0;
59 
60  for(number = 0; number < num_points; number++){
61  *cPtr++ = (*aPtr++) | (*bPtr++);
62  }
63 }
64 #endif /* LV_HAVE_GENERIC */
65 
66 #ifdef LV_HAVE_ORC
67 /*!
68  \brief Ors the two input vectors and store their results in the third vector
69  \param cVector The vector where the results will be stored
70  \param aVector One of the vectors to be ored
71  \param bVector One of the vectors to be ored
72  \param num_points The number of values in aVector and bVector to be ored together and stored into cVector
73 */
74 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);
75 static inline void volk_32i_x2_or_32i_u_orc(int32_t* cVector, const int32_t* aVector, const int32_t* bVector, unsigned int num_points){
76  volk_32i_x2_or_32i_a_orc_impl(cVector, aVector, bVector, num_points);
77 }
78 #endif /* LV_HAVE_ORC */
79 
80 
81 #endif /* INCLUDED_volk_32i_x2_or_32i_a_H */
signed int int32_t
Definition: stdint.h:77