59 #ifndef INCLUDED_volk_64f_x2_min_64f_a_H
60 #define INCLUDED_volk_64f_x2_min_64f_a_H
65 #ifdef LV_HAVE_AVX512F
66 #include <immintrin.h>
68 static inline void volk_64f_x2_min_64f_a_avx512f(
double* cVector,
69 const double* aVector,
70 const double* bVector,
71 unsigned int num_points)
73 unsigned int number = 0;
74 const unsigned int eigthPoints = num_points / 8;
76 double* cPtr = cVector;
77 const double* aPtr = aVector;
78 const double* bPtr = bVector;
80 __m512d aVal, bVal, cVal;
81 for (; number < eigthPoints; number++) {
83 aVal = _mm512_load_pd(aPtr);
84 bVal = _mm512_load_pd(bPtr);
86 cVal = _mm512_min_pd(aVal, bVal);
88 _mm512_store_pd(cPtr, cVal);
95 number = eigthPoints * 8;
96 for (; number < num_points; number++) {
97 const double a = *aPtr++;
98 const double b = *bPtr++;
99 *cPtr++ = (a < b ? a : b);
106 #include <immintrin.h>
109 const double* aVector,
110 const double* bVector,
111 unsigned int num_points)
113 unsigned int number = 0;
114 const unsigned int quarterPoints = num_points / 4;
116 double* cPtr = cVector;
117 const double* aPtr = aVector;
118 const double* bPtr = bVector;
120 __m256d aVal, bVal, cVal;
121 for (; number < quarterPoints; number++) {
123 aVal = _mm256_load_pd(aPtr);
124 bVal = _mm256_load_pd(bPtr);
126 cVal = _mm256_min_pd(aVal, bVal);
128 _mm256_store_pd(cPtr, cVal);
135 number = quarterPoints * 4;
136 for (; number < num_points; number++) {
137 const double a = *aPtr++;
138 const double b = *bPtr++;
139 *cPtr++ = (a < b ? a : b);
146 #include <emmintrin.h>
149 const double* aVector,
150 const double* bVector,
151 unsigned int num_points)
153 unsigned int number = 0;
154 const unsigned int halfPoints = num_points / 2;
156 double* cPtr = cVector;
157 const double* aPtr = aVector;
158 const double* bPtr = bVector;
161 for (; number < halfPoints; number++) {
175 number = halfPoints * 2;
176 for (; number < num_points; number++) {
177 const double a = *aPtr++;
178 const double b = *bPtr++;
179 *cPtr++ = (a < b ? a : b);
185 #ifdef LV_HAVE_GENERIC
188 const double* aVector,
189 const double* bVector,
190 unsigned int num_points)
192 double* cPtr = cVector;
193 const double* aPtr = aVector;
194 const double* bPtr = bVector;
195 unsigned int number = 0;
197 for (number = 0; number < num_points; number++) {
198 const double a = *aPtr++;
199 const double b = *bPtr++;
200 *cPtr++ = (a < b ? a : b);
208 #ifndef INCLUDED_volk_64f_x2_min_64f_u_H
209 #define INCLUDED_volk_64f_x2_min_64f_u_H
211 #include <inttypes.h>
214 #ifdef LV_HAVE_AVX512F
215 #include <immintrin.h>
217 static inline void volk_64f_x2_min_64f_u_avx512f(
double* cVector,
218 const double* aVector,
219 const double* bVector,
220 unsigned int num_points)
222 unsigned int number = 0;
223 const unsigned int eigthPoints = num_points / 8;
225 double* cPtr = cVector;
226 const double* aPtr = aVector;
227 const double* bPtr = bVector;
229 __m512d aVal, bVal, cVal;
230 for (; number < eigthPoints; number++) {
232 aVal = _mm512_loadu_pd(aPtr);
233 bVal = _mm512_loadu_pd(bPtr);
235 cVal = _mm512_min_pd(aVal, bVal);
237 _mm512_storeu_pd(cPtr, cVal);
244 number = eigthPoints * 8;
245 for (; number < num_points; number++) {
246 const double a = *aPtr++;
247 const double b = *bPtr++;
248 *cPtr++ = (a < b ? a : b);
255 #include <immintrin.h>
258 const double* aVector,
259 const double* bVector,
260 unsigned int num_points)
262 unsigned int number = 0;
263 const unsigned int quarterPoints = num_points / 4;
265 double* cPtr = cVector;
266 const double* aPtr = aVector;
267 const double* bPtr = bVector;
269 __m256d aVal, bVal, cVal;
270 for (; number < quarterPoints; number++) {
272 aVal = _mm256_loadu_pd(aPtr);
273 bVal = _mm256_loadu_pd(bPtr);
275 cVal = _mm256_min_pd(aVal, bVal);
277 _mm256_storeu_pd(cPtr, cVal);
284 number = quarterPoints * 4;
285 for (; number < num_points; number++) {
286 const double a = *aPtr++;
287 const double b = *bPtr++;
288 *cPtr++ = (a < b ? a : b);
FORCE_INLINE __m128d _mm_min_pd(__m128d a, __m128d b)
Definition: sse2neon.h:4705
FORCE_INLINE __m128d _mm_load_pd(const double *p)
Definition: sse2neon.h:4430
float32x4_t __m128d
Definition: sse2neon.h:242
FORCE_INLINE void _mm_store_pd(double *mem_addr, __m128d a)
Definition: sse2neon.h:5897
static void volk_64f_x2_min_64f_u_avx(double *cVector, const double *aVector, const double *bVector, unsigned int num_points)
Definition: volk_64f_x2_min_64f.h:257
static void volk_64f_x2_min_64f_a_sse2(double *cVector, const double *aVector, const double *bVector, unsigned int num_points)
Definition: volk_64f_x2_min_64f.h:148
static void volk_64f_x2_min_64f_a_avx(double *cVector, const double *aVector, const double *bVector, unsigned int num_points)
Definition: volk_64f_x2_min_64f.h:108
static void volk_64f_x2_min_64f_generic(double *cVector, const double *aVector, const double *bVector, unsigned int num_points)
Definition: volk_64f_x2_min_64f.h:187