10 #ifndef EIGEN_PACKET_MATH_AVX512_H 11 #define EIGEN_PACKET_MATH_AVX512_H 17 #ifndef EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 18 #define EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 8 21 #ifndef EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS 22 #define EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS (2*sizeof(void*)) 26 #ifndef EIGEN_HAS_SINGLE_INSTRUCTION_MADD 27 #define EIGEN_HAS_SINGLE_INSTRUCTION_MADD 57 #if EIGEN_GNUC_AT_LEAST(5, 3) 58 #ifdef EIGEN_VECTORIZE_AVX512DQ 77 #if EIGEN_GNUC_AT_LEAST(5, 3) 118 return _mm512_set1_ps(from);
122 return _mm512_set1_pd(from);
126 return _mm512_set1_epi32(from);
131 return _mm512_broadcastss_ps(_mm_load_ps1(from));
135 return _mm512_broadcastsd_pd(_mm_load_pd1(from));
140 return _mm512_add_ps(
142 _mm512_set_ps(15.0
f, 14.0
f, 13.0
f, 12.0
f, 11.0
f, 10.0
f, 9.0
f, 8.0
f, 7.0
f, 6.0
f, 5.0
f,
143 4.0
f, 3.0
f, 2.0
f, 1.0
f, 0.0
f));
147 return _mm512_add_pd(_mm512_set1_pd(a),
148 _mm512_set_pd(7.0, 6.0, 5.0, 4.0, 3.0, 2.0, 1.0, 0.0));
153 const Packet16f&
b) {
154 return _mm512_add_ps(a,
b);
159 return _mm512_add_pd(a,
b);
164 const Packet16f&
b) {
165 return _mm512_sub_ps(a,
b);
170 return _mm512_sub_pd(a,
b);
175 return _mm512_sub_ps(_mm512_set1_ps(0.0), a);
179 return _mm512_sub_pd(_mm512_set1_pd(0.0), a);
197 const Packet16f&
b) {
198 return _mm512_mul_ps(a,
b);
203 return _mm512_mul_pd(a,
b);
208 const Packet16f&
b) {
209 return _mm512_div_ps(a,
b);
214 return _mm512_div_pd(a,
b);
220 const Packet16f& c) {
221 return _mm512_fmadd_ps(a, b, c);
226 return _mm512_fmadd_pd(a, b, c);
232 const Packet16f&
b) {
233 return _mm512_min_ps(a, b);
238 return _mm512_min_pd(a, b);
243 const Packet16f&
b) {
244 return _mm512_max_ps(a, b);
249 return _mm512_max_pd(a, b);
254 const Packet16f&
b) {
255 #ifdef EIGEN_VECTORIZE_AVX512DQ 256 return _mm512_and_ps(a, b);
258 Packet16f res = _mm512_undefined_ps();
259 Packet4f lane0_a = _mm512_extractf32x4_ps(a, 0);
260 Packet4f lane0_b = _mm512_extractf32x4_ps(b, 0);
261 res = _mm512_insertf32x4(res, _mm_and_ps(lane0_a, lane0_b), 0);
263 Packet4f lane1_a = _mm512_extractf32x4_ps(a, 1);
264 Packet4f lane1_b = _mm512_extractf32x4_ps(b, 1);
265 res = _mm512_insertf32x4(res, _mm_and_ps(lane1_a, lane1_b), 1);
267 Packet4f lane2_a = _mm512_extractf32x4_ps(a, 2);
268 Packet4f lane2_b = _mm512_extractf32x4_ps(b, 2);
269 res = _mm512_insertf32x4(res, _mm_and_ps(lane2_a, lane2_b), 2);
271 Packet4f lane3_a = _mm512_extractf32x4_ps(a, 3);
272 Packet4f lane3_b = _mm512_extractf32x4_ps(b, 3);
273 res = _mm512_insertf32x4(res, _mm_and_ps(lane3_a, lane3_b), 3);
281 #ifdef EIGEN_VECTORIZE_AVX512DQ 282 return _mm512_and_pd(a, b);
284 Packet8d res = _mm512_undefined_pd();
285 Packet4d lane0_a = _mm512_extractf64x4_pd(a, 0);
286 Packet4d lane0_b = _mm512_extractf64x4_pd(b, 0);
287 res = _mm512_insertf64x4(res, _mm256_and_pd(lane0_a, lane0_b), 0);
289 Packet4d lane1_a = _mm512_extractf64x4_pd(a, 1);
290 Packet4d lane1_b = _mm512_extractf64x4_pd(b, 1);
291 res = _mm512_insertf64x4(res, _mm256_and_pd(lane1_a, lane1_b), 1);
298 const Packet16f&
b) {
299 #ifdef EIGEN_VECTORIZE_AVX512DQ 300 return _mm512_or_ps(a, b);
302 Packet16f res = _mm512_undefined_ps();
303 Packet4f lane0_a = _mm512_extractf32x4_ps(a, 0);
304 Packet4f lane0_b = _mm512_extractf32x4_ps(b, 0);
305 res = _mm512_insertf32x4(res, _mm_or_ps(lane0_a, lane0_b), 0);
307 Packet4f lane1_a = _mm512_extractf32x4_ps(a, 1);
308 Packet4f lane1_b = _mm512_extractf32x4_ps(b, 1);
309 res = _mm512_insertf32x4(res, _mm_or_ps(lane1_a, lane1_b), 1);
311 Packet4f lane2_a = _mm512_extractf32x4_ps(a, 2);
312 Packet4f lane2_b = _mm512_extractf32x4_ps(b, 2);
313 res = _mm512_insertf32x4(res, _mm_or_ps(lane2_a, lane2_b), 2);
315 Packet4f lane3_a = _mm512_extractf32x4_ps(a, 3);
316 Packet4f lane3_b = _mm512_extractf32x4_ps(b, 3);
317 res = _mm512_insertf32x4(res, _mm_or_ps(lane3_a, lane3_b), 3);
326 #ifdef EIGEN_VECTORIZE_AVX512DQ 327 return _mm512_or_pd(a, b);
329 Packet8d res = _mm512_undefined_pd();
330 Packet4d lane0_a = _mm512_extractf64x4_pd(a, 0);
331 Packet4d lane0_b = _mm512_extractf64x4_pd(b, 0);
332 res = _mm512_insertf64x4(res, _mm256_or_pd(lane0_a, lane0_b), 0);
334 Packet4d lane1_a = _mm512_extractf64x4_pd(a, 1);
335 Packet4d lane1_b = _mm512_extractf64x4_pd(b, 1);
336 res = _mm512_insertf64x4(res, _mm256_or_pd(lane1_a, lane1_b), 1);
344 const Packet16f&
b) {
345 #ifdef EIGEN_VECTORIZE_AVX512DQ 346 return _mm512_xor_ps(a, b);
348 Packet16f res = _mm512_undefined_ps();
349 Packet4f lane0_a = _mm512_extractf32x4_ps(a, 0);
350 Packet4f lane0_b = _mm512_extractf32x4_ps(b, 0);
351 res = _mm512_insertf32x4(res, _mm_xor_ps(lane0_a, lane0_b), 0);
353 Packet4f lane1_a = _mm512_extractf32x4_ps(a, 1);
354 Packet4f lane1_b = _mm512_extractf32x4_ps(b, 1);
355 res = _mm512_insertf32x4(res, _mm_xor_ps(lane1_a, lane1_b), 1);
357 Packet4f lane2_a = _mm512_extractf32x4_ps(a, 2);
358 Packet4f lane2_b = _mm512_extractf32x4_ps(b, 2);
359 res = _mm512_insertf32x4(res, _mm_xor_ps(lane2_a, lane2_b), 2);
361 Packet4f lane3_a = _mm512_extractf32x4_ps(a, 3);
362 Packet4f lane3_b = _mm512_extractf32x4_ps(b, 3);
363 res = _mm512_insertf32x4(res, _mm_xor_ps(lane3_a, lane3_b), 3);
371 #ifdef EIGEN_VECTORIZE_AVX512DQ 372 return _mm512_xor_pd(a, b);
374 Packet8d res = _mm512_undefined_pd();
375 Packet4d lane0_a = _mm512_extractf64x4_pd(a, 0);
376 Packet4d lane0_b = _mm512_extractf64x4_pd(b, 0);
377 res = _mm512_insertf64x4(res, _mm256_xor_pd(lane0_a, lane0_b), 0);
379 Packet4d lane1_a = _mm512_extractf64x4_pd(a, 1);
380 Packet4d lane1_b = _mm512_extractf64x4_pd(b, 1);
381 res = _mm512_insertf64x4(res, _mm256_xor_pd(lane1_a, lane1_b), 1);
389 const Packet16f&
b) {
390 #ifdef EIGEN_VECTORIZE_AVX512DQ 391 return _mm512_andnot_ps(a, b);
393 Packet16f res = _mm512_undefined_ps();
394 Packet4f lane0_a = _mm512_extractf32x4_ps(a, 0);
395 Packet4f lane0_b = _mm512_extractf32x4_ps(b, 0);
396 res = _mm512_insertf32x4(res, _mm_andnot_ps(lane0_a, lane0_b), 0);
398 Packet4f lane1_a = _mm512_extractf32x4_ps(a, 1);
399 Packet4f lane1_b = _mm512_extractf32x4_ps(b, 1);
400 res = _mm512_insertf32x4(res, _mm_andnot_ps(lane1_a, lane1_b), 1);
402 Packet4f lane2_a = _mm512_extractf32x4_ps(a, 2);
403 Packet4f lane2_b = _mm512_extractf32x4_ps(b, 2);
404 res = _mm512_insertf32x4(res, _mm_andnot_ps(lane2_a, lane2_b), 2);
406 Packet4f lane3_a = _mm512_extractf32x4_ps(a, 3);
407 Packet4f lane3_b = _mm512_extractf32x4_ps(b, 3);
408 res = _mm512_insertf32x4(res, _mm_andnot_ps(lane3_a, lane3_b), 3);
416 #ifdef EIGEN_VECTORIZE_AVX512DQ 417 return _mm512_andnot_pd(a, b);
419 Packet8d res = _mm512_undefined_pd();
420 Packet4d lane0_a = _mm512_extractf64x4_pd(a, 0);
421 Packet4d lane0_b = _mm512_extractf64x4_pd(b, 0);
422 res = _mm512_insertf64x4(res, _mm256_andnot_pd(lane0_a, lane0_b), 0);
424 Packet4d lane1_a = _mm512_extractf64x4_pd(a, 1);
425 Packet4d lane1_b = _mm512_extractf64x4_pd(b, 1);
426 res = _mm512_insertf64x4(res, _mm256_andnot_pd(lane1_a, lane1_b), 1);
443 reinterpret_cast<const __m512i*>(from));
457 reinterpret_cast<const __m512i*>(from));
464 Packet8f lane0 = _mm256_broadcast_ps((
const __m128*)(
const void*)from);
466 lane0 = _mm256_blend_ps(
467 lane0, _mm256_castps128_ps256(_mm_permute_ps(
468 _mm256_castps256_ps128(lane0), _MM_SHUFFLE(1, 0, 1, 0))),
472 lane0 = _mm256_permute_ps(lane0, _MM_SHUFFLE(3, 3, 2, 2));
474 Packet8f lane1 = _mm256_broadcast_ps((
const __m128*)(
const void*)(from + 4));
476 lane1 = _mm256_blend_ps(
477 lane1, _mm256_castps128_ps256(_mm_permute_ps(
478 _mm256_castps256_ps128(lane1), _MM_SHUFFLE(1, 0, 1, 0))),
482 lane1 = _mm256_permute_ps(lane1, _MM_SHUFFLE(3, 3, 2, 2));
484 #ifdef EIGEN_VECTORIZE_AVX512DQ 485 Packet16f res = _mm512_undefined_ps();
486 return _mm512_insertf32x8(res, lane0, 0);
487 return _mm512_insertf32x8(res, lane1, 1);
490 Packet16f res = _mm512_undefined_ps();
491 res = _mm512_insertf32x4(res, _mm256_extractf128_ps(lane0, 0), 0);
492 res = _mm512_insertf32x4(res, _mm256_extractf128_ps(lane0, 1), 1);
493 res = _mm512_insertf32x4(res, _mm256_extractf128_ps(lane1, 0), 2);
494 res = _mm512_insertf32x4(res, _mm256_extractf128_ps(lane1, 1), 3);
502 Packet4d lane0 = _mm256_broadcast_pd((
const __m128d*)(
const void*)from);
503 lane0 = _mm256_permute_pd(lane0, 3 << 2);
505 Packet4d lane1 = _mm256_broadcast_pd((
const __m128d*)(
const void*)(from + 2));
506 lane1 = _mm256_permute_pd(lane1, 3 << 2);
508 Packet8d res = _mm512_undefined_pd();
509 res = _mm512_insertf64x4(res, lane0, 0);
510 return _mm512_insertf64x4(res, lane1, 1);
517 Packet16f tmp = _mm512_undefined_ps();
518 tmp = _mm512_insertf32x4(tmp, _mm_load_ps1(from), 0);
519 tmp = _mm512_insertf32x4(tmp, _mm_load_ps1(from + 1), 1);
520 tmp = _mm512_insertf32x4(tmp, _mm_load_ps1(from + 2), 2);
521 tmp = _mm512_insertf32x4(tmp, _mm_load_ps1(from + 3), 3);
528 Packet8d tmp = _mm512_undefined_pd();
530 Packet2d tmp1 = _mm_load_pd1(from + 1);
531 Packet4d lane0 = _mm256_broadcastsd_pd(tmp0);
532 Packet4d lane1 = _mm256_broadcastsd_pd(tmp1);
533 tmp = _mm512_insertf64x4(tmp, lane0, 0);
534 return _mm512_insertf64x4(tmp, lane1, 1);
562 reinterpret_cast<__m512i*>(to), from);
568 Packet16i stride_vector = _mm512_set1_epi32(stride);
569 Packet16i stride_multiplier =
570 _mm512_set_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
571 Packet16i indices = _mm512_mullo_epi32(stride_vector, stride_multiplier);
573 return _mm512_i32gather_ps(indices, from, 4);
578 Packet8i stride_vector = _mm256_set1_epi32(stride);
579 Packet8i stride_multiplier = _mm256_set_epi32(7, 6, 5, 4, 3, 2, 1, 0);
580 Packet8i indices = _mm256_mullo_epi32(stride_vector, stride_multiplier);
582 return _mm512_i32gather_pd(indices, from, 8);
587 const Packet16f& from,
589 Packet16i stride_vector = _mm512_set1_epi32(stride);
590 Packet16i stride_multiplier =
591 _mm512_set_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
592 Packet16i indices = _mm512_mullo_epi32(stride_vector, stride_multiplier);
593 _mm512_i32scatter_ps(to, indices, from, 4);
597 const Packet8d& from,
599 Packet8i stride_vector = _mm256_set1_epi32(stride);
600 Packet8i stride_multiplier = _mm256_set_epi32(7, 6, 5, 4, 3, 2, 1, 0);
601 Packet8i indices = _mm256_mullo_epi32(stride_vector, stride_multiplier);
602 _mm512_i32scatter_pd(to, indices, from, 8);
627 return _mm_cvtss_f32(_mm512_extractf32x4_ps(a, 0));
631 return _mm_cvtsd_f64(_mm256_extractf128_pd(_mm512_extractf64x4_pd(a, 0), 0));
635 return _mm_extract_epi32(_mm512_extracti32x4_epi32(a, 0), 0);
640 return _mm512_permutexvar_ps(_mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15), a);
645 return _mm512_permutexvar_pd(_mm512_set_epi32(0, 0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7), a);
651 return (__m512)_mm512_and_si512((__m512i)a, _mm512_set1_epi32(0x7fffffff));
656 return (__m512d)_mm512_and_si512((__m512i)a,
657 _mm512_set1_epi64(0x7fffffffffffffff));
660 #ifdef EIGEN_VECTORIZE_AVX512DQ 662 #define EIGEN_EXTRACT_8f_FROM_16f(INPUT, OUTPUT) \ 663 __m256 OUTPUT##_0 = _mm512_extractf32x8_ps(INPUT, 0) __m256 OUTPUT##_1 = \ 664 _mm512_extractf32x8_ps(INPUT, 1) 666 #define EIGEN_EXTRACT_8f_FROM_16f(INPUT, OUTPUT) \ 667 __m256 OUTPUT##_0 = _mm256_insertf128_ps( \ 668 _mm256_castps128_ps256(_mm512_extractf32x4_ps(INPUT, 0)), \ 669 _mm512_extractf32x4_ps(INPUT, 1), 1); \ 670 __m256 OUTPUT##_1 = _mm256_insertf128_ps( \ 671 _mm256_castps128_ps256(_mm512_extractf32x4_ps(INPUT, 2)), \ 672 _mm512_extractf32x4_ps(INPUT, 3), 1); 675 #ifdef EIGEN_VECTORIZE_AVX512DQ 676 #define EIGEN_INSERT_8f_INTO_16f(OUTPUT, INPUTA, INPUTB) \ 677 OUTPUT = _mm512_insertf32x8(OUTPUT, INPUTA, 0); \ 678 OUTPUT = _mm512_insertf32x8(OUTPUT, INPUTB, 1); 680 #define EIGEN_INSERT_8f_INTO_16f(OUTPUT, INPUTA, INPUTB) \ 681 OUTPUT = _mm512_insertf32x4(OUTPUT, _mm256_extractf128_ps(INPUTA, 0), 0); \ 682 OUTPUT = _mm512_insertf32x4(OUTPUT, _mm256_extractf128_ps(INPUTA, 1), 1); \ 683 OUTPUT = _mm512_insertf32x4(OUTPUT, _mm256_extractf128_ps(INPUTB, 0), 2); \ 684 OUTPUT = _mm512_insertf32x4(OUTPUT, _mm256_extractf128_ps(INPUTB, 1), 3); 706 __m256 hsum1 = _mm256_hadd_ps(vecs0_0, vecs1_0);
707 __m256 hsum2 = _mm256_hadd_ps(vecs2_0, vecs3_0);
708 __m256 hsum3 = _mm256_hadd_ps(vecs4_0, vecs5_0);
709 __m256 hsum4 = _mm256_hadd_ps(vecs6_0, vecs7_0);
711 __m256 hsum5 = _mm256_hadd_ps(hsum1, hsum1);
712 __m256 hsum6 = _mm256_hadd_ps(hsum2, hsum2);
713 __m256 hsum7 = _mm256_hadd_ps(hsum3, hsum3);
714 __m256 hsum8 = _mm256_hadd_ps(hsum4, hsum4);
716 __m256 perm1 = _mm256_permute2f128_ps(hsum5, hsum5, 0x23);
717 __m256 perm2 = _mm256_permute2f128_ps(hsum6, hsum6, 0x23);
718 __m256 perm3 = _mm256_permute2f128_ps(hsum7, hsum7, 0x23);
719 __m256 perm4 = _mm256_permute2f128_ps(hsum8, hsum8, 0x23);
721 __m256 sum1 = _mm256_add_ps(perm1, hsum5);
722 __m256 sum2 = _mm256_add_ps(perm2, hsum6);
723 __m256 sum3 = _mm256_add_ps(perm3, hsum7);
724 __m256 sum4 = _mm256_add_ps(perm4, hsum8);
726 __m256 blend1 = _mm256_blend_ps(sum1, sum2, 0xcc);
727 __m256 blend2 = _mm256_blend_ps(sum3, sum4, 0xcc);
729 __m256
final = _mm256_blend_ps(blend1, blend2, 0xf0);
731 hsum1 = _mm256_hadd_ps(vecs0_1, vecs1_1);
732 hsum2 = _mm256_hadd_ps(vecs2_1, vecs3_1);
733 hsum3 = _mm256_hadd_ps(vecs4_1, vecs5_1);
734 hsum4 = _mm256_hadd_ps(vecs6_1, vecs7_1);
736 hsum5 = _mm256_hadd_ps(hsum1, hsum1);
737 hsum6 = _mm256_hadd_ps(hsum2, hsum2);
738 hsum7 = _mm256_hadd_ps(hsum3, hsum3);
739 hsum8 = _mm256_hadd_ps(hsum4, hsum4);
741 perm1 = _mm256_permute2f128_ps(hsum5, hsum5, 0x23);
742 perm2 = _mm256_permute2f128_ps(hsum6, hsum6, 0x23);
743 perm3 = _mm256_permute2f128_ps(hsum7, hsum7, 0x23);
744 perm4 = _mm256_permute2f128_ps(hsum8, hsum8, 0x23);
746 sum1 = _mm256_add_ps(perm1, hsum5);
747 sum2 = _mm256_add_ps(perm2, hsum6);
748 sum3 = _mm256_add_ps(perm3, hsum7);
749 sum4 = _mm256_add_ps(perm4, hsum8);
751 blend1 = _mm256_blend_ps(sum1, sum2, 0xcc);
752 blend2 = _mm256_blend_ps(sum3, sum4, 0xcc);
754 final =
padd(
final, _mm256_blend_ps(blend1, blend2, 0xf0));
756 hsum1 = _mm256_hadd_ps(vecs8_0, vecs9_0);
757 hsum2 = _mm256_hadd_ps(vecs10_0, vecs11_0);
758 hsum3 = _mm256_hadd_ps(vecs12_0, vecs13_0);
759 hsum4 = _mm256_hadd_ps(vecs14_0, vecs15_0);
761 hsum5 = _mm256_hadd_ps(hsum1, hsum1);
762 hsum6 = _mm256_hadd_ps(hsum2, hsum2);
763 hsum7 = _mm256_hadd_ps(hsum3, hsum3);
764 hsum8 = _mm256_hadd_ps(hsum4, hsum4);
766 perm1 = _mm256_permute2f128_ps(hsum5, hsum5, 0x23);
767 perm2 = _mm256_permute2f128_ps(hsum6, hsum6, 0x23);
768 perm3 = _mm256_permute2f128_ps(hsum7, hsum7, 0x23);
769 perm4 = _mm256_permute2f128_ps(hsum8, hsum8, 0x23);
771 sum1 = _mm256_add_ps(perm1, hsum5);
772 sum2 = _mm256_add_ps(perm2, hsum6);
773 sum3 = _mm256_add_ps(perm3, hsum7);
774 sum4 = _mm256_add_ps(perm4, hsum8);
776 blend1 = _mm256_blend_ps(sum1, sum2, 0xcc);
777 blend2 = _mm256_blend_ps(sum3, sum4, 0xcc);
779 __m256 final_1 = _mm256_blend_ps(blend1, blend2, 0xf0);
781 hsum1 = _mm256_hadd_ps(vecs8_1, vecs9_1);
782 hsum2 = _mm256_hadd_ps(vecs10_1, vecs11_1);
783 hsum3 = _mm256_hadd_ps(vecs12_1, vecs13_1);
784 hsum4 = _mm256_hadd_ps(vecs14_1, vecs15_1);
786 hsum5 = _mm256_hadd_ps(hsum1, hsum1);
787 hsum6 = _mm256_hadd_ps(hsum2, hsum2);
788 hsum7 = _mm256_hadd_ps(hsum3, hsum3);
789 hsum8 = _mm256_hadd_ps(hsum4, hsum4);
791 perm1 = _mm256_permute2f128_ps(hsum5, hsum5, 0x23);
792 perm2 = _mm256_permute2f128_ps(hsum6, hsum6, 0x23);
793 perm3 = _mm256_permute2f128_ps(hsum7, hsum7, 0x23);
794 perm4 = _mm256_permute2f128_ps(hsum8, hsum8, 0x23);
796 sum1 = _mm256_add_ps(perm1, hsum5);
797 sum2 = _mm256_add_ps(perm2, hsum6);
798 sum3 = _mm256_add_ps(perm3, hsum7);
799 sum4 = _mm256_add_ps(perm4, hsum8);
801 blend1 = _mm256_blend_ps(sum1, sum2, 0xcc);
802 blend2 = _mm256_blend_ps(sum3, sum4, 0xcc);
804 final_1 =
padd(final_1, _mm256_blend_ps(blend1, blend2, 0xf0));
814 Packet4d vecs0_0 = _mm512_extractf64x4_pd(vecs[0], 0);
815 Packet4d vecs0_1 = _mm512_extractf64x4_pd(vecs[0], 1);
817 Packet4d vecs1_0 = _mm512_extractf64x4_pd(vecs[1], 0);
818 Packet4d vecs1_1 = _mm512_extractf64x4_pd(vecs[1], 1);
820 Packet4d vecs2_0 = _mm512_extractf64x4_pd(vecs[2], 0);
821 Packet4d vecs2_1 = _mm512_extractf64x4_pd(vecs[2], 1);
823 Packet4d vecs3_0 = _mm512_extractf64x4_pd(vecs[3], 0);
824 Packet4d vecs3_1 = _mm512_extractf64x4_pd(vecs[3], 1);
826 Packet4d vecs4_0 = _mm512_extractf64x4_pd(vecs[4], 0);
827 Packet4d vecs4_1 = _mm512_extractf64x4_pd(vecs[4], 1);
829 Packet4d vecs5_0 = _mm512_extractf64x4_pd(vecs[5], 0);
830 Packet4d vecs5_1 = _mm512_extractf64x4_pd(vecs[5], 1);
832 Packet4d vecs6_0 = _mm512_extractf64x4_pd(vecs[6], 0);
833 Packet4d vecs6_1 = _mm512_extractf64x4_pd(vecs[6], 1);
835 Packet4d vecs7_0 = _mm512_extractf64x4_pd(vecs[7], 0);
836 Packet4d vecs7_1 = _mm512_extractf64x4_pd(vecs[7], 1);
840 tmp0 = _mm256_hadd_pd(vecs0_0, vecs1_0);
841 tmp0 = _mm256_add_pd(tmp0, _mm256_permute2f128_pd(tmp0, tmp0, 1));
843 tmp1 = _mm256_hadd_pd(vecs2_0, vecs3_0);
844 tmp1 = _mm256_add_pd(tmp1, _mm256_permute2f128_pd(tmp1, tmp1, 1));
846 __m256d final_0 = _mm256_blend_pd(tmp0, tmp1, 0xC);
848 tmp0 = _mm256_hadd_pd(vecs0_1, vecs1_1);
849 tmp0 = _mm256_add_pd(tmp0, _mm256_permute2f128_pd(tmp0, tmp0, 1));
851 tmp1 = _mm256_hadd_pd(vecs2_1, vecs3_1);
852 tmp1 = _mm256_add_pd(tmp1, _mm256_permute2f128_pd(tmp1, tmp1, 1));
854 final_0 =
padd(final_0, _mm256_blend_pd(tmp0, tmp1, 0xC));
856 tmp0 = _mm256_hadd_pd(vecs4_0, vecs5_0);
857 tmp0 = _mm256_add_pd(tmp0, _mm256_permute2f128_pd(tmp0, tmp0, 1));
859 tmp1 = _mm256_hadd_pd(vecs6_0, vecs7_0);
860 tmp1 = _mm256_add_pd(tmp1, _mm256_permute2f128_pd(tmp1, tmp1, 1));
862 __m256d final_1 = _mm256_blend_pd(tmp0, tmp1, 0xC);
864 tmp0 = _mm256_hadd_pd(vecs4_1, vecs5_1);
865 tmp0 = _mm256_add_pd(tmp0, _mm256_permute2f128_pd(tmp0, tmp0, 1));
867 tmp1 = _mm256_hadd_pd(vecs6_1, vecs7_1);
868 tmp1 = _mm256_add_pd(tmp1, _mm256_permute2f128_pd(tmp1, tmp1, 1));
870 final_1 =
padd(final_1, _mm256_blend_pd(tmp0, tmp1, 0xC));
872 __m512d final_output = _mm512_insertf64x4(final_output, final_0, 0);
874 return _mm512_insertf64x4(final_output, final_1, 1);
881 Packet8f lane0 = _mm512_extractf32x8_ps(a, 0);
882 Packet8f lane1 = _mm512_extractf32x8_ps(a, 1);
884 Packet8f tmp0 = _mm256_hadd_ps(sum, _mm256_permute2f128_ps(a, a, 1));
885 tmp0 = _mm256_hadd_ps(tmp0, tmp0);
886 return pfirst(_mm256_hadd_ps(tmp0, tmp0));
888 Packet4f lane0 = _mm512_extractf32x4_ps(a, 0);
889 Packet4f lane1 = _mm512_extractf32x4_ps(a, 1);
890 Packet4f lane2 = _mm512_extractf32x4_ps(a, 2);
891 Packet4f lane3 = _mm512_extractf32x4_ps(a, 3);
893 sum = _mm_hadd_ps(sum, sum);
894 sum = _mm_hadd_ps(sum, _mm_permute_ps(sum, 1));
900 Packet4d lane0 = _mm512_extractf64x4_pd(a, 0);
901 Packet4d lane1 = _mm512_extractf64x4_pd(a, 1);
903 Packet4d tmp0 = _mm256_hadd_pd(sum, _mm256_permute2f128_pd(sum, sum, 1));
904 return pfirst(_mm256_hadd_pd(tmp0, tmp0));
909 #ifdef EIGEN_VECTORIZE_AVX512DQ 910 Packet8f lane0 = _mm512_extractf32x8_ps(a, 0);
911 Packet8f lane1 = _mm512_extractf32x8_ps(a, 1);
912 return padd(lane0, lane1);
914 Packet4f lane0 = _mm512_extractf32x4_ps(a, 0);
915 Packet4f lane1 = _mm512_extractf32x4_ps(a, 1);
916 Packet4f lane2 = _mm512_extractf32x4_ps(a, 2);
917 Packet4f lane3 = _mm512_extractf32x4_ps(a, 3);
920 return _mm256_insertf128_ps(_mm256_castps128_ps256(sum0), sum1, 1);
925 Packet4d lane0 = _mm512_extractf64x4_pd(a, 0);
926 Packet4d lane1 = _mm512_extractf64x4_pd(a, 1);
935 Packet8f lane0 = _mm512_extractf32x8_ps(a, 0);
936 Packet8f lane1 = _mm512_extractf32x8_ps(a, 1);
938 res =
pmul(res, _mm256_permute2f128_ps(res, res, 1));
939 res =
pmul(res, _mm_permute_ps(res, _MM_SHUFFLE(0, 0, 3, 2)));
940 return pfirst(
pmul(res, _mm_permute_ps(res, _MM_SHUFFLE(0, 0, 0, 1))));
942 Packet4f lane0 = _mm512_extractf32x4_ps(a, 0);
943 Packet4f lane1 = _mm512_extractf32x4_ps(a, 1);
944 Packet4f lane2 = _mm512_extractf32x4_ps(a, 2);
945 Packet4f lane3 = _mm512_extractf32x4_ps(a, 3);
947 res =
pmul(res, _mm_permute_ps(res, _MM_SHUFFLE(0, 0, 3, 2)));
948 return pfirst(
pmul(res, _mm_permute_ps(res, _MM_SHUFFLE(0, 0, 0, 1))));
953 Packet4d lane0 = _mm512_extractf64x4_pd(a, 0);
954 Packet4d lane1 = _mm512_extractf64x4_pd(a, 1);
956 res =
pmul(res, _mm256_permute2f128_pd(res, res, 1));
957 return pfirst(
pmul(res, _mm256_shuffle_pd(res, res, 1)));
962 Packet4f lane0 = _mm512_extractf32x4_ps(a, 0);
963 Packet4f lane1 = _mm512_extractf32x4_ps(a, 1);
964 Packet4f lane2 = _mm512_extractf32x4_ps(a, 2);
965 Packet4f lane3 = _mm512_extractf32x4_ps(a, 3);
966 Packet4f res = _mm_min_ps(_mm_min_ps(lane0, lane1), _mm_min_ps(lane2, lane3));
967 res = _mm_min_ps(res, _mm_permute_ps(res, _MM_SHUFFLE(0, 0, 3, 2)));
968 return pfirst(_mm_min_ps(res, _mm_permute_ps(res, _MM_SHUFFLE(0, 0, 0, 1))));
972 Packet4d lane0 = _mm512_extractf64x4_pd(a, 0);
973 Packet4d lane1 = _mm512_extractf64x4_pd(a, 1);
974 Packet4d res = _mm256_min_pd(lane0, lane1);
975 res = _mm256_min_pd(res, _mm256_permute2f128_pd(res, res, 1));
976 return pfirst(_mm256_min_pd(res, _mm256_shuffle_pd(res, res, 1)));
981 Packet4f lane0 = _mm512_extractf32x4_ps(a, 0);
982 Packet4f lane1 = _mm512_extractf32x4_ps(a, 1);
983 Packet4f lane2 = _mm512_extractf32x4_ps(a, 2);
984 Packet4f lane3 = _mm512_extractf32x4_ps(a, 3);
985 Packet4f res = _mm_max_ps(_mm_max_ps(lane0, lane1), _mm_max_ps(lane2, lane3));
986 res = _mm_max_ps(res, _mm_permute_ps(res, _MM_SHUFFLE(0, 0, 3, 2)));
987 return pfirst(_mm_max_ps(res, _mm_permute_ps(res, _MM_SHUFFLE(0, 0, 0, 1))));
991 Packet4d lane0 = _mm512_extractf64x4_pd(a, 0);
992 Packet4d lane1 = _mm512_extractf64x4_pd(a, 1);
993 Packet4d res = _mm256_max_pd(lane0, lane1);
994 res = _mm256_max_pd(res, _mm256_permute2f128_pd(res, res, 1));
995 return pfirst(_mm256_max_pd(res, _mm256_shuffle_pd(res, res, 1)));
998 template <
int Offset>
1001 const Packet16f& second) {
1003 __m512i first_idx = _mm512_set_epi32(
1004 Offset + 15, Offset + 14, Offset + 13, Offset + 12, Offset + 11,
1005 Offset + 10, Offset + 9, Offset + 8, Offset + 7, Offset + 6,
1006 Offset + 5, Offset + 4, Offset + 3, Offset + 2, Offset + 1, Offset);
1008 __m512i second_idx =
1009 _mm512_set_epi32(Offset - 1, Offset - 2, Offset - 3, Offset - 4,
1010 Offset - 5, Offset - 6, Offset - 7, Offset - 8,
1011 Offset - 9, Offset - 10, Offset - 11, Offset - 12,
1012 Offset - 13, Offset - 14, Offset - 15, Offset - 16);
1014 unsigned short mask = 0xFFFF;
1015 mask <<= (16 - Offset);
1017 first = _mm512_permutexvar_ps(first_idx, first);
1018 Packet16f tmp = _mm512_permutexvar_ps(second_idx, second);
1019 first = _mm512_mask_blend_ps(mask, first, tmp);
1023 template <
int Offset>
1027 __m512i first_idx = _mm512_set_epi32(
1028 0, Offset + 7, 0, Offset + 6, 0, Offset + 5, 0, Offset + 4, 0,
1029 Offset + 3, 0, Offset + 2, 0, Offset + 1, 0, Offset);
1031 __m512i second_idx = _mm512_set_epi32(
1032 0, Offset - 1, 0, Offset - 2, 0, Offset - 3, 0, Offset - 4, 0,
1033 Offset - 5, 0, Offset - 6, 0, Offset - 7, 0, Offset - 8);
1035 unsigned char mask = 0xFF;
1036 mask <<= (8 - Offset);
1038 first = _mm512_permutexvar_pd(first_idx, first);
1039 Packet8d tmp = _mm512_permutexvar_pd(second_idx, second);
1040 first = _mm512_mask_blend_pd(mask, first, tmp);
1046 #define PACK_OUTPUT(OUTPUT, INPUT, INDEX, STRIDE) \ 1047 EIGEN_INSERT_8f_INTO_16f(OUTPUT[INDEX], INPUT[INDEX], INPUT[INDEX + STRIDE]); 1050 __m512 T0 = _mm512_unpacklo_ps(kernel.
packet[0], kernel.
packet[1]);
1051 __m512 T1 = _mm512_unpackhi_ps(kernel.
packet[0], kernel.
packet[1]);
1052 __m512 T2 = _mm512_unpacklo_ps(kernel.
packet[2], kernel.
packet[3]);
1053 __m512 T3 = _mm512_unpackhi_ps(kernel.
packet[2], kernel.
packet[3]);
1054 __m512 T4 = _mm512_unpacklo_ps(kernel.
packet[4], kernel.
packet[5]);
1055 __m512 T5 = _mm512_unpackhi_ps(kernel.
packet[4], kernel.
packet[5]);
1056 __m512 T6 = _mm512_unpacklo_ps(kernel.
packet[6], kernel.
packet[7]);
1057 __m512 T7 = _mm512_unpackhi_ps(kernel.
packet[6], kernel.
packet[7]);
1058 __m512 T8 = _mm512_unpacklo_ps(kernel.
packet[8], kernel.
packet[9]);
1059 __m512 T9 = _mm512_unpackhi_ps(kernel.
packet[8], kernel.
packet[9]);
1060 __m512 T10 = _mm512_unpacklo_ps(kernel.
packet[10], kernel.
packet[11]);
1061 __m512 T11 = _mm512_unpackhi_ps(kernel.
packet[10], kernel.
packet[11]);
1062 __m512 T12 = _mm512_unpacklo_ps(kernel.
packet[12], kernel.
packet[13]);
1063 __m512 T13 = _mm512_unpackhi_ps(kernel.
packet[12], kernel.
packet[13]);
1064 __m512 T14 = _mm512_unpacklo_ps(kernel.
packet[14], kernel.
packet[15]);
1065 __m512 T15 = _mm512_unpackhi_ps(kernel.
packet[14], kernel.
packet[15]);
1066 __m512 S0 = _mm512_shuffle_ps(T0, T2, _MM_SHUFFLE(1, 0, 1, 0));
1067 __m512 S1 = _mm512_shuffle_ps(T0, T2, _MM_SHUFFLE(3, 2, 3, 2));
1068 __m512 S2 = _mm512_shuffle_ps(T1, T3, _MM_SHUFFLE(1, 0, 1, 0));
1069 __m512 S3 = _mm512_shuffle_ps(T1, T3, _MM_SHUFFLE(3, 2, 3, 2));
1070 __m512 S4 = _mm512_shuffle_ps(T4, T6, _MM_SHUFFLE(1, 0, 1, 0));
1071 __m512 S5 = _mm512_shuffle_ps(T4, T6, _MM_SHUFFLE(3, 2, 3, 2));
1072 __m512 S6 = _mm512_shuffle_ps(T5, T7, _MM_SHUFFLE(1, 0, 1, 0));
1073 __m512 S7 = _mm512_shuffle_ps(T5, T7, _MM_SHUFFLE(3, 2, 3, 2));
1074 __m512 S8 = _mm512_shuffle_ps(T8, T10, _MM_SHUFFLE(1, 0, 1, 0));
1075 __m512 S9 = _mm512_shuffle_ps(T8, T10, _MM_SHUFFLE(3, 2, 3, 2));
1076 __m512 S10 = _mm512_shuffle_ps(T9, T11, _MM_SHUFFLE(1, 0, 1, 0));
1077 __m512 S11 = _mm512_shuffle_ps(T9, T11, _MM_SHUFFLE(3, 2, 3, 2));
1078 __m512 S12 = _mm512_shuffle_ps(T12, T14, _MM_SHUFFLE(1, 0, 1, 0));
1079 __m512 S13 = _mm512_shuffle_ps(T12, T14, _MM_SHUFFLE(3, 2, 3, 2));
1080 __m512 S14 = _mm512_shuffle_ps(T13, T15, _MM_SHUFFLE(1, 0, 1, 0));
1081 __m512 S15 = _mm512_shuffle_ps(T13, T15, _MM_SHUFFLE(3, 2, 3, 2));
1102 tmp.
packet[0] = _mm256_permute2f128_ps(S0_0, S4_0, 0x20);
1103 tmp.
packet[1] = _mm256_permute2f128_ps(S1_0, S5_0, 0x20);
1104 tmp.
packet[2] = _mm256_permute2f128_ps(S2_0, S6_0, 0x20);
1105 tmp.
packet[3] = _mm256_permute2f128_ps(S3_0, S7_0, 0x20);
1106 tmp.
packet[4] = _mm256_permute2f128_ps(S0_0, S4_0, 0x31);
1107 tmp.
packet[5] = _mm256_permute2f128_ps(S1_0, S5_0, 0x31);
1108 tmp.
packet[6] = _mm256_permute2f128_ps(S2_0, S6_0, 0x31);
1109 tmp.
packet[7] = _mm256_permute2f128_ps(S3_0, S7_0, 0x31);
1111 tmp.
packet[8] = _mm256_permute2f128_ps(S0_1, S4_1, 0x20);
1112 tmp.
packet[9] = _mm256_permute2f128_ps(S1_1, S5_1, 0x20);
1113 tmp.
packet[10] = _mm256_permute2f128_ps(S2_1, S6_1, 0x20);
1114 tmp.
packet[11] = _mm256_permute2f128_ps(S3_1, S7_1, 0x20);
1115 tmp.
packet[12] = _mm256_permute2f128_ps(S0_1, S4_1, 0x31);
1116 tmp.
packet[13] = _mm256_permute2f128_ps(S1_1, S5_1, 0x31);
1117 tmp.
packet[14] = _mm256_permute2f128_ps(S2_1, S6_1, 0x31);
1118 tmp.
packet[15] = _mm256_permute2f128_ps(S3_1, S7_1, 0x31);
1121 tmp.
packet[16] = _mm256_permute2f128_ps(S8_0, S12_0, 0x20);
1122 tmp.
packet[17] = _mm256_permute2f128_ps(S9_0, S13_0, 0x20);
1123 tmp.
packet[18] = _mm256_permute2f128_ps(S10_0, S14_0, 0x20);
1124 tmp.
packet[19] = _mm256_permute2f128_ps(S11_0, S15_0, 0x20);
1125 tmp.
packet[20] = _mm256_permute2f128_ps(S8_0, S12_0, 0x31);
1126 tmp.
packet[21] = _mm256_permute2f128_ps(S9_0, S13_0, 0x31);
1127 tmp.
packet[22] = _mm256_permute2f128_ps(S10_0, S14_0, 0x31);
1128 tmp.
packet[23] = _mm256_permute2f128_ps(S11_0, S15_0, 0x31);
1130 tmp.
packet[24] = _mm256_permute2f128_ps(S8_1, S12_1, 0x20);
1131 tmp.
packet[25] = _mm256_permute2f128_ps(S9_1, S13_1, 0x20);
1132 tmp.
packet[26] = _mm256_permute2f128_ps(S10_1, S14_1, 0x20);
1133 tmp.
packet[27] = _mm256_permute2f128_ps(S11_1, S15_1, 0x20);
1134 tmp.
packet[28] = _mm256_permute2f128_ps(S8_1, S12_1, 0x31);
1135 tmp.
packet[29] = _mm256_permute2f128_ps(S9_1, S13_1, 0x31);
1136 tmp.
packet[30] = _mm256_permute2f128_ps(S10_1, S14_1, 0x31);
1137 tmp.
packet[31] = _mm256_permute2f128_ps(S11_1, S15_1, 0x31);
1160 #define PACK_OUTPUT_2(OUTPUT, INPUT, INDEX, STRIDE) \ 1161 EIGEN_INSERT_8f_INTO_16f(OUTPUT[INDEX], INPUT[2 * INDEX], \ 1162 INPUT[2 * INDEX + STRIDE]); 1165 __m512 T0 = _mm512_unpacklo_ps(kernel.
packet[0], kernel.
packet[1]);
1166 __m512 T1 = _mm512_unpackhi_ps(kernel.
packet[0], kernel.
packet[1]);
1167 __m512 T2 = _mm512_unpacklo_ps(kernel.
packet[2], kernel.
packet[3]);
1168 __m512 T3 = _mm512_unpackhi_ps(kernel.
packet[2], kernel.
packet[3]);
1170 __m512 S0 = _mm512_shuffle_ps(T0, T2, _MM_SHUFFLE(1, 0, 1, 0));
1171 __m512 S1 = _mm512_shuffle_ps(T0, T2, _MM_SHUFFLE(3, 2, 3, 2));
1172 __m512 S2 = _mm512_shuffle_ps(T1, T3, _MM_SHUFFLE(1, 0, 1, 0));
1173 __m512 S3 = _mm512_shuffle_ps(T1, T3, _MM_SHUFFLE(3, 2, 3, 2));
1182 tmp.
packet[0] = _mm256_permute2f128_ps(S0_0, S1_0, 0x20);
1183 tmp.
packet[1] = _mm256_permute2f128_ps(S2_0, S3_0, 0x20);
1184 tmp.
packet[2] = _mm256_permute2f128_ps(S0_0, S1_0, 0x31);
1185 tmp.
packet[3] = _mm256_permute2f128_ps(S2_0, S3_0, 0x31);
1187 tmp.
packet[4] = _mm256_permute2f128_ps(S0_1, S1_1, 0x20);
1188 tmp.
packet[5] = _mm256_permute2f128_ps(S2_1, S3_1, 0x20);
1189 tmp.
packet[6] = _mm256_permute2f128_ps(S0_1, S1_1, 0x31);
1190 tmp.
packet[7] = _mm256_permute2f128_ps(S2_1, S3_1, 0x31);
1198 #define PACK_OUTPUT_SQ_D(OUTPUT, INPUT, INDEX, STRIDE) \ 1199 OUTPUT[INDEX] = _mm512_insertf64x4(OUTPUT[INDEX], INPUT[INDEX], 0); \ 1200 OUTPUT[INDEX] = _mm512_insertf64x4(OUTPUT[INDEX], INPUT[INDEX + STRIDE], 1); 1202 #define PACK_OUTPUT_D(OUTPUT, INPUT, INDEX, STRIDE) \ 1203 OUTPUT[INDEX] = _mm512_insertf64x4(OUTPUT[INDEX], INPUT[(2 * INDEX)], 0); \ 1205 _mm512_insertf64x4(OUTPUT[INDEX], INPUT[(2 * INDEX) + STRIDE], 1); 1208 __m512d T0 = _mm512_shuffle_pd(kernel.
packet[0], kernel.
packet[1], 0);
1209 __m512d T1 = _mm512_shuffle_pd(kernel.
packet[0], kernel.
packet[1], 0xff);
1210 __m512d T2 = _mm512_shuffle_pd(kernel.
packet[2], kernel.
packet[3], 0);
1211 __m512d T3 = _mm512_shuffle_pd(kernel.
packet[2], kernel.
packet[3], 0xff);
1215 tmp.
packet[0] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T0, 0),
1216 _mm512_extractf64x4_pd(T2, 0), 0x20);
1217 tmp.
packet[1] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T1, 0),
1218 _mm512_extractf64x4_pd(T3, 0), 0x20);
1219 tmp.
packet[2] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T0, 0),
1220 _mm512_extractf64x4_pd(T2, 0), 0x31);
1221 tmp.
packet[3] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T1, 0),
1222 _mm512_extractf64x4_pd(T3, 0), 0x31);
1224 tmp.
packet[4] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T0, 1),
1225 _mm512_extractf64x4_pd(T2, 1), 0x20);
1226 tmp.
packet[5] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T1, 1),
1227 _mm512_extractf64x4_pd(T3, 1), 0x20);
1228 tmp.
packet[6] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T0, 1),
1229 _mm512_extractf64x4_pd(T2, 1), 0x31);
1230 tmp.
packet[7] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T1, 1),
1231 _mm512_extractf64x4_pd(T3, 1), 0x31);
1240 __m512d T0 = _mm512_unpacklo_pd(kernel.
packet[0], kernel.
packet[1]);
1241 __m512d T1 = _mm512_unpackhi_pd(kernel.
packet[0], kernel.
packet[1]);
1242 __m512d T2 = _mm512_unpacklo_pd(kernel.
packet[2], kernel.
packet[3]);
1243 __m512d T3 = _mm512_unpackhi_pd(kernel.
packet[2], kernel.
packet[3]);
1244 __m512d T4 = _mm512_unpacklo_pd(kernel.
packet[4], kernel.
packet[5]);
1245 __m512d T5 = _mm512_unpackhi_pd(kernel.
packet[4], kernel.
packet[5]);
1246 __m512d T6 = _mm512_unpacklo_pd(kernel.
packet[6], kernel.
packet[7]);
1247 __m512d T7 = _mm512_unpackhi_pd(kernel.
packet[6], kernel.
packet[7]);
1251 tmp.
packet[0] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T0, 0),
1252 _mm512_extractf64x4_pd(T2, 0), 0x20);
1253 tmp.
packet[1] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T1, 0),
1254 _mm512_extractf64x4_pd(T3, 0), 0x20);
1255 tmp.
packet[2] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T0, 0),
1256 _mm512_extractf64x4_pd(T2, 0), 0x31);
1257 tmp.
packet[3] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T1, 0),
1258 _mm512_extractf64x4_pd(T3, 0), 0x31);
1260 tmp.
packet[4] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T0, 1),
1261 _mm512_extractf64x4_pd(T2, 1), 0x20);
1262 tmp.
packet[5] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T1, 1),
1263 _mm512_extractf64x4_pd(T3, 1), 0x20);
1264 tmp.
packet[6] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T0, 1),
1265 _mm512_extractf64x4_pd(T2, 1), 0x31);
1266 tmp.
packet[7] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T1, 1),
1267 _mm512_extractf64x4_pd(T3, 1), 0x31);
1269 tmp.
packet[8] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T4, 0),
1270 _mm512_extractf64x4_pd(T6, 0), 0x20);
1271 tmp.
packet[9] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T5, 0),
1272 _mm512_extractf64x4_pd(T7, 0), 0x20);
1273 tmp.
packet[10] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T4, 0),
1274 _mm512_extractf64x4_pd(T6, 0), 0x31);
1275 tmp.
packet[11] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T5, 0),
1276 _mm512_extractf64x4_pd(T7, 0), 0x31);
1278 tmp.
packet[12] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T4, 1),
1279 _mm512_extractf64x4_pd(T6, 1), 0x20);
1280 tmp.
packet[13] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T5, 1),
1281 _mm512_extractf64x4_pd(T7, 1), 0x20);
1282 tmp.
packet[14] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T4, 1),
1283 _mm512_extractf64x4_pd(T6, 1), 0x31);
1284 tmp.
packet[15] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T5, 1),
1285 _mm512_extractf64x4_pd(T7, 1), 0x31);
1300 const Packet16f& ) {
1301 assert(
false &&
"To be implemented");
1308 assert(
false &&
"To be implemented");
1316 #endif // EIGEN_PACKET_MATH_AVX512_H EIGEN_STRONG_INLINE Packet16f pmax< Packet16f >(const Packet16f &a, const Packet16f &b)
EIGEN_DEVICE_FUNC Packet8d pgather< double, Packet8d >(const double *from, Index stride)
EIGEN_STRONG_INLINE double pfirst< Packet8d >(const Packet8d &a)
#define EIGEN_STRONG_INLINE
#define PACK_OUTPUT_2(OUTPUT, INPUT, INDEX, STRIDE)
EIGEN_STRONG_INLINE double predux_min< Packet8d >(const Packet8d &a)
EIGEN_STRONG_INLINE void pstore1< Packet8d >(double *to, const double &a)
EIGEN_STRONG_INLINE Packet16f pload1< Packet16f >(const float *from)
EIGEN_STRONG_INLINE Packet16i ploadu< Packet16i >(const int *from)
#define EIGEN_DEBUG_UNALIGNED_LOAD
static EIGEN_STRONG_INLINE void run(Packet8d &first, const Packet8d &second)
EIGEN_STRONG_INLINE Packet16f pand< Packet16f >(const Packet16f &a, const Packet16f &b)
EIGEN_STRONG_INLINE Packet16f padd< Packet16f >(const Packet16f &a, const Packet16f &b)
#define EIGEN_EXTRACT_8f_FROM_16f(INPUT, OUTPUT)
static int f(const TensorMap< Tensor< int, 3 > > &tensor)
EIGEN_STRONG_INLINE Packet16f pload< Packet16f >(const float *from)
EIGEN_STRONG_INLINE Packet16f pset1< Packet16f >(const float &from)
EIGEN_STRONG_INLINE Packet16f pxor< Packet16f >(const Packet16f &a, const Packet16f &b)
#define EIGEN_DEBUG_ALIGNED_STORE
EIGEN_STRONG_INLINE Packet16f pmul< Packet16f >(const Packet16f &a, const Packet16f &b)
static constexpr size_t size(Tuple< Args... > &)
Provides access to the number of elements in a tuple as a compile-time constant expression.
EIGEN_STRONG_INLINE Packet16f pmin< Packet16f >(const Packet16f &a, const Packet16f &b)
EIGEN_STRONG_INLINE Packet8d psub< Packet8d >(const Packet8d &a, const Packet8d &b)
#define EIGEN_DEBUG_UNALIGNED_STORE
EIGEN_STRONG_INLINE Packet16f pandnot< Packet16f >(const Packet16f &a, const Packet16f &b)
EIGEN_STRONG_INLINE void prefetch< float >(const float *addr)
EIGEN_STRONG_INLINE Packet8d pxor< Packet8d >(const Packet8d &a, const Packet8d &b)
EIGEN_STRONG_INLINE void pstoreu< double >(double *to, const Packet4d &from)
EIGEN_STRONG_INLINE Packet16f pdiv< Packet16f >(const Packet16f &a, const Packet16f &b)
EIGEN_DEVICE_FUNC void pscatter< double, Packet8d >(double *to, const Packet8d &from, Index stride)
EIGEN_STRONG_INLINE Packet8d padd< Packet8d >(const Packet8d &a, const Packet8d &b)
#define EIGEN_DEBUG_ALIGNED_LOAD
EIGEN_STRONG_INLINE Packet8d pload1< Packet8d >(const double *from)
EIGEN_STRONG_INLINE double predux< Packet8d >(const Packet8d &a)
EIGEN_STRONG_INLINE Packet8d pset1< Packet8d >(const double &from)
#define PACK_OUTPUT(OUTPUT, INPUT, INDEX, STRIDE)
EIGEN_DEVICE_FUNC Packet padd(const Packet &a, const Packet &b)
EIGEN_STRONG_INLINE Packet16i pload< Packet16i >(const int *from)
EIGEN_STRONG_INLINE void pstore< double >(double *to, const Packet4d &from)
EIGEN_STRONG_INLINE Packet8d pandnot< Packet8d >(const Packet8d &a, const Packet8d &b)
EIGEN_STRONG_INLINE double predux_mul< Packet8d >(const Packet8d &a)
EIGEN_STRONG_INLINE void prefetch< int >(const int *addr)
#define PACK_OUTPUT_SQ_D(OUTPUT, INPUT, INDEX, STRIDE)
EIGEN_DEVICE_FUNC void pscatter< float, Packet16f >(float *to, const Packet16f &from, Index stride)
EIGEN_STRONG_INLINE Packet16f psub< Packet16f >(const Packet16f &a, const Packet16f &b)
EIGEN_STRONG_INLINE void ptranspose(PacketBlock< Packet2cf, 2 > &kernel)
EIGEN_STRONG_INLINE Packet16f por< Packet16f >(const Packet16f &a, const Packet16f &b)
EIGEN_STRONG_INLINE void pstoreu< int >(int *to, const Packet4i &from)
EIGEN_STRONG_INLINE void pstore< float >(float *to, const Packet4f &from)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
EIGEN_STRONG_INLINE Packet8d pand< Packet8d >(const Packet8d &a, const Packet8d &b)
EIGEN_STRONG_INLINE Packet16f ploaddup< Packet16f >(const float *from)
EIGEN_STRONG_INLINE void pstore1< Packet16i >(int *to, const int &a)
__vector short int Packet8i
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type pfirst(const Packet &a)
const mpreal sum(const mpreal tab[], const unsigned long int n, int &status, mp_rnd_t mode=mpreal::get_default_rnd())
static EIGEN_STRONG_INLINE void run(Packet16f &first, const Packet16f &second)
EIGEN_STRONG_INLINE float predux_mul< Packet16f >(const Packet16f &a)
#define EIGEN_INSERT_8f_INTO_16f(OUTPUT, INPUTA, INPUTB)
EIGEN_STRONG_INLINE Packet2cf pconj(const Packet2cf &a)
EIGEN_STRONG_INLINE Packet8d pmul< Packet8d >(const Packet8d &a, const Packet8d &b)
EIGEN_STRONG_INLINE Packet16f plset< Packet16f >(const float &a)
EIGEN_STRONG_INLINE int pfirst< Packet16i >(const Packet16i &a)
EIGEN_STRONG_INLINE void pstoreu< float >(float *to, const Packet4f &from)
EIGEN_DEVICE_FUNC void pstore(Scalar *to, const Packet &from)
EIGEN_STRONG_INLINE Packet8d ploadu< Packet8d >(const double *from)
EIGEN_STRONG_INLINE Packet8d preduxp< Packet8d >(const Packet8d *vecs)
EIGEN_STRONG_INLINE Packet8d plset< Packet8d >(const double &a)
EIGEN_STRONG_INLINE Packet8d pload< Packet8d >(const double *from)
EIGEN_STRONG_INLINE float predux_max< Packet16f >(const Packet16f &a)
EIGEN_STRONG_INLINE float pfirst< Packet16f >(const Packet16f &a)
EIGEN_STRONG_INLINE Packet2cf pnegate(const Packet2cf &a)
EIGEN_STRONG_INLINE float predux< Packet16f >(const Packet16f &a)
EIGEN_STRONG_INLINE Packet16f ploadquad< Packet16f >(const float *from)
EIGEN_STRONG_INLINE void pstore< int >(int *to, const Packet4i &from)
EIGEN_STRONG_INLINE Packet16i pset1< Packet16i >(const int &from)
EIGEN_STRONG_INLINE Packet4f pmadd(const Packet4f &a, const Packet4f &b, const Packet4f &c)
EIGEN_STRONG_INLINE Packet8d pmin< Packet8d >(const Packet8d &a, const Packet8d &b)
EIGEN_STRONG_INLINE Packet8d ploadquad< Packet8d >(const double *from)
EIGEN_STRONG_INLINE Packet8d por< Packet8d >(const Packet8d &a, const Packet8d &b)
#define PACK_OUTPUT_D(OUTPUT, INPUT, INDEX, STRIDE)
EIGEN_STRONG_INLINE Packet16f preduxp< Packet16f >(const Packet16f *vecs)
EIGEN_STRONG_INLINE void pstore1< Packet16f >(float *to, const float &a)
EIGEN_STRONG_INLINE Packet8d pmax< Packet8d >(const Packet8d &a, const Packet8d &b)
EIGEN_STRONG_INLINE Packet16f ploadu< Packet16f >(const float *from)
EIGEN_DEVICE_FUNC const Scalar & b
EIGEN_STRONG_INLINE Packet8f predux_downto4< Packet16f >(const Packet16f &a)
EIGEN_STRONG_INLINE Packet8d pdiv< Packet8d >(const Packet8d &a, const Packet8d &b)
EIGEN_DEVICE_FUNC Packet pmul(const Packet &a, const Packet &b)
EIGEN_STRONG_INLINE void prefetch< double >(const double *addr)
EIGEN_STRONG_INLINE double predux_max< Packet8d >(const Packet8d &a)
EIGEN_STRONG_INLINE Packet4i pblend(const Selector< 4 > &ifPacket, const Packet4i &thenPacket, const Packet4i &elsePacket)
EIGEN_STRONG_INLINE float predux_min< Packet16f >(const Packet16f &a)
EIGEN_STRONG_INLINE Packet2cf preverse(const Packet2cf &a)
EIGEN_STRONG_INLINE Packet4f pabs(const Packet4f &a)
EIGEN_DEVICE_FUNC Packet16f pgather< float, Packet16f >(const float *from, Index stride)
EIGEN_STRONG_INLINE Packet8d ploaddup< Packet8d >(const double *from)
EIGEN_STRONG_INLINE Packet4d predux_downto4< Packet8d >(const Packet8d &a)