10 #ifndef EIGEN_PACKET_MATH_ALTIVEC_H
11 #define EIGEN_PACKET_MATH_ALTIVEC_H
13 #include "../../InternalHeaderCheck.h"
19 #ifndef EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD
20 #define EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 4
23 #ifndef EIGEN_HAS_SINGLE_INSTRUCTION_MADD
24 #define EIGEN_HAS_SINGLE_INSTRUCTION_MADD
28 #ifndef EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS
29 #define EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS 32
41 typedef eigen_packet_wrapper<__vector unsigned short int,0>
Packet8bf;
45 #define EIGEN_DECLARE_CONST_FAST_Packet4f(NAME,X) \
46 Packet4f p4f_##NAME = {X, X, X, X}
48 #define EIGEN_DECLARE_CONST_FAST_Packet4i(NAME,X) \
49 Packet4i p4i_##NAME = vec_splat_s32(X)
51 #define EIGEN_DECLARE_CONST_FAST_Packet4ui(NAME,X) \
52 Packet4ui p4ui_##NAME = {X, X, X, X}
54 #define EIGEN_DECLARE_CONST_FAST_Packet8us(NAME,X) \
55 Packet8us p8us_##NAME = {X, X, X, X, X, X, X, X}
57 #define EIGEN_DECLARE_CONST_FAST_Packet16uc(NAME,X) \
58 Packet16uc p16uc_##NAME = {X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X}
60 #define EIGEN_DECLARE_CONST_Packet4f(NAME,X) \
61 Packet4f p4f_##NAME = pset1<Packet4f>(X)
63 #define EIGEN_DECLARE_CONST_Packet4i(NAME,X) \
64 Packet4i p4i_##NAME = pset1<Packet4i>(X)
66 #define EIGEN_DECLARE_CONST_Packet2d(NAME,X) \
67 Packet2d p2d_##NAME = pset1<Packet2d>(X)
69 #define EIGEN_DECLARE_CONST_Packet2l(NAME,X) \
70 Packet2l p2l_##NAME = pset1<Packet2l>(X)
72 #define EIGEN_DECLARE_CONST_Packet4f_FROM_INT(NAME,X) \
73 const Packet4f p4f_##NAME = reinterpret_cast<Packet4f>(pset1<Packet4i>(X))
76 #define DST_CTRL(size, count, stride) (((size) << 24) | ((count) << 16) | (stride))
77 #define __UNPACK_TYPE__(PACKETNAME) typename unpacket_traits<PACKETNAME>::type
99 8, 9, 10, 11, 12, 13, 14, 15};
101 8, 9, 10, 11, 12, 13, 14, 15};
103 static Packet16uc p16uc_REVERSE32 = { 12,13,14,15, 8,9,10,11, 4,5,6,7, 0,1,2,3 };
104 static Packet16uc p16uc_REVERSE16 = { 14,15, 12,13, 10,11, 8,9, 6,7, 4,5, 2,3, 0,1 };
106 static Packet16uc p16uc_REVERSE8 = { 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 };
110 static Packet16uc p16uc_DUPLICATE32_HI = { 0,1,2,3, 0,1,2,3, 4,5,6,7, 4,5,6,7 };
112 static const Packet16uc p16uc_DUPLICATE16_EVEN= { 0,1 ,0,1, 4,5, 4,5, 8,9, 8,9, 12,13, 12,13 };
113 static const Packet16uc p16uc_DUPLICATE16_ODD = { 2,3 ,2,3, 6,7, 6,7, 10,11, 10,11, 14,15, 14,15 };
115 static Packet16uc p16uc_QUADRUPLICATE16_HI = { 0,1,0,1,0,1,0,1, 2,3,2,3,2,3,2,3 };
117 static Packet16uc p16uc_MERGEE16 = { 0,1, 16,17, 4,5, 20,21, 8,9, 24,25, 12,13, 28,29 };
118 static Packet16uc p16uc_MERGEO16 = { 2,3, 18,19, 6,7, 22,23, 10,11, 26,27, 14,15, 30,31 };
120 static Packet16uc p16uc_MERGEH16 = { 0,1, 4,5, 8,9, 12,13, 16,17, 20,21, 24,25, 28,29 };
122 static Packet16uc p16uc_MERGEL16 = { 2,3, 6,7, 10,11, 14,15, 18,19, 22,23, 26,27, 30,31 };
146 #if EIGEN_HAS_BUILTIN(__builtin_prefetch) || EIGEN_COMP_GNUC
147 #define EIGEN_PPC_PREFETCH(ADDR) __builtin_prefetch(ADDR);
149 #define EIGEN_PPC_PREFETCH(ADDR) asm( " dcbt [%[addr]]\n" :: [addr] "r" (ADDR) : "cc" );
153 #define LOAD_STORE_UNROLL_16 _Pragma("unroll 16")
155 #define LOAD_STORE_UNROLL_16 _Pragma("GCC unroll(16)")
159 struct packet_traits<float> : default_packet_traits {
182 #ifdef EIGEN_VECTORIZE_VSX
184 #if !EIGEN_COMP_CLANG
207 struct packet_traits<bfloat16> : default_packet_traits {
226 #ifdef EIGEN_VECTORIZE_VSX
228 #if !EIGEN_COMP_CLANG
250 struct packet_traits<int> : default_packet_traits {
262 #if defined(_ARCH_PWR10) && (EIGEN_COMP_LLVM || EIGEN_GNUC_STRICT_AT_LEAST(11,0,0))
273 struct packet_traits<short int> : default_packet_traits {
291 struct packet_traits<unsigned short int> : default_packet_traits {
309 struct packet_traits<signed char> : default_packet_traits {
327 struct packet_traits<unsigned char> : default_packet_traits {
344 template<>
struct unpacket_traits<
Packet4f>
349 enum {
size=4, alignment=
Aligned16, vectorizable=
true, masked_load_available=
false, masked_store_available=
false};
351 template<>
struct unpacket_traits<
Packet4i>
355 enum {
size=4, alignment=
Aligned16, vectorizable=
true, masked_load_available=
false, masked_store_available=
false};
357 template<>
struct unpacket_traits<
Packet8s>
359 typedef short int type;
361 enum {
size=8, alignment=
Aligned16, vectorizable=
true, masked_load_available=
false, masked_store_available=
false};
363 template<>
struct unpacket_traits<
Packet8us>
365 typedef unsigned short int type;
367 enum {
size=8, alignment=
Aligned16, vectorizable=
true, masked_load_available=
false, masked_store_available=
false};
370 template<>
struct unpacket_traits<
Packet16c>
372 typedef signed char type;
374 enum {
size=16, alignment=
Aligned16, vectorizable=
true, masked_load_available=
false, masked_store_available=
false};
378 typedef unsigned char type;
380 enum {
size=16, alignment=
Aligned16, vectorizable=
true, masked_load_available=
false, masked_store_available=
false};
383 template<>
struct unpacket_traits<
Packet8bf>
385 typedef bfloat16 type;
387 enum {
size=8, alignment=
Aligned16, vectorizable=
true, masked_load_available=
false, masked_store_available=
false};
396 for (
int i=0;
i< 16;
i++)
397 s << vt.n[
i] <<
", ";
408 for (
int i=0;
i< 16;
i++)
409 s << vt.n[
i] <<
", ";
420 s << vt.n[0] <<
", " << vt.n[1] <<
", " << vt.n[2] <<
", " << vt.n[3];
431 s << vt.n[0] <<
", " << vt.n[1] <<
", " << vt.n[2] <<
", " << vt.n[3];
442 s << vt.n[0] <<
", " << vt.n[1] <<
", " << vt.n[2] <<
", " << vt.n[3];
446 template <
typename Packet>
453 #ifdef EIGEN_VECTORIZE_VSX
456 return vec_ld(0, from);
463 return pload_common<Packet4f>(from);
468 return pload_common<Packet4i>(from);
473 return pload_common<Packet8s>(from);
478 return pload_common<Packet8us>(from);
483 return pload_common<Packet16c>(from);
488 return pload_common<Packet16uc>(from);
493 return pload_common<Packet8us>(
reinterpret_cast<const unsigned short int*
>(from));
496 template <
typename Packet>
505 #pragma GCC diagnostic push
506 #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
508 #ifdef EIGEN_VECTORIZE_VSX
511 return vec_ld(0, from);
514 #pragma GCC diagnostic pop
520 return pload_ignore<Packet8us>(
reinterpret_cast<const unsigned short int*
>(from));
523 template <
typename Packet>
529 eigen_internal_assert(
n + offset <= packet_size &&
"number of elements plus offset will read past end of packet");
539 load = Packet(vec_sro(
Packet16uc(load), shift));
541 load = Packet(vec_slo(
Packet16uc(load), shift));
548 unsigned char* load2 =
reinterpret_cast<unsigned char *
>(load + offset);
549 unsigned char* from2 =
reinterpret_cast<unsigned char *
>(
const_cast<__UNPACK_TYPE__(Packet)*
>(from));
554 memcpy((
void *)load2, (
void *)from2, n2);
556 return pload_ignore<Packet>(load);
565 return pload_partial_common<Packet4f>(from,
n, offset);
570 return pload_partial_common<Packet4i>(from,
n, offset);
575 return pload_partial_common<Packet8s>(from,
n, offset);
580 return pload_partial_common<Packet8us>(from,
n, offset);
585 return pload_partial_common<Packet8us>(
reinterpret_cast<const unsigned short int*
>(from),
n, offset);
590 return pload_partial_common<Packet16c>(from,
n, offset);
595 return pload_partial_common<Packet16uc>(from,
n, offset);
598 template <
typename Packet>
604 #ifdef EIGEN_VECTORIZE_VSX
605 vec_xst(from, 0, to);
613 pstore_common<Packet4f>(to, from);
618 pstore_common<Packet4i>(to, from);
623 pstore_common<Packet8s>(to, from);
628 pstore_common<Packet8us>(to, from);
633 pstore_common<Packet8us>(
reinterpret_cast<unsigned short int*
>(to), from.m_val);
638 pstore_common<Packet16c>(to, from);
643 pstore_common<Packet16uc>(to, from);
651 eigen_internal_assert(
n + offset <= packet_size &&
"number of elements plus offset will write past end of packet");
661 store = Packet(vec_slo(
Packet16uc(store), shift));
663 store = Packet(vec_sro(
Packet16uc(store), shift));
666 vec_xst_len(store, to,
n *
size);
671 unsigned char* store2 =
reinterpret_cast<unsigned char *
>(store + offset);
672 unsigned char* to2 =
reinterpret_cast<unsigned char *
>(to);
677 memcpy((
void *)to2, (
void *)store2, n2);
685 pstore_partial_common<Packet4f>(to, from,
n, offset);
690 pstore_partial_common<Packet4i>(to, from,
n, offset);
695 pstore_partial_common<Packet8s>(to, from,
n, offset);
700 pstore_partial_common<Packet8us>(to, from,
n, offset);
705 pstore_partial_common<Packet8us>(
reinterpret_cast<unsigned short int*
>(to), from.m_val,
n, offset);
710 pstore_partial_common<Packet16c>(to, from,
n, offset);
715 pstore_partial_common<Packet16uc>(to, from,
n, offset);
718 template<
typename Packet>
721 Packet
v = {from, from, from, from};
725 template<
typename Packet>
728 Packet
v = {from, from, from, from, from, from, from, from};
732 template<
typename Packet>
735 Packet
v = {from, from, from, from, from, from, from, from, from, from, from, from, from, from, from, from};
740 return pset1_size4<Packet4f>(from);
744 return pset1_size4<Packet4i>(from);
748 return pset1_size8<Packet8s>(from);
752 return pset1_size8<Packet8us>(from);
756 return pset1_size16<Packet16c>(from);
760 return pset1_size16<Packet16uc>(from);
768 return pset1_size8<Packet8us>(
reinterpret_cast<const unsigned short int&
>(from));
771 template<
typename Packet> EIGEN_STRONG_INLINE
void
773 Packet& a0, Packet& a1, Packet& a2, Packet& a3)
775 a3 = pload<Packet>(
a);
776 a0 = vec_splat(a3, 0);
777 a1 = vec_splat(a3, 1);
778 a2 = vec_splat(a3, 2);
779 a3 = vec_splat(a3, 3);
782 template<> EIGEN_STRONG_INLINE
void
786 pbroadcast4_common<Packet4f>(
a, a0, a1, a2, a3);
788 template<> EIGEN_STRONG_INLINE
void
792 pbroadcast4_common<Packet4i>(
a, a0, a1, a2, a3);
801 return ploadu<Packet>(from);
803 return ploadu_partial<Packet>(from,
n);
808 a[
i] = from[
i*stride];
811 return pload_ignore<Packet>(
a);
817 return pgather_common<Packet4f>(from, stride);
822 return pgather_common<Packet4i>(from, stride);
827 return pgather_common<Packet8s>(from, stride);
832 return pgather_common<Packet8us>(from, stride);
837 return pgather_common<Packet8bf>(from, stride);
842 return pgather_common<Packet16c>(from, stride);
847 return pgather_common<Packet16uc>(from, stride);
852 return pgather_common<Packet4f>(from, stride,
n);
857 return pgather_common<Packet4i>(from, stride,
n);
862 return pgather_common<Packet8s>(from, stride,
n);
867 return pgather_common<Packet8us>(from, stride,
n);
872 return pgather_common<Packet8bf>(from, stride,
n);
877 return pgather_common<Packet16c>(from, stride,
n);
882 return pgather_common<Packet16uc>(from, stride,
n);
896 pstore<__UNPACK_TYPE__(Packet)>(
a, from);
906 pscatter_common<Packet4f>(to, from, stride);
911 pscatter_common<Packet4i>(to, from, stride);
916 pscatter_common<Packet8s>(to, from, stride);
921 pscatter_common<Packet8us>(to, from, stride);
926 pscatter_common<Packet8bf>(to, from, stride);
931 pscatter_common<Packet16c>(to, from, stride);
936 pscatter_common<Packet16uc>(to, from, stride);
941 pscatter_common<Packet4f>(to, from, stride,
n);
946 pscatter_common<Packet4i>(to, from, stride,
n);
951 pscatter_common<Packet8s>(to, from, stride,
n);
956 pscatter_common<Packet8us>(to, from, stride,
n);
961 pscatter_common<Packet8bf>(to, from, stride,
n);
966 pscatter_common<Packet16c>(to, from, stride,
n);
971 pscatter_common<Packet16uc>(to, from, stride,
n);
998 #ifdef __POWER8_VECTOR__
1006 #ifdef __POWER8_VECTOR__
1009 return reinterpret_cast<Packet16c>(p4i_ZERO) -
a;
1014 #ifdef __POWER8_VECTOR__
1017 return reinterpret_cast<Packet8s>(p4i_ZERO) -
a;
1022 #ifdef __POWER8_VECTOR__
1025 return p4i_ZERO -
a;
1050 y_1 = vec_madd(y_0, t, y_0);
1054 return vec_div(
a,
b);
1060 #if defined(_ARCH_PWR10) && (EIGEN_COMP_LLVM || EIGEN_GNUC_STRICT_AT_LEAST(11,0,0))
1061 return vec_div(
a,
b);
1065 eigen_assert(
false &&
"packet integer division are not supported by AltiVec");
1076 #ifdef EIGEN_VECTORIZE_VSX
1084 #ifdef EIGEN_VECTORIZE_VSX
1087 __asm__ (
"xvcmpgesp %x0,%x1,%x2\n\txxsel %x0,%x1,%x2,%x0" :
"=&wa" (ret) :
"wa" (
a),
"wa" (
b));
1090 return vec_min(
a,
b);
1102 #ifdef EIGEN_VECTORIZE_VSX
1105 __asm__ (
"xvcmpgtsp %x0,%x2,%x1\n\txxsel %x0,%x1,%x2,%x0" :
"=&wa" (ret) :
"wa" (
a),
"wa" (
b));
1108 return vec_max(
a,
b);
1119 #ifdef EIGEN_VECTORIZE_VSX
1125 return vec_nor(
c,
c);
1128 #ifdef EIGEN_VECTORIZE_VSX
1133 #ifdef EIGEN_VECTORIZE_VSX
1138 #ifdef EIGEN_VECTORIZE_VSX
1143 #ifdef EIGEN_VECTORIZE_VSX
1148 #ifdef EIGEN_VECTORIZE_VSX
1182 return vec_sel(
b,
a,
reinterpret_cast<Packet4ui>(mask));
1190 #ifdef EIGEN_VECTORIZE_VSX
1191 __asm__(
"xvrspiz %x0, %x1\n\t"
1195 __asm__(
"vrfiz %0, %1\n\t"
1204 #ifdef EIGEN_VECTORIZE_VSX
1209 __asm__(
"xvrspic %x0, %x1\n\t"
1220 #if defined(EIGEN_VECTORIZE_VSX) || !defined(_BIG_ENDIAN)
1226 MSQ = vec_ld(0, (
unsigned char *)from);
1227 LSQ = vec_ld(15, (
unsigned char *)from);
1228 mask = vec_lvsl(0, from);
1230 return (Packet) vec_perm(MSQ, LSQ, mask);
1236 return ploadu_common<Packet4f>(from);
1240 return ploadu_common<Packet4i>(from);
1244 return ploadu_common<Packet8s>(from);
1248 return ploadu_common<Packet8us>(from);
1252 return ploadu_common<Packet8us>(
reinterpret_cast<const unsigned short int*
>(from));
1256 return ploadu_common<Packet16c>(from);
1260 return ploadu_common<Packet16uc>(from);
1266 eigen_internal_assert(
n + offset <= packet_size &&
"number of elements plus offset will read past end of packet");
1276 load = Packet(vec_sro(
Packet16uc(load), shift));
1278 load = Packet(vec_slo(
Packet16uc(load), shift));
1285 unsigned char* load2 =
reinterpret_cast<unsigned char *
>(load + offset);
1286 unsigned char* from2 =
reinterpret_cast<unsigned char *
>(
const_cast<__UNPACK_TYPE__(Packet)*
>(from));
1291 memcpy((
void *)load2, (
void *)from2, n2);
1293 return pload_ignore<Packet>(load);
1302 return ploadu_partial_common<Packet4f>(from,
n, offset);
1306 return ploadu_partial_common<Packet4i>(from,
n, offset);
1310 return ploadu_partial_common<Packet8s>(from,
n, offset);
1314 return ploadu_partial_common<Packet8us>(from,
n, offset);
1318 return ploadu_partial_common<Packet8us>(
reinterpret_cast<const unsigned short int*
>(from),
n, offset);
1322 return ploadu_partial_common<Packet16c>(from,
n, offset);
1326 return ploadu_partial_common<Packet16uc>(from,
n, offset);
1332 if((std::ptrdiff_t(from) % 16) == 0)
p = pload<Packet>(from);
1333 else p = ploadu<Packet>(from);
1334 return vec_mergeh(
p,
p);
1338 return ploaddup_common<Packet4f>(from);
1342 return ploaddup_common<Packet4i>(from);
1350 return vec_mergeh(
p,
p);
1358 return vec_mergeh(
p,
p);
1387 return vec_mergeh(
p,
p);
1395 return vec_mergeh(
p,
p);
1401 #if defined(EIGEN_VECTORIZE_VSX) || !defined(_BIG_ENDIAN)
1402 vec_xst(from, 0, to);
1409 MSQ = vec_ld(0, (
unsigned char *)to);
1410 LSQ = vec_ld(15, (
unsigned char *)to);
1411 edgeAlign = vec_lvsl(0, to);
1412 edges=vec_perm(LSQ,MSQ,edgeAlign);
1413 align = vec_lvsr( 0, to );
1414 MSQ = vec_perm(edges,(
Packet16uc)from,align);
1415 LSQ = vec_perm((
Packet16uc)from,edges,align);
1416 vec_st( LSQ, 15, (
unsigned char *)to );
1417 vec_st( MSQ, 0, (
unsigned char *)to );
1422 pstoreu_common<Packet4f>(to, from);
1426 pstoreu_common<Packet4i>(to, from);
1430 pstoreu_common<Packet8s>(to, from);
1434 pstoreu_common<Packet8us>(to, from);
1438 pstoreu_common<Packet8us>(
reinterpret_cast<unsigned short int*
>(to), from.m_val);
1442 pstoreu_common<Packet16c>(to, from);
1446 pstoreu_common<Packet16uc>(to, from);
1452 eigen_internal_assert(
n + offset <= packet_size &&
"number of elements plus offset will write past end of packet");
1457 Packet store = from;
1461 store = Packet(vec_slo(
Packet16uc(store), shift));
1463 store = Packet(vec_sro(
Packet16uc(store), shift));
1466 vec_xst_len(store, to,
n *
size);
1471 unsigned char* store2 =
reinterpret_cast<unsigned char *
>(store + offset);
1472 unsigned char* to2 =
reinterpret_cast<unsigned char *
>(to);
1477 memcpy((
void *)to2, (
void *)store2, n2);
1485 pstoreu_partial_common<Packet4f>(to, from,
n, offset);
1489 pstoreu_partial_common<Packet4i>(to, from,
n, offset);
1493 pstoreu_partial_common<Packet8s>(to, from,
n, offset);
1497 pstoreu_partial_common<Packet8us>(to, from,
n, offset);
1501 pstoreu_partial_common<Packet8us>(
reinterpret_cast<unsigned short int*
>(to), from,
n, offset);
1505 pstoreu_partial_common<Packet16c>(to, from,
n, offset);
1509 pstoreu_partial_common<Packet16uc>(to, from,
n, offset);
1518 template<
typename Packet> EIGEN_STRONG_INLINE
__UNPACK_TYPE__(Packet) pfirst_common(
const Packet&
a) {
1525 return pfirst_common<Packet8s>(
a);
1529 return pfirst_common<Packet8us>(
a);
1534 return pfirst_common<Packet16c>(
a);
1539 return pfirst_common<Packet16uc>(
a);
1576 return preverse<Packet8us>(
a);
1603 return reinterpret_cast<Packet4f>(r);
1610 return reinterpret_cast<Packet4f>(r);
1616 return vec_sr(
a, p4ui_mask);
1622 return vec_sl(
a, p4ui_mask);
1628 return vec_sl(
a, p8us_mask);
1633 return vec_sr(
a, p8us_mask);
1637 return plogical_shift_left<16>(
reinterpret_cast<Packet4f>(bf.m_val));
1643 reinterpret_cast<Packet4f>(bf.m_val),
1644 reinterpret_cast<Packet4f>(p4ui_high_mask)
1664 #ifndef __VEC_CLASS_FP_NAN
1665 #define __VEC_CLASS_FP_NAN (1<<6)
1668 #if defined(SUPPORT_BF16_SUBNORMALS) && !defined(__VEC_CLASS_FP_SUBNORMAL)
1669 #define __VEC_CLASS_FP_SUBNORMAL_P (1<<1)
1670 #define __VEC_CLASS_FP_SUBNORMAL_N (1<<0)
1672 #define __VEC_CLASS_FP_SUBNORMAL (__VEC_CLASS_FP_SUBNORMAL_P | __VEC_CLASS_FP_SUBNORMAL_N)
1677 return reinterpret_cast<Packet8us>(__builtin_vsx_xvcvspbf16(
reinterpret_cast<Packet16uc>(p4f)));
1680 Packet4ui lsb = plogical_shift_right<16>(input);
1690 input = vec_sel(input, p4ui_nan, nan_selector);
1692 #ifdef SUPPORT_BF16_SUBNORMALS
1693 Packet4bi subnormal_selector = vec_test_data_class(p4f, __VEC_CLASS_FP_SUBNORMAL);
1694 input = vec_sel(input,
reinterpret_cast<Packet4ui>(p4f), subnormal_selector);
1697 #ifdef SUPPORT_BF16_SUBNORMALS
1709 reinterpret_cast<Packet4ui>(is_max_exp),
1710 reinterpret_cast<Packet4ui>(is_mant_zero)
1716 reinterpret_cast<Packet4ui>(is_zero_exp),
1717 reinterpret_cast<Packet4ui>(is_mant_zero)
1720 input = vec_sel(input, p4ui_nan, nan_selector);
1721 input = vec_sel(input,
reinterpret_cast<Packet4ui>(p4f), subnormal_selector);
1724 Packet4bi nan_selector = vec_cmpeq(p4f, p4f);
1726 input = vec_sel(p4ui_nan, input, nan_selector);
1730 input = plogical_shift_right<16>(input);
1731 return reinterpret_cast<Packet8us>(input);
1745 return vec_perm(
reinterpret_cast<Packet8us>(lo),
reinterpret_cast<Packet8us>(hi), p16uc_MERGEH16);
1792 template<
bool lohi = true>
1795 Packet8us p4f = Bf16PackHigh<lohi>(lo, hi);
1796 Packet8us p4f2 = Bf16PackLow<lohi>(lo, hi);
1803 Packet8bi rounding_bias = vec_cmplt(lsb, p4f2);
1809 Packet8us nan_selector = Bf16PackLow<lohi>(
reinterpret_cast<Packet4f>(nan_selector_lo),
reinterpret_cast<Packet4f>(nan_selector_hi));
1811 input = vec_sel(input, p8us_BIAS, nan_selector);
1813 #ifdef SUPPORT_BF16_SUBNORMALS
1814 Packet4bi subnormal_selector_lo = vec_test_data_class(lo, __VEC_CLASS_FP_SUBNORMAL);
1815 Packet4bi subnormal_selector_hi = vec_test_data_class(hi, __VEC_CLASS_FP_SUBNORMAL);
1816 Packet8us subnormal_selector = Bf16PackLow<lohi>(
reinterpret_cast<Packet4f>(subnormal_selector_lo),
reinterpret_cast<Packet4f>(subnormal_selector_hi));
1818 input = vec_sel(input,
reinterpret_cast<Packet8us>(p4f), subnormal_selector);
1821 #ifdef SUPPORT_BF16_SUBNORMALS
1833 reinterpret_cast<Packet8us>(is_max_exp),
1834 reinterpret_cast<Packet8us>(is_mant_zero)
1840 reinterpret_cast<Packet8us>(is_zero_exp),
1841 reinterpret_cast<Packet8us>(is_mant_zero)
1845 input = vec_sel(input, p8us_BIAS, nan_selector);
1846 input = vec_sel(input,
reinterpret_cast<Packet8us>(p4f), subnormal_selector);
1849 Packet4bi nan_selector_lo = vec_cmpeq(lo, lo);
1850 Packet4bi nan_selector_hi = vec_cmpeq(hi, hi);
1851 Packet8us nan_selector = Bf16PackLow<lohi>(
reinterpret_cast<Packet4f>(nan_selector_lo),
reinterpret_cast<Packet4f>(nan_selector_hi));
1853 input = vec_sel(p8us_BIAS, input, nan_selector);
1868 return vec_pack(
reinterpret_cast<Packet4ui>(fp16_0.m_val),
reinterpret_cast<Packet4ui>(fp16_1.m_val));
1881 return F32ToBf16Two<false>(even, odd);
1884 #define BF16_TO_F32_UNARY_OP_WRAPPER(OP, A) \
1885 Packet4f a_even = Bf16ToF32Even(A);\
1886 Packet4f a_odd = Bf16ToF32Odd(A);\
1887 Packet4f op_even = OP(a_even);\
1888 Packet4f op_odd = OP(a_odd);\
1889 return F32ToBf16(op_even, op_odd);\
1891 #define BF16_TO_F32_BINARY_OP_WRAPPER(OP, A, B) \
1892 Packet4f a_even = Bf16ToF32Even(A);\
1893 Packet4f a_odd = Bf16ToF32Odd(A);\
1894 Packet4f b_even = Bf16ToF32Even(B);\
1895 Packet4f b_odd = Bf16ToF32Odd(B);\
1896 Packet4f op_even = OP(a_even, b_even);\
1897 Packet4f op_odd = OP(a_odd, b_odd);\
1898 return F32ToBf16(op_even, op_odd);\
1900 #define BF16_TO_F32_BINARY_OP_WRAPPER_BOOL(OP, A, B) \
1901 Packet4f a_even = Bf16ToF32Even(A);\
1902 Packet4f a_odd = Bf16ToF32Odd(A);\
1903 Packet4f b_even = Bf16ToF32Even(B);\
1904 Packet4f b_odd = Bf16ToF32Odd(B);\
1905 Packet4f op_even = OP(a_even, b_even);\
1906 Packet4f op_odd = OP(a_odd, b_odd);\
1907 return F32ToBf16Bool(op_even, op_odd);\
1973 #ifdef EIGEN_VECTORIZE_VSX
1985 Packet4f pmadd_even = pmadd<Packet4f>(a_even, b_even, c_even);
1986 Packet4f pmadd_odd = pmadd<Packet4f>(a_odd, b_odd, c_odd);
1987 return F32ToBf16(pmadd_even, pmadd_odd);
2029 b = vec_sld(
a,
a, 8);
2031 b = vec_sld(sum, sum, 4);
2039 sum = vec_sums(
a, p4i_ZERO);
2041 sum = vec_sld(sum, p4i_ZERO, 12);
2043 sum = vec_sld(p4i_ZERO, sum, 4);
2052 float f32_result = redux_even + redux_odd;
2055 template<
typename Packet> EIGEN_STRONG_INLINE
__UNPACK_TYPE__(Packet) predux_size8(
const Packet&
a)
2063 EIGEN_ALIGN16 int first_loader[4] = { vt.n[0], vt.n[1], vt.n[2], vt.n[3] };
2064 EIGEN_ALIGN16 int second_loader[4] = { vt.n[4], vt.n[5], vt.n[6], vt.n[7] };
2073 return predux_size8<Packet8s>(
a);
2078 return predux_size8<Packet8us>(
a);
2081 template<
typename Packet> EIGEN_STRONG_INLINE
__UNPACK_TYPE__(Packet) predux_size16(
const Packet&
a)
2089 EIGEN_ALIGN16 int first_loader[4] = { vt.n[0], vt.n[1], vt.n[2], vt.n[3] };
2090 EIGEN_ALIGN16 int second_loader[4] = { vt.n[4], vt.n[5], vt.n[6], vt.n[7] };
2091 EIGEN_ALIGN16 int third_loader[4] = { vt.n[8], vt.n[9], vt.n[10], vt.n[11] };
2092 EIGEN_ALIGN16 int fourth_loader[4] = { vt.n[12], vt.n[13], vt.n[14], vt.n[15] };
2105 return predux_size16<Packet16c>(
a);
2110 return predux_size16<Packet16uc>(
a);
2118 prod =
pmul(
a, vec_sld(
a,
a, 8));
2119 return pfirst(
pmul(prod, vec_sld(prod, prod, 4)));
2126 return aux[0] * aux[1] * aux[2] * aux[3];
2133 pair = vec_mul(
a, vec_sld(
a,
a, 8));
2134 quad = vec_mul(pair, vec_sld(pair, pair, 4));
2135 octo = vec_mul(quad, vec_sld(quad, quad, 2));
2144 pair = vec_mul(
a, vec_sld(
a,
a, 8));
2145 quad = vec_mul(pair, vec_sld(pair, pair, 4));
2146 octo = vec_mul(quad, vec_sld(quad, quad, 2));
2155 float f32_result = redux_even * redux_odd;
2164 pair = vec_mul(
a, vec_sld(
a,
a, 8));
2165 quad = vec_mul(pair, vec_sld(pair, pair, 4));
2166 octo = vec_mul(quad, vec_sld(quad, quad, 2));
2167 result = vec_mul(octo, vec_sld(octo, octo, 1));
2176 pair = vec_mul(
a, vec_sld(
a,
a, 8));
2177 quad = vec_mul(pair, vec_sld(pair, pair, 4));
2178 octo = vec_mul(quad, vec_sld(quad, quad, 2));
2179 result = vec_mul(octo, vec_sld(octo, octo, 1));
2185 template<
typename Packet> EIGEN_STRONG_INLINE
2189 b = vec_min(
a, vec_sld(
a,
a, 8));
2190 res = vec_min(
b, vec_sld(
b,
b, 4));
2197 return predux_min4<Packet4f>(
a);
2202 return predux_min4<Packet4i>(
a);
2209 float f32_result = (
std::min)(redux_even, redux_odd);
2218 pair = vec_min(
a, vec_sld(
a,
a, 8));
2221 quad = vec_min(pair, vec_sld(pair, pair, 4));
2224 octo = vec_min(quad, vec_sld(quad, quad, 2));
2233 pair = vec_min(
a, vec_sld(
a,
a, 8));
2236 quad = vec_min(pair, vec_sld(pair, pair, 4));
2239 octo = vec_min(quad, vec_sld(quad, quad, 2));
2247 pair = vec_min(
a, vec_sld(
a,
a, 8));
2248 quad = vec_min(pair, vec_sld(pair, pair, 4));
2249 octo = vec_min(quad, vec_sld(quad, quad, 2));
2250 result = vec_min(octo, vec_sld(octo, octo, 1));
2259 pair = vec_min(
a, vec_sld(
a,
a, 8));
2260 quad = vec_min(pair, vec_sld(pair, pair, 4));
2261 octo = vec_min(quad, vec_sld(quad, quad, 2));
2262 result = vec_min(octo, vec_sld(octo, octo, 1));
2267 template<
typename Packet> EIGEN_STRONG_INLINE
__UNPACK_TYPE__(Packet) predux_max4(
const Packet&
a)
2270 b = vec_max(
a, vec_sld(
a,
a, 8));
2271 res = vec_max(
b, vec_sld(
b,
b, 4));
2277 return predux_max4<Packet4f>(
a);
2282 return predux_max4<Packet4i>(
a);
2289 float f32_result = (
std::max)(redux_even, redux_odd);
2298 pair = vec_max(
a, vec_sld(
a,
a, 8));
2301 quad = vec_max(pair, vec_sld(pair, pair, 4));
2304 octo = vec_max(quad, vec_sld(quad, quad, 2));
2313 pair = vec_max(
a, vec_sld(
a,
a, 8));
2316 quad = vec_max(pair, vec_sld(pair, pair, 4));
2319 octo = vec_max(quad, vec_sld(quad, quad, 2));
2327 pair = vec_max(
a, vec_sld(
a,
a, 8));
2328 quad = vec_max(pair, vec_sld(pair, pair, 4));
2329 octo = vec_max(quad, vec_sld(quad, quad, 2));
2330 result = vec_max(octo, vec_sld(octo, octo, 1));
2339 pair = vec_max(
a, vec_sld(
a,
a, 8));
2340 quad = vec_max(pair, vec_sld(pair, pair, 4));
2341 octo = vec_max(quad, vec_sld(quad, quad, 2));
2342 result = vec_max(octo, vec_sld(octo, octo, 1));
2349 return vec_any_ne(
x,
pzero(
x));
2355 t0 = vec_mergeh(kernel.packet[0], kernel.packet[2]);
2356 t1 = vec_mergel(kernel.packet[0], kernel.packet[2]);
2357 t2 = vec_mergeh(kernel.packet[1], kernel.packet[3]);
2358 t3 = vec_mergel(kernel.packet[1], kernel.packet[3]);
2359 kernel.packet[0] = vec_mergeh(t0, t2);
2360 kernel.packet[1] = vec_mergel(t0, t2);
2361 kernel.packet[2] = vec_mergeh(t1, t3);
2362 kernel.packet[3] = vec_mergel(t1, t3);
2367 ptranpose_common<Packet4f>(kernel);
2372 ptranpose_common<Packet4i>(kernel);
2378 t0 = vec_mergeh(kernel.packet[0], kernel.packet[2]);
2379 t1 = vec_mergel(kernel.packet[0], kernel.packet[2]);
2380 t2 = vec_mergeh(kernel.packet[1], kernel.packet[3]);
2381 t3 = vec_mergel(kernel.packet[1], kernel.packet[3]);
2382 kernel.packet[0] = vec_mergeh(t0, t2);
2383 kernel.packet[1] = vec_mergel(t0, t2);
2384 kernel.packet[2] = vec_mergeh(t1, t3);
2385 kernel.packet[3] = vec_mergel(t1, t3);
2391 t0 = vec_mergeh(kernel.packet[0], kernel.packet[2]);
2392 t1 = vec_mergel(kernel.packet[0], kernel.packet[2]);
2393 t2 = vec_mergeh(kernel.packet[1], kernel.packet[3]);
2394 t3 = vec_mergel(kernel.packet[1], kernel.packet[3]);
2395 kernel.packet[0] = vec_mergeh(t0, t2);
2396 kernel.packet[1] = vec_mergel(t0, t2);
2397 kernel.packet[2] = vec_mergeh(t1, t3);
2398 kernel.packet[3] = vec_mergel(t1, t3);
2406 t0 = vec_mergeh(kernel.packet[0].m_val, kernel.packet[2].m_val);
2407 t1 = vec_mergel(kernel.packet[0].m_val, kernel.packet[2].m_val);
2408 t2 = vec_mergeh(kernel.packet[1].m_val, kernel.packet[3].m_val);
2409 t3 = vec_mergel(kernel.packet[1].m_val, kernel.packet[3].m_val);
2410 kernel.packet[0] = vec_mergeh(t0, t2);
2411 kernel.packet[1] = vec_mergel(t0, t2);
2412 kernel.packet[2] = vec_mergeh(t1, t3);
2413 kernel.packet[3] = vec_mergel(t1, t3);
2419 t0 = vec_mergeh(kernel.packet[0], kernel.packet[2]);
2420 t1 = vec_mergel(kernel.packet[0], kernel.packet[2]);
2421 t2 = vec_mergeh(kernel.packet[1], kernel.packet[3]);
2422 t3 = vec_mergel(kernel.packet[1], kernel.packet[3]);
2423 kernel.packet[0] = vec_mergeh(t0, t2);
2424 kernel.packet[1] = vec_mergel(t0, t2);
2425 kernel.packet[2] = vec_mergeh(t1, t3);
2426 kernel.packet[3] = vec_mergel(t1, t3);
2433 t0 = vec_mergeh(kernel.packet[0], kernel.packet[2]);
2434 t1 = vec_mergel(kernel.packet[0], kernel.packet[2]);
2435 t2 = vec_mergeh(kernel.packet[1], kernel.packet[3]);
2436 t3 = vec_mergel(kernel.packet[1], kernel.packet[3]);
2437 kernel.packet[0] = vec_mergeh(t0, t2);
2438 kernel.packet[1] = vec_mergel(t0, t2);
2439 kernel.packet[2] = vec_mergeh(t1, t3);
2440 kernel.packet[3] = vec_mergel(t1, t3);
2447 v[0] = vec_mergeh(kernel.packet[0], kernel.packet[4]);
2448 v[1] = vec_mergel(kernel.packet[0], kernel.packet[4]);
2449 v[2] = vec_mergeh(kernel.packet[1], kernel.packet[5]);
2450 v[3] = vec_mergel(kernel.packet[1], kernel.packet[5]);
2451 v[4] = vec_mergeh(kernel.packet[2], kernel.packet[6]);
2452 v[5] = vec_mergel(kernel.packet[2], kernel.packet[6]);
2453 v[6] = vec_mergeh(kernel.packet[3], kernel.packet[7]);
2454 v[7] = vec_mergel(kernel.packet[3], kernel.packet[7]);
2455 sum[0] = vec_mergeh(
v[0],
v[4]);
2456 sum[1] = vec_mergel(
v[0],
v[4]);
2457 sum[2] = vec_mergeh(
v[1],
v[5]);
2458 sum[3] = vec_mergel(
v[1],
v[5]);
2459 sum[4] = vec_mergeh(
v[2],
v[6]);
2460 sum[5] = vec_mergel(
v[2],
v[6]);
2461 sum[6] = vec_mergeh(
v[3],
v[7]);
2462 sum[7] = vec_mergel(
v[3],
v[7]);
2464 kernel.packet[0] = vec_mergeh(sum[0], sum[4]);
2465 kernel.packet[1] = vec_mergel(sum[0], sum[4]);
2466 kernel.packet[2] = vec_mergeh(sum[1], sum[5]);
2467 kernel.packet[3] = vec_mergel(sum[1], sum[5]);
2468 kernel.packet[4] = vec_mergeh(sum[2], sum[6]);
2469 kernel.packet[5] = vec_mergel(sum[2], sum[6]);
2470 kernel.packet[6] = vec_mergeh(sum[3], sum[7]);
2471 kernel.packet[7] = vec_mergel(sum[3], sum[7]);
2478 v[0] = vec_mergeh(kernel.packet[0], kernel.packet[4]);
2479 v[1] = vec_mergel(kernel.packet[0], kernel.packet[4]);
2480 v[2] = vec_mergeh(kernel.packet[1], kernel.packet[5]);
2481 v[3] = vec_mergel(kernel.packet[1], kernel.packet[5]);
2482 v[4] = vec_mergeh(kernel.packet[2], kernel.packet[6]);
2483 v[5] = vec_mergel(kernel.packet[2], kernel.packet[6]);
2484 v[6] = vec_mergeh(kernel.packet[3], kernel.packet[7]);
2485 v[7] = vec_mergel(kernel.packet[3], kernel.packet[7]);
2486 sum[0] = vec_mergeh(
v[0],
v[4]);
2487 sum[1] = vec_mergel(
v[0],
v[4]);
2488 sum[2] = vec_mergeh(
v[1],
v[5]);
2489 sum[3] = vec_mergel(
v[1],
v[5]);
2490 sum[4] = vec_mergeh(
v[2],
v[6]);
2491 sum[5] = vec_mergel(
v[2],
v[6]);
2492 sum[6] = vec_mergeh(
v[3],
v[7]);
2493 sum[7] = vec_mergel(
v[3],
v[7]);
2495 kernel.packet[0] = vec_mergeh(sum[0], sum[4]);
2496 kernel.packet[1] = vec_mergel(sum[0], sum[4]);
2497 kernel.packet[2] = vec_mergeh(sum[1], sum[5]);
2498 kernel.packet[3] = vec_mergel(sum[1], sum[5]);
2499 kernel.packet[4] = vec_mergeh(sum[2], sum[6]);
2500 kernel.packet[5] = vec_mergel(sum[2], sum[6]);
2501 kernel.packet[6] = vec_mergeh(sum[3], sum[7]);
2502 kernel.packet[7] = vec_mergel(sum[3], sum[7]);
2509 v[0] = vec_mergeh(kernel.packet[0].m_val, kernel.packet[4].m_val);
2510 v[1] = vec_mergel(kernel.packet[0].m_val, kernel.packet[4].m_val);
2511 v[2] = vec_mergeh(kernel.packet[1].m_val, kernel.packet[5].m_val);
2512 v[3] = vec_mergel(kernel.packet[1].m_val, kernel.packet[5].m_val);
2513 v[4] = vec_mergeh(kernel.packet[2].m_val, kernel.packet[6].m_val);
2514 v[5] = vec_mergel(kernel.packet[2].m_val, kernel.packet[6].m_val);
2515 v[6] = vec_mergeh(kernel.packet[3].m_val, kernel.packet[7].m_val);
2516 v[7] = vec_mergel(kernel.packet[3].m_val, kernel.packet[7].m_val);
2517 sum[0] = vec_mergeh(
v[0].m_val,
v[4].m_val);
2518 sum[1] = vec_mergel(
v[0].m_val,
v[4].m_val);
2519 sum[2] = vec_mergeh(
v[1].m_val,
v[5].m_val);
2520 sum[3] = vec_mergel(
v[1].m_val,
v[5].m_val);
2521 sum[4] = vec_mergeh(
v[2].m_val,
v[6].m_val);
2522 sum[5] = vec_mergel(
v[2].m_val,
v[6].m_val);
2523 sum[6] = vec_mergeh(
v[3].m_val,
v[7].m_val);
2524 sum[7] = vec_mergel(
v[3].m_val,
v[7].m_val);
2526 kernel.packet[0] = vec_mergeh(sum[0].m_val, sum[4].m_val);
2527 kernel.packet[1] = vec_mergel(sum[0].m_val, sum[4].m_val);
2528 kernel.packet[2] = vec_mergeh(sum[1].m_val, sum[5].m_val);
2529 kernel.packet[3] = vec_mergel(sum[1].m_val, sum[5].m_val);
2530 kernel.packet[4] = vec_mergeh(sum[2].m_val, sum[6].m_val);
2531 kernel.packet[5] = vec_mergel(sum[2].m_val, sum[6].m_val);
2532 kernel.packet[6] = vec_mergeh(sum[3].m_val, sum[7].m_val);
2533 kernel.packet[7] = vec_mergel(sum[3].m_val, sum[7].m_val);
2538 Packet16c step1[16], step2[16], step3[16];
2540 step1[0] = vec_mergeh(kernel.packet[0], kernel.packet[8]);
2541 step1[1] = vec_mergel(kernel.packet[0], kernel.packet[8]);
2542 step1[2] = vec_mergeh(kernel.packet[1], kernel.packet[9]);
2543 step1[3] = vec_mergel(kernel.packet[1], kernel.packet[9]);
2544 step1[4] = vec_mergeh(kernel.packet[2], kernel.packet[10]);
2545 step1[5] = vec_mergel(kernel.packet[2], kernel.packet[10]);
2546 step1[6] = vec_mergeh(kernel.packet[3], kernel.packet[11]);
2547 step1[7] = vec_mergel(kernel.packet[3], kernel.packet[11]);
2548 step1[8] = vec_mergeh(kernel.packet[4], kernel.packet[12]);
2549 step1[9] = vec_mergel(kernel.packet[4], kernel.packet[12]);
2550 step1[10] = vec_mergeh(kernel.packet[5], kernel.packet[13]);
2551 step1[11] = vec_mergel(kernel.packet[5], kernel.packet[13]);
2552 step1[12] = vec_mergeh(kernel.packet[6], kernel.packet[14]);
2553 step1[13] = vec_mergel(kernel.packet[6], kernel.packet[14]);
2554 step1[14] = vec_mergeh(kernel.packet[7], kernel.packet[15]);
2555 step1[15] = vec_mergel(kernel.packet[7], kernel.packet[15]);
2557 step2[0] = vec_mergeh(step1[0], step1[8]);
2558 step2[1] = vec_mergel(step1[0], step1[8]);
2559 step2[2] = vec_mergeh(step1[1], step1[9]);
2560 step2[3] = vec_mergel(step1[1], step1[9]);
2561 step2[4] = vec_mergeh(step1[2], step1[10]);
2562 step2[5] = vec_mergel(step1[2], step1[10]);
2563 step2[6] = vec_mergeh(step1[3], step1[11]);
2564 step2[7] = vec_mergel(step1[3], step1[11]);
2565 step2[8] = vec_mergeh(step1[4], step1[12]);
2566 step2[9] = vec_mergel(step1[4], step1[12]);
2567 step2[10] = vec_mergeh(step1[5], step1[13]);
2568 step2[11] = vec_mergel(step1[5], step1[13]);
2569 step2[12] = vec_mergeh(step1[6], step1[14]);
2570 step2[13] = vec_mergel(step1[6], step1[14]);
2571 step2[14] = vec_mergeh(step1[7], step1[15]);
2572 step2[15] = vec_mergel(step1[7], step1[15]);
2574 step3[0] = vec_mergeh(step2[0], step2[8]);
2575 step3[1] = vec_mergel(step2[0], step2[8]);
2576 step3[2] = vec_mergeh(step2[1], step2[9]);
2577 step3[3] = vec_mergel(step2[1], step2[9]);
2578 step3[4] = vec_mergeh(step2[2], step2[10]);
2579 step3[5] = vec_mergel(step2[2], step2[10]);
2580 step3[6] = vec_mergeh(step2[3], step2[11]);
2581 step3[7] = vec_mergel(step2[3], step2[11]);
2582 step3[8] = vec_mergeh(step2[4], step2[12]);
2583 step3[9] = vec_mergel(step2[4], step2[12]);
2584 step3[10] = vec_mergeh(step2[5], step2[13]);
2585 step3[11] = vec_mergel(step2[5], step2[13]);
2586 step3[12] = vec_mergeh(step2[6], step2[14]);
2587 step3[13] = vec_mergel(step2[6], step2[14]);
2588 step3[14] = vec_mergeh(step2[7], step2[15]);
2589 step3[15] = vec_mergel(step2[7], step2[15]);
2591 kernel.packet[0] = vec_mergeh(step3[0], step3[8]);
2592 kernel.packet[1] = vec_mergel(step3[0], step3[8]);
2593 kernel.packet[2] = vec_mergeh(step3[1], step3[9]);
2594 kernel.packet[3] = vec_mergel(step3[1], step3[9]);
2595 kernel.packet[4] = vec_mergeh(step3[2], step3[10]);
2596 kernel.packet[5] = vec_mergel(step3[2], step3[10]);
2597 kernel.packet[6] = vec_mergeh(step3[3], step3[11]);
2598 kernel.packet[7] = vec_mergel(step3[3], step3[11]);
2599 kernel.packet[8] = vec_mergeh(step3[4], step3[12]);
2600 kernel.packet[9] = vec_mergel(step3[4], step3[12]);
2601 kernel.packet[10] = vec_mergeh(step3[5], step3[13]);
2602 kernel.packet[11] = vec_mergel(step3[5], step3[13]);
2603 kernel.packet[12] = vec_mergeh(step3[6], step3[14]);
2604 kernel.packet[13] = vec_mergel(step3[6], step3[14]);
2605 kernel.packet[14] = vec_mergeh(step3[7], step3[15]);
2606 kernel.packet[15] = vec_mergel(step3[7], step3[15]);
2613 step1[0] = vec_mergeh(kernel.packet[0], kernel.packet[8]);
2614 step1[1] = vec_mergel(kernel.packet[0], kernel.packet[8]);
2615 step1[2] = vec_mergeh(kernel.packet[1], kernel.packet[9]);
2616 step1[3] = vec_mergel(kernel.packet[1], kernel.packet[9]);
2617 step1[4] = vec_mergeh(kernel.packet[2], kernel.packet[10]);
2618 step1[5] = vec_mergel(kernel.packet[2], kernel.packet[10]);
2619 step1[6] = vec_mergeh(kernel.packet[3], kernel.packet[11]);
2620 step1[7] = vec_mergel(kernel.packet[3], kernel.packet[11]);
2621 step1[8] = vec_mergeh(kernel.packet[4], kernel.packet[12]);
2622 step1[9] = vec_mergel(kernel.packet[4], kernel.packet[12]);
2623 step1[10] = vec_mergeh(kernel.packet[5], kernel.packet[13]);
2624 step1[11] = vec_mergel(kernel.packet[5], kernel.packet[13]);
2625 step1[12] = vec_mergeh(kernel.packet[6], kernel.packet[14]);
2626 step1[13] = vec_mergel(kernel.packet[6], kernel.packet[14]);
2627 step1[14] = vec_mergeh(kernel.packet[7], kernel.packet[15]);
2628 step1[15] = vec_mergel(kernel.packet[7], kernel.packet[15]);
2630 step2[0] = vec_mergeh(step1[0], step1[8]);
2631 step2[1] = vec_mergel(step1[0], step1[8]);
2632 step2[2] = vec_mergeh(step1[1], step1[9]);
2633 step2[3] = vec_mergel(step1[1], step1[9]);
2634 step2[4] = vec_mergeh(step1[2], step1[10]);
2635 step2[5] = vec_mergel(step1[2], step1[10]);
2636 step2[6] = vec_mergeh(step1[3], step1[11]);
2637 step2[7] = vec_mergel(step1[3], step1[11]);
2638 step2[8] = vec_mergeh(step1[4], step1[12]);
2639 step2[9] = vec_mergel(step1[4], step1[12]);
2640 step2[10] = vec_mergeh(step1[5], step1[13]);
2641 step2[11] = vec_mergel(step1[5], step1[13]);
2642 step2[12] = vec_mergeh(step1[6], step1[14]);
2643 step2[13] = vec_mergel(step1[6], step1[14]);
2644 step2[14] = vec_mergeh(step1[7], step1[15]);
2645 step2[15] = vec_mergel(step1[7], step1[15]);
2647 step3[0] = vec_mergeh(step2[0], step2[8]);
2648 step3[1] = vec_mergel(step2[0], step2[8]);
2649 step3[2] = vec_mergeh(step2[1], step2[9]);
2650 step3[3] = vec_mergel(step2[1], step2[9]);
2651 step3[4] = vec_mergeh(step2[2], step2[10]);
2652 step3[5] = vec_mergel(step2[2], step2[10]);
2653 step3[6] = vec_mergeh(step2[3], step2[11]);
2654 step3[7] = vec_mergel(step2[3], step2[11]);
2655 step3[8] = vec_mergeh(step2[4], step2[12]);
2656 step3[9] = vec_mergel(step2[4], step2[12]);
2657 step3[10] = vec_mergeh(step2[5], step2[13]);
2658 step3[11] = vec_mergel(step2[5], step2[13]);
2659 step3[12] = vec_mergeh(step2[6], step2[14]);
2660 step3[13] = vec_mergel(step2[6], step2[14]);
2661 step3[14] = vec_mergeh(step2[7], step2[15]);
2662 step3[15] = vec_mergel(step2[7], step2[15]);
2664 kernel.packet[0] = vec_mergeh(step3[0], step3[8]);
2665 kernel.packet[1] = vec_mergel(step3[0], step3[8]);
2666 kernel.packet[2] = vec_mergeh(step3[1], step3[9]);
2667 kernel.packet[3] = vec_mergel(step3[1], step3[9]);
2668 kernel.packet[4] = vec_mergeh(step3[2], step3[10]);
2669 kernel.packet[5] = vec_mergel(step3[2], step3[10]);
2670 kernel.packet[6] = vec_mergeh(step3[3], step3[11]);
2671 kernel.packet[7] = vec_mergel(step3[3], step3[11]);
2672 kernel.packet[8] = vec_mergeh(step3[4], step3[12]);
2673 kernel.packet[9] = vec_mergel(step3[4], step3[12]);
2674 kernel.packet[10] = vec_mergeh(step3[5], step3[13]);
2675 kernel.packet[11] = vec_mergel(step3[5], step3[13]);
2676 kernel.packet[12] = vec_mergeh(step3[6], step3[14]);
2677 kernel.packet[13] = vec_mergel(step3[6], step3[14]);
2678 kernel.packet[14] = vec_mergeh(step3[7], step3[15]);
2679 kernel.packet[15] = vec_mergel(step3[7], step3[15]);
2682 template<
typename Packet> EIGEN_STRONG_INLINE
2683 Packet
pblend4(
const Selector<4>& ifPacket,
const Packet& thenPacket,
const Packet& elsePacket) {
2684 Packet4ui select = { ifPacket.select[0], ifPacket.select[1], ifPacket.select[2], ifPacket.select[3] };
2686 return vec_sel(elsePacket, thenPacket, mask);
2690 return pblend4<Packet4i>(ifPacket, thenPacket, elsePacket);
2694 return pblend4<Packet4f>(ifPacket, thenPacket, elsePacket);
2698 Packet8us select = { ifPacket.select[0], ifPacket.select[1], ifPacket.select[2], ifPacket.select[3],
2699 ifPacket.select[4], ifPacket.select[5], ifPacket.select[6], ifPacket.select[7] };
2701 Packet8s result = vec_sel(elsePacket, thenPacket, mask);
2706 Packet8us select = { ifPacket.select[0], ifPacket.select[1], ifPacket.select[2], ifPacket.select[3],
2707 ifPacket.select[4], ifPacket.select[5], ifPacket.select[6], ifPacket.select[7] };
2709 return vec_sel(elsePacket, thenPacket, mask);
2713 return pblend<Packet8us>(ifPacket, thenPacket, elsePacket);
2717 Packet16uc select = { ifPacket.select[0], ifPacket.select[1], ifPacket.select[2], ifPacket.select[3],
2718 ifPacket.select[4], ifPacket.select[5], ifPacket.select[6], ifPacket.select[7],
2719 ifPacket.select[8], ifPacket.select[9], ifPacket.select[10], ifPacket.select[11],
2720 ifPacket.select[12], ifPacket.select[13], ifPacket.select[14], ifPacket.select[15] };
2723 return vec_sel(elsePacket, thenPacket, mask);
2727 Packet16uc select = { ifPacket.select[0], ifPacket.select[1], ifPacket.select[2], ifPacket.select[3],
2728 ifPacket.select[4], ifPacket.select[5], ifPacket.select[6], ifPacket.select[7],
2729 ifPacket.select[8], ifPacket.select[9], ifPacket.select[10], ifPacket.select[11],
2730 ifPacket.select[12], ifPacket.select[13], ifPacket.select[14], ifPacket.select[15] };
2733 return vec_sel(elsePacket, thenPacket, mask);
2738 #ifdef EIGEN_VECTORIZE_VSX
2740 typedef __vector
unsigned long long Packet2ul;
2741 typedef __vector
long long Packet2l;
2742 #if EIGEN_COMP_CLANG
2745 typedef __vector __bool
long Packet2bl;
2749 static Packet2ul p2ul_SIGN = { 0x8000000000000000ull, 0x8000000000000000ull };
2750 static Packet2ul p2ul_PREV0DOT5 = { 0x3FDFFFFFFFFFFFFFull, 0x3FDFFFFFFFFFFFFFull };
2753 static Packet2d p2d_MZERO = { numext::bit_cast<double>(0x8000000000000000ull),
2754 numext::bit_cast<double>(0x8000000000000000ull) };
2764 return vec_splat(
a, index);
2767 template<>
struct packet_traits<double> : default_packet_traits
2773 AlignedOnScalar = 1,
2789 #if !EIGEN_COMP_CLANG
2803 template<>
struct unpacket_traits<
Packet2d> {
typedef double type;
enum {
size=2, alignment=
Aligned16, vectorizable=
true, masked_load_available=
false, masked_store_available=
false};
typedef Packet2d half; };
2812 s << vt.n[0] <<
", " << vt.n[1];
2823 s << vt.n[0] <<
", " << vt.n[1];
2831 return vec_xl(0,
const_cast<double *
>(from));
2836 return pload_partial_common<Packet2d>(from,
n, offset);
2842 vec_xst(from, 0, to);
2847 pstore_partial_common<Packet2d>(to, from,
n, offset);
2856 Packet2l v = {
static_cast<long long>(from),
static_cast<long long>(from)};
2860 template<> EIGEN_STRONG_INLINE
void
2873 return pgather_common<Packet2d>(from, stride);
2877 return pgather_common<Packet2d>(from, stride,
n);
2881 pscatter_common<Packet2d>(to, from, stride);
2885 pscatter_common<Packet2d>(to, from, stride,
n);
2896 #ifdef __POWER8_VECTOR__
2899 return vec_xor(
a, p2d_MZERO);
2918 __asm__ (
"xvcmpgedp %x0,%x1,%x2\n\txxsel %x0,%x1,%x2,%x0" :
"=&wa" (ret) :
"wa" (
a),
"wa" (
b));
2926 __asm__ (
"xvcmpgtdp %x0,%x2,%x1\n\txxsel %x0,%x1,%x2,%x0" :
"=&wa" (ret) :
"wa" (
a),
"wa" (
b));
2935 return vec_nor(
c,
c);
2951 __asm__(
"xvrdpiz %x0, %x1\n\t"
2963 __asm__(
"xvrdpic %x0, %x1\n\t"
2973 return vec_xl(0,
const_cast<double*
>(from));
2978 return ploadu_partial_common<Packet2d>(from,
n, offset);
2986 return vec_splat_dbl<0>(
p);
2992 vec_xst(from, 0, to);
2997 pstoreu_partial_common<Packet2d>(to, from,
n, offset);
3006 return vec_sld(
a,
a, 8);
3009 #ifdef __POWER8_VECTOR__
3013 static Packet16uc p16uc_DUPSIGN = { 0,0,0,0, 0,0,0,0, 8,8,8,8, 8,8,8,8 };
3015 static Packet16uc p16uc_DUPSIGN = { 7,7,7,7, 7,7,7,7, 15,15,15,15, 15,15,15,15 };
3021 return reinterpret_cast<Packet2d>(vec_perm(tmp, tmp, p16uc_DUPSIGN));
3035 #ifdef __POWER8_VECTOR__
3040 return vec_sl(
a, shift);
3046 return vec_sr(
a, shift);
3055 0x14, 0x15, 0x16, 0x17, 0x00, 0x01, 0x02, 0x03,
3056 0x1c, 0x1d, 0x1e, 0x1f, 0x08, 0x09, 0x0a, 0x0b };
3058 return vec_perm(p4i_ZERO,
a, perm);
3060 return vec_perm(
a, p4i_ZERO, perm);
3068 0x04, 0x05, 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
3069 0x0c, 0x0d, 0x0e, 0x0f, 0x18, 0x19, 0x1a, 0x1b };
3071 return vec_perm(p4i_ZERO,
a, perm);
3073 return vec_perm(
a, p4i_ZERO, perm);
3077 template<
int N,
typename EnableIf =
void>
3078 struct plogical_shift_left_impl;
3081 struct plogical_shift_left_impl<N,
std::enable_if_t<(N < 32) && (N >= 0)>> {
3083 static const unsigned n =
static_cast<unsigned>(N);
3086 static const unsigned m =
static_cast<unsigned>(32 - N);
3088 const Packet4i out_hi = vec_sl(ai, shift);
3089 const Packet4i out_lo = shift_even_left(vec_sr(ai, shift_right));
3095 struct plogical_shift_left_impl<N,
std::enable_if_t<(N >= 32)>> {
3097 static const unsigned m =
static_cast<unsigned>(N - 32);
3100 return reinterpret_cast<Packet2l>(shift_even_left(vec_sl(ai, shift)));
3106 return plogical_shift_left_impl<N>::run(
a);
3109 template<
int N,
typename EnableIf =
void>
3110 struct plogical_shift_right_impl;
3113 struct plogical_shift_right_impl<N,
std::enable_if_t<(N < 32) && (N >= 0)>> {
3115 static const unsigned n =
static_cast<unsigned>(N);
3118 static const unsigned m =
static_cast<unsigned>(32 - N);
3120 const Packet4i out_lo = vec_sr(ai, shift);
3121 const Packet4i out_hi = shift_odd_right(vec_sl(ai, shift_left));
3127 struct plogical_shift_right_impl<N,
std::enable_if_t<(N >= 32)>> {
3129 static const unsigned m =
static_cast<unsigned>(N - 32);
3132 return reinterpret_cast<Packet2l>(shift_odd_right(vec_sr(ai, shift)));
3138 return plogical_shift_right_impl<N>::run(
a);
3148 const Packet2l bias = { 1023, 1023 };
3153 c =
reinterpret_cast<Packet2d>(plogical_shift_left<52>(
b + bias));
3163 return pcast<Packet2l, Packet2d>(plogical_shift_right<52>(
reinterpret_cast<Packet2l>(
pabs(
a))));
3198 ptranspose(PacketBlock<Packet2d,2>& kernel) {
3200 t0 = vec_mergeh(kernel.packet[0], kernel.packet[1]);
3201 t1 = vec_mergel(kernel.packet[0], kernel.packet[1]);
3202 kernel.packet[0] = t0;
3203 kernel.packet[1] = t1;
3207 Packet2l select = { ifPacket.select[0], ifPacket.select[1] };
3209 return vec_sel(elsePacket, thenPacket, mask);
#define EIGEN_PPC_PREFETCH(ADDR)
#define LOAD_STORE_UNROLL_16
#define BF16_TO_F32_UNARY_OP_WRAPPER(OP, A)
#define __VEC_CLASS_FP_NAN
#define BF16_TO_F32_BINARY_OP_WRAPPER_BOOL(OP, A, B)
#define BF16_TO_F32_BINARY_OP_WRAPPER(OP, A, B)
Array< int, Dynamic, 1 > v
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_ALWAYS_INLINE
#define eigen_internal_assert(x)
#define EIGEN_UNUSED_VARIABLE(var)
#define EIGEN_DEVICE_FUNC
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
bfloat16() max(const bfloat16 &a, const bfloat16 &b)
EIGEN_CONSTEXPR __bfloat16_raw raw_uint16_to_bfloat16(unsigned short value)
bfloat16() min(const bfloat16 &a, const bfloat16 &b)
EIGEN_ALWAYS_INLINE Packet4f pload_partial< Packet4f >(const float *from, const Index n, const Index offset)
Packet4f pcmp_lt< Packet4f >(const Packet4f &a, const Packet4f &b)
std::ostream & operator<<(std::ostream &s, const Packet16c &v)
void pbroadcast4_common(const __UNPACK_TYPE__(Packet) *a, Packet &a0, Packet &a1, Packet &a2, Packet &a3)
signed char pfirst< Packet16c >(const Packet16c &a)
EIGEN_ALWAYS_INLINE void pstore_partial< signed char >(signed char *to, const Packet16c &from, const Index n, const Index offset)
Packet pmin(const Packet &a, const Packet &b)
Packet8us pand< Packet8us >(const Packet8us &a, const Packet8us &b)
Packet2d pdiv< Packet2d >(const Packet2d &a, const Packet2d &b)
Packet pnmsub(const Packet &a, const Packet &b, const Packet &c)
Packet8bf pldexp< Packet8bf >(const Packet8bf &a, const Packet8bf &exponent)
Packet16uc psub< Packet16uc >(const Packet16uc &a, const Packet16uc &b)
Packet8us pandnot< Packet8us >(const Packet8us &a, const Packet8us &b)
Packet16uc ploadu< Packet16uc >(const unsigned char *from)
Packet8s pmax< Packet8s >(const Packet8s &a, const Packet8s &b)
EIGEN_ALWAYS_INLINE void pstore_partial< unsigned short int >(unsigned short int *to, const Packet8us &from, const Index n, const Index offset)
double predux_max< Packet2d >(const Packet2d &a)
Packet8f pzero(const Packet8f &)
void pstore(Scalar *to, const Packet &from)
Packet8bf ploadquad< Packet8bf >(const bfloat16 *from)
EIGEN_ALWAYS_INLINE void pscatter< unsigned char, Packet16uc >(unsigned char *to, const Packet16uc &from, Index stride)
void pstore< float >(float *to, const Packet4f &from)
static Packet8us p8us_COUNTDOWN
Packet2d pset1frombits< Packet2d >(uint64_t from)
float predux_max< Packet4f >(const Packet4f &a)
double predux_min< Packet2d >(const Packet2d &a)
EIGEN_ALWAYS_INLINE void pstore_partial< int >(int *to, const Packet4i &from, const Index n, const Index offset)
static Packet4i p4i_COUNTDOWN
Packet2d plset< Packet2d >(const double &a)
EIGEN_ALWAYS_INLINE void pscatter_partial< float, Packet4f >(float *to, const Packet4f &from, Index stride, const Index n)
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet psin_float(const Packet &x)
EIGEN_ALWAYS_INLINE Packet16c pload_partial< Packet16c >(const signed char *from, const Index n, const Index offset)
Packet2d pmin< Packet2d >(const Packet2d &a, const Packet2d &b)
Packet2d pmul< Packet2d >(const Packet2d &a, const Packet2d &b)
unpacket_traits< Packet >::type predux(const Packet &a)
Packet16c pload< Packet16c >(const signed char *from)
Packet4f pcmp_lt_or_nan(const Packet4f &a, const Packet4f &b)
static Packet16uc p16uc_MERGEO16
static Packet8s p8s_COUNTDOWN
void pstore< int >(int *to, const Packet4i &from)
static Packet16uc p16uc_REVERSE8
static EIGEN_DECLARE_CONST_FAST_Packet4f(ZERO, 0)
EIGEN_ALWAYS_INLINE Packet16uc pload_partial< Packet16uc >(const unsigned char *from, const Index n, const Index offset)
Packet4f pxor< Packet4f >(const Packet4f &a, const Packet4f &b)
Packet2d pfrexp< Packet2d >(const Packet2d &a, Packet2d &exponent)
__vector unsigned char Packet16uc
Packet8bf F32ToBf16(Packet4f p4f)
static Packet16uc p16uc_MERGEE16
EIGEN_ALWAYS_INLINE void pstore_partial< unsigned char >(unsigned char *to, const Packet16uc &from, const Index n, const Index offset)
Packet16uc plset< Packet16uc >(const unsigned char &a)
static Packet16uc p16uc_REVERSE16
EIGEN_ALWAYS_INLINE Packet pload_ignore(const __UNPACK_TYPE__(Packet) *from)
Packet8us ploaddup< Packet8us >(const unsigned short int *from)
void pstoreu< signed char >(signed char *to, const Packet16c &from)
EIGEN_ALWAYS_INLINE void pscatter< signed char, Packet16c >(signed char *to, const Packet16c &from, Index stride)
static Packet16c p16c_COUNTDOWN
short int predux_mul< Packet8s >(const Packet8s &a)
Packet8s padd< Packet8s >(const Packet8s &a, const Packet8s &b)
Packet8us por< Packet8us >(const Packet8us &a, const Packet8us &b)
Packet8s ploaddup< Packet8s >(const short int *from)
Packet16uc pset1< Packet16uc >(const unsigned char &from)
int predux< Packet4i >(const Packet4i &a)
Packet4f pmin< Packet4f >(const Packet4f &a, const Packet4f &b)
Packet8bf pnegate< Packet8bf >(const Packet8bf &a)
Packet8s ploadu< Packet8s >(const short int *from)
Packet pload_common(const __UNPACK_TYPE__(Packet) *from)
float predux_min< Packet4f >(const Packet4f &a)
Packet4f pset1frombits< Packet4f >(unsigned int from)
Packet2d pceil< Packet2d >(const Packet2d &a)
EIGEN_ALWAYS_INLINE void pstoreu_partial< signed char >(signed char *to, const Packet16c &from, const Index n, const Index offset)
EIGEN_ALWAYS_INLINE void pscatter_common(__UNPACK_TYPE__(Packet) *to, const Packet &from, Index stride, const Index n=unpacket_traits< Packet >::size)
EIGEN_ALWAYS_INLINE Packet8bf F32ToBf16Two(Packet4f lo, Packet4f hi)
Packet4f por< Packet4f >(const Packet4f &a, const Packet4f &b)
EIGEN_ALWAYS_INLINE Packet4i pgather< int, Packet4i >(const int *from, Index stride)
Packet4f Bf16ToF32Even(const Packet8bf &bf)
EIGEN_ALWAYS_INLINE void pstoreu_partial< bfloat16 >(bfloat16 *to, const Packet8bf &from, const Index n, const Index offset)
EIGEN_ALWAYS_INLINE void pstoreu_partial_common(__UNPACK_TYPE__(Packet) *to, const Packet &from, const Index n, const Index offset)
Packet8bf pdiv< Packet8bf >(const Packet8bf &a, const Packet8bf &b)
EIGEN_ALWAYS_INLINE Packet8us pmerge(Packet4ui even, Packet4ui odd)
EIGEN_ALWAYS_INLINE void pscatter_partial< int, Packet4i >(int *to, const Packet4i &from, Index stride, const Index n)
bfloat16 predux_max< Packet8bf >(const Packet8bf &a)
EIGEN_ALWAYS_INLINE void pstoreu_partial< int >(int *to, const Packet4i &from, const Index n, const Index offset)
EIGEN_ALWAYS_INLINE void pstore_partial< bfloat16 >(bfloat16 *to, const Packet8bf &from, const Index n, const Index offset)
static Packet16uc p16uc_TRANSPOSE64_LO
Packet8bf F32ToBf16Bool(Packet4f even, Packet4f odd)
Packet4f pandnot< Packet4f >(const Packet4f &a, const Packet4f &b)
EIGEN_ALWAYS_INLINE Packet8s pgather< short int, Packet8s >(const short int *from, Index stride)
Packet4f pldexp< Packet4f >(const Packet4f &a, const Packet4f &exponent)
void pstoreu< short int >(short int *to, const Packet8s &from)
Packet4f pabs(const Packet4f &a)
static Packet16uc p16uc_REVERSE32
__vector unsigned short int Packet8us
static Packet16uc p16uc_MERGEL16
Packet pmax(const Packet &a, const Packet &b)
Packet8s psub< Packet8s >(const Packet8s &a, const Packet8s &b)
EIGEN_ALWAYS_INLINE Packet16c pgather< signed char, Packet16c >(const signed char *from, Index stride)
float predux< Packet4f >(const Packet4f &a)
Packet4f plset< Packet4f >(const float &a)
Packet8s ploadquad< Packet8s >(const short int *from)
unsigned short int predux< Packet8us >(const Packet8us &a)
__vector __bool short Packet8bi
Packet ploaddup_common(const __UNPACK_TYPE__(Packet) *from)
Packet2cf pnegate(const Packet2cf &a)
void pstore< signed char >(signed char *to, const Packet16c &from)
void pstoreu< unsigned short int >(unsigned short int *to, const Packet8us &from)
double predux< Packet2d >(const Packet2d &a)
Packet2d pround< Packet2d >(const Packet2d &a)
EIGEN_ALWAYS_INLINE void pstoreu_partial< unsigned char >(unsigned char *to, const Packet16uc &from, const Index n, const Index offset)
Packet8bf pfloor< Packet8bf >(const Packet8bf &a)
Packet4f pand< Packet4f >(const Packet4f &a, const Packet4f &b)
unsigned short int predux_min< Packet8us >(const Packet8us &a)
Packet8s pset1< Packet8s >(const short int &from)
Packet16c plset< Packet16c >(const signed char &a)
EIGEN_ALWAYS_INLINE Packet8bf ploadu_partial< Packet8bf >(const bfloat16 *from, const Index n, const Index offset)
EIGEN_ALWAYS_INLINE Packet8s pload_partial< Packet8s >(const short int *from, const Index n, const Index offset)
Packet16uc pmax< Packet16uc >(const Packet16uc &a, const Packet16uc &b)
int predux_max< Packet4i >(const Packet4i &a)
Packet8bf print< Packet8bf >(const Packet8bf &a)
Packet4f pcmp_eq< Packet4f >(const Packet4f &a, const Packet4f &b)
Packet8bf pload< Packet8bf >(const bfloat16 *from)
Packet4i plogical_shift_right(const Packet4i &a)
signed char predux< Packet16c >(const Packet16c &a)
Packet8us ploadquad< Packet8us >(const unsigned short int *from)
Packet pset1_size16(const __UNPACK_TYPE__(Packet)&from)
signed char predux_mul< Packet16c >(const Packet16c &a)
Packet4f pcmp_le< Packet4f >(const Packet4f &a, const Packet4f &b)
Packet2d pand< Packet2d >(const Packet2d &a, const Packet2d &b)
EIGEN_ALWAYS_INLINE void pstore_partial_common(__UNPACK_TYPE__(Packet) *to, const Packet &from, const Index n, const Index offset)
double predux_mul< Packet2d >(const Packet2d &a)
Packet4f pdiv< Packet4f >(const Packet4f &a, const Packet4f &b)
static Packet16uc p16uc_PSET32_WEVEN
void pstore< unsigned short int >(unsigned short int *to, const Packet8us &from)
Packet16uc pmin< Packet16uc >(const Packet16uc &a, const Packet16uc &b)
__UNPACK_TYPE__(Packet) pfirst_common(const Packet &a)
Packet4f pmadd(const Packet4f &a, const Packet4f &b, const Packet4f &c)
EIGEN_ALWAYS_INLINE Packet16uc pgather_partial< unsigned char, Packet16uc >(const unsigned char *from, Index stride, const Index n)
Packet16c pmul< Packet16c >(const Packet16c &a, const Packet16c &b)
EIGEN_ALWAYS_INLINE Packet4i pload_partial< Packet4i >(const int *from, const Index n, const Index offset)
EIGEN_ALWAYS_INLINE Packet8us pgather_partial< unsigned short int, Packet8us >(const unsigned short int *from, Index stride, const Index n)
Packet8bf pmul< Packet8bf >(const Packet8bf &a, const Packet8bf &b)
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pcos_float(const Packet &x)
Packet2d ploaddup< Packet2d >(const double *from)
static EIGEN_DECLARE_CONST_FAST_Packet4ui(SIGN, 0x80000000u)
void pstoreu(Scalar *to, const Packet &from)
Packet4i pmul< Packet4i >(const Packet4i &a, const Packet4i &b)
__vector signed char Packet16c
Packet4ui padd< Packet4ui >(const Packet4ui &a, const Packet4ui &b)
Packet2cf pcmp_eq(const Packet2cf &a, const Packet2cf &b)
bfloat16 pfirst(const Packet8bf &a)
Packet16c padd< Packet16c >(const Packet16c &a, const Packet16c &b)
Packet2d pgather< double, Packet2d >(const double *from, Index stride)
Packet8us padd< Packet8us >(const Packet8us &a, const Packet8us &b)
void pstoreu_partial(Scalar *to, const Packet &from, const Index n, const Index offset=0)
Packet8s pmin< Packet8s >(const Packet8s &a, const Packet8s &b)
Packet ploadu_common(const __UNPACK_TYPE__(Packet) *from)
void pstoreu< double >(double *to, const Packet4d &from)
Packet4f pselect(const Packet4f &mask, const Packet4f &a, const Packet4f &b)
Packet8bf plog< Packet8bf >(const Packet8bf &a)
EIGEN_ALWAYS_INLINE void pscatter< int, Packet4i >(int *to, const Packet4i &from, Index stride)
Packet16c ploaddup< Packet16c >(const signed char *from)
__vector unsigned int Packet4ui
Packet16uc ploaddup< Packet16uc >(const unsigned char *from)
Packet pmul(const Packet &a, const Packet &b)
__vector __bool int Packet4bi
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)
Packet8bf psub< Packet8bf >(const Packet8bf &a, const Packet8bf &b)
Packet4i ploadu< Packet4i >(const int *from)
signed char predux_max< Packet16c >(const Packet16c &a)
float pfirst< Packet4f >(const Packet4f &a)
Packet8bf pceil< Packet8bf >(const Packet8bf &a)
Packet pfrexp_generic(const Packet &a, Packet &exponent)
EIGEN_ALWAYS_INLINE void pscatter_partial< bfloat16, Packet8bf >(bfloat16 *to, const Packet8bf &from, Index stride, const Index n)
unsigned char predux< Packet16uc >(const Packet16uc &a)
double pfirst< Packet2d >(const Packet2d &a)
Packet pldexp_generic(const Packet &a, const Packet &exponent)
Packet4i pxor< Packet4i >(const Packet4i &a, const Packet4i &b)
bfloat16 predux_mul< Packet8bf >(const Packet8bf &a)
Packet8bf por< Packet8bf >(const Packet8bf &a, const Packet8bf &b)
void pstoreu< bfloat16 >(bfloat16 *to, const Packet8bf &from)
eigen_packet_wrapper< __vector unsigned short int, 0 > Packet8bf
Packet16c pmin< Packet16c >(const Packet16c &a, const Packet16c &b)
Packet4i pandnot< Packet4i >(const Packet4i &a, const Packet4i &b)
Packet8bf pmin< Packet8bf >(const Packet8bf &a, const Packet8bf &b)
Packet4i pset1< Packet4i >(const int &from)
static Packet16uc p16uc_HALF64_0_16
Packet8s pload< Packet8s >(const short int *from)
Packet16c pset1< Packet16c >(const signed char &from)
Packet4f padd< Packet4f >(const Packet4f &a, const Packet4f &b)
Packet4i pload< Packet4i >(const int *from)
Packet4f ploadu< Packet4f >(const float *from)
EIGEN_ALWAYS_INLINE Packet4f pgather_partial< float, Packet4f >(const float *from, Index stride, const Index n)
float predux_mul< Packet4f >(const Packet4f &a)
Packet2d padd< Packet2d >(const Packet2d &a, const Packet2d &b)
short int pfirst< Packet8s >(const Packet8s &a)
unsigned char predux_min< Packet16uc >(const Packet16uc &a)
Packet2d pandnot< Packet2d >(const Packet2d &a, const Packet2d &b)
EIGEN_ALWAYS_INLINE void pscatter< float, Packet4f >(float *to, const Packet4f &from, Index stride)
Packet8us plset< Packet8us >(const unsigned short int &a)
Packet pnmadd(const Packet &a, const Packet &b, const Packet &c)
Packet8bf pxor< Packet8bf >(const Packet8bf &a, const Packet8bf &b)
__vector short int Packet8s
void pbroadcast4< Packet4i >(const int *a, Packet4i &a0, Packet4i &a1, Packet4i &a2, Packet4i &a3)
EIGEN_ALWAYS_INLINE void pstoreu_partial< float >(float *to, const Packet4f &from, const Index n, const Index offset)
Packet psub(const Packet &a, const Packet &b)
static Packet4f p4f_MZERO
bfloat16 predux_min< Packet8bf >(const Packet8bf &a)
void pstore< unsigned char >(unsigned char *to, const Packet16uc &from)
void pstore_common(__UNPACK_TYPE__(Packet) *to, const Packet &from)
Packet4i ploaddup< Packet4i >(const int *from)
void prefetch< float >(const float *addr)
void prefetch< double >(const double *addr)
Packet8us pset1< Packet8us >(const unsigned short int &from)
Packet4f pmul< Packet4f >(const Packet4f &a, const Packet4f &b)
Packet2d pset1< Packet2d >(const double &from)
Packet4i pdiv< Packet4i >(const Packet4i &a, const Packet4i &b)
bfloat16 predux< Packet8bf >(const Packet8bf &a)
Packet4f pfrexp< Packet4f >(const Packet4f &a, Packet4f &exponent)
Packet2d ploadu< Packet2d >(const double *from)
Packet8bf pfrexp< Packet8bf >(const Packet8bf &a, Packet8bf &e)
Packet8us pmul< Packet8us >(const Packet8us &a, const Packet8us &b)
short int predux_min< Packet8s >(const Packet8s &a)
Packet4i plset< Packet4i >(const int &a)
Packet16uc pload< Packet16uc >(const unsigned char *from)
EIGEN_ALWAYS_INLINE Packet8bf pgather_partial< bfloat16, Packet8bf >(const bfloat16 *from, Index stride, const Index n)
Packet8bf pexp< Packet8bf >(const Packet8bf &a)
Packet16c ploadu< Packet16c >(const signed char *from)
EIGEN_ALWAYS_INLINE void pstoreu_partial< short int >(short int *to, const Packet8s &from, const Index n, const Index offset)
void pstoreu< float >(float *to, const Packet4f &from)
static EIGEN_DECLARE_CONST_FAST_Packet4i(ZERO, 0)
unsigned char predux_max< Packet16uc >(const Packet16uc &a)
Packet16c pmax< Packet16c >(const Packet16c &a, const Packet16c &b)
EIGEN_ALWAYS_INLINE void pstore_partial< short int >(short int *to, const Packet8s &from, const Index n, const Index offset)
EIGEN_ALWAYS_INLINE void pscatter_partial< unsigned short int, Packet8us >(unsigned short int *to, const Packet8us &from, Index stride, const Index n)
Packet8s pmul< Packet8s >(const Packet8s &a, const Packet8s &b)
EIGEN_ALWAYS_INLINE void pscatter_partial< signed char, Packet16c >(signed char *to, const Packet16c &from, Index stride, const Index n)
void pstoreu_common(__UNPACK_TYPE__(Packet) *to, const Packet &from)
EIGEN_ALWAYS_INLINE Packet16uc pgather< unsigned char, Packet16uc >(const unsigned char *from, Index stride)
Packet2d psub< Packet2d >(const Packet2d &a, const Packet2d &b)
Packet2d pfloor< Packet2d >(const Packet2d &a)
static Packet16uc p16uc_PSET64_HI
Packet8s plset< Packet8s >(const short int &a)
EIGEN_ALWAYS_INLINE Packet4f pgather< float, Packet4f >(const float *from, Index stride)
EIGEN_ALWAYS_INLINE Packet8us pgather< unsigned short int, Packet8us >(const unsigned short int *from, Index stride)
Packet2d pldexp< Packet2d >(const Packet2d &a, const Packet2d &exponent)
void ptranpose_common(PacketBlock< T, 4 > &kernel)
EIGEN_ALWAYS_INLINE Packet4i pgather_partial< int, Packet4i >(const int *from, Index stride, const Index n)
Packet8bf plset< Packet8bf >(const bfloat16 &a)
Packet8bf padd< Packet8bf >(const Packet8bf &a, const Packet8bf &b)
Packet8us psub< Packet8us >(const Packet8us &a, const Packet8us &b)
Packet8bf ploadu< Packet8bf >(const bfloat16 *from)
Packet16c psub< Packet16c >(const Packet16c &a, const Packet16c &b)
int predux_min< Packet4i >(const Packet4i &a)
Packet8us pmax< Packet8us >(const Packet8us &a, const Packet8us &b)
static EIGEN_DECLARE_CONST_FAST_Packet8us(ONE, 1)
Packet4i padd< Packet4i >(const Packet4i &a, const Packet4i &b)
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pexp_float(const Packet _x)
Packet4f Bf16ToF32Odd(const Packet8bf &bf)
Packet4i psub< Packet4i >(const Packet4i &a, const Packet4i &b)
EIGEN_ALWAYS_INLINE Packet8bf pload_partial< Packet8bf >(const bfloat16 *from, const Index n, const Index offset)
Packet8bf pset1< Packet8bf >(const bfloat16 &from)
EIGEN_ALWAYS_INLINE void pscatter< unsigned short int, Packet8us >(unsigned short int *to, const Packet8us &from, Index stride)
Packet2d pxor< Packet2d >(const Packet2d &a, const Packet2d &b)
unsigned short int pfirst< Packet8us >(const Packet8us &a)
EIGEN_ALWAYS_INLINE void pscatter_partial< unsigned char, Packet16uc >(unsigned char *to, const Packet16uc &from, Index stride, const Index n)
static Packet16uc p16uc_COUNTDOWN
Packet8bf psignbit(const Packet8bf &a)
int predux_mul< Packet4i >(const Packet4i &a)
void pstoreu< unsigned char >(unsigned char *to, const Packet16uc &from)
Packet4i pblend(const Selector< 4 > &ifPacket, const Packet4i &thenPacket, const Packet4i &elsePacket)
static Packet16uc p16uc_FORWARD
int pfirst< Packet4i >(const Packet4i &a)
EIGEN_ALWAYS_INLINE Packet4i ploadu_partial< Packet4i >(const int *from, const Index n, const Index offset)
void pstore< short int >(short int *to, const Packet8s &from)
Packet4i pmax< Packet4i >(const Packet4i &a, const Packet4i &b)
Packet4i por< Packet4i >(const Packet4i &a, const Packet4i &b)
Packet2cf pconj(const Packet2cf &a)
EIGEN_ALWAYS_INLINE void pscatter< bfloat16, Packet8bf >(bfloat16 *to, const Packet8bf &from, Index stride)
Packet8bf psin< Packet8bf >(const Packet8bf &a)
Packet2d por< Packet2d >(const Packet2d &a, const Packet2d &b)
Packet pset1_size4(const __UNPACK_TYPE__(Packet)&from)
void pstoreu< int >(int *to, const Packet4i &from)
short int predux< Packet8s >(const Packet8s &a)
EIGEN_ALWAYS_INLINE Packet8bf Bf16PackLow(Packet4f hi, Packet4f lo)
unsigned char pfirst< Packet16uc >(const Packet16uc &a)
Packet8bf pcos< Packet8bf >(const Packet8bf &a)
Packet8bf pmax< Packet8bf >(const Packet8bf &a, const Packet8bf &b)
Packet4f pmax< Packet4f >(const Packet4f &a, const Packet4f &b)
Packet4i pmin< Packet4i >(const Packet4i &a, const Packet4i &b)
EIGEN_ALWAYS_INLINE void pstoreu_partial< unsigned short int >(unsigned short int *to, const Packet8us &from, const Index n, const Index offset)
Packet4i pand< Packet4i >(const Packet4i &a, const Packet4i &b)
static const Packet16uc p16uc_DUPLICATE16_EVEN
Packet8us pxor< Packet8us >(const Packet8us &a, const Packet8us &b)
EIGEN_ALWAYS_INLINE Packet4f ploadu_partial< Packet4f >(const float *from, const Index n, const Index offset)
Packet2d pload< Packet2d >(const double *from)
Packet8bf pand< Packet8bf >(const Packet8bf &a, const Packet8bf &b)
Packet4f psub< Packet4f >(const Packet4f &a, const Packet4f &b)
static Packet2d p2d_COUNTDOWN
Packet4i plogical_shift_left(const Packet4i &a)
static Packet16uc p16uc_PSET32_WODD
EIGEN_ALWAYS_INLINE Packet8bf pload_ignore< Packet8bf >(const bfloat16 *from)
Packet2cf preverse(const Packet2cf &a)
Packet4i parithmetic_shift_right(const Packet4i &a)
EIGEN_ALWAYS_INLINE Packet8us pload_partial< Packet8us >(const unsigned short int *from, const Index n, const Index offset)
static Packet16uc p16uc_PSET64_LO
EIGEN_ALWAYS_INLINE Packet16uc ploadu_partial< Packet16uc >(const unsigned char *from, const Index n, const Index offset)
Packet pblend4(const Selector< 4 > &ifPacket, const Packet &thenPacket, const Packet &elsePacket)
Packet4f pload< Packet4f >(const float *from)
EIGEN_ALWAYS_INLINE void pscatter_partial< short int, Packet8s >(short int *to, const Packet8s &from, Index stride, const Index n)
Packet4f pcmp_lt_or_nan< Packet4f >(const Packet4f &a, const Packet4f &b)
static Packet16uc p16uc_COMPLEX32_REV
Packet4f pset1< Packet4f >(const float &from)
Packet4i pcmp_lt(const Packet4i &a, const Packet4i &b)
Packet4f ploaddup< Packet4f >(const float *from)
static Packet16uc p16uc_QUADRUPLICATE16_HI
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet plog_float(const Packet _x)
unsigned char predux_mul< Packet16uc >(const Packet16uc &a)
static const Packet16uc p16uc_DUPLICATE16_ODD
EIGEN_ALWAYS_INLINE Packet ploadu_partial_common(const __UNPACK_TYPE__(Packet) *from, const Index n, const Index offset)
EIGEN_ALWAYS_INLINE void pstore_partial< float >(float *to, const Packet4f &from, const Index n, const Index offset)
EIGEN_ALWAYS_INLINE Packet8s ploadu_partial< Packet8s >(const short int *from, const Index n, const Index offset)
Packet pset1_size8(const __UNPACK_TYPE__(Packet)&from)
static Packet4f p4f_COUNTDOWN
Packet4f pround< Packet4f >(const Packet4f &a)
Packet4f pfloor< Packet4f >(const Packet4f &a)
short int predux_max< Packet8s >(const Packet8s &a)
Packet16uc padd< Packet16uc >(const Packet16uc &a, const Packet16uc &b)
EIGEN_ALWAYS_INLINE Packet16c pgather_partial< signed char, Packet16c >(const signed char *from, Index stride, const Index n)
EIGEN_ALWAYS_INLINE Packet8us ploadu_partial< Packet8us >(const unsigned short int *from, const Index n, const Index offset)
unsigned short int predux_max< Packet8us >(const Packet8us &a)
EIGEN_ALWAYS_INLINE Packet16c ploadu_partial< Packet16c >(const signed char *from, const Index n, const Index offset)
Packet8bf F32ToBf16Both(Packet4f lo, Packet4f hi)
Packet8s por< Packet8s >(const Packet8s &a, const Packet8s &b)
EIGEN_ALWAYS_INLINE void pscatter< short int, Packet8s >(short int *to, const Packet8s &from, Index stride)
void pstore< bfloat16 >(bfloat16 *to, const Packet8bf &from)
Packet16uc pmul< Packet16uc >(const Packet16uc &a, const Packet16uc &b)
void prefetch< int >(const int *addr)
void pbroadcast4< Packet4f >(const float *a, Packet4f &a0, Packet4f &a1, Packet4f &a2, Packet4f &a3)
EIGEN_ALWAYS_INLINE Packet8bf pgather< bfloat16, Packet8bf >(const bfloat16 *from, Index stride)
Packet4ui pand< Packet4ui >(const Packet4ui &a, const Packet4ui &b)
void pscatter< double, Packet2d >(double *to, const Packet2d &from, Index stride)
void pbroadcast4< Packet2d >(const double *a, Packet2d &a0, Packet2d &a1, Packet2d &a2, Packet2d &a3)
unsigned short int predux_mul< Packet8us >(const Packet8us &a)
Packet8us ploadu< Packet8us >(const unsigned short int *from)
Packet8us pload< Packet8us >(const unsigned short int *from)
signed char predux_min< Packet16c >(const Packet16c &a)
bool predux_any(const Packet4f &x)
EIGEN_ALWAYS_INLINE Packet8bf Bf16PackHigh(Packet4f hi, Packet4f lo)
Packet4ui pandnot< Packet4ui >(const Packet4ui &a, const Packet4ui &b)
Packet8us pmin< Packet8us >(const Packet8us &a, const Packet8us &b)
Packet8bf ploaddup< Packet8bf >(const bfloat16 *from)
void pstore< double >(double *to, const Packet4d &from)
Packet4f pcmp_le(const Packet4f &a, const Packet4f &b)
Packet4f pceil< Packet4f >(const Packet4f &a)
EIGEN_ALWAYS_INLINE Packet pload_partial_common(const __UNPACK_TYPE__(Packet) *from, const Index n, const Index offset)
Packet8bf pround< Packet8bf >(const Packet8bf &a)
EIGEN_ALWAYS_INLINE Packet pgather_common(const __UNPACK_TYPE__(Packet) *from, Index stride, const Index n=unpacket_traits< Packet >::size)
EIGEN_ALWAYS_INLINE Packet8s pgather_partial< short int, Packet8s >(const short int *from, Index stride, const Index n)
static Packet16uc p16uc_DUPLICATE32_HI
Packet2d pmax< Packet2d >(const Packet2d &a, const Packet2d &b)
static Packet16uc p16uc_TRANSPOSE64_HI
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_exp_op< typename Derived::Scalar >, const Derived > exp(const Eigen::ArrayBase< Derived > &x)