71 #ifndef INCLUDED_volk_32f_x2_max_32f_a_H
72 #define INCLUDED_volk_32f_x2_max_32f_a_H
78 #include <xmmintrin.h>
81 volk_32f_x2_max_32f_a_sse(
float* cVector,
const float* aVector,
82 const float* bVector,
unsigned int num_points)
84 unsigned int number = 0;
85 const unsigned int quarterPoints = num_points / 4;
87 float* cPtr = cVector;
88 const float* aPtr = aVector;
89 const float* bPtr= bVector;
91 __m128 aVal, bVal, cVal;
92 for(;number < quarterPoints; number++){
93 aVal = _mm_load_ps(aPtr);
94 bVal = _mm_load_ps(bPtr);
96 cVal = _mm_max_ps(aVal, bVal);
98 _mm_store_ps(cPtr,cVal);
105 number = quarterPoints * 4;
106 for(;number < num_points; number++){
107 const float a = *aPtr++;
108 const float b = *bPtr++;
109 *cPtr++ = ( a > b ? a : b);
116 #include <arm_neon.h>
119 volk_32f_x2_max_32f_neon(
float* cVector,
const float* aVector,
120 const float* bVector,
unsigned int num_points)
122 unsigned int quarter_points = num_points / 4;
123 float* cPtr = cVector;
124 const float* aPtr = aVector;
125 const float* bPtr= bVector;
126 unsigned int number = 0;
128 float32x4_t a_vec, b_vec, c_vec;
129 for(number = 0; number < quarter_points; number++){
130 a_vec = vld1q_f32(aPtr);
131 b_vec = vld1q_f32(bPtr);
132 c_vec = vmaxq_f32(a_vec, b_vec);
133 vst1q_f32(cPtr, c_vec);
139 for(number = quarter_points*4; number < num_points; number++){
140 const float a = *aPtr++;
141 const float b = *bPtr++;
142 *cPtr++ = ( a > b ? a : b);
148 #ifdef LV_HAVE_GENERIC
151 volk_32f_x2_max_32f_generic(
float* cVector,
const float* aVector,
152 const float* bVector,
unsigned int num_points)
154 float* cPtr = cVector;
155 const float* aPtr = aVector;
156 const float* bPtr= bVector;
157 unsigned int number = 0;
159 for(number = 0; number < num_points; number++){
160 const float a = *aPtr++;
161 const float b = *bPtr++;
162 *cPtr++ = ( a > b ? a : b);
170 volk_32f_x2_max_32f_a_orc_impl(
float* cVector,
const float* aVector,
171 const float* bVector,
unsigned int num_points);
174 volk_32f_x2_max_32f_u_orc(
float* cVector,
const float* aVector,
175 const float* bVector,
unsigned int num_points)
177 volk_32f_x2_max_32f_a_orc_impl(cVector, aVector, bVector, num_points);