10 #ifndef EIGEN_PACKET_MATH_AVX512_H
11 #define EIGEN_PACKET_MATH_AVX512_H
13 #include "../../InternalHeaderCheck.h"
19 #ifndef EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD
20 #define EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 8
23 #ifndef EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS
24 #define EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS 32
27 #ifdef EIGEN_VECTORIZE_FMA
28 #ifndef EIGEN_HAS_SINGLE_INSTRUCTION_MADD
29 #define EIGEN_HAS_SINGLE_INSTRUCTION_MADD
36 #ifndef EIGEN_VECTORIZE_AVX512FP16
42 struct is_arithmetic<__m512> {
43 enum { value =
true };
46 struct is_arithmetic<__m512i> {
47 enum { value =
true };
50 struct is_arithmetic<__m512d> {
51 enum { value =
true };
54 #ifndef EIGEN_VECTORIZE_AVX512FP16
55 template<>
struct is_arithmetic<
Packet16h> {
enum { value =
true }; };
58 struct packet_traits<half> : default_packet_traits {
100 template<>
struct packet_traits<float> : default_packet_traits
139 template<>
struct packet_traits<double> : default_packet_traits
162 template<>
struct packet_traits<int> : default_packet_traits
182 enum {
size = 16, alignment=
Aligned64, vectorizable=
true, masked_load_available=
true, masked_store_available=
true, masked_fpops_available=
true };
189 enum {
size = 8, alignment=
Aligned64, vectorizable=
true, masked_load_available=
true, masked_store_available=
true, masked_fpops_available=
true };
195 enum {
size = 16, alignment=
Aligned64, vectorizable=
true, masked_load_available=
false, masked_store_available=
false };
198 #ifndef EIGEN_VECTORIZE_AVX512FP16
203 enum {
size=16, alignment=
Aligned32, vectorizable=
true, masked_load_available=
false, masked_store_available=
false};
209 return _mm512_set1_ps(from);
213 return _mm512_set1_pd(from);
217 return _mm512_set1_epi32(from);
222 return _mm512_castsi512_ps(_mm512_set1_epi32(from));
227 return _mm512_castsi512_pd(_mm512_set1_epi64(from));
235 return _mm512_castsi512_ps(_mm512_set_epi32(0, -1, 0, -1, 0, -1, 0, -1,
236 0, -1, 0, -1, 0, -1, 0, -1));
239 return _mm512_set_epi32(0, -1, 0, -1, 0, -1, 0, -1,
240 0, -1, 0, -1, 0, -1, 0, -1);
243 return _mm512_castsi512_pd(_mm512_set_epi32(0, 0, -1, -1, 0, 0, -1, -1,
244 0, 0, -1, -1, 0, 0, -1, -1));
249 #if (EIGEN_COMP_GNUC != 0) || (EIGEN_COMP_CLANG != 0)
253 __asm__ (
"vbroadcastss %[mem], %[dst]" : [dst]
"=v" (ret) : [mem]
"m" (*from));
256 return _mm512_broadcastss_ps(_mm_load_ps1(from));
261 #if (EIGEN_COMP_GNUC != 0) || (EIGEN_COMP_CLANG != 0)
263 __asm__ (
"vbroadcastsd %[mem], %[dst]" : [dst]
"=v" (ret) : [mem]
"m" (*from));
266 return _mm512_set1_pd(*from);
272 return _mm512_add_ps(
274 _mm512_set_ps(15.0f, 14.0f, 13.0f, 12.0f, 11.0f, 10.0f, 9.0f, 8.0f, 7.0f, 6.0f, 5.0f,
275 4.0f, 3.0f, 2.0f, 1.0f, 0.0f));
279 return _mm512_add_pd(_mm512_set1_pd(
a),
280 _mm512_set_pd(7.0, 6.0, 5.0, 4.0, 3.0, 2.0, 1.0, 0.0));
284 return _mm512_add_epi32(
285 _mm512_set1_epi32(
a),
286 _mm512_set_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0));
292 return _mm512_add_ps(
a,
b);
297 return _mm512_add_pd(
a,
b);
302 return _mm512_add_epi32(
a,
b);
309 __mmask16 mask =
static_cast<__mmask16
>(umask);
310 return _mm512_maskz_add_ps(mask,
a,
b);
316 __mmask8 mask =
static_cast<__mmask8
>(umask);
317 return _mm512_maskz_add_pd(mask,
a,
b);
323 return _mm512_sub_ps(
a,
b);
328 return _mm512_sub_pd(
a,
b);
333 return _mm512_sub_epi32(
a,
b);
341 const __m512i mask = _mm512_set_epi32(0x80000000,0x80000000,0x80000000,0x80000000,
342 0x80000000,0x80000000,0x80000000,0x80000000,
343 0x80000000,0x80000000,0x80000000,0x80000000,
344 0x80000000,0x80000000,0x80000000,0x80000000);
345 return _mm512_castsi512_ps(_mm512_xor_epi32(_mm512_castps_si512(
a), mask));
349 const __m512i mask = _mm512_set_epi64(0x8000000000000000ULL, 0x8000000000000000ULL, 0x8000000000000000ULL, 0x8000000000000000ULL,
350 0x8000000000000000ULL, 0x8000000000000000ULL, 0x8000000000000000ULL, 0x8000000000000000ULL);
351 return _mm512_castsi512_pd(_mm512_xor_epi64(_mm512_castpd_si512(
a), mask));
355 return _mm512_sub_epi32(_mm512_setzero_si512(),
a);
374 return _mm512_mul_ps(
a,
b);
379 return _mm512_mul_pd(
a,
b);
384 return _mm512_mullo_epi32(
a,
b);
390 return _mm512_div_ps(
a,
b);
396 return _mm512_div_pd(
a,
b);
404 return _mm512_inserti64x4(_mm512_castsi256_si512(q_lo), q_hi, 1);
407 #ifdef EIGEN_VECTORIZE_FMA
411 return _mm512_fmadd_ps(
a,
b,
c);
416 return _mm512_fmadd_pd(
a,
b,
c);
422 return _mm512_fmsub_ps(
a,
b,
c);
427 return _mm512_fmsub_pd(
a,
b,
c);
433 return _mm512_fnmadd_ps(
a,
b,
c);
438 return _mm512_fnmadd_pd(
a,
b,
c);
444 return _mm512_fnmsub_ps(
a,
b,
c);
449 return _mm512_fnmsub_pd(
a,
b,
c);
457 __mmask16 mask16 = _mm512_cmpeq_epi32_mask(_mm512_castps_si512(mask), _mm512_setzero_epi32());
458 return _mm512_mask_blend_ps(mask16,
a,
b);
465 __mmask16 mask16 = _mm512_cmpeq_epi32_mask(mask, _mm512_setzero_epi32());
466 return _mm512_mask_blend_epi32(mask16,
a,
b);
473 __mmask8 mask8 = _mm512_cmp_epi64_mask(_mm512_castpd_si512(mask),
474 _mm512_setzero_epi32(), _MM_CMPINT_EQ);
475 return _mm512_mask_blend_pd(mask8,
a,
b);
482 return _mm512_min_ps(
b,
a);
488 return _mm512_min_pd(
b,
a);
493 return _mm512_min_epi32(
b,
a);
500 return _mm512_max_ps(
b,
a);
506 return _mm512_max_pd(
b,
a);
511 return _mm512_max_epi32(
b,
a);
549 #ifdef EIGEN_VECTORIZE_AVX512DQ
557 return _mm256_castsi256_ps(_mm512_extracti64x4_epi64( _mm512_castps_si512(
x),I_));
562 return _mm_castsi128_pd(_mm512_extracti32x4_epi32( _mm512_castpd_si512(
x),I_));
566 return _mm512_castsi512_ps(_mm512_inserti64x4(_mm512_castsi256_si512(_mm256_castps_si256(
a)),
567 _mm256_castps_si256(
b),1));
570 return _mm512_inserti64x4(_mm512_castsi256_si512(
a),
b, 1);
584 __m256i lo = _mm256_castps_si256(extract256<0>(rf));
585 __m256i hi = _mm256_castps_si256(extract256<1>(rf));
586 __m128i result_lo = _mm_packs_epi32(_mm256_extractf128_si256(lo, 0),
587 _mm256_extractf128_si256(lo, 1));
588 __m128i result_hi = _mm_packs_epi32(_mm256_extractf128_si256(hi, 0),
589 _mm256_extractf128_si256(hi, 1));
590 return _mm256_insertf128_si256(_mm256_castsi128_si256(result_lo), result_hi, 1);
595 __mmask16 mask = _mm512_cmp_ps_mask(
a,
a, _CMP_UNORD_Q);
596 return _mm512_castsi512_ps(_mm512_maskz_set1_epi32(mask, 0xffffffffu));
601 __mmask16 mask = _mm512_cmp_ps_mask(
a,
b, _CMP_EQ_OQ);
602 return _mm512_castsi512_ps(
603 _mm512_mask_set1_epi32(_mm512_setzero_epi32(), mask, 0xffffffffu));
606 __mmask16 mask = _mm512_cmp_ps_mask(
a,
b, _CMP_LE_OQ);
607 return _mm512_castsi512_ps(
608 _mm512_mask_set1_epi32(_mm512_setzero_epi32(), mask, 0xffffffffu));
612 __mmask16 mask = _mm512_cmp_ps_mask(
a,
b, _CMP_LT_OQ);
613 return _mm512_castsi512_ps(
614 _mm512_mask_set1_epi32(_mm512_setzero_epi32(), mask, 0xffffffffu));
618 __mmask16 mask = _mm512_cmp_ps_mask(
a,
b, _CMP_NGE_UQ);
619 return _mm512_castsi512_ps(
620 _mm512_mask_set1_epi32(_mm512_setzero_epi32(), mask, 0xffffffffu));
624 __mmask16 mask = _mm512_cmp_epi32_mask(
a,
b, _MM_CMPINT_EQ);
625 return _mm512_mask_set1_epi32(_mm512_setzero_epi32(), mask, 0xffffffffu);
628 __mmask16 mask = _mm512_cmp_epi32_mask(
a,
b, _MM_CMPINT_LE);
629 return _mm512_mask_set1_epi32(_mm512_setzero_epi32(), mask, 0xffffffffu);
632 __mmask16 mask = _mm512_cmp_epi32_mask(
a,
b, _MM_CMPINT_LT);
633 return _mm512_mask_set1_epi32(_mm512_setzero_epi32(), mask, 0xffffffffu);
638 __mmask8 mask = _mm512_cmp_pd_mask(
a,
b, _CMP_EQ_OQ);
639 return _mm512_castsi512_pd(
640 _mm512_mask_set1_epi64(_mm512_setzero_epi32(), mask, 0xffffffffffffffffu));
644 __mmask8 mask = _mm512_cmp_pd_mask(
a,
b, _CMP_LE_OQ);
645 return _mm512_castsi512_pd(
646 _mm512_mask_set1_epi64(_mm512_setzero_epi32(), mask, 0xffffffffffffffffu));
650 __mmask8 mask = _mm512_cmp_pd_mask(
a,
b, _CMP_LT_OQ);
651 return _mm512_castsi512_pd(
652 _mm512_mask_set1_epi64(_mm512_setzero_epi32(), mask, 0xffffffffffffffffu));
656 __mmask8 mask = _mm512_cmp_pd_mask(
a,
b, _CMP_NGE_UQ);
657 return _mm512_castsi512_pd(
658 _mm512_mask_set1_epi64(_mm512_setzero_epi32(), mask, 0xffffffffffffffffu));
672 return _mm512_set1_epi32(0xffffffffu);
688 return _mm512_and_si512(
a,
b);
694 #ifdef EIGEN_VECTORIZE_AVX512DQ
695 return _mm512_and_ps(
a,
b);
697 return _mm512_castsi512_ps(
pand(_mm512_castps_si512(
a),_mm512_castps_si512(
b)));
703 #ifdef EIGEN_VECTORIZE_AVX512DQ
704 return _mm512_and_pd(
a,
b);
707 Packet4d lane0_a = _mm512_extractf64x4_pd(
a, 0);
708 Packet4d lane0_b = _mm512_extractf64x4_pd(
b, 0);
709 res = _mm512_insertf64x4(
res, _mm256_and_pd(lane0_a, lane0_b), 0);
711 Packet4d lane1_a = _mm512_extractf64x4_pd(
a, 1);
712 Packet4d lane1_b = _mm512_extractf64x4_pd(
b, 1);
713 return _mm512_insertf64x4(
res, _mm256_and_pd(lane1_a, lane1_b), 1);
719 return _mm512_or_si512(
a,
b);
724 #ifdef EIGEN_VECTORIZE_AVX512DQ
725 return _mm512_or_ps(
a,
b);
727 return _mm512_castsi512_ps(
por(_mm512_castps_si512(
a),_mm512_castps_si512(
b)));
734 #ifdef EIGEN_VECTORIZE_AVX512DQ
735 return _mm512_or_pd(
a,
b);
737 return _mm512_castsi512_pd(
por(_mm512_castpd_si512(
a),_mm512_castpd_si512(
b)));
743 return _mm512_xor_si512(
a,
b);
748 #ifdef EIGEN_VECTORIZE_AVX512DQ
749 return _mm512_xor_ps(
a,
b);
751 return _mm512_castsi512_ps(
pxor(_mm512_castps_si512(
a),_mm512_castps_si512(
b)));
757 #ifdef EIGEN_VECTORIZE_AVX512DQ
758 return _mm512_xor_pd(
a,
b);
760 return _mm512_castsi512_pd(
pxor(_mm512_castpd_si512(
a),_mm512_castpd_si512(
b)));
766 return _mm512_andnot_si512(
b,
a);
771 #ifdef EIGEN_VECTORIZE_AVX512DQ
772 return _mm512_andnot_ps(
b,
a);
774 return _mm512_castsi512_ps(
pandnot(_mm512_castps_si512(
a),_mm512_castps_si512(
b)));
779 #ifdef EIGEN_VECTORIZE_AVX512DQ
780 return _mm512_andnot_pd(
b,
a);
782 return _mm512_castsi512_pd(
pandnot(_mm512_castpd_si512(
a),_mm512_castpd_si512(
b)));
791 return _mm512_roundscale_ps(
padd(
por(
pand(
a, mask), prev0dot5),
a), _MM_FROUND_TO_ZERO);
798 return _mm512_roundscale_pd(
padd(
por(
pand(
a, mask), prev0dot5),
a), _MM_FROUND_TO_ZERO);
802 return _mm512_srai_epi32(
a, N);
806 return _mm512_srli_epi32(
a, N);
810 return _mm512_slli_epi32(
a, N);
824 reinterpret_cast<const __m512i*
>(from));
838 reinterpret_cast<const __m512i*
>(from));
843 __mmask16 mask =
static_cast<__mmask16
>(umask);
848 __mmask8 mask =
static_cast<__mmask8
>(umask);
858 __m256i low_half = _mm256_loadu_si256(
reinterpret_cast<const __m256i*
>(from));
859 __m512 even_elements = _mm512_castsi512_ps(_mm512_cvtepu32_epi64(low_half));
860 __m512 pairs = _mm512_permute_ps(even_elements, _MM_SHUFFLE(2, 2, 0, 0));
864 #ifdef EIGEN_VECTORIZE_AVX512DQ
870 __m512d
x = _mm512_setzero_pd();
871 x = _mm512_insertf64x2(
x, _mm_loaddup_pd(&from[0]), 0);
872 x = _mm512_insertf64x2(
x, _mm_loaddup_pd(&from[1]), 1);
873 x = _mm512_insertf64x2(
x, _mm_loaddup_pd(&from[2]), 2);
874 x = _mm512_insertf64x2(
x, _mm_loaddup_pd(&from[3]), 3);
880 __m512d
x = _mm512_setzero_pd();
881 x = _mm512_mask_broadcastsd_pd(
x, 0x3<<0, _mm_load_sd(from+0));
882 x = _mm512_mask_broadcastsd_pd(
x, 0x3<<2, _mm_load_sd(from+1));
883 x = _mm512_mask_broadcastsd_pd(
x, 0x3<<4, _mm_load_sd(from+2));
884 x = _mm512_mask_broadcastsd_pd(
x, 0x3<<6, _mm_load_sd(from+3));
893 __m256i low_half = _mm256_loadu_si256(
reinterpret_cast<const __m256i*
>(from));
894 __m512 even_elements = _mm512_castsi512_ps(_mm512_cvtepu32_epi64(low_half));
895 __m512 pairs = _mm512_permute_ps(even_elements, _MM_SHUFFLE(2, 2, 0, 0));
896 return _mm512_castps_si512(pairs);
904 const Packet16i scatter_mask = _mm512_set_epi32(3,3,3,3, 2,2,2,2, 1,1,1,1, 0,0,0,0);
905 return _mm512_permutexvar_ps(scatter_mask, tmp);
912 __m256d lane0 = _mm256_set1_pd(*from);
913 __m256d lane1 = _mm256_set1_pd(*(from+1));
914 __m512d tmp = _mm512_undefined_pd();
915 tmp = _mm512_insertf64x4(tmp, lane0, 0);
916 return _mm512_insertf64x4(tmp, lane1, 1);
924 const Packet16i scatter_mask = _mm512_set_epi32(3,3,3,3, 2,2,2,2, 1,1,1,1, 0,0,0,0);
925 return _mm512_permutexvar_epi32(scatter_mask, tmp);
953 reinterpret_cast<__m512i*
>(to), from);
957 __mmask16 mask =
static_cast<__mmask16
>(umask);
962 __mmask8 mask =
static_cast<__mmask8
>(umask);
966 template <
typename Scalar,
typename Packet>
968 Index stride,
typename unpacket_traits<Packet>::mask_t umask);
974 Packet16i stride_vector = _mm512_set1_epi32(convert_index<int>(stride));
976 _mm512_set_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
977 Packet16i indices = _mm512_mullo_epi32(stride_vector, stride_multiplier);
978 __mmask16 mask =
static_cast<__mmask16
>(umask);
980 return _mm512_mask_i32gather_ps(src, mask, indices, from, 4);
987 Packet8i stride_vector = _mm256_set1_epi32(convert_index<int>(stride));
988 Packet8i stride_multiplier = _mm256_set_epi32(7, 6, 5, 4, 3, 2, 1, 0);
989 Packet8i indices = _mm256_mullo_epi32(stride_vector, stride_multiplier);
990 __mmask8 mask =
static_cast<__mmask8
>(umask);
992 return _mm512_mask_i32gather_pd(src, mask, indices, from, 8);
998 Packet16i stride_vector = _mm512_set1_epi32(convert_index<int>(stride));
1000 _mm512_set_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
1001 Packet16i indices = _mm512_mullo_epi32(stride_vector, stride_multiplier);
1003 return _mm512_i32gather_ps(indices, from, 4);
1008 Packet8i stride_vector = _mm256_set1_epi32(convert_index<int>(stride));
1009 Packet8i stride_multiplier = _mm256_set_epi32(7, 6, 5, 4, 3, 2, 1, 0);
1010 Packet8i indices = _mm256_mullo_epi32(stride_vector, stride_multiplier);
1012 return _mm512_i32gather_pd(indices, from, 8);
1017 Packet16i stride_vector = _mm512_set1_epi32(convert_index<int>(stride));
1019 _mm512_set_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
1020 Packet16i indices = _mm512_mullo_epi32(stride_vector, stride_multiplier);
1021 return _mm512_i32gather_epi32(indices, from, 4);
1024 template <
typename Scalar,
typename Packet>
1026 Index stride,
typename unpacket_traits<Packet>::mask_t umask);
1032 Packet16i stride_vector = _mm512_set1_epi32(convert_index<int>(stride));
1034 _mm512_set_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
1035 Packet16i indices = _mm512_mullo_epi32(stride_vector, stride_multiplier);
1036 __mmask16 mask =
static_cast<__mmask16
>(umask);
1037 _mm512_mask_i32scatter_ps(to, mask, indices, from, 4);
1044 Packet8i stride_vector = _mm256_set1_epi32(convert_index<int>(stride));
1045 Packet8i stride_multiplier = _mm256_set_epi32(7, 6, 5, 4, 3, 2, 1, 0);
1046 Packet8i indices = _mm256_mullo_epi32(stride_vector, stride_multiplier);
1047 __mmask8 mask =
static_cast<__mmask8
>(umask);
1048 _mm512_mask_i32scatter_pd(to, mask, indices, from, 8);
1055 Packet16i stride_vector = _mm512_set1_epi32(convert_index<int>(stride));
1057 _mm512_set_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
1058 Packet16i indices = _mm512_mullo_epi32(stride_vector, stride_multiplier);
1059 _mm512_i32scatter_ps(to, indices, from, 4);
1065 Packet8i stride_vector = _mm256_set1_epi32(convert_index<int>(stride));
1066 Packet8i stride_multiplier = _mm256_set_epi32(7, 6, 5, 4, 3, 2, 1, 0);
1067 Packet8i indices = _mm256_mullo_epi32(stride_vector, stride_multiplier);
1068 _mm512_i32scatter_pd(to, indices, from, 8);
1074 Packet16i stride_vector = _mm512_set1_epi32(convert_index<int>(stride));
1076 _mm512_set_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
1077 Packet16i indices = _mm512_mullo_epi32(stride_vector, stride_multiplier);
1078 _mm512_i32scatter_epi32(to, indices, from, 4);
1103 return _mm_cvtss_f32(_mm512_extractf32x4_ps(
a, 0));
1107 return _mm_cvtsd_f64(_mm256_extractf128_pd(_mm512_extractf64x4_pd(
a, 0), 0));
1111 return _mm_extract_epi32(_mm512_extracti32x4_epi32(
a, 0), 0);
1116 return _mm512_permutexvar_ps(_mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15),
a);
1121 return _mm512_permutexvar_pd(_mm512_set_epi32(0, 0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7),
a);
1126 return _mm512_permutexvar_epi32(_mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15),
a);
1132 return _mm512_castsi512_ps(_mm512_and_si512(_mm512_castps_si512(
a), _mm512_set1_epi32(0x7fffffff)));
1137 return _mm512_castsi512_pd(_mm512_and_si512(_mm512_castpd_si512(
a),
1138 _mm512_set1_epi64(0x7fffffffffffffff)));
1142 return _mm512_abs_epi32(
a);
1148 template<> EIGEN_STRONG_INLINE
Packet8d psignbit(
const Packet8d&
a) {
return _mm512_castsi512_pd(_mm512_srai_epi64(_mm512_castpd_si512(
a), 63)); }
1160 #ifdef EIGEN_VECTORIZE_AVX512DQ
1161 return _mm512_cvtepi64_pd(_mm512_srli_epi64(_mm512_castpd_si512(
pand(
a, cst_exp_mask)), 52));
1163 return _mm512_cvtepi32_pd(_mm512_cvtepi64_epi32(_mm512_srli_epi64(_mm512_castpd_si512(
pand(
a, cst_exp_mask)), 52)));
1186 const Packet8i permute_idx = _mm256_setr_epi32(0, 4, 1, 5, 2, 6, 3, 7);
1187 Packet8i hi = _mm256_permutevar8x32_epi32(
padd(
b, bias), permute_idx);
1188 Packet8i lo = _mm256_slli_epi64(hi, 52);
1189 hi = _mm256_slli_epi64(_mm256_srli_epi64(hi, 32), 52);
1190 Packet8d c = _mm512_castsi512_pd(_mm512_inserti64x4(_mm512_castsi256_si512(lo), hi, 1));
1195 hi = _mm256_permutevar8x32_epi32(
padd(
b, bias), permute_idx);
1196 lo = _mm256_slli_epi64(hi, 52);
1197 hi = _mm256_slli_epi64(_mm256_srli_epi64(hi, 32), 52);
1198 c = _mm512_castsi512_pd(_mm512_inserti64x4(_mm512_castsi256_si512(lo), hi, 1));
1203 #ifdef EIGEN_VECTORIZE_AVX512DQ
1205 #define EIGEN_EXTRACT_8f_FROM_16f(INPUT, OUTPUT) \
1206 __m256 OUTPUT##_0 = _mm512_extractf32x8_ps(INPUT, 0); \
1207 __m256 OUTPUT##_1 = _mm512_extractf32x8_ps(INPUT, 1)
1210 #define EIGEN_EXTRACT_8i_FROM_16i(INPUT, OUTPUT) \
1211 __m256i OUTPUT##_0 = _mm512_extracti32x8_epi32(INPUT, 0); \
1212 __m256i OUTPUT##_1 = _mm512_extracti32x8_epi32(INPUT, 1)
1214 #define EIGEN_EXTRACT_8f_FROM_16f(INPUT, OUTPUT) \
1215 __m256 OUTPUT##_0 = _mm256_insertf128_ps( \
1216 _mm256_castps128_ps256(_mm512_extractf32x4_ps(INPUT, 0)), \
1217 _mm512_extractf32x4_ps(INPUT, 1), 1); \
1218 __m256 OUTPUT##_1 = _mm256_insertf128_ps( \
1219 _mm256_castps128_ps256(_mm512_extractf32x4_ps(INPUT, 2)), \
1220 _mm512_extractf32x4_ps(INPUT, 3), 1)
1222 #define EIGEN_EXTRACT_8i_FROM_16i(INPUT, OUTPUT) \
1223 __m256i OUTPUT##_0 = _mm256_insertf128_si256( \
1224 _mm256_castsi128_si256(_mm512_extracti32x4_epi32(INPUT, 0)), \
1225 _mm512_extracti32x4_epi32(INPUT, 1), 1); \
1226 __m256i OUTPUT##_1 = _mm256_insertf128_si256( \
1227 _mm256_castsi128_si256(_mm512_extracti32x4_epi32(INPUT, 2)), \
1228 _mm512_extracti32x4_epi32(INPUT, 3), 1)
1231 #ifdef EIGEN_VECTORIZE_AVX512DQ
1232 #define EIGEN_INSERT_8f_INTO_16f(OUTPUT, INPUTA, INPUTB) \
1233 OUTPUT = _mm512_insertf32x8(_mm512_castps256_ps512(INPUTA), INPUTB, 1);
1235 #define EIGEN_INSERT_8i_INTO_16i(OUTPUT, INPUTA, INPUTB) \
1236 OUTPUT = _mm512_inserti32x8(_mm512_castsi256_si512(INPUTA), INPUTB, 1);
1238 #define EIGEN_INSERT_8f_INTO_16f(OUTPUT, INPUTA, INPUTB) \
1239 OUTPUT = _mm512_undefined_ps(); \
1240 OUTPUT = _mm512_insertf32x4(OUTPUT, _mm256_extractf128_ps(INPUTA, 0), 0); \
1241 OUTPUT = _mm512_insertf32x4(OUTPUT, _mm256_extractf128_ps(INPUTA, 1), 1); \
1242 OUTPUT = _mm512_insertf32x4(OUTPUT, _mm256_extractf128_ps(INPUTB, 0), 2); \
1243 OUTPUT = _mm512_insertf32x4(OUTPUT, _mm256_extractf128_ps(INPUTB, 1), 3);
1245 #define EIGEN_INSERT_8i_INTO_16i(OUTPUT, INPUTA, INPUTB) \
1246 OUTPUT = _mm512_undefined_epi32(); \
1247 OUTPUT = _mm512_inserti32x4(OUTPUT, _mm256_extractf128_si256(INPUTA, 0), 0); \
1248 OUTPUT = _mm512_inserti32x4(OUTPUT, _mm256_extractf128_si256(INPUTA, 1), 1); \
1249 OUTPUT = _mm512_inserti32x4(OUTPUT, _mm256_extractf128_si256(INPUTB, 0), 2); \
1250 OUTPUT = _mm512_inserti32x4(OUTPUT, _mm256_extractf128_si256(INPUTB, 1), 3);
1255 #ifdef EIGEN_VECTORIZE_AVX512DQ
1256 __m256 lane0 = _mm512_extractf32x8_ps(
a, 0);
1257 __m256 lane1 = _mm512_extractf32x8_ps(
a, 1);
1258 Packet8f x = _mm256_add_ps(lane0, lane1);
1261 __m128 lane0 = _mm512_extractf32x4_ps(
a, 0);
1262 __m128 lane1 = _mm512_extractf32x4_ps(
a, 1);
1263 __m128 lane2 = _mm512_extractf32x4_ps(
a, 2);
1264 __m128 lane3 = _mm512_extractf32x4_ps(
a, 3);
1265 __m128 sum = _mm_add_ps(_mm_add_ps(lane0, lane1), _mm_add_ps(lane2, lane3));
1266 sum = _mm_hadd_ps(sum, sum);
1267 sum = _mm_hadd_ps(sum, _mm_permute_ps(sum, 1));
1268 return _mm_cvtss_f32(sum);
1273 __m256d lane0 = _mm512_extractf64x4_pd(
a, 0);
1274 __m256d lane1 = _mm512_extractf64x4_pd(
a, 1);
1275 __m256d sum = _mm256_add_pd(lane0, lane1);
1276 __m256d tmp0 = _mm256_hadd_pd(sum, _mm256_permute2f128_pd(sum, sum, 1));
1277 return _mm_cvtsd_f64(_mm256_castpd256_pd128(_mm256_hadd_pd(tmp0, tmp0)));
1281 #ifdef EIGEN_VECTORIZE_AVX512DQ
1282 __m256i lane0 = _mm512_extracti32x8_epi32(
a, 0);
1283 __m256i lane1 = _mm512_extracti32x8_epi32(
a, 1);
1284 Packet8i x = _mm256_add_epi32(lane0, lane1);
1287 __m128i lane0 = _mm512_extracti32x4_epi32(
a, 0);
1288 __m128i lane1 = _mm512_extracti32x4_epi32(
a, 1);
1289 __m128i lane2 = _mm512_extracti32x4_epi32(
a, 2);
1290 __m128i lane3 = _mm512_extracti32x4_epi32(
a, 3);
1291 __m128i sum = _mm_add_epi32(_mm_add_epi32(lane0, lane1), _mm_add_epi32(lane2, lane3));
1292 sum = _mm_hadd_epi32(sum, sum);
1293 sum = _mm_hadd_epi32(sum, _mm_castps_si128(_mm_permute_ps(_mm_castsi128_ps(sum), 1)));
1294 return _mm_cvtsi128_si32(sum);
1300 #ifdef EIGEN_VECTORIZE_AVX512DQ
1301 __m256 lane0 = _mm512_extractf32x8_ps(
a, 0);
1302 __m256 lane1 = _mm512_extractf32x8_ps(
a, 1);
1303 return _mm256_add_ps(lane0, lane1);
1305 __m128 lane0 = _mm512_extractf32x4_ps(
a, 0);
1306 __m128 lane1 = _mm512_extractf32x4_ps(
a, 1);
1307 __m128 lane2 = _mm512_extractf32x4_ps(
a, 2);
1308 __m128 lane3 = _mm512_extractf32x4_ps(
a, 3);
1309 __m128 sum0 = _mm_add_ps(lane0, lane2);
1310 __m128 sum1 = _mm_add_ps(lane1, lane3);
1311 return _mm256_insertf128_ps(_mm256_castps128_ps256(sum0), sum1, 1);
1316 __m256d lane0 = _mm512_extractf64x4_pd(
a, 0);
1317 __m256d lane1 = _mm512_extractf64x4_pd(
a, 1);
1318 return _mm256_add_pd(lane0, lane1);
1322 #ifdef EIGEN_VECTORIZE_AVX512DQ
1323 __m256i lane0 = _mm512_extracti32x8_epi32(
a, 0);
1324 __m256i lane1 = _mm512_extracti32x8_epi32(
a, 1);
1325 return _mm256_add_epi32(lane0, lane1);
1327 __m128i lane0 = _mm512_extracti32x4_epi32(
a, 0);
1328 __m128i lane1 = _mm512_extracti32x4_epi32(
a, 1);
1329 __m128i lane2 = _mm512_extracti32x4_epi32(
a, 2);
1330 __m128i lane3 = _mm512_extracti32x4_epi32(
a, 3);
1331 __m128i sum0 = _mm_add_epi32(lane0, lane2);
1332 __m128i sum1 = _mm_add_epi32(lane1, lane3);
1333 return _mm256_inserti128_si256(_mm256_castsi128_si256(sum0), sum1, 1);
1341 Packet8f lane0 = _mm512_extractf32x8_ps(
a, 0);
1342 Packet8f lane1 = _mm512_extractf32x8_ps(
a, 1);
1345 res =
pmul(
res, _mm_permute_ps(
res, _MM_SHUFFLE(0, 0, 3, 2)));
1348 __m128 lane0 = _mm512_extractf32x4_ps(
a, 0);
1349 __m128 lane1 = _mm512_extractf32x4_ps(
a, 1);
1350 __m128 lane2 = _mm512_extractf32x4_ps(
a, 2);
1351 __m128 lane3 = _mm512_extractf32x4_ps(
a, 3);
1353 res =
pmul(
res, _mm_permute_ps(
res, _MM_SHUFFLE(0, 0, 3, 2)));
1359 __m256d lane0 = _mm512_extractf64x4_pd(
a, 0);
1360 __m256d lane1 = _mm512_extractf64x4_pd(
a, 1);
1361 __m256d
res =
pmul(lane0, lane1);
1368 __m128 lane0 = _mm512_extractf32x4_ps(
a, 0);
1369 __m128 lane1 = _mm512_extractf32x4_ps(
a, 1);
1370 __m128 lane2 = _mm512_extractf32x4_ps(
a, 2);
1371 __m128 lane3 = _mm512_extractf32x4_ps(
a, 3);
1372 __m128
res = _mm_min_ps(_mm_min_ps(lane0, lane1), _mm_min_ps(lane2, lane3));
1373 res = _mm_min_ps(
res, _mm_permute_ps(
res, _MM_SHUFFLE(0, 0, 3, 2)));
1374 return pfirst(_mm_min_ps(
res, _mm_permute_ps(
res, _MM_SHUFFLE(0, 0, 0, 1))));
1378 __m256d lane0 = _mm512_extractf64x4_pd(
a, 0);
1379 __m256d lane1 = _mm512_extractf64x4_pd(
a, 1);
1380 __m256d
res = _mm256_min_pd(lane0, lane1);
1381 res = _mm256_min_pd(
res, _mm256_permute2f128_pd(
res,
res, 1));
1387 __m128 lane0 = _mm512_extractf32x4_ps(
a, 0);
1388 __m128 lane1 = _mm512_extractf32x4_ps(
a, 1);
1389 __m128 lane2 = _mm512_extractf32x4_ps(
a, 2);
1390 __m128 lane3 = _mm512_extractf32x4_ps(
a, 3);
1391 __m128
res = _mm_max_ps(_mm_max_ps(lane0, lane1), _mm_max_ps(lane2, lane3));
1392 res = _mm_max_ps(
res, _mm_permute_ps(
res, _MM_SHUFFLE(0, 0, 3, 2)));
1393 return pfirst(_mm_max_ps(
res, _mm_permute_ps(
res, _MM_SHUFFLE(0, 0, 0, 1))));
1398 __m256d lane0 = _mm512_extractf64x4_pd(
a, 0);
1399 __m256d lane1 = _mm512_extractf64x4_pd(
a, 1);
1400 __m256d
res = _mm256_max_pd(lane0, lane1);
1401 res = _mm256_max_pd(
res, _mm256_permute2f128_pd(
res,
res, 1));
1408 __mmask16 tmp = _mm512_test_epi32_mask(xi,xi);
1409 return !_mm512_kortestz(tmp,tmp);
1414 __mmask16 tmp = _mm512_test_epi32_mask(
x,
x);
1415 return !_mm512_kortestz(tmp,tmp);
1418 #define PACK_OUTPUT(OUTPUT, INPUT, INDEX, STRIDE) \
1419 EIGEN_INSERT_8f_INTO_16f(OUTPUT[INDEX], INPUT[INDEX], INPUT[INDEX + STRIDE]);
1422 __m512 T0 = _mm512_unpacklo_ps(kernel.packet[0], kernel.packet[1]);
1423 __m512 T1 = _mm512_unpackhi_ps(kernel.packet[0], kernel.packet[1]);
1424 __m512 T2 = _mm512_unpacklo_ps(kernel.packet[2], kernel.packet[3]);
1425 __m512 T3 = _mm512_unpackhi_ps(kernel.packet[2], kernel.packet[3]);
1426 __m512 T4 = _mm512_unpacklo_ps(kernel.packet[4], kernel.packet[5]);
1427 __m512 T5 = _mm512_unpackhi_ps(kernel.packet[4], kernel.packet[5]);
1428 __m512 T6 = _mm512_unpacklo_ps(kernel.packet[6], kernel.packet[7]);
1429 __m512 T7 = _mm512_unpackhi_ps(kernel.packet[6], kernel.packet[7]);
1430 __m512 T8 = _mm512_unpacklo_ps(kernel.packet[8], kernel.packet[9]);
1431 __m512 T9 = _mm512_unpackhi_ps(kernel.packet[8], kernel.packet[9]);
1432 __m512 T10 = _mm512_unpacklo_ps(kernel.packet[10], kernel.packet[11]);
1433 __m512 T11 = _mm512_unpackhi_ps(kernel.packet[10], kernel.packet[11]);
1434 __m512 T12 = _mm512_unpacklo_ps(kernel.packet[12], kernel.packet[13]);
1435 __m512 T13 = _mm512_unpackhi_ps(kernel.packet[12], kernel.packet[13]);
1436 __m512 T14 = _mm512_unpacklo_ps(kernel.packet[14], kernel.packet[15]);
1437 __m512 T15 = _mm512_unpackhi_ps(kernel.packet[14], kernel.packet[15]);
1438 __m512 S0 = _mm512_shuffle_ps(T0, T2, _MM_SHUFFLE(1, 0, 1, 0));
1439 __m512 S1 = _mm512_shuffle_ps(T0, T2, _MM_SHUFFLE(3, 2, 3, 2));
1440 __m512 S2 = _mm512_shuffle_ps(T1, T3, _MM_SHUFFLE(1, 0, 1, 0));
1441 __m512 S3 = _mm512_shuffle_ps(T1, T3, _MM_SHUFFLE(3, 2, 3, 2));
1442 __m512 S4 = _mm512_shuffle_ps(T4, T6, _MM_SHUFFLE(1, 0, 1, 0));
1443 __m512 S5 = _mm512_shuffle_ps(T4, T6, _MM_SHUFFLE(3, 2, 3, 2));
1444 __m512 S6 = _mm512_shuffle_ps(T5, T7, _MM_SHUFFLE(1, 0, 1, 0));
1445 __m512 S7 = _mm512_shuffle_ps(T5, T7, _MM_SHUFFLE(3, 2, 3, 2));
1446 __m512 S8 = _mm512_shuffle_ps(T8, T10, _MM_SHUFFLE(1, 0, 1, 0));
1447 __m512 S9 = _mm512_shuffle_ps(T8, T10, _MM_SHUFFLE(3, 2, 3, 2));
1448 __m512 S10 = _mm512_shuffle_ps(T9, T11, _MM_SHUFFLE(1, 0, 1, 0));
1449 __m512 S11 = _mm512_shuffle_ps(T9, T11, _MM_SHUFFLE(3, 2, 3, 2));
1450 __m512 S12 = _mm512_shuffle_ps(T12, T14, _MM_SHUFFLE(1, 0, 1, 0));
1451 __m512 S13 = _mm512_shuffle_ps(T12, T14, _MM_SHUFFLE(3, 2, 3, 2));
1452 __m512 S14 = _mm512_shuffle_ps(T13, T15, _MM_SHUFFLE(1, 0, 1, 0));
1453 __m512 S15 = _mm512_shuffle_ps(T13, T15, _MM_SHUFFLE(3, 2, 3, 2));
1472 PacketBlock<Packet8f, 32> tmp;
1474 tmp.packet[0] = _mm256_permute2f128_ps(S0_0, S4_0, 0x20);
1475 tmp.packet[1] = _mm256_permute2f128_ps(S1_0, S5_0, 0x20);
1476 tmp.packet[2] = _mm256_permute2f128_ps(S2_0, S6_0, 0x20);
1477 tmp.packet[3] = _mm256_permute2f128_ps(S3_0, S7_0, 0x20);
1478 tmp.packet[4] = _mm256_permute2f128_ps(S0_0, S4_0, 0x31);
1479 tmp.packet[5] = _mm256_permute2f128_ps(S1_0, S5_0, 0x31);
1480 tmp.packet[6] = _mm256_permute2f128_ps(S2_0, S6_0, 0x31);
1481 tmp.packet[7] = _mm256_permute2f128_ps(S3_0, S7_0, 0x31);
1483 tmp.packet[8] = _mm256_permute2f128_ps(S0_1, S4_1, 0x20);
1484 tmp.packet[9] = _mm256_permute2f128_ps(S1_1, S5_1, 0x20);
1485 tmp.packet[10] = _mm256_permute2f128_ps(S2_1, S6_1, 0x20);
1486 tmp.packet[11] = _mm256_permute2f128_ps(S3_1, S7_1, 0x20);
1487 tmp.packet[12] = _mm256_permute2f128_ps(S0_1, S4_1, 0x31);
1488 tmp.packet[13] = _mm256_permute2f128_ps(S1_1, S5_1, 0x31);
1489 tmp.packet[14] = _mm256_permute2f128_ps(S2_1, S6_1, 0x31);
1490 tmp.packet[15] = _mm256_permute2f128_ps(S3_1, S7_1, 0x31);
1493 tmp.packet[16] = _mm256_permute2f128_ps(S8_0, S12_0, 0x20);
1494 tmp.packet[17] = _mm256_permute2f128_ps(S9_0, S13_0, 0x20);
1495 tmp.packet[18] = _mm256_permute2f128_ps(S10_0, S14_0, 0x20);
1496 tmp.packet[19] = _mm256_permute2f128_ps(S11_0, S15_0, 0x20);
1497 tmp.packet[20] = _mm256_permute2f128_ps(S8_0, S12_0, 0x31);
1498 tmp.packet[21] = _mm256_permute2f128_ps(S9_0, S13_0, 0x31);
1499 tmp.packet[22] = _mm256_permute2f128_ps(S10_0, S14_0, 0x31);
1500 tmp.packet[23] = _mm256_permute2f128_ps(S11_0, S15_0, 0x31);
1502 tmp.packet[24] = _mm256_permute2f128_ps(S8_1, S12_1, 0x20);
1503 tmp.packet[25] = _mm256_permute2f128_ps(S9_1, S13_1, 0x20);
1504 tmp.packet[26] = _mm256_permute2f128_ps(S10_1, S14_1, 0x20);
1505 tmp.packet[27] = _mm256_permute2f128_ps(S11_1, S15_1, 0x20);
1506 tmp.packet[28] = _mm256_permute2f128_ps(S8_1, S12_1, 0x31);
1507 tmp.packet[29] = _mm256_permute2f128_ps(S9_1, S13_1, 0x31);
1508 tmp.packet[30] = _mm256_permute2f128_ps(S10_1, S14_1, 0x31);
1509 tmp.packet[31] = _mm256_permute2f128_ps(S11_1, S15_1, 0x31);
1532 #define PACK_OUTPUT_2(OUTPUT, INPUT, INDEX, STRIDE) \
1533 EIGEN_INSERT_8f_INTO_16f(OUTPUT[INDEX], INPUT[2 * INDEX], \
1534 INPUT[2 * INDEX + STRIDE]);
1537 __m512 T0 = _mm512_unpacklo_ps(kernel.packet[0],kernel.packet[1]);
1538 __m512 T1 = _mm512_unpackhi_ps(kernel.packet[0],kernel.packet[1]);
1539 __m512 T2 = _mm512_unpacklo_ps(kernel.packet[2],kernel.packet[3]);
1540 __m512 T3 = _mm512_unpackhi_ps(kernel.packet[2],kernel.packet[3]);
1541 __m512 T4 = _mm512_unpacklo_ps(kernel.packet[4],kernel.packet[5]);
1542 __m512 T5 = _mm512_unpackhi_ps(kernel.packet[4],kernel.packet[5]);
1543 __m512 T6 = _mm512_unpacklo_ps(kernel.packet[6],kernel.packet[7]);
1544 __m512 T7 = _mm512_unpackhi_ps(kernel.packet[6],kernel.packet[7]);
1546 kernel.packet[0] = _mm512_castpd_ps(_mm512_unpacklo_pd(_mm512_castps_pd(T0),_mm512_castps_pd(T2)));
1547 kernel.packet[1] = _mm512_castpd_ps(_mm512_unpackhi_pd(_mm512_castps_pd(T0),_mm512_castps_pd(T2)));
1548 kernel.packet[2] = _mm512_castpd_ps(_mm512_unpacklo_pd(_mm512_castps_pd(T1),_mm512_castps_pd(T3)));
1549 kernel.packet[3] = _mm512_castpd_ps(_mm512_unpackhi_pd(_mm512_castps_pd(T1),_mm512_castps_pd(T3)));
1550 kernel.packet[4] = _mm512_castpd_ps(_mm512_unpacklo_pd(_mm512_castps_pd(T4),_mm512_castps_pd(T6)));
1551 kernel.packet[5] = _mm512_castpd_ps(_mm512_unpackhi_pd(_mm512_castps_pd(T4),_mm512_castps_pd(T6)));
1552 kernel.packet[6] = _mm512_castpd_ps(_mm512_unpacklo_pd(_mm512_castps_pd(T5),_mm512_castps_pd(T7)));
1553 kernel.packet[7] = _mm512_castpd_ps(_mm512_unpackhi_pd(_mm512_castps_pd(T5),_mm512_castps_pd(T7)));
1555 T0 = _mm512_shuffle_f32x4(kernel.packet[0], kernel.packet[4], 0x44);
1556 T1 = _mm512_shuffle_f32x4(kernel.packet[0], kernel.packet[4], 0xee);
1557 T2 = _mm512_shuffle_f32x4(kernel.packet[1], kernel.packet[5], 0x44);
1558 T3 = _mm512_shuffle_f32x4(kernel.packet[1], kernel.packet[5], 0xee);
1559 T4 = _mm512_shuffle_f32x4(kernel.packet[2], kernel.packet[6], 0x44);
1560 T5 = _mm512_shuffle_f32x4(kernel.packet[2], kernel.packet[6], 0xee);
1561 T6 = _mm512_shuffle_f32x4(kernel.packet[3], kernel.packet[7], 0x44);
1562 T7 = _mm512_shuffle_f32x4(kernel.packet[3], kernel.packet[7], 0xee);
1564 kernel.packet[0] = _mm512_shuffle_f32x4(T0, T2, 0x88);
1565 kernel.packet[2] = _mm512_shuffle_f32x4(T0, T2, 0xdd);
1566 kernel.packet[1] = _mm512_shuffle_f32x4(T4, T6, 0x88);
1567 kernel.packet[3] = _mm512_shuffle_f32x4(T4, T6, 0xdd);
1568 kernel.packet[4] = _mm512_shuffle_f32x4(T1, T3, 0x88);
1569 kernel.packet[6] = _mm512_shuffle_f32x4(T1, T3, 0xdd);
1570 kernel.packet[5] = _mm512_shuffle_f32x4(T5, T7, 0x88);
1571 kernel.packet[7] = _mm512_shuffle_f32x4(T5, T7, 0xdd);
1575 __m512 T0 = _mm512_unpacklo_ps(kernel.packet[0], kernel.packet[1]);
1576 __m512 T1 = _mm512_unpackhi_ps(kernel.packet[0], kernel.packet[1]);
1577 __m512 T2 = _mm512_unpacklo_ps(kernel.packet[2], kernel.packet[3]);
1578 __m512 T3 = _mm512_unpackhi_ps(kernel.packet[2], kernel.packet[3]);
1580 __m512 S0 = _mm512_shuffle_ps(T0, T2, _MM_SHUFFLE(1, 0, 1, 0));
1581 __m512 S1 = _mm512_shuffle_ps(T0, T2, _MM_SHUFFLE(3, 2, 3, 2));
1582 __m512 S2 = _mm512_shuffle_ps(T1, T3, _MM_SHUFFLE(1, 0, 1, 0));
1583 __m512 S3 = _mm512_shuffle_ps(T1, T3, _MM_SHUFFLE(3, 2, 3, 2));
1590 PacketBlock<Packet8f, 8> tmp;
1592 tmp.packet[0] = _mm256_permute2f128_ps(S0_0, S1_0, 0x20);
1593 tmp.packet[1] = _mm256_permute2f128_ps(S2_0, S3_0, 0x20);
1594 tmp.packet[2] = _mm256_permute2f128_ps(S0_0, S1_0, 0x31);
1595 tmp.packet[3] = _mm256_permute2f128_ps(S2_0, S3_0, 0x31);
1597 tmp.packet[4] = _mm256_permute2f128_ps(S0_1, S1_1, 0x20);
1598 tmp.packet[5] = _mm256_permute2f128_ps(S2_1, S3_1, 0x20);
1599 tmp.packet[6] = _mm256_permute2f128_ps(S0_1, S1_1, 0x31);
1600 tmp.packet[7] = _mm256_permute2f128_ps(S2_1, S3_1, 0x31);
1608 #define PACK_OUTPUT_SQ_D(OUTPUT, INPUT, INDEX, STRIDE) \
1609 OUTPUT[INDEX] = _mm512_insertf64x4(OUTPUT[INDEX], INPUT[INDEX], 0); \
1610 OUTPUT[INDEX] = _mm512_insertf64x4(OUTPUT[INDEX], INPUT[INDEX + STRIDE], 1);
1612 #define PACK_OUTPUT_D(OUTPUT, INPUT, INDEX, STRIDE) \
1613 OUTPUT[INDEX] = _mm512_insertf64x4(OUTPUT[INDEX], INPUT[(2 * INDEX)], 0); \
1615 _mm512_insertf64x4(OUTPUT[INDEX], INPUT[(2 * INDEX) + STRIDE], 1);
1618 __m512d T0 = _mm512_shuffle_pd(kernel.packet[0], kernel.packet[1], 0);
1619 __m512d T1 = _mm512_shuffle_pd(kernel.packet[0], kernel.packet[1], 0xff);
1620 __m512d T2 = _mm512_shuffle_pd(kernel.packet[2], kernel.packet[3], 0);
1621 __m512d T3 = _mm512_shuffle_pd(kernel.packet[2], kernel.packet[3], 0xff);
1623 PacketBlock<Packet4d, 8> tmp;
1625 tmp.packet[0] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T0, 0),
1626 _mm512_extractf64x4_pd(T2, 0), 0x20);
1627 tmp.packet[1] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T1, 0),
1628 _mm512_extractf64x4_pd(T3, 0), 0x20);
1629 tmp.packet[2] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T0, 0),
1630 _mm512_extractf64x4_pd(T2, 0), 0x31);
1631 tmp.packet[3] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T1, 0),
1632 _mm512_extractf64x4_pd(T3, 0), 0x31);
1634 tmp.packet[4] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T0, 1),
1635 _mm512_extractf64x4_pd(T2, 1), 0x20);
1636 tmp.packet[5] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T1, 1),
1637 _mm512_extractf64x4_pd(T3, 1), 0x20);
1638 tmp.packet[6] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T0, 1),
1639 _mm512_extractf64x4_pd(T2, 1), 0x31);
1640 tmp.packet[7] = _mm256_permute2f128_pd(_mm512_extractf64x4_pd(T1, 1),
1641 _mm512_extractf64x4_pd(T3, 1), 0x31);
1650 __m512d T0 = _mm512_unpacklo_pd(kernel.packet[0],kernel.packet[1]);
1651 __m512d T1 = _mm512_unpackhi_pd(kernel.packet[0],kernel.packet[1]);
1652 __m512d T2 = _mm512_unpacklo_pd(kernel.packet[2],kernel.packet[3]);
1653 __m512d T3 = _mm512_unpackhi_pd(kernel.packet[2],kernel.packet[3]);
1654 __m512d T4 = _mm512_unpacklo_pd(kernel.packet[4],kernel.packet[5]);
1655 __m512d T5 = _mm512_unpackhi_pd(kernel.packet[4],kernel.packet[5]);
1656 __m512d T6 = _mm512_unpacklo_pd(kernel.packet[6],kernel.packet[7]);
1657 __m512d T7 = _mm512_unpackhi_pd(kernel.packet[6],kernel.packet[7]);
1659 kernel.packet[0] = _mm512_permutex_pd(T2, 0x4E);
1660 kernel.packet[0] = _mm512_mask_blend_pd(0xCC, T0, kernel.packet[0]);
1661 kernel.packet[2] = _mm512_permutex_pd(T0, 0x4E);
1662 kernel.packet[2] = _mm512_mask_blend_pd(0xCC, kernel.packet[2], T2);
1663 kernel.packet[1] = _mm512_permutex_pd(T3, 0x4E);
1664 kernel.packet[1] = _mm512_mask_blend_pd(0xCC, T1, kernel.packet[1]);
1665 kernel.packet[3] = _mm512_permutex_pd(T1, 0x4E);
1666 kernel.packet[3] = _mm512_mask_blend_pd(0xCC, kernel.packet[3], T3);
1667 kernel.packet[4] = _mm512_permutex_pd(T6, 0x4E);
1668 kernel.packet[4] = _mm512_mask_blend_pd(0xCC, T4, kernel.packet[4]);
1669 kernel.packet[6] = _mm512_permutex_pd(T4, 0x4E);
1670 kernel.packet[6] = _mm512_mask_blend_pd(0xCC, kernel.packet[6], T6);
1671 kernel.packet[5] = _mm512_permutex_pd(T7, 0x4E);
1672 kernel.packet[5] = _mm512_mask_blend_pd(0xCC, T5, kernel.packet[5]);
1673 kernel.packet[7] = _mm512_permutex_pd(T5, 0x4E);
1674 kernel.packet[7] = _mm512_mask_blend_pd(0xCC, kernel.packet[7], T7);
1676 T0 = _mm512_shuffle_f64x2(kernel.packet[4], kernel.packet[4], 0x4E);
1677 T0 = _mm512_mask_blend_pd(0xF0, kernel.packet[0], T0);
1678 T4 = _mm512_shuffle_f64x2(kernel.packet[0], kernel.packet[0], 0x4E);
1679 T4 = _mm512_mask_blend_pd(0xF0, T4, kernel.packet[4]);
1680 T1 = _mm512_shuffle_f64x2(kernel.packet[5], kernel.packet[5], 0x4E);
1681 T1 = _mm512_mask_blend_pd(0xF0, kernel.packet[1], T1);
1682 T5 = _mm512_shuffle_f64x2(kernel.packet[1], kernel.packet[1], 0x4E);
1683 T5 = _mm512_mask_blend_pd(0xF0, T5, kernel.packet[5]);
1684 T2 = _mm512_shuffle_f64x2(kernel.packet[6], kernel.packet[6], 0x4E);
1685 T2 = _mm512_mask_blend_pd(0xF0, kernel.packet[2], T2);
1686 T6 = _mm512_shuffle_f64x2(kernel.packet[2], kernel.packet[2], 0x4E);
1687 T6 = _mm512_mask_blend_pd(0xF0, T6, kernel.packet[6]);
1688 T3 = _mm512_shuffle_f64x2(kernel.packet[7], kernel.packet[7], 0x4E);
1689 T3 = _mm512_mask_blend_pd(0xF0, kernel.packet[3], T3);
1690 T7 = _mm512_shuffle_f64x2(kernel.packet[3], kernel.packet[3], 0x4E);
1691 T7 = _mm512_mask_blend_pd(0xF0, T7, kernel.packet[7]);
1693 kernel.packet[0] = T0; kernel.packet[1] = T1;
1694 kernel.packet[2] = T2; kernel.packet[3] = T3;
1695 kernel.packet[4] = T4; kernel.packet[5] = T5;
1696 kernel.packet[6] = T6; kernel.packet[7] = T7;
1699 #define PACK_OUTPUT_I32(OUTPUT, INPUT, INDEX, STRIDE) \
1700 EIGEN_INSERT_8i_INTO_16i(OUTPUT[INDEX], INPUT[INDEX], INPUT[INDEX + STRIDE]);
1702 #define PACK_OUTPUT_I32_2(OUTPUT, INPUT, INDEX, STRIDE) \
1703 EIGEN_INSERT_8i_INTO_16i(OUTPUT[INDEX], INPUT[2 * INDEX], \
1704 INPUT[2 * INDEX + STRIDE]);
1706 #define SHUFFLE_EPI32(A, B, M) \
1707 _mm512_castps_si512(_mm512_shuffle_ps(_mm512_castsi512_ps(A), _mm512_castsi512_ps(B), M))
1710 __m512i T0 = _mm512_unpacklo_epi32(kernel.packet[0], kernel.packet[1]);
1711 __m512i T1 = _mm512_unpackhi_epi32(kernel.packet[0], kernel.packet[1]);
1712 __m512i T2 = _mm512_unpacklo_epi32(kernel.packet[2], kernel.packet[3]);
1713 __m512i T3 = _mm512_unpackhi_epi32(kernel.packet[2], kernel.packet[3]);
1714 __m512i T4 = _mm512_unpacklo_epi32(kernel.packet[4], kernel.packet[5]);
1715 __m512i T5 = _mm512_unpackhi_epi32(kernel.packet[4], kernel.packet[5]);
1716 __m512i T6 = _mm512_unpacklo_epi32(kernel.packet[6], kernel.packet[7]);
1717 __m512i T7 = _mm512_unpackhi_epi32(kernel.packet[6], kernel.packet[7]);
1718 __m512i T8 = _mm512_unpacklo_epi32(kernel.packet[8], kernel.packet[9]);
1719 __m512i T9 = _mm512_unpackhi_epi32(kernel.packet[8], kernel.packet[9]);
1720 __m512i T10 = _mm512_unpacklo_epi32(kernel.packet[10], kernel.packet[11]);
1721 __m512i T11 = _mm512_unpackhi_epi32(kernel.packet[10], kernel.packet[11]);
1722 __m512i T12 = _mm512_unpacklo_epi32(kernel.packet[12], kernel.packet[13]);
1723 __m512i T13 = _mm512_unpackhi_epi32(kernel.packet[12], kernel.packet[13]);
1724 __m512i T14 = _mm512_unpacklo_epi32(kernel.packet[14], kernel.packet[15]);
1725 __m512i T15 = _mm512_unpackhi_epi32(kernel.packet[14], kernel.packet[15]);
1726 __m512i S0 =
SHUFFLE_EPI32(T0, T2, _MM_SHUFFLE(1, 0, 1, 0));
1727 __m512i S1 =
SHUFFLE_EPI32(T0, T2, _MM_SHUFFLE(3, 2, 3, 2));
1728 __m512i S2 =
SHUFFLE_EPI32(T1, T3, _MM_SHUFFLE(1, 0, 1, 0));
1729 __m512i S3 =
SHUFFLE_EPI32(T1, T3, _MM_SHUFFLE(3, 2, 3, 2));
1730 __m512i S4 =
SHUFFLE_EPI32(T4, T6, _MM_SHUFFLE(1, 0, 1, 0));
1731 __m512i S5 =
SHUFFLE_EPI32(T4, T6, _MM_SHUFFLE(3, 2, 3, 2));
1732 __m512i S6 =
SHUFFLE_EPI32(T5, T7, _MM_SHUFFLE(1, 0, 1, 0));
1733 __m512i S7 =
SHUFFLE_EPI32(T5, T7, _MM_SHUFFLE(3, 2, 3, 2));
1734 __m512i S8 =
SHUFFLE_EPI32(T8, T10, _MM_SHUFFLE(1, 0, 1, 0));
1735 __m512i S9 =
SHUFFLE_EPI32(T8, T10, _MM_SHUFFLE(3, 2, 3, 2));
1736 __m512i S10 =
SHUFFLE_EPI32(T9, T11, _MM_SHUFFLE(1, 0, 1, 0));
1737 __m512i S11 =
SHUFFLE_EPI32(T9, T11, _MM_SHUFFLE(3, 2, 3, 2));
1738 __m512i S12 =
SHUFFLE_EPI32(T12, T14, _MM_SHUFFLE(1, 0, 1, 0));
1739 __m512i S13 =
SHUFFLE_EPI32(T12, T14, _MM_SHUFFLE(3, 2, 3, 2));
1740 __m512i S14 =
SHUFFLE_EPI32(T13, T15, _MM_SHUFFLE(1, 0, 1, 0));
1741 __m512i S15 =
SHUFFLE_EPI32(T13, T15, _MM_SHUFFLE(3, 2, 3, 2));
1760 PacketBlock<Packet8i, 32> tmp;
1762 tmp.packet[0] = _mm256_permute2f128_si256(S0_0, S4_0, 0x20);
1763 tmp.packet[1] = _mm256_permute2f128_si256(S1_0, S5_0, 0x20);
1764 tmp.packet[2] = _mm256_permute2f128_si256(S2_0, S6_0, 0x20);
1765 tmp.packet[3] = _mm256_permute2f128_si256(S3_0, S7_0, 0x20);
1766 tmp.packet[4] = _mm256_permute2f128_si256(S0_0, S4_0, 0x31);
1767 tmp.packet[5] = _mm256_permute2f128_si256(S1_0, S5_0, 0x31);
1768 tmp.packet[6] = _mm256_permute2f128_si256(S2_0, S6_0, 0x31);
1769 tmp.packet[7] = _mm256_permute2f128_si256(S3_0, S7_0, 0x31);
1771 tmp.packet[8] = _mm256_permute2f128_si256(S0_1, S4_1, 0x20);
1772 tmp.packet[9] = _mm256_permute2f128_si256(S1_1, S5_1, 0x20);
1773 tmp.packet[10] = _mm256_permute2f128_si256(S2_1, S6_1, 0x20);
1774 tmp.packet[11] = _mm256_permute2f128_si256(S3_1, S7_1, 0x20);
1775 tmp.packet[12] = _mm256_permute2f128_si256(S0_1, S4_1, 0x31);
1776 tmp.packet[13] = _mm256_permute2f128_si256(S1_1, S5_1, 0x31);
1777 tmp.packet[14] = _mm256_permute2f128_si256(S2_1, S6_1, 0x31);
1778 tmp.packet[15] = _mm256_permute2f128_si256(S3_1, S7_1, 0x31);
1781 tmp.packet[16] = _mm256_permute2f128_si256(S8_0, S12_0, 0x20);
1782 tmp.packet[17] = _mm256_permute2f128_si256(S9_0, S13_0, 0x20);
1783 tmp.packet[18] = _mm256_permute2f128_si256(S10_0, S14_0, 0x20);
1784 tmp.packet[19] = _mm256_permute2f128_si256(S11_0, S15_0, 0x20);
1785 tmp.packet[20] = _mm256_permute2f128_si256(S8_0, S12_0, 0x31);
1786 tmp.packet[21] = _mm256_permute2f128_si256(S9_0, S13_0, 0x31);
1787 tmp.packet[22] = _mm256_permute2f128_si256(S10_0, S14_0, 0x31);
1788 tmp.packet[23] = _mm256_permute2f128_si256(S11_0, S15_0, 0x31);
1790 tmp.packet[24] = _mm256_permute2f128_si256(S8_1, S12_1, 0x20);
1791 tmp.packet[25] = _mm256_permute2f128_si256(S9_1, S13_1, 0x20);
1792 tmp.packet[26] = _mm256_permute2f128_si256(S10_1, S14_1, 0x20);
1793 tmp.packet[27] = _mm256_permute2f128_si256(S11_1, S15_1, 0x20);
1794 tmp.packet[28] = _mm256_permute2f128_si256(S8_1, S12_1, 0x31);
1795 tmp.packet[29] = _mm256_permute2f128_si256(S9_1, S13_1, 0x31);
1796 tmp.packet[30] = _mm256_permute2f128_si256(S10_1, S14_1, 0x31);
1797 tmp.packet[31] = _mm256_permute2f128_si256(S11_1, S15_1, 0x31);
1822 __m512i T0 = _mm512_unpacklo_epi32(kernel.packet[0], kernel.packet[1]);
1823 __m512i T1 = _mm512_unpackhi_epi32(kernel.packet[0], kernel.packet[1]);
1824 __m512i T2 = _mm512_unpacklo_epi32(kernel.packet[2], kernel.packet[3]);
1825 __m512i T3 = _mm512_unpackhi_epi32(kernel.packet[2], kernel.packet[3]);
1827 __m512i S0 =
SHUFFLE_EPI32(T0, T2, _MM_SHUFFLE(1, 0, 1, 0));
1828 __m512i S1 =
SHUFFLE_EPI32(T0, T2, _MM_SHUFFLE(3, 2, 3, 2));
1829 __m512i S2 =
SHUFFLE_EPI32(T1, T3, _MM_SHUFFLE(1, 0, 1, 0));
1830 __m512i S3 =
SHUFFLE_EPI32(T1, T3, _MM_SHUFFLE(3, 2, 3, 2));
1837 PacketBlock<Packet8i, 8> tmp;
1839 tmp.packet[0] = _mm256_permute2f128_si256(S0_0, S1_0, 0x20);
1840 tmp.packet[1] = _mm256_permute2f128_si256(S2_0, S3_0, 0x20);
1841 tmp.packet[2] = _mm256_permute2f128_si256(S0_0, S1_0, 0x31);
1842 tmp.packet[3] = _mm256_permute2f128_si256(S2_0, S3_0, 0x31);
1844 tmp.packet[4] = _mm256_permute2f128_si256(S0_1, S1_1, 0x20);
1845 tmp.packet[5] = _mm256_permute2f128_si256(S2_1, S3_1, 0x20);
1846 tmp.packet[6] = _mm256_permute2f128_si256(S0_1, S1_1, 0x31);
1847 tmp.packet[7] = _mm256_permute2f128_si256(S2_1, S3_1, 0x31);
1859 __mmask16
m = (ifPacket.select[0]) | (ifPacket.select[1] << 1) | (ifPacket.select[2] << 2) |
1860 (ifPacket.select[3] << 3) | (ifPacket.select[4] << 4) | (ifPacket.select[5] << 5) |
1861 (ifPacket.select[6] << 6) | (ifPacket.select[7] << 7) | (ifPacket.select[8] << 8) |
1862 (ifPacket.select[9] << 9) | (ifPacket.select[10] << 10) | (ifPacket.select[11] << 11) |
1863 (ifPacket.select[12] << 12) | (ifPacket.select[13] << 13) | (ifPacket.select[14] << 14) |
1864 (ifPacket.select[15] << 15);
1865 return _mm512_mask_blend_ps(
m, elsePacket, thenPacket);
1871 __mmask8
m = (ifPacket.select[0] )
1872 | (ifPacket.select[1]<<1)
1873 | (ifPacket.select[2]<<2)
1874 | (ifPacket.select[3]<<3)
1875 | (ifPacket.select[4]<<4)
1876 | (ifPacket.select[5]<<5)
1877 | (ifPacket.select[6]<<6)
1878 | (ifPacket.select[7]<<7);
1879 return _mm512_mask_blend_pd(
m, elsePacket, thenPacket);
1884 return _mm256_set1_epi16(from.
x);
1892 return _mm256_load_si256(
reinterpret_cast<const __m256i*
>(from));
1896 return _mm256_loadu_si256(
reinterpret_cast<const __m256i*
>(from));
1902 _mm256_store_si256((__m256i*)(
void*)to, from);
1908 _mm256_storeu_si256((__m256i*)(
void*)to, from);
1913 unsigned short a = from[0].
x;
1914 unsigned short b = from[1].
x;
1915 unsigned short c = from[2].
x;
1916 unsigned short d = from[3].
x;
1917 unsigned short e = from[4].
x;
1918 unsigned short f = from[5].
x;
1919 unsigned short g = from[6].
x;
1920 unsigned short h = from[7].
x;
1921 return _mm256_set_epi16(h, h, g, g, f, f,
e,
e, d, d,
c,
c,
b,
b,
a,
a);
1924 template<> EIGEN_STRONG_INLINE
Packet16h
1926 unsigned short a = from[0].
x;
1927 unsigned short b = from[1].
x;
1928 unsigned short c = from[2].
x;
1929 unsigned short d = from[3].
x;
1930 return _mm256_set_epi16(d, d, d, d,
c,
c,
c,
c,
b,
b,
b,
b,
a,
a,
a,
a);
1934 return _mm512_cvtph_ps(
a);
1938 return _mm512_cvtps_ph(
a, _MM_FROUND_TO_NEAREST_INT|_MM_FROUND_NO_EXC);
1947 const __m256i sign_mask = _mm256_set1_epi16(
static_cast<numext::uint16_t>(0x8000));
1948 return _mm256_andnot_si256(sign_mask,
a);
1984 return _mm256_blendv_epi8(
b,
a, mask);
2024 Packet16h sign_mask = _mm256_set1_epi16(
static_cast<unsigned short>(0x8000));
2025 return _mm256_xor_si256(
a, sign_mask);
2028 #ifndef EIGEN_VECTORIZE_AVX512FP16
2066 Packet8h lane0 = _mm256_extractf128_si256(
a, 0);
2067 Packet8h lane1 = _mm256_extractf128_si256(
a, 1);
2090 __m128i
m = _mm_setr_epi8(14,15,12,13,10,11,8,9,6,7,4,5,2,3,0,1);
2091 return _mm256_insertf128_si256(
2092 _mm256_castsi128_si256(_mm_shuffle_epi8(_mm256_extractf128_si256(
a,1),
m)),
2093 _mm_shuffle_epi8(_mm256_extractf128_si256(
a,0),
m), 1);
2098 return _mm256_set_epi16(
2099 from[15*stride].
x, from[14*stride].
x, from[13*stride].
x, from[12*stride].
x,
2100 from[11*stride].
x, from[10*stride].
x, from[9*stride].
x, from[8*stride].
x,
2101 from[7*stride].
x, from[6*stride].
x, from[5*stride].
x, from[4*stride].
x,
2102 from[3*stride].
x, from[2*stride].
x, from[1*stride].
x, from[0*stride].
x);
2109 to[stride*0] = aux[0];
2110 to[stride*1] = aux[1];
2111 to[stride*2] = aux[2];
2112 to[stride*3] = aux[3];
2113 to[stride*4] = aux[4];
2114 to[stride*5] = aux[5];
2115 to[stride*6] = aux[6];
2116 to[stride*7] = aux[7];
2117 to[stride*8] = aux[8];
2118 to[stride*9] = aux[9];
2119 to[stride*10] = aux[10];
2120 to[stride*11] = aux[11];
2121 to[stride*12] = aux[12];
2122 to[stride*13] = aux[13];
2123 to[stride*14] = aux[14];
2124 to[stride*15] = aux[15];
2127 EIGEN_STRONG_INLINE
void
2129 __m256i
a = kernel.packet[0];
2130 __m256i
b = kernel.packet[1];
2131 __m256i
c = kernel.packet[2];
2132 __m256i d = kernel.packet[3];
2133 __m256i
e = kernel.packet[4];
2134 __m256i f = kernel.packet[5];
2135 __m256i g = kernel.packet[6];
2136 __m256i h = kernel.packet[7];
2137 __m256i
i = kernel.packet[8];
2138 __m256i
j = kernel.packet[9];
2139 __m256i k = kernel.packet[10];
2140 __m256i l = kernel.packet[11];
2141 __m256i
m = kernel.packet[12];
2142 __m256i
n = kernel.packet[13];
2143 __m256i o = kernel.packet[14];
2144 __m256i
p = kernel.packet[15];
2146 __m256i ab_07 = _mm256_unpacklo_epi16(
a,
b);
2147 __m256i cd_07 = _mm256_unpacklo_epi16(
c, d);
2148 __m256i ef_07 = _mm256_unpacklo_epi16(
e, f);
2149 __m256i gh_07 = _mm256_unpacklo_epi16(g, h);
2150 __m256i ij_07 = _mm256_unpacklo_epi16(
i,
j);
2151 __m256i kl_07 = _mm256_unpacklo_epi16(k, l);
2152 __m256i mn_07 = _mm256_unpacklo_epi16(
m,
n);
2153 __m256i op_07 = _mm256_unpacklo_epi16(o,
p);
2155 __m256i ab_8f = _mm256_unpackhi_epi16(
a,
b);
2156 __m256i cd_8f = _mm256_unpackhi_epi16(
c, d);
2157 __m256i ef_8f = _mm256_unpackhi_epi16(
e, f);
2158 __m256i gh_8f = _mm256_unpackhi_epi16(g, h);
2159 __m256i ij_8f = _mm256_unpackhi_epi16(
i,
j);
2160 __m256i kl_8f = _mm256_unpackhi_epi16(k, l);
2161 __m256i mn_8f = _mm256_unpackhi_epi16(
m,
n);
2162 __m256i op_8f = _mm256_unpackhi_epi16(o,
p);
2164 __m256i abcd_03 = _mm256_unpacklo_epi32(ab_07, cd_07);
2165 __m256i abcd_47 = _mm256_unpackhi_epi32(ab_07, cd_07);
2166 __m256i efgh_03 = _mm256_unpacklo_epi32(ef_07, gh_07);
2167 __m256i efgh_47 = _mm256_unpackhi_epi32(ef_07, gh_07);
2168 __m256i ijkl_03 = _mm256_unpacklo_epi32(ij_07, kl_07);
2169 __m256i ijkl_47 = _mm256_unpackhi_epi32(ij_07, kl_07);
2170 __m256i mnop_03 = _mm256_unpacklo_epi32(mn_07, op_07);
2171 __m256i mnop_47 = _mm256_unpackhi_epi32(mn_07, op_07);
2173 __m256i abcd_8b = _mm256_unpacklo_epi32(ab_8f, cd_8f);
2174 __m256i abcd_cf = _mm256_unpackhi_epi32(ab_8f, cd_8f);
2175 __m256i efgh_8b = _mm256_unpacklo_epi32(ef_8f, gh_8f);
2176 __m256i efgh_cf = _mm256_unpackhi_epi32(ef_8f, gh_8f);
2177 __m256i ijkl_8b = _mm256_unpacklo_epi32(ij_8f, kl_8f);
2178 __m256i ijkl_cf = _mm256_unpackhi_epi32(ij_8f, kl_8f);
2179 __m256i mnop_8b = _mm256_unpacklo_epi32(mn_8f, op_8f);
2180 __m256i mnop_cf = _mm256_unpackhi_epi32(mn_8f, op_8f);
2182 __m256i abcdefgh_01 = _mm256_unpacklo_epi64(abcd_03, efgh_03);
2183 __m256i abcdefgh_23 = _mm256_unpackhi_epi64(abcd_03, efgh_03);
2184 __m256i ijklmnop_01 = _mm256_unpacklo_epi64(ijkl_03, mnop_03);
2185 __m256i ijklmnop_23 = _mm256_unpackhi_epi64(ijkl_03, mnop_03);
2186 __m256i abcdefgh_45 = _mm256_unpacklo_epi64(abcd_47, efgh_47);
2187 __m256i abcdefgh_67 = _mm256_unpackhi_epi64(abcd_47, efgh_47);
2188 __m256i ijklmnop_45 = _mm256_unpacklo_epi64(ijkl_47, mnop_47);
2189 __m256i ijklmnop_67 = _mm256_unpackhi_epi64(ijkl_47, mnop_47);
2190 __m256i abcdefgh_89 = _mm256_unpacklo_epi64(abcd_8b, efgh_8b);
2191 __m256i abcdefgh_ab = _mm256_unpackhi_epi64(abcd_8b, efgh_8b);
2192 __m256i ijklmnop_89 = _mm256_unpacklo_epi64(ijkl_8b, mnop_8b);
2193 __m256i ijklmnop_ab = _mm256_unpackhi_epi64(ijkl_8b, mnop_8b);
2194 __m256i abcdefgh_cd = _mm256_unpacklo_epi64(abcd_cf, efgh_cf);
2195 __m256i abcdefgh_ef = _mm256_unpackhi_epi64(abcd_cf, efgh_cf);
2196 __m256i ijklmnop_cd = _mm256_unpacklo_epi64(ijkl_cf, mnop_cf);
2197 __m256i ijklmnop_ef = _mm256_unpackhi_epi64(ijkl_cf, mnop_cf);
2200 __m256i a_p_0 = _mm256_permute2x128_si256(abcdefgh_01, ijklmnop_01, 0x20);
2201 __m256i a_p_1 = _mm256_permute2x128_si256(abcdefgh_23, ijklmnop_23, 0x20);
2202 __m256i a_p_2 = _mm256_permute2x128_si256(abcdefgh_45, ijklmnop_45, 0x20);
2203 __m256i a_p_3 = _mm256_permute2x128_si256(abcdefgh_67, ijklmnop_67, 0x20);
2204 __m256i a_p_4 = _mm256_permute2x128_si256(abcdefgh_89, ijklmnop_89, 0x20);
2205 __m256i a_p_5 = _mm256_permute2x128_si256(abcdefgh_ab, ijklmnop_ab, 0x20);
2206 __m256i a_p_6 = _mm256_permute2x128_si256(abcdefgh_cd, ijklmnop_cd, 0x20);
2207 __m256i a_p_7 = _mm256_permute2x128_si256(abcdefgh_ef, ijklmnop_ef, 0x20);
2208 __m256i a_p_8 = _mm256_permute2x128_si256(abcdefgh_01, ijklmnop_01, 0x31);
2209 __m256i a_p_9 = _mm256_permute2x128_si256(abcdefgh_23, ijklmnop_23, 0x31);
2210 __m256i a_p_a = _mm256_permute2x128_si256(abcdefgh_45, ijklmnop_45, 0x31);
2211 __m256i a_p_b = _mm256_permute2x128_si256(abcdefgh_67, ijklmnop_67, 0x31);
2212 __m256i a_p_c = _mm256_permute2x128_si256(abcdefgh_89, ijklmnop_89, 0x31);
2213 __m256i a_p_d = _mm256_permute2x128_si256(abcdefgh_ab, ijklmnop_ab, 0x31);
2214 __m256i a_p_e = _mm256_permute2x128_si256(abcdefgh_cd, ijklmnop_cd, 0x31);
2215 __m256i a_p_f = _mm256_permute2x128_si256(abcdefgh_ef, ijklmnop_ef, 0x31);
2217 kernel.packet[0] = a_p_0;
2218 kernel.packet[1] = a_p_1;
2219 kernel.packet[2] = a_p_2;
2220 kernel.packet[3] = a_p_3;
2221 kernel.packet[4] = a_p_4;
2222 kernel.packet[5] = a_p_5;
2223 kernel.packet[6] = a_p_6;
2224 kernel.packet[7] = a_p_7;
2225 kernel.packet[8] = a_p_8;
2226 kernel.packet[9] = a_p_9;
2227 kernel.packet[10] = a_p_a;
2228 kernel.packet[11] = a_p_b;
2229 kernel.packet[12] = a_p_c;
2230 kernel.packet[13] = a_p_d;
2231 kernel.packet[14] = a_p_e;
2232 kernel.packet[15] = a_p_f;
2235 EIGEN_STRONG_INLINE
void
2249 for (
int i = 0;
i < 8; ++
i) {
2250 for (
int j = 0;
j < 8; ++
j) {
2251 out[
i][
j] = in[
j][2*
i];
2253 for (
int j = 0;
j < 8; ++
j) {
2254 out[
i][
j+8] = in[
j][2*
i+1];
2268 EIGEN_STRONG_INLINE
void
2278 for (
int i = 0;
i < 4; ++
i) {
2279 for (
int j = 0;
j < 4; ++
j) {
2280 out[
i][
j] = in[
j][4*
i];
2282 for (
int j = 0;
j < 4; ++
j) {
2283 out[
i][
j+4] = in[
j][4*
i+1];
2285 for (
int j = 0;
j < 4; ++
j) {
2286 out[
i][
j+8] = in[
j][4*
i+2];
2288 for (
int j = 0;
j < 4; ++
j) {
2289 out[
i][
j+12] = in[
j][4*
i+3];
2299 template <>
struct is_arithmetic<
Packet16bf> {
enum { value =
true }; };
2302 struct packet_traits<bfloat16> : default_packet_traits {
2307 AlignedOnScalar = 1,
2315 #ifdef EIGEN_VECTORIZE_AVX512DQ
2333 typedef bfloat16 type;
2334 enum {
size=16, alignment=
Aligned32, vectorizable=
true, masked_load_available=
false, masked_store_available=
false};
2340 return _mm256_set1_epi16(from.
value);
2346 t.
value =
static_cast<unsigned short>(_mm256_extract_epi16(from, 0));
2352 return _mm256_load_si256(
reinterpret_cast<const __m256i*
>(from));
2357 return _mm256_loadu_si256(
reinterpret_cast<const __m256i*
>(from));
2363 _mm256_store_si256(
reinterpret_cast<__m256i*
>(to), from);
2369 _mm256_storeu_si256(
reinterpret_cast<__m256i*
>(to), from);
2374 unsigned short a = from[0].
value;
2375 unsigned short b = from[1].
value;
2376 unsigned short c = from[2].
value;
2377 unsigned short d = from[3].
value;
2378 unsigned short e = from[4].
value;
2379 unsigned short f = from[5].
value;
2380 unsigned short g = from[6].
value;
2381 unsigned short h = from[7].
value;
2382 return _mm256_set_epi16(h, h, g, g, f, f,
e,
e, d, d,
c,
c,
b,
b,
a,
a);
2387 unsigned short a = from[0].
value;
2388 unsigned short b = from[1].
value;
2389 unsigned short c = from[2].
value;
2390 unsigned short d = from[3].
value;
2391 return _mm256_set_epi16(d, d, d, d,
c,
c,
c,
c,
b,
b,
b,
b,
a,
a,
a,
a);
2395 return _mm512_castsi512_ps(_mm512_slli_epi32(_mm512_cvtepu16_epi32(
a), 16));
2402 #if defined(EIGEN_VECTORIZE_AVX512BF16) && EIGEN_GNUC_STRICT_AT_LEAST(10,1,0)
2406 r = (__m256i)(_mm512_cvtneps_pbh(
a));
2410 __m512i input = _mm512_castps_si512(
a);
2411 __m512i nan = _mm512_set1_epi32(0x7fc0);
2414 t = _mm512_and_si512(_mm512_srli_epi32(input, 16), _mm512_set1_epi32(1));
2416 t = _mm512_add_epi32(t, _mm512_set1_epi32(0x7fff));
2418 t = _mm512_add_epi32(t, input);
2420 t = _mm512_srli_epi32(t, 16);
2423 __mmask16 mask = _mm512_cmp_ps_mask(
a,
a, _CMP_ORD_Q);
2425 t = _mm512_mask_blend_epi32(mask, nan, t);
2427 r = _mm512_cvtepi32_epi16(t);
2465 return _mm256_blendv_epi8(
b,
a, mask);
2511 Packet16bf sign_mask = _mm256_set1_epi16(
static_cast<unsigned short>(0x8000));
2512 return _mm256_xor_si256(
a, sign_mask);
2522 const __m256i sign_mask = _mm256_set1_epi16(
static_cast<numext::uint16_t>(0x8000));
2523 return _mm256_andnot_si256(sign_mask,
a);
2569 Packet8bf lane0 = _mm256_extractf128_si256(
a, 0);
2570 Packet8bf lane1 = _mm256_extractf128_si256(
a, 1);
2596 __m256i
m = _mm256_setr_epi8(14,15,12,13,10,11,8,9,6,7,4,5,2,3,0,1,
2597 14,15,12,13,10,11,8,9,6,7,4,5,2,3,0,1);
2601 res = _mm256_permute2x128_si256(
a,
a, 1);
2603 return _mm256_shuffle_epi8(
res,
m);
2609 return _mm256_set_epi16(
2610 from[15*stride].value, from[14*stride].value, from[13*stride].value, from[12*stride].value,
2611 from[11*stride].value, from[10*stride].value, from[9*stride].value, from[8*stride].value,
2612 from[7*stride].value, from[6*stride].value, from[5*stride].value, from[4*stride].value,
2613 from[3*stride].value, from[2*stride].value, from[1*stride].value, from[0*stride].value);
2622 to[stride*0] = aux[0];
2623 to[stride*1] = aux[1];
2624 to[stride*2] = aux[2];
2625 to[stride*3] = aux[3];
2626 to[stride*4] = aux[4];
2627 to[stride*5] = aux[5];
2628 to[stride*6] = aux[6];
2629 to[stride*7] = aux[7];
2630 to[stride*8] = aux[8];
2631 to[stride*9] = aux[9];
2632 to[stride*10] = aux[10];
2633 to[stride*11] = aux[11];
2634 to[stride*12] = aux[12];
2635 to[stride*13] = aux[13];
2636 to[stride*14] = aux[14];
2637 to[stride*15] = aux[15];
2640 EIGEN_STRONG_INLINE
void ptranspose(PacketBlock<Packet16bf,16>& kernel) {
2641 __m256i
a = kernel.packet[0];
2642 __m256i
b = kernel.packet[1];
2643 __m256i
c = kernel.packet[2];
2644 __m256i d = kernel.packet[3];
2645 __m256i
e = kernel.packet[4];
2646 __m256i f = kernel.packet[5];
2647 __m256i g = kernel.packet[6];
2648 __m256i h = kernel.packet[7];
2649 __m256i
i = kernel.packet[8];
2650 __m256i
j = kernel.packet[9];
2651 __m256i k = kernel.packet[10];
2652 __m256i l = kernel.packet[11];
2653 __m256i
m = kernel.packet[12];
2654 __m256i
n = kernel.packet[13];
2655 __m256i o = kernel.packet[14];
2656 __m256i
p = kernel.packet[15];
2658 __m256i ab_07 = _mm256_unpacklo_epi16(
a,
b);
2659 __m256i cd_07 = _mm256_unpacklo_epi16(
c, d);
2660 __m256i ef_07 = _mm256_unpacklo_epi16(
e, f);
2661 __m256i gh_07 = _mm256_unpacklo_epi16(g, h);
2662 __m256i ij_07 = _mm256_unpacklo_epi16(
i,
j);
2663 __m256i kl_07 = _mm256_unpacklo_epi16(k, l);
2664 __m256i mn_07 = _mm256_unpacklo_epi16(
m,
n);
2665 __m256i op_07 = _mm256_unpacklo_epi16(o,
p);
2667 __m256i ab_8f = _mm256_unpackhi_epi16(
a,
b);
2668 __m256i cd_8f = _mm256_unpackhi_epi16(
c, d);
2669 __m256i ef_8f = _mm256_unpackhi_epi16(
e, f);
2670 __m256i gh_8f = _mm256_unpackhi_epi16(g, h);
2671 __m256i ij_8f = _mm256_unpackhi_epi16(
i,
j);
2672 __m256i kl_8f = _mm256_unpackhi_epi16(k, l);
2673 __m256i mn_8f = _mm256_unpackhi_epi16(
m,
n);
2674 __m256i op_8f = _mm256_unpackhi_epi16(o,
p);
2676 __m256i abcd_03 = _mm256_unpacklo_epi32(ab_07, cd_07);
2677 __m256i abcd_47 = _mm256_unpackhi_epi32(ab_07, cd_07);
2678 __m256i efgh_03 = _mm256_unpacklo_epi32(ef_07, gh_07);
2679 __m256i efgh_47 = _mm256_unpackhi_epi32(ef_07, gh_07);
2680 __m256i ijkl_03 = _mm256_unpacklo_epi32(ij_07, kl_07);
2681 __m256i ijkl_47 = _mm256_unpackhi_epi32(ij_07, kl_07);
2682 __m256i mnop_03 = _mm256_unpacklo_epi32(mn_07, op_07);
2683 __m256i mnop_47 = _mm256_unpackhi_epi32(mn_07, op_07);
2685 __m256i abcd_8b = _mm256_unpacklo_epi32(ab_8f, cd_8f);
2686 __m256i abcd_cf = _mm256_unpackhi_epi32(ab_8f, cd_8f);
2687 __m256i efgh_8b = _mm256_unpacklo_epi32(ef_8f, gh_8f);
2688 __m256i efgh_cf = _mm256_unpackhi_epi32(ef_8f, gh_8f);
2689 __m256i ijkl_8b = _mm256_unpacklo_epi32(ij_8f, kl_8f);
2690 __m256i ijkl_cf = _mm256_unpackhi_epi32(ij_8f, kl_8f);
2691 __m256i mnop_8b = _mm256_unpacklo_epi32(mn_8f, op_8f);
2692 __m256i mnop_cf = _mm256_unpackhi_epi32(mn_8f, op_8f);
2694 __m256i abcdefgh_01 = _mm256_unpacklo_epi64(abcd_03, efgh_03);
2695 __m256i abcdefgh_23 = _mm256_unpackhi_epi64(abcd_03, efgh_03);
2696 __m256i ijklmnop_01 = _mm256_unpacklo_epi64(ijkl_03, mnop_03);
2697 __m256i ijklmnop_23 = _mm256_unpackhi_epi64(ijkl_03, mnop_03);
2698 __m256i abcdefgh_45 = _mm256_unpacklo_epi64(abcd_47, efgh_47);
2699 __m256i abcdefgh_67 = _mm256_unpackhi_epi64(abcd_47, efgh_47);
2700 __m256i ijklmnop_45 = _mm256_unpacklo_epi64(ijkl_47, mnop_47);
2701 __m256i ijklmnop_67 = _mm256_unpackhi_epi64(ijkl_47, mnop_47);
2702 __m256i abcdefgh_89 = _mm256_unpacklo_epi64(abcd_8b, efgh_8b);
2703 __m256i abcdefgh_ab = _mm256_unpackhi_epi64(abcd_8b, efgh_8b);
2704 __m256i ijklmnop_89 = _mm256_unpacklo_epi64(ijkl_8b, mnop_8b);
2705 __m256i ijklmnop_ab = _mm256_unpackhi_epi64(ijkl_8b, mnop_8b);
2706 __m256i abcdefgh_cd = _mm256_unpacklo_epi64(abcd_cf, efgh_cf);
2707 __m256i abcdefgh_ef = _mm256_unpackhi_epi64(abcd_cf, efgh_cf);
2708 __m256i ijklmnop_cd = _mm256_unpacklo_epi64(ijkl_cf, mnop_cf);
2709 __m256i ijklmnop_ef = _mm256_unpackhi_epi64(ijkl_cf, mnop_cf);
2712 kernel.packet[0] = _mm256_permute2x128_si256(abcdefgh_01, ijklmnop_01, 0x20);
2713 kernel.packet[1] = _mm256_permute2x128_si256(abcdefgh_23, ijklmnop_23, 0x20);
2714 kernel.packet[2] = _mm256_permute2x128_si256(abcdefgh_45, ijklmnop_45, 0x20);
2715 kernel.packet[3] = _mm256_permute2x128_si256(abcdefgh_67, ijklmnop_67, 0x20);
2716 kernel.packet[4] = _mm256_permute2x128_si256(abcdefgh_89, ijklmnop_89, 0x20);
2717 kernel.packet[5] = _mm256_permute2x128_si256(abcdefgh_ab, ijklmnop_ab, 0x20);
2718 kernel.packet[6] = _mm256_permute2x128_si256(abcdefgh_cd, ijklmnop_cd, 0x20);
2719 kernel.packet[7] = _mm256_permute2x128_si256(abcdefgh_ef, ijklmnop_ef, 0x20);
2720 kernel.packet[8] = _mm256_permute2x128_si256(abcdefgh_01, ijklmnop_01, 0x31);
2721 kernel.packet[9] = _mm256_permute2x128_si256(abcdefgh_23, ijklmnop_23, 0x31);
2722 kernel.packet[10] = _mm256_permute2x128_si256(abcdefgh_45, ijklmnop_45, 0x31);
2723 kernel.packet[11] = _mm256_permute2x128_si256(abcdefgh_67, ijklmnop_67, 0x31);
2724 kernel.packet[12] = _mm256_permute2x128_si256(abcdefgh_89, ijklmnop_89, 0x31);
2725 kernel.packet[13] = _mm256_permute2x128_si256(abcdefgh_ab, ijklmnop_ab, 0x31);
2726 kernel.packet[14] = _mm256_permute2x128_si256(abcdefgh_cd, ijklmnop_cd, 0x31);
2727 kernel.packet[15] = _mm256_permute2x128_si256(abcdefgh_ef, ijklmnop_ef, 0x31);
2730 EIGEN_STRONG_INLINE
void ptranspose(PacketBlock<Packet16bf,4>& kernel) {
2731 __m256i
a = kernel.packet[0];
2732 __m256i
b = kernel.packet[1];
2733 __m256i
c = kernel.packet[2];
2734 __m256i d = kernel.packet[3];
2736 __m256i ab_07 = _mm256_unpacklo_epi16(
a,
b);
2737 __m256i cd_07 = _mm256_unpacklo_epi16(
c, d);
2738 __m256i ab_8f = _mm256_unpackhi_epi16(
a,
b);
2739 __m256i cd_8f = _mm256_unpackhi_epi16(
c, d);
2741 __m256i abcd_03 = _mm256_unpacklo_epi32(ab_07, cd_07);
2742 __m256i abcd_47 = _mm256_unpackhi_epi32(ab_07, cd_07);
2743 __m256i abcd_8b = _mm256_unpacklo_epi32(ab_8f, cd_8f);
2744 __m256i abcd_cf = _mm256_unpackhi_epi32(ab_8f, cd_8f);
2747 kernel.packet[0] = _mm256_permute2x128_si256(abcd_03, abcd_47, 0x20);
2748 kernel.packet[1] = _mm256_permute2x128_si256(abcd_8b, abcd_cf, 0x20);
2749 kernel.packet[2] = _mm256_permute2x128_si256(abcd_03, abcd_47, 0x31);
2750 kernel.packet[3] = _mm256_permute2x128_si256(abcd_8b, abcd_cf, 0x31);
#define EIGEN_EXTRACT_8i_FROM_16i(INPUT, OUTPUT)
#define PACK_OUTPUT_2(OUTPUT, INPUT, INDEX, STRIDE)
#define SHUFFLE_EPI32(A, B, M)
#define PACK_OUTPUT_D(OUTPUT, INPUT, INDEX, STRIDE)
#define PACK_OUTPUT_I32_2(OUTPUT, INPUT, INDEX, STRIDE)
#define EIGEN_EXTRACT_8f_FROM_16f(INPUT, OUTPUT)
#define PACK_OUTPUT(OUTPUT, INPUT, INDEX, STRIDE)
#define PACK_OUTPUT_I32(OUTPUT, INPUT, INDEX, STRIDE)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
#define EIGEN_DEBUG_ALIGNED_STORE
#define EIGEN_DEBUG_ALIGNED_LOAD
#define EIGEN_DEBUG_UNALIGNED_STORE
#define EIGEN_DEBUG_UNALIGNED_LOAD
#define EIGEN_DEVICE_FUNC
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
EIGEN_CONSTEXPR __half_raw raw_uint16_to_half(numext::uint16_t x)
Packet pmin(const Packet &a, const Packet &b)
Packet pnmsub(const Packet &a, const Packet &b, const Packet &c)
Packet padd(const Packet &a, const Packet &b)
Packet16bf pround< Packet16bf >(const Packet16bf &a)
Packet8f pzero(const Packet8f &)
Packet16h pmax< Packet16h >(const Packet16h &a, const Packet16h &b)
void pstore(Scalar *to, const Packet &from)
void pstore< float >(float *to, const Packet4f &from)
void pscatter< float, Packet16f >(float *to, const Packet16f &from, Index stride, uint16_t umask)
half predux_mul< Packet16h >(const Packet16h &from)
Packet8d pload1< Packet8d >(const double *from)
void pstoreu< half >(Eigen::half *to, const Packet16h &from)
Packet8d pfrexp< Packet8d >(const Packet8d &a, Packet8d &exponent)
Packet16i pand< Packet16i >(const Packet16i &a, const Packet16i &b)
Packet4d predux_half_dowto4< Packet8d >(const Packet8d &a)
Eigen::half predux_max< Packet16h >(const Packet16h &a)
Packet16i psub< Packet16i >(const Packet16i &a, const Packet16i &b)
Packet8d pdiv< Packet8d >(const Packet8d &a, const Packet8d &b)
Packet8d pmin< PropagateNaN, Packet8d >(const Packet8d &a, const Packet8d &b)
unpacket_traits< Packet >::type predux(const Packet &a)
bfloat16 predux< Packet16bf >(const Packet16bf &p)
void pscatter< half, Packet16h >(half *to, const Packet16h &from, Index stride)
Packet8h ptrue(const Packet8h &a)
Packet4f pcmp_lt_or_nan(const Packet4f &a, const Packet4f &b)
Packet8d por< Packet8d >(const Packet8d &a, const Packet8d &b)
Packet8d ploadquad< Packet8d >(const double *from)
void pstore< int >(int *to, const Packet4i &from)
Packet16f por< Packet16f >(const Packet16f &a, const Packet16f &b)
Packet16i ptrue< Packet16i >(const Packet16i &)
Packet8d ploadu< Packet8d >(const double *from)
Packet8bf F32ToBf16(Packet4f p4f)
Packet8d pmax< Packet8d >(const Packet8d &a, const Packet8d &b)
Packet16i pmin< Packet16i >(const Packet16i &a, const Packet16i &b)
Packet16i pmul< Packet16i >(const Packet16i &a, const Packet16i &b)
Packet16h pfloor< Packet16h >(const Packet16h &a)
Packet16h plset< Packet16h >(const half &a)
bfloat16 predux_min< Packet16bf >(const Packet16bf &from)
bfloat16 predux_mul< Packet16bf >(const Packet16bf &from)
Packet8i pdiv< Packet8i >(const Packet8i &a, const Packet8i &b)
Packet16f print< Packet16f >(const Packet16f &a)
Packet8f extract256(Packet16f x)
Packet8d ptrue< Packet8d >(const Packet8d &a)
Packet8h padd< Packet8h >(const Packet8h &a, const Packet8h &b)
Packet16f pand< Packet16f >(const Packet16f &a, const Packet16f &b)
Packet16f pmin< PropagateNaN, Packet16f >(const Packet16f &a, const Packet16f &b)
Packet8d pmin< PropagateNumbers, Packet8d >(const Packet8d &a, const Packet8d &b)
Packet8d pxor< Packet8d >(const Packet8d &a, const Packet8d &b)
Packet16f plset< Packet16f >(const float &a)
Packet8h predux_half_dowto4< Packet16h >(const Packet16h &a)
Packet16h ploadu< Packet16h >(const Eigen::half *from)
double pfirst< Packet8d >(const Packet8d &a)
double predux_max< Packet8d >(const Packet8d &a)
float predux_mul< Packet16f >(const Packet16f &a)
Packet8h pandnot(const Packet8h &a, const Packet8h &b)
Packet16i ploaddup< Packet16i >(const int *from)
Packet16f pmax< PropagateNumbers, Packet16f >(const Packet16f &a, const Packet16f &b)
Packet8i pxor< Packet8i >(const Packet8i &a, const Packet8i &b)
Packet4f pabs(const Packet4f &a)
Packet16i pdiv< Packet16i >(const Packet16i &a, const Packet16i &b)
Packet pmax(const Packet &a, const Packet &b)
Packet8f Bf16ToF32(const Packet8bf &a)
double predux< Packet8d >(const Packet8d &a)
bfloat16 predux_max< Packet16bf >(const Packet16bf &from)
Packet2cf pnegate(const Packet2cf &a)
float predux_max< Packet16f >(const Packet16f &a)
void pscatter< double, Packet8d >(double *to, const Packet8d &from, Index stride, uint8_t umask)
Packet16h pmin< Packet16h >(const Packet16h &a, const Packet16h &b)
Packet16i ploadu< Packet16i >(const int *from)
Packet16h print< Packet16h >(const Packet16h &a)
Packet4i plogical_shift_right(const Packet4i &a)
Packet16f pandnot< Packet16f >(const Packet16f &a, const Packet16f &b)
int predux< Packet8i >(const Packet8i &a)
double predux_mul< Packet8d >(const Packet8d &a)
Packet pminmax_propagate_nan(const Packet &a, const Packet &b, Op op)
Packet8d pldexp< Packet8d >(const Packet8d &a, const Packet8d &exponent)
Packet8d pand< Packet8d >(const Packet8d &a, const Packet8d &b)
Packet16bf pgather< bfloat16, Packet16bf >(const bfloat16 *from, Index stride)
Packet8d plset< Packet8d >(const double &a)
float predux< Packet8f >(const Packet8f &a)
__m256i Pack32To16(Packet16f rf)
Packet16bf pmax< Packet16bf >(const Packet16bf &a, const Packet16bf &b)
Packet16h pset1< Packet16h >(const Eigen::half &from)
Packet4f pmadd(const Packet4f &a, const Packet4f &b, const Packet4f &c)
Packet16bf print< Packet16bf >(const Packet16bf &a)
Packet16i por< Packet16i >(const Packet16i &a, const Packet16i &b)
Packet2cf pcmp_eq(const Packet2cf &a, const Packet2cf &b)
eigen_packet_wrapper< __m256i, 2 > Packet16bf
Packet16bf padd< Packet16bf >(const Packet16bf &a, const Packet16bf &b)
Packet16f ptrue< Packet16f >(const Packet16f &a)
bfloat16 pfirst(const Packet8bf &a)
Packet16h pload< Packet16h >(const Eigen::half *from)
void pscatter< bfloat16, Packet16bf >(bfloat16 *to, const Packet16bf &from, Index stride)
void pstoreu< double >(double *to, const Packet4d &from)
Packet4f pselect(const Packet4f &mask, const Packet4f &a, const Packet4f &b)
Packet pmul(const Packet &a, const Packet &b)
void pscatter(Scalar *to, const Packet &from, Index stride, typename unpacket_traits< Packet >::mask_t umask)
Packet16i pxor< Packet16i >(const Packet16i &a, const Packet16i &b)
Packet16f pfrexp< Packet16f >(const Packet16f &a, Packet16f &exponent)
Packet16i pgather< int, Packet16i >(const int *from, Index stride)
void ptranspose(PacketBlock< Packet2cf, 2 > &kernel)
Packet4d pfrexp_generic_get_biased_exponent(const Packet4d &a)
Packet pmsub(const Packet &a, const Packet &b, const Packet &c)
Packet8i pandnot< Packet8i >(const Packet8i &a, const Packet8i &b)
Packet16f ploaddup< Packet16f >(const float *from)
Packet16f pmax< Packet16f >(const Packet16f &a, const Packet16f &b)
Packet4i ploadu< Packet4i >(const int *from)
Packet pfrexp_generic(const Packet &a, Packet &exponent)
Packet pldexp_generic(const Packet &a, const Packet &exponent)
Packet16f ploadu< Packet16f >(const float *from)
Packet8d psub< Packet8d >(const Packet8d &a, const Packet8d &b)
void pstoreu< bfloat16 >(bfloat16 *to, const Packet8bf &from)
eigen_packet_wrapper< __vector unsigned short int, 0 > Packet8bf
Eigen::half pfirst< Packet16h >(const Packet16h &from)
Packet pminmax_propagate_numbers(const Packet &a, const Packet &b, Op op)
Packet16i pandnot< Packet16i >(const Packet16i &a, const Packet16i &b)
Packet16f pldexp< Packet16f >(const Packet16f &a, const Packet16f &exponent)
Packet8i pand< Packet8i >(const Packet8i &a, const Packet8i &b)
Packet8h float2half(const Packet8f &a)
Packet8d pceil< Packet8d >(const Packet8d &a)
Packet4f ploadu< Packet4f >(const float *from)
Packet16bf ploaddup< Packet16bf >(const bfloat16 *from)
Packet16i pmax< Packet16i >(const Packet16i &a, const Packet16i &b)
Packet8bf predux_half_dowto4< Packet16bf >(const Packet16bf &a)
Packet16f pmax< PropagateNaN, Packet16f >(const Packet16f &a, const Packet16f &b)
Packet16i pload< Packet16i >(const int *from)
Packet pnmadd(const Packet &a, const Packet &b, const Packet &c)
Packet16bf pceil< Packet16bf >(const Packet16bf &a)
Packet16f pmin< PropagateNumbers, Packet16f >(const Packet16f &a, const Packet16f &b)
Packet psub(const Packet &a, const Packet &b)
void pstore< half >(Eigen::half *to, const Packet16h &from)
Packet16bf pmul< Packet16bf >(const Packet16bf &a, const Packet16bf &b)
Packet16f pceil< Packet16f >(const Packet16f &a)
Packet8d pset1frombits< Packet8d >(const numext::uint64_t from)
void prefetch< float >(const float *addr)
void prefetch< double >(const double *addr)
Packet pgather(const Packet &src, const Scalar *from, Index stride, typename unpacket_traits< Packet >::mask_t umask)
unpacket_traits< Packet >::type predux_mul(const Packet &a)
Packet8d pload< Packet8d >(const double *from)
Packet8f half2float(const Packet8h &a)
Packet16h padd< Packet16h >(const Packet16h &a, const Packet16h &b)
Packet8h pand(const Packet8h &a, const Packet8h &b)
Packet16h ploadquad(const Eigen::half *from)
Packet16i pset1< Packet16i >(const int &from)
const char * SsePrefetchPtrType
float predux< Packet16f >(const Packet16f &a)
void pstoreu< float >(float *to, const Packet4f &from)
double predux_min< Packet8d >(const Packet8d &a)
Packet16f pfloor< Packet16f >(const Packet16f &a)
Packet16h pmul< Packet16h >(const Packet16h &a, const Packet16h &b)
Packet8d padd< Packet8d >(const Packet8d &a, const Packet8d &b)
Packet16bf pmin< Packet16bf >(const Packet16bf &a, const Packet16bf &b)
Packet8d pmax< PropagateNaN, Packet8d >(const Packet8d &a, const Packet8d &b)
Packet16f pround< Packet16f >(const Packet16f &a)
eigen_packet_wrapper< __m256i, 0 > Packet8i
Packet16bf pset1< Packet16bf >(const bfloat16 &from)
Packet8i predux_half_dowto4< Packet16i >(const Packet16i &a)
Packet16bf plset< Packet16bf >(const bfloat16 &a)
half predux< Packet16h >(const Packet16h &from)
Packet8d print< Packet8d >(const Packet8d &a)
Packet16bf pload< Packet16bf >(const bfloat16 *from)
Packet8d pmin< Packet8d >(const Packet8d &a, const Packet8d &b)
Packet8h pxor(const Packet8h &a, const Packet8h &b)
Packet8bf padd< Packet8bf >(const Packet8bf &a, const Packet8bf &b)
Packet8f predux_half_dowto4< Packet16f >(const Packet16f &a)
Packet16i cat256i(Packet8i a, Packet8i b)
Packet8d pset1< Packet8d >(const double &from)
Packet16f pdiv< Packet16f >(const Packet16f &a, const Packet16f &b)
Packet16bf pfloor< Packet16bf >(const Packet16bf &a)
Packet16f padd< Packet16f >(const Packet16f &a, const Packet16f &b)
Packet8i pset1< Packet8i >(const int &from)
Packet16f pxor< Packet16f >(const Packet16f &a, const Packet16f &b)
Packet8bf psignbit(const Packet8bf &a)
Packet pdiv(const Packet &a, const Packet &b)
Packet4i pblend(const Selector< 4 > &ifPacket, const Packet4i &thenPacket, const Packet4i &elsePacket)
int pfirst< Packet16i >(const Packet16i &a)
bfloat16 pfirst< Packet16bf >(const Packet16bf &from)
Packet2d extract128(Packet8d x)
Packet8d ploaddup< Packet8d >(const double *from)
Packet16f cat256(Packet8f a, Packet8f b)
Packet2cf pconj(const Packet2cf &a)
Packet16f pmin< Packet16f >(const Packet16f &a, const Packet16f &b)
void pstoreu< int >(int *to, const Packet4i &from)
Packet16f ploadquad< Packet16f >(const float *from)
void pscatter< int, Packet16i >(int *to, const Packet16i &from, Index stride)
Packet16f pgather< float, Packet16f >(const Packet16f &src, const float *from, Index stride, uint16_t umask)
Packet16h psub< Packet16h >(const Packet16h &a, const Packet16h &b)
Packet4i plogical_shift_left(const Packet4i &a)
Packet8i ptrue< Packet8i >(const Packet8i &a)
Packet2cf preverse(const Packet2cf &a)
Packet4i parithmetic_shift_right(const Packet4i &a)
Packet16f psub< Packet16f >(const Packet16f &a, const Packet16f &b)
Packet16i ploadquad< Packet16i >(const int *from)
Packet16h ploaddup< Packet16h >(const Eigen::half *from)
Packet8d pgather< double, Packet8d >(const Packet8d &src, const double *from, Index stride, uint8_t umask)
void pstore1< Packet16f >(float *to, const float &a)
float pfirst< Packet16f >(const Packet16f &a)
Packet8h por(const Packet8h &a, const Packet8h &b)
Packet16f pload1< Packet16f >(const float *from)
Packet4i pcmp_lt(const Packet4i &a, const Packet4i &b)
Packet16f pload< Packet16f >(const float *from)
Packet8d pandnot< Packet8d >(const Packet8d &a, const Packet8d &b)
Packet8f pisnan(const Packet8f &a)
Packet16f pset1< Packet16f >(const float &from)
eigen_packet_wrapper< __m256i, 1 > Packet16h
Packet16i plset< Packet16i >(const int &a)
Packet8d pmul< Packet8d >(const Packet8d &a, const Packet8d &b)
Packet8i por< Packet8i >(const Packet8i &a, const Packet8i &b)
void pstore< bfloat16 >(bfloat16 *to, const Packet8bf &from)
void prefetch< int >(const int *addr)
Packet8d pround< Packet8d >(const Packet8d &a)
Packet16h pdiv< Packet16h >(const Packet16h &a, const Packet16h &b)
Packet16f pset1frombits< Packet16f >(unsigned int from)
Packet16i padd< Packet16i >(const Packet16i &a, const Packet16i &b)
void pstore1< Packet16i >(int *to, const int &a)
Packet16bf psub< Packet16bf >(const Packet16bf &a, const Packet16bf &b)
Packet8d pmax< PropagateNumbers, Packet8d >(const Packet8d &a, const Packet8d &b)
Packet16f pmul< Packet16f >(const Packet16f &a, const Packet16f &b)
Packet16bf ploadu< Packet16bf >(const bfloat16 *from)
Eigen::half predux_min< Packet16h >(const Packet16h &a)
bool predux_any(const Packet4f &x)
Packet16bf pdiv< Packet16bf >(const Packet16bf &a, const Packet16bf &b)
Packet16h pround< Packet16h >(const Packet16h &a)
eigen_packet_wrapper< __m128i, 2 > Packet8h
Packet8d pfloor< Packet8d >(const Packet8d &a)
void pstore< double >(double *to, const Packet4d &from)
Packet4f pcmp_le(const Packet4f &a, const Packet4f &b)
Packet16h pceil< Packet16h >(const Packet16h &a)
void pstore1< Packet8d >(double *to, const double &a)
int predux< Packet16i >(const Packet16i &a)
float predux_min< Packet16f >(const Packet16f &a)
Packet8f peven_mask(const Packet8f &)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.