58#ifndef INCLUDED_volk_32f_x2_subtract_32f_a_H
59#define INCLUDED_volk_32f_x2_subtract_32f_a_H
70 unsigned int num_points)
72 for (
unsigned int number = 0; number < num_points; number++) {
73 *cVector++ = (*aVector++) - (*bVector++);
82static inline void volk_32f_x2_subtract_32f_a_avx512f(
float* cVector,
85 unsigned int num_points)
87 const unsigned int sixteenthPoints = num_points / 16;
89 for (
unsigned int number = 0; number < sixteenthPoints; number++) {
90 __m512 aVal = _mm512_load_ps(aVector);
91 __m512 bVal = _mm512_load_ps(bVector);
93 __m512 cVal = _mm512_sub_ps(aVal, bVal);
95 _mm512_store_ps(cVector, cVal);
103 cVector, aVector, bVector, num_points - sixteenthPoints * 16);
108#include <immintrin.h>
111 const float* aVector,
112 const float* bVector,
113 unsigned int num_points)
115 const unsigned int eighthPoints = num_points / 8;
117 for (
unsigned int number = 0; number < eighthPoints; number++) {
118 __m256 aVal = _mm256_load_ps(aVector);
119 __m256 bVal = _mm256_load_ps(bVector);
121 __m256 cVal = _mm256_sub_ps(aVal, bVal);
123 _mm256_store_ps(cVector, cVal);
131 cVector, aVector, bVector, num_points - eighthPoints * 8);
136#include <xmmintrin.h>
139 const float* aVector,
140 const float* bVector,
141 unsigned int num_points)
143 const unsigned int quarterPoints = num_points / 4;
145 for (
unsigned int number = 0; number < quarterPoints; number++) {
146 __m128 aVal = _mm_load_ps(aVector);
147 __m128 bVal = _mm_load_ps(bVector);
149 __m128 cVal = _mm_sub_ps(aVal, bVal);
151 _mm_store_ps(cVector, cVal);
159 cVector, aVector, bVector, num_points - quarterPoints * 4);
168 const float* aVector,
169 const float* bVector,
170 unsigned int num_points)
172 const unsigned int quarterPoints = num_points / 4;
174 for (
unsigned int number = 0; number < quarterPoints; number++) {
175 float32x4_t a_vec = vld1q_f32(aVector);
176 float32x4_t b_vec = vld1q_f32(bVector);
178 float32x4_t c_vec = vsubq_f32(a_vec, b_vec);
180 vst1q_f32(cVector, c_vec);
188 cVector, aVector, bVector, num_points - quarterPoints * 4);
196static inline void volk_32f_x2_subtract_32f_neonv8(
float* cVector,
197 const float* aVector,
198 const float* bVector,
199 unsigned int num_points)
201 unsigned int n = num_points;
203 const float* a = aVector;
204 const float* b = bVector;
208 float32x4_t a0 = vld1q_f32(a);
209 float32x4_t a1 = vld1q_f32(a + 4);
210 float32x4_t b0 = vld1q_f32(b);
211 float32x4_t b1 = vld1q_f32(b + 4);
215 vst1q_f32(c, vsubq_f32(a0, b0));
216 vst1q_f32(c + 4, vsubq_f32(a1, b1));
226 vst1q_f32(c, vsubq_f32(vld1q_f32(a), vld1q_f32(b)));
244extern void volk_32f_x2_subtract_32f_a_orc_impl(
float* cVector,
245 const float* aVector,
246 const float* bVector,
249static inline void volk_32f_x2_subtract_32f_u_orc(
float* cVector,
250 const float* aVector,
251 const float* bVector,
252 unsigned int num_points)
254 volk_32f_x2_subtract_32f_a_orc_impl(cVector, aVector, bVector, num_points);
262#ifndef INCLUDED_volk_32f_x2_subtract_32f_u_H
263#define INCLUDED_volk_32f_x2_subtract_32f_u_H
268#ifdef LV_HAVE_AVX512F
269#include <immintrin.h>
271static inline void volk_32f_x2_subtract_32f_u_avx512f(
float* cVector,
272 const float* aVector,
273 const float* bVector,
274 unsigned int num_points)
276 const unsigned int sixteenthPoints = num_points / 16;
278 for (
unsigned int number = 0; number < sixteenthPoints; number++) {
279 __m512 aVal = _mm512_loadu_ps(aVector);
280 __m512 bVal = _mm512_loadu_ps(bVector);
282 __m512 cVal = _mm512_sub_ps(aVal, bVal);
284 _mm512_storeu_ps(cVector, cVal);
292 cVector, aVector, bVector, num_points - sixteenthPoints * 16);
298#include <immintrin.h>
301 const float* aVector,
302 const float* bVector,
303 unsigned int num_points)
305 const unsigned int eighthPoints = num_points / 8;
307 for (
unsigned int number = 0; number < eighthPoints; number++) {
308 __m256 aVal = _mm256_loadu_ps(aVector);
309 __m256 bVal = _mm256_loadu_ps(bVector);
311 __m256 cVal = _mm256_sub_ps(aVal, bVal);
313 _mm256_storeu_ps(cVector, cVal);
321 cVector, aVector, bVector, num_points - eighthPoints * 8);
326#include <riscv_vector.h>
328static inline void volk_32f_x2_subtract_32f_rvv(
float* cVector,
329 const float* aVector,
330 const float* bVector,
331 unsigned int num_points)
333 size_t n = num_points;
334 for (
size_t vl; n > 0; n -= vl, aVector += vl, bVector += vl, cVector += vl) {
335 vl = __riscv_vsetvl_e32m8(n);
336 vfloat32m8_t va = __riscv_vle32_v_f32m8(aVector, vl);
337 vfloat32m8_t vb = __riscv_vle32_v_f32m8(bVector, vl);
338 __riscv_vse32(cVector, __riscv_vfsub(va, vb, vl), vl);