1 #ifndef INCLUDED_volk_32fc_s32f_power_32fc_a_H
2 #define INCLUDED_volk_32fc_s32f_power_32fc_a_H
12 return mag*
lv_cmake(-cosf(arg), sinf(arg));
16 #include <xmmintrin.h>
18 #ifdef LV_HAVE_LIB_SIMDMATH
29 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){
30 unsigned int number = 0;
35 #ifdef LV_HAVE_LIB_SIMDMATH
36 const unsigned int quarterPoints = num_points / 4;
37 __m128 vPower = _mm_set_ps1(power);
39 __m128 cplxValue1, cplxValue2, magnitude, phase, iValue, qValue;
40 for(;number < quarterPoints; number++){
42 cplxValue1 = _mm_load_ps((
float*)aPtr);
45 cplxValue2 = _mm_load_ps((
float*)aPtr);
51 iValue = _mm_shuffle_ps(cplxValue1, cplxValue2, _MM_SHUFFLE(2,0,2,0));
53 qValue = _mm_shuffle_ps(cplxValue1, cplxValue2, _MM_SHUFFLE(3,1,3,1));
55 phase = atan2f4(qValue, iValue);
57 magnitude = _mm_sqrt_ps(_mm_add_ps(_mm_mul_ps(iValue, iValue), _mm_mul_ps(qValue, qValue)));
60 magnitude = powf4(magnitude, vPower);
62 phase = _mm_mul_ps(phase, vPower);
65 iValue = _mm_mul_ps( cosf4(phase), magnitude);
66 qValue = _mm_mul_ps( sinf4(phase), magnitude);
68 cplxValue1 = _mm_unpacklo_ps(iValue, qValue);
69 cplxValue2 = _mm_unpackhi_ps(iValue, qValue);
71 _mm_store_ps((
float*)cPtr,cplxValue1);
75 _mm_store_ps((
float*)cPtr,cplxValue2);
80 number = quarterPoints * 4;
83 for(;number < num_points; number++){
89 #ifdef LV_HAVE_GENERIC
97 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){
100 unsigned int number = 0;
102 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:9
#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