1 #ifndef INCLUDED_volk_32fc_32f_multiply_32fc_a_H
2 #define INCLUDED_volk_32fc_32f_multiply_32fc_a_H
16 static inline void volk_32fc_32f_multiply_32fc_a_avx(
lv_32fc_t* cVector,
const lv_32fc_t* aVector,
const float* bVector,
unsigned int num_points)
18 unsigned int number = 0;
19 const unsigned int eighthPoints = num_points / 8;
23 const float* bPtr= bVector;
25 __m256 aVal1, aVal2, bVal, bVal1, bVal2, cVal1, cVal2;
27 __m256i permute_mask = _mm256_set_epi32(3, 3, 2, 2, 1, 1, 0, 0);
29 for(;number < eighthPoints; number++){
31 aVal1 = _mm256_load_ps((
float *)aPtr);
34 aVal2 = _mm256_load_ps((
float *)aPtr);
37 bVal = _mm256_load_ps(bPtr);
40 bVal1 = _mm256_permute2f128_ps(bVal, bVal, 0x00);
41 bVal2 = _mm256_permute2f128_ps(bVal, bVal, 0x11);
43 bVal1 = _mm256_permutevar_ps(bVal1, permute_mask);
44 bVal2 = _mm256_permutevar_ps(bVal2, permute_mask);
46 cVal1 = _mm256_mul_ps(aVal1, bVal1);
47 cVal2 = _mm256_mul_ps(aVal2, bVal2);
49 _mm256_store_ps((
float*)cPtr,cVal1);
52 _mm256_store_ps((
float*)cPtr,cVal2);
56 number = eighthPoints * 8;
57 for(;number < num_points; ++number){
58 *cPtr++ = (*aPtr++) * (*bPtr++);
66 #include <xmmintrin.h>
74 static inline void volk_32fc_32f_multiply_32fc_a_sse(
lv_32fc_t* cVector,
const lv_32fc_t* aVector,
const float* bVector,
unsigned int num_points)
76 unsigned int number = 0;
77 const unsigned int quarterPoints = num_points / 4;
81 const float* bPtr= bVector;
83 __m128 aVal1, aVal2, bVal, bVal1, bVal2, cVal;
84 for(;number < quarterPoints; number++){
86 aVal1 = _mm_load_ps((
const float*)aPtr);
89 aVal2 = _mm_load_ps((
const float*)aPtr);
92 bVal = _mm_load_ps(bPtr);
95 bVal1 = _mm_shuffle_ps(bVal, bVal, _MM_SHUFFLE(1,1,0,0));
96 bVal2 = _mm_shuffle_ps(bVal, bVal, _MM_SHUFFLE(3,3,2,2));
98 cVal = _mm_mul_ps(aVal1, bVal1);
100 _mm_store_ps((
float*)cPtr,cVal);
103 cVal = _mm_mul_ps(aVal2, bVal2);
105 _mm_store_ps((
float*)cPtr,cVal);
110 number = quarterPoints * 4;
111 for(;number < num_points; number++){
112 *cPtr++ = (*aPtr++) * (*bPtr);
118 #ifdef LV_HAVE_GENERIC
126 static inline void volk_32fc_32f_multiply_32fc_generic(
lv_32fc_t* cVector,
const lv_32fc_t* aVector,
const float* bVector,
unsigned int num_points){
129 const float* bPtr= bVector;
130 unsigned int number = 0;
132 for(number = 0; number < num_points; number++){
133 *cPtr++ = (*aPtr++) * (*bPtr++);
146 extern void volk_32fc_32f_multiply_32fc_a_orc_impl(
lv_32fc_t* cVector,
const lv_32fc_t* aVector,
const float* bVector,
unsigned int num_points);
147 static inline void volk_32fc_32f_multiply_32fc_u_orc(
lv_32fc_t* cVector,
const lv_32fc_t* aVector,
const float* bVector,
unsigned int num_points){
148 volk_32fc_32f_multiply_32fc_a_orc_impl(cVector, aVector, bVector, num_points);
float complex lv_32fc_t
Definition: volk_complex.h:56