23 #ifndef INCLUDED_volk_32fc_s32f_power_32fc_a_H
24 #define INCLUDED_volk_32fc_s32f_power_32fc_a_H
34 return mag*
lv_cmake(-cosf(arg), sinf(arg));
38 #include <xmmintrin.h>
40 #ifdef LV_HAVE_LIB_SIMDMATH
51 static inline void volk_32fc_s32f_power_32fc_a_sse(
lv_32fc_t* cVector,
const lv_32fc_t* aVector,
const float power,
unsigned int num_points){
52 unsigned int number = 0;
57 #ifdef LV_HAVE_LIB_SIMDMATH
58 const unsigned int quarterPoints = num_points / 4;
59 __m128 vPower = _mm_set_ps1(power);
61 __m128 cplxValue1, cplxValue2, magnitude, phase, iValue, qValue;
62 for(;number < quarterPoints; number++){
64 cplxValue1 = _mm_load_ps((
float*)aPtr);
67 cplxValue2 = _mm_load_ps((
float*)aPtr);
73 iValue = _mm_shuffle_ps(cplxValue1, cplxValue2, _MM_SHUFFLE(2,0,2,0));
75 qValue = _mm_shuffle_ps(cplxValue1, cplxValue2, _MM_SHUFFLE(3,1,3,1));
77 phase = atan2f4(qValue, iValue);
79 magnitude = _mm_sqrt_ps(_mm_add_ps(_mm_mul_ps(iValue, iValue), _mm_mul_ps(qValue, qValue)));
82 magnitude = powf4(magnitude, vPower);
84 phase = _mm_mul_ps(phase, vPower);
87 iValue = _mm_mul_ps( cosf4(phase), magnitude);
88 qValue = _mm_mul_ps( sinf4(phase), magnitude);
90 cplxValue1 = _mm_unpacklo_ps(iValue, qValue);
91 cplxValue2 = _mm_unpackhi_ps(iValue, qValue);
93 _mm_store_ps((
float*)cPtr,cplxValue1);
97 _mm_store_ps((
float*)cPtr,cplxValue2);
102 number = quarterPoints * 4;
105 for(;number < num_points; number++){
111 #ifdef LV_HAVE_GENERIC
119 static inline void volk_32fc_s32f_power_32fc_generic(
lv_32fc_t* cVector,
const lv_32fc_t* aVector,
const float power,
unsigned int num_points){
122 unsigned int number = 0;
124 for(number = 0; number < num_points; number++){
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:31
#define lv_cmake(r, i)
Definition: volk_complex.h:59
float complex lv_32fc_t
Definition: volk_complex.h:56
#define lv_creal(x)
Definition: volk_complex.h:76
#define lv_cimag(x)
Definition: volk_complex.h:78