55 #ifndef INCLUDED_volk_32fc_s32f_power_32fc_a_H 56 #define INCLUDED_volk_32fc_s32f_power_32fc_a_H 67 return mag*
lv_cmake(-cosf(arg), sinf(arg));
71 #include <xmmintrin.h> 73 #ifdef LV_HAVE_LIB_SIMDMATH 79 const float power,
unsigned int num_points)
81 unsigned int number = 0;
86 #ifdef LV_HAVE_LIB_SIMDMATH 87 const unsigned int quarterPoints = num_points / 4;
88 __m128 vPower = _mm_set_ps1(power);
90 __m128 cplxValue1, cplxValue2, magnitude, phase, iValue, qValue;
91 for(;number < quarterPoints; number++){
93 cplxValue1 = _mm_load_ps((
float*)aPtr);
96 cplxValue2 = _mm_load_ps((
float*)aPtr);
102 iValue = _mm_shuffle_ps(cplxValue1, cplxValue2, _MM_SHUFFLE(2,0,2,0));
104 qValue = _mm_shuffle_ps(cplxValue1, cplxValue2, _MM_SHUFFLE(3,1,3,1));
106 phase = atan2f4(qValue, iValue);
108 magnitude = _mm_sqrt_ps(_mm_add_ps(_mm_mul_ps(iValue, iValue), _mm_mul_ps(qValue, qValue)));
111 magnitude = powf4(magnitude, vPower);
113 phase = _mm_mul_ps(phase, vPower);
116 iValue = _mm_mul_ps( cosf4(phase), magnitude);
117 qValue = _mm_mul_ps( sinf4(phase), magnitude);
119 cplxValue1 = _mm_unpacklo_ps(iValue, qValue);
120 cplxValue2 = _mm_unpackhi_ps(iValue, qValue);
122 _mm_store_ps((
float*)cPtr,cplxValue1);
126 _mm_store_ps((
float*)cPtr,cplxValue2);
131 number = quarterPoints * 4;
134 for(;number < num_points; number++){
141 #ifdef LV_HAVE_GENERIC 145 const float power,
unsigned int num_points)
149 unsigned int number = 0;
151 for(number = 0; number < num_points; number++){
static void volk_32fc_s32f_power_32fc_a_sse(lv_32fc_t *cVector, const lv_32fc_t *aVector, const float power, unsigned int num_points)
Definition: volk_32fc_s32f_power_32fc.h:78
static lv_32fc_t __volk_s32fc_s32f_power_s32fc_a(const lv_32fc_t exp, const float power)
raise a complex float to a real float power
Definition: volk_32fc_s32f_power_32fc.h:63
static void volk_32fc_s32f_power_32fc_generic(lv_32fc_t *cVector, const lv_32fc_t *aVector, const float power, unsigned int num_points)
Definition: volk_32fc_s32f_power_32fc.h:144
#define lv_cmake(r, i)
Definition: volk_complex.h:64
float complex lv_32fc_t
Definition: volk_complex.h:61
#define lv_creal(x)
Definition: volk_complex.h:83
#define lv_cimag(x)
Definition: volk_complex.h:85