1 #ifndef INCLUDED_volk_32f_invsqrt_32f_a_H
2 #define INCLUDED_volk_32f_invsqrt_32f_a_H
8 static inline float Q_rsqrt(
float number )
12 const float threehalfs = 1.5F;
17 i = 0x5f3759df - ( i >> 1 );
19 y = y * ( threehalfs - ( x2 * y * y ) );
26 #include <xmmintrin.h>
33 static inline void volk_32f_invsqrt_32f_a_sse(
float* cVector,
const float* aVector,
unsigned int num_points){
34 unsigned int number = 0;
35 const unsigned int quarterPoints = num_points / 4;
37 float* cPtr = cVector;
38 const float* aPtr = aVector;
41 for(;number < quarterPoints; number++){
43 aVal = _mm_load_ps(aPtr);
45 cVal = _mm_rsqrt_ps(aVal);
47 _mm_store_ps(cPtr,cVal);
53 number = quarterPoints * 4;
54 for(;number < num_points; number++){
60 #ifdef LV_HAVE_GENERIC
67 static inline void volk_32f_invsqrt_32f_generic(
float* cVector,
const float* aVector,
unsigned int num_points){
68 float* cPtr = cVector;
69 const float* aPtr = aVector;
70 unsigned int number = 0;
71 for(number = 0; number < num_points; number++){
static float Q_rsqrt(float number)
Definition: volk_32f_invsqrt_32f.h:8