57 #ifndef INCLUDED_volk_32fc_x2_multiply_32fc_u_H
58 #define INCLUDED_volk_32fc_x2_multiply_32fc_u_H
65 #if LV_HAVE_AVX2 && LV_HAVE_FMA
66 #include <immintrin.h>
74 static inline void volk_32fc_x2_multiply_32fc_u_avx2_fma(
lv_32fc_t* cVector,
77 unsigned int num_points)
79 unsigned int number = 0;
80 const unsigned int quarterPoints = num_points / 4;
86 for (; number < quarterPoints; number++) {
89 _mm256_loadu_ps((
float*)a);
91 _mm256_loadu_ps((
float*)b);
93 const __m256 yl = _mm256_moveldup_ps(y);
94 const __m256 yh = _mm256_movehdup_ps(y);
96 const __m256 tmp2x = _mm256_permute_ps(x, 0xB1);
98 const __m256 tmp2 = _mm256_mul_ps(tmp2x, yh);
100 const __m256 z = _mm256_fmaddsub_ps(
103 _mm256_storeu_ps((
float*)c, z);
110 number = quarterPoints * 4;
111 for (; number < num_points; number++) {
112 *c++ = (*a++) * (*b++);
119 #include <immintrin.h>
125 unsigned int num_points)
127 unsigned int number = 0;
128 const unsigned int quarterPoints = num_points / 4;
135 for (; number < quarterPoints; number++) {
141 _mm256_storeu_ps((
float*)c, z);
148 number = quarterPoints * 4;
150 for (; number < num_points; number++) {
151 *c++ = (*a++) * (*b++);
158 #include <pmmintrin.h>
164 unsigned int num_points)
166 unsigned int number = 0;
167 const unsigned int halfPoints = num_points / 2;
174 for (; number < halfPoints; number++) {
185 if ((num_points % 2) != 0) {
192 #ifdef LV_HAVE_GENERIC
197 unsigned int num_points)
202 unsigned int number = 0;
204 for (number = 0; number < num_points; number++) {
205 *cPtr++ = (*aPtr++) * (*bPtr++);
212 #ifndef INCLUDED_volk_32fc_x2_multiply_32fc_a_H
213 #define INCLUDED_volk_32fc_x2_multiply_32fc_a_H
216 #include <inttypes.h>
220 #if LV_HAVE_AVX2 && LV_HAVE_FMA
221 #include <immintrin.h>
229 static inline void volk_32fc_x2_multiply_32fc_a_avx2_fma(
lv_32fc_t* cVector,
232 unsigned int num_points)
234 unsigned int number = 0;
235 const unsigned int quarterPoints = num_points / 4;
241 for (; number < quarterPoints; number++) {
244 _mm256_load_ps((
float*)a);
246 _mm256_load_ps((
float*)b);
248 const __m256 yl = _mm256_moveldup_ps(y);
249 const __m256 yh = _mm256_movehdup_ps(y);
251 const __m256 tmp2x = _mm256_permute_ps(x, 0xB1);
253 const __m256 tmp2 = _mm256_mul_ps(tmp2x, yh);
255 const __m256 z = _mm256_fmaddsub_ps(
258 _mm256_store_ps((
float*)c, z);
265 number = quarterPoints * 4;
266 for (; number < num_points; number++) {
267 *c++ = (*a++) * (*b++);
274 #include <immintrin.h>
280 unsigned int num_points)
282 unsigned int number = 0;
283 const unsigned int quarterPoints = num_points / 4;
290 for (; number < quarterPoints; number++) {
291 x = _mm256_load_ps((
float*)a);
292 y = _mm256_load_ps((
float*)b);
294 _mm256_store_ps((
float*)c, z);
301 number = quarterPoints * 4;
303 for (; number < num_points; number++) {
304 *c++ = (*a++) * (*b++);
310 #include <pmmintrin.h>
316 unsigned int num_points)
318 unsigned int number = 0;
319 const unsigned int halfPoints = num_points / 2;
326 for (; number < halfPoints; number++) {
337 if ((num_points % 2) != 0) {
344 #ifdef LV_HAVE_GENERIC
349 unsigned int num_points)
354 unsigned int number = 0;
356 for (number = 0; number < num_points; number++) {
357 *cPtr++ = (*aPtr++) * (*bPtr++);
364 #include <arm_neon.h>
369 unsigned int num_points)
373 unsigned int quarter_points = num_points / 4;
374 float32x4x2_t a_val, b_val, c_val;
375 float32x4x2_t tmp_real, tmp_imag;
376 unsigned int number = 0;
378 for (number = 0; number < quarter_points; ++number) {
379 a_val = vld2q_f32((
float*)a_ptr);
380 b_val = vld2q_f32((
float*)b_ptr);
386 tmp_real.val[0] = vmulq_f32(a_val.val[0], b_val.val[0]);
388 tmp_real.val[1] = vmulq_f32(a_val.val[1], b_val.val[1]);
392 tmp_imag.val[0] = vmulq_f32(a_val.val[0], b_val.val[1]);
394 tmp_imag.val[1] = vmulq_f32(a_val.val[1], b_val.val[0]);
397 c_val.val[0] = vsubq_f32(tmp_real.val[0], tmp_real.val[1]);
398 c_val.val[1] = vaddq_f32(tmp_imag.val[0], tmp_imag.val[1]);
399 vst2q_f32((
float*)cVector, c_val);
406 for (number = quarter_points * 4; number < num_points; number++) {
407 *cVector++ = (*a_ptr++) * (*b_ptr++);
418 unsigned int num_points)
422 unsigned int quarter_points = num_points / 4;
423 float32x4x2_t a_val, b_val;
424 float32x4x2_t tmp_imag;
425 unsigned int number = 0;
427 for (number = 0; number < quarter_points; ++number) {
428 a_val = vld2q_f32((
float*)a_ptr);
429 b_val = vld2q_f32((
float*)b_ptr);
434 tmp_imag.val[1] = vmulq_f32(a_val.val[1], b_val.val[0]);
435 tmp_imag.val[0] = vmulq_f32(a_val.val[0], b_val.val[0]);
438 tmp_imag.val[1] = vmlaq_f32(tmp_imag.val[1], a_val.val[0], b_val.val[1]);
439 tmp_imag.val[0] = vmlsq_f32(tmp_imag.val[0], a_val.val[1], b_val.val[1]);
442 vst2q_f32((
float*)cVector, tmp_imag);
449 for (number = quarter_points * 4; number < num_points; number++) {
450 *cVector++ = (*a_ptr++) * (*b_ptr++);
456 #ifdef LV_HAVE_NEONV7
458 extern void volk_32fc_x2_multiply_32fc_a_neonasm(
lv_32fc_t* cVector,
461 unsigned int num_points);
467 extern void volk_32fc_x2_multiply_32fc_a_orc_impl(
lv_32fc_t* cVector,
470 unsigned int num_points);
472 static inline void volk_32fc_x2_multiply_32fc_u_orc(
lv_32fc_t* cVector,
475 unsigned int num_points)
477 volk_32fc_x2_multiply_32fc_a_orc_impl(cVector, aVector, bVector, num_points);
float32x4_t __m128
Definition: sse2neon.h:235
FORCE_INLINE void _mm_storeu_ps(float *p, __m128 a)
Definition: sse2neon.h:2787
FORCE_INLINE __m128 _mm_loadu_ps(const float *p)
Definition: sse2neon.h:1941
FORCE_INLINE __m128 _mm_load_ps(const float *p)
Definition: sse2neon.h:1858
FORCE_INLINE void _mm_store_ps(float *p, __m128 a)
Definition: sse2neon.h:2704
static void volk_32fc_x2_multiply_32fc_a_sse3(lv_32fc_t *cVector, const lv_32fc_t *aVector, const lv_32fc_t *bVector, unsigned int num_points)
Definition: volk_32fc_x2_multiply_32fc.h:313
static void volk_32fc_x2_multiply_32fc_u_avx(lv_32fc_t *cVector, const lv_32fc_t *aVector, const lv_32fc_t *bVector, unsigned int num_points)
Definition: volk_32fc_x2_multiply_32fc.h:122
static void volk_32fc_x2_multiply_32fc_generic(lv_32fc_t *cVector, const lv_32fc_t *aVector, const lv_32fc_t *bVector, unsigned int num_points)
Definition: volk_32fc_x2_multiply_32fc.h:194
static void volk_32fc_x2_multiply_32fc_neon_opttests(lv_32fc_t *cVector, const lv_32fc_t *aVector, const lv_32fc_t *bVector, unsigned int num_points)
Definition: volk_32fc_x2_multiply_32fc.h:415
static void volk_32fc_x2_multiply_32fc_neon(lv_32fc_t *cVector, const lv_32fc_t *aVector, const lv_32fc_t *bVector, unsigned int num_points)
Definition: volk_32fc_x2_multiply_32fc.h:366
static void volk_32fc_x2_multiply_32fc_a_avx(lv_32fc_t *cVector, const lv_32fc_t *aVector, const lv_32fc_t *bVector, unsigned int num_points)
Definition: volk_32fc_x2_multiply_32fc.h:277
static void volk_32fc_x2_multiply_32fc_u_sse3(lv_32fc_t *cVector, const lv_32fc_t *aVector, const lv_32fc_t *bVector, unsigned int num_points)
Definition: volk_32fc_x2_multiply_32fc.h:161
static void volk_32fc_x2_multiply_32fc_a_generic(lv_32fc_t *cVector, const lv_32fc_t *aVector, const lv_32fc_t *bVector, unsigned int num_points)
Definition: volk_32fc_x2_multiply_32fc.h:346
static __m256 _mm256_complexmul_ps(__m256 x, __m256 y)
Definition: volk_avx_intrinsics.h:19
#define __VOLK_PREFETCH(addr)
Definition: volk_common.h:71
float complex lv_32fc_t
Definition: volk_complex.h:74
static __m128 _mm_complexmul_ps(__m128 x, __m128 y)
Definition: volk_sse3_intrinsics.h:19