65 #ifndef INCLUDED_volk_32f_invsqrt_32f_a_H 66 #define INCLUDED_volk_32f_invsqrt_32f_a_H 77 const float threehalfs = 1.5F;
85 u.i = 0x5f3759df - ( u.i >> 1 );
86 u.f = u.f * ( threehalfs - ( x2 * u.f * u.f ) );
93 #include <immintrin.h> 98 unsigned int number = 0;
99 const unsigned int eighthPoints = num_points / 8;
101 float* cPtr = cVector;
102 const float* aPtr = aVector;
104 for (; number < eighthPoints; number++) {
105 aVal = _mm256_load_ps(aPtr);
106 cVal = _mm256_rsqrt_ps(aVal);
107 _mm256_store_ps(cPtr, cVal);
112 number = eighthPoints * 8;
113 for(;number < num_points; number++)
121 #include <xmmintrin.h> 126 unsigned int number = 0;
127 const unsigned int quarterPoints = num_points / 4;
129 float* cPtr = cVector;
130 const float* aPtr = aVector;
133 for(;number < quarterPoints; number++){
135 aVal = _mm_load_ps(aPtr);
137 cVal = _mm_rsqrt_ps(aVal);
139 _mm_store_ps(cPtr,cVal);
145 number = quarterPoints * 4;
146 for(;number < num_points; number++) {
154 #include <arm_neon.h> 160 const unsigned int quarter_points = num_points / 4;
162 float* cPtr = cVector;
163 const float* aPtr = aVector;
164 float32x4_t a_val, c_val;
165 for (number = 0; number < quarter_points; ++number) {
166 a_val = vld1q_f32(aPtr);
167 c_val = vrsqrteq_f32(a_val);
168 vst1q_f32(cPtr, c_val);
173 for(number=quarter_points * 4;number < num_points; number++)
179 #ifdef LV_HAVE_GENERIC 184 float* cPtr = cVector;
185 const float* aPtr = aVector;
186 unsigned int number = 0;
187 for(number = 0; number < num_points; number++) {
194 #include <immintrin.h> 199 unsigned int number = 0;
200 const unsigned int eighthPoints = num_points / 8;
202 float* cPtr = cVector;
203 const float* aPtr = aVector;
205 for (; number < eighthPoints; number++) {
206 aVal = _mm256_loadu_ps(aPtr);
207 cVal = _mm256_rsqrt_ps(aVal);
208 _mm256_storeu_ps(cPtr, cVal);
213 number = eighthPoints * 8;
214 for(;number < num_points; number++)
static void volk_32f_invsqrt_32f_a_avx(float *cVector, const float *aVector, unsigned int num_points)
Definition: volk_32f_invsqrt_32f.h:96
static void volk_32f_invsqrt_32f_neon(float *cVector, const float *aVector, unsigned int num_points)
Definition: volk_32f_invsqrt_32f.h:157
static void volk_32f_invsqrt_32f_a_sse(float *cVector, const float *aVector, unsigned int num_points)
Definition: volk_32f_invsqrt_32f.h:124
for i
Definition: volk_config_fixed.tmpl.h:25
static float Q_rsqrt(float number)
Definition: volk_32f_invsqrt_32f.h:74
static void volk_32f_invsqrt_32f_u_avx(float *cVector, const float *aVector, unsigned int num_points)
Definition: volk_32f_invsqrt_32f.h:197
static void volk_32f_invsqrt_32f_generic(float *cVector, const float *aVector, unsigned int num_points)
Definition: volk_32f_invsqrt_32f.h:182