AltiVec/PacketMath.h
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2008-2016 Konstantinos Margaritis <markos@freevec.org>
5 //
6 // This Source Code Form is subject to the terms of the Mozilla
7 // Public License v. 2.0. If a copy of the MPL was not distributed
8 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 
10 #ifndef EIGEN_PACKET_MATH_ALTIVEC_H
11 #define EIGEN_PACKET_MATH_ALTIVEC_H
12 
13 // IWYU pragma: private
14 #include "../../InternalHeaderCheck.h"
15 
16 namespace Eigen {
17 
18 namespace internal {
19 
20 #ifndef EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD
21 #define EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 4
22 #endif
23 
24 #ifndef EIGEN_HAS_SINGLE_INSTRUCTION_MADD
25 #define EIGEN_HAS_SINGLE_INSTRUCTION_MADD
26 #endif
27 
28 // NOTE Altivec has 32 registers, but Eigen only accepts a value of 8 or 16
29 #ifndef EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS
30 #define EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS 32
31 #endif
32 
33 typedef __vector float Packet4f;
34 typedef __vector int Packet4i;
35 typedef __vector unsigned int Packet4ui;
36 typedef __vector __bool int Packet4bi;
37 typedef __vector short int Packet8s;
38 typedef __vector unsigned short int Packet8us;
39 typedef __vector __bool short Packet8bi;
40 typedef __vector signed char Packet16c;
41 typedef __vector unsigned char Packet16uc;
43 
44 // We don't want to write the same code all the time, but we need to reuse the constants
45 // and it doesn't really work to declare them global, so we define macros instead
46 #define EIGEN_DECLARE_CONST_FAST_Packet4f(NAME, X) Packet4f p4f_##NAME = {X, X, X, X}
47 
48 #define EIGEN_DECLARE_CONST_FAST_Packet4i(NAME, X) Packet4i p4i_##NAME = vec_splat_s32(X)
49 
50 #define EIGEN_DECLARE_CONST_FAST_Packet4ui(NAME, X) Packet4ui p4ui_##NAME = {X, X, X, X}
51 
52 #define EIGEN_DECLARE_CONST_FAST_Packet8us(NAME, X) Packet8us p8us_##NAME = {X, X, X, X, X, X, X, X}
53 
54 #define EIGEN_DECLARE_CONST_FAST_Packet16uc(NAME, X) \
55  Packet16uc p16uc_##NAME = {X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X}
56 
57 #define EIGEN_DECLARE_CONST_Packet4f(NAME, X) Packet4f p4f_##NAME = pset1<Packet4f>(X)
58 
59 #define EIGEN_DECLARE_CONST_Packet4i(NAME, X) Packet4i p4i_##NAME = pset1<Packet4i>(X)
60 
61 #define EIGEN_DECLARE_CONST_Packet2d(NAME, X) Packet2d p2d_##NAME = pset1<Packet2d>(X)
62 
63 #define EIGEN_DECLARE_CONST_Packet2l(NAME, X) Packet2l p2l_##NAME = pset1<Packet2l>(X)
64 
65 #define EIGEN_DECLARE_CONST_Packet4f_FROM_INT(NAME, X) \
66  const Packet4f p4f_##NAME = reinterpret_cast<Packet4f>(pset1<Packet4i>(X))
67 
68 #define DST_CHAN 1
69 #define DST_CTRL(size, count, stride) (((size) << 24) | ((count) << 16) | (stride))
70 #define __UNPACK_TYPE__(PACKETNAME) typename unpacket_traits<PACKETNAME>::type
71 
72 // These constants are endian-agnostic
73 static EIGEN_DECLARE_CONST_FAST_Packet4f(ZERO, 0); //{ 0.0, 0.0, 0.0, 0.0}
74 static EIGEN_DECLARE_CONST_FAST_Packet4i(ZERO, 0); //{ 0, 0, 0, 0,}
75 static EIGEN_DECLARE_CONST_FAST_Packet4i(ONE, 1); //{ 1, 1, 1, 1}
76 static EIGEN_DECLARE_CONST_FAST_Packet4i(MINUS16, -16); //{ -16, -16, -16, -16}
77 static EIGEN_DECLARE_CONST_FAST_Packet4i(MINUS1, -1); //{ -1, -1, -1, -1}
78 static EIGEN_DECLARE_CONST_FAST_Packet4ui(SIGN, 0x80000000u);
79 static EIGEN_DECLARE_CONST_FAST_Packet4ui(PREV0DOT5, 0x3EFFFFFFu);
80 static EIGEN_DECLARE_CONST_FAST_Packet8us(ONE, 1); //{ 1, 1, 1, 1, 1, 1, 1, 1}
82  (Packet4f)vec_sl((Packet4ui)p4i_MINUS1, (Packet4ui)p4i_MINUS1); //{ 0x80000000, 0x80000000, 0x80000000, 0x80000000}
83 #ifndef __VSX__
84 static Packet4f p4f_ONE = vec_ctf(p4i_ONE, 0); //{ 1.0, 1.0, 1.0, 1.0}
85 #endif
86 
87 static Packet4f p4f_COUNTDOWN = {0.0, 1.0, 2.0, 3.0};
88 static Packet4i p4i_COUNTDOWN = {0, 1, 2, 3};
89 static Packet8s p8s_COUNTDOWN = {0, 1, 2, 3, 4, 5, 6, 7};
90 static Packet8us p8us_COUNTDOWN = {0, 1, 2, 3, 4, 5, 6, 7};
91 
92 static Packet16c p16c_COUNTDOWN = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
93 static Packet16uc p16uc_COUNTDOWN = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
94 
95 static Packet16uc p16uc_REVERSE32 = {12, 13, 14, 15, 8, 9, 10, 11, 4, 5, 6, 7, 0, 1, 2, 3};
96 static Packet16uc p16uc_REVERSE16 = {14, 15, 12, 13, 10, 11, 8, 9, 6, 7, 4, 5, 2, 3, 0, 1};
97 static Packet16uc p16uc_REVERSE8 = {15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
98 
99 #ifdef _BIG_ENDIAN
100 static Packet16uc p16uc_DUPLICATE32_HI = {0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 6, 7, 4, 5, 6, 7};
101 #endif
102 static const Packet16uc p16uc_DUPLICATE16_EVEN = {0, 1, 0, 1, 4, 5, 4, 5, 8, 9, 8, 9, 12, 13, 12, 13};
103 static const Packet16uc p16uc_DUPLICATE16_ODD = {2, 3, 2, 3, 6, 7, 6, 7, 10, 11, 10, 11, 14, 15, 14, 15};
104 
105 static Packet16uc p16uc_QUADRUPLICATE16_HI = {0, 1, 0, 1, 0, 1, 0, 1, 2, 3, 2, 3, 2, 3, 2, 3};
106 static Packet16uc p16uc_QUADRUPLICATE16 = {0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3};
107 
108 static Packet16uc p16uc_MERGEE16 = {0, 1, 16, 17, 4, 5, 20, 21, 8, 9, 24, 25, 12, 13, 28, 29};
109 static Packet16uc p16uc_MERGEO16 = {2, 3, 18, 19, 6, 7, 22, 23, 10, 11, 26, 27, 14, 15, 30, 31};
110 #ifdef _BIG_ENDIAN
111 static Packet16uc p16uc_MERGEH16 = {0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21, 24, 25, 28, 29};
112 #else
113 static Packet16uc p16uc_MERGEL16 = {2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27, 30, 31};
114 #endif
115 
116 // Handle endianness properly while loading constants
117 // Define global static constants:
118 #ifdef _BIG_ENDIAN
119 static Packet16uc p16uc_FORWARD = vec_lvsl(0, (float*)0);
121  vec_sld((Packet16uc)vec_splat((Packet4ui)p16uc_FORWARD, 0), (Packet16uc)vec_splat((Packet4ui)p16uc_FORWARD, 2),
122  8); //{ 0,1,2,3, 0,1,2,3, 8,9,10,11, 8,9,10,11 };
124  8); //{ 4,5,6,7, 4,5,6,7, 12,13,14,15, 12,13,14,15 };
125 static Packet16uc p16uc_HALF64_0_16 = vec_sld((Packet16uc)p4i_ZERO, vec_splat((Packet16uc)vec_abs(p4i_MINUS16), 3),
126  8); //{ 0,0,0,0, 0,0,0,0, 16,16,16,16, 16,16,16,16};
127 #else
130  vec_sld((Packet16uc)vec_splat((Packet4ui)p16uc_FORWARD, 1), (Packet16uc)vec_splat((Packet4ui)p16uc_FORWARD, 3),
131  8); //{ 0,1,2,3, 0,1,2,3, 8,9,10,11, 8,9,10,11 };
133  vec_sld((Packet16uc)vec_splat((Packet4ui)p16uc_FORWARD, 0), (Packet16uc)vec_splat((Packet4ui)p16uc_FORWARD, 2),
134  8); //{ 4,5,6,7, 4,5,6,7, 12,13,14,15, 12,13,14,15 };
135 static Packet16uc p16uc_HALF64_0_16 = vec_sld(vec_splat((Packet16uc)vec_abs(p4i_MINUS16), 0), (Packet16uc)p4i_ZERO,
136  8); //{ 0,0,0,0, 0,0,0,0, 16,16,16,16, 16,16,16,16};
137 #endif // _BIG_ENDIAN
138 
139 static Packet16uc p16uc_PSET64_HI = (Packet16uc)vec_mergeh(
140  (Packet4ui)p16uc_PSET32_WODD, (Packet4ui)p16uc_PSET32_WEVEN); //{ 0,1,2,3, 4,5,6,7, 0,1,2,3, 4,5,6,7 };
141 static Packet16uc p16uc_PSET64_LO = (Packet16uc)vec_mergel(
142  (Packet4ui)p16uc_PSET32_WODD, (Packet4ui)p16uc_PSET32_WEVEN); //{ 8,9,10,11, 12,13,14,15, 8,9,10,11, 12,13,14,15 };
144  p16uc_PSET64_HI + p16uc_HALF64_0_16; //{ 0,1,2,3, 4,5,6,7, 16,17,18,19, 20,21,22,23};
146  p16uc_PSET64_LO + p16uc_HALF64_0_16; //{ 8,9,10,11, 12,13,14,15, 24,25,26,27, 28,29,30,31};
147 
149  vec_sld(p16uc_REVERSE32, p16uc_REVERSE32, 8); //{ 4,5,6,7, 0,1,2,3, 12,13,14,15, 8,9,10,11 };
150 
151 #if EIGEN_HAS_BUILTIN(__builtin_prefetch) || EIGEN_COMP_GNUC
152 #define EIGEN_PPC_PREFETCH(ADDR) __builtin_prefetch(ADDR);
153 #else
154 #define EIGEN_PPC_PREFETCH(ADDR) asm(" dcbt [%[addr]]\n" ::[addr] "r"(ADDR) : "cc");
155 #endif
156 
157 #if EIGEN_COMP_LLVM
158 #define LOAD_STORE_UNROLL_16 _Pragma("unroll 16")
159 #else
160 #define LOAD_STORE_UNROLL_16 _Pragma("GCC unroll(16)")
161 #endif
162 
163 template <>
165  typedef Packet4f type;
166  typedef Packet4f half;
167  enum {
170  size = 4,
171 
172  HasAdd = 1,
173  HasSub = 1,
174  HasMul = 1,
175  HasDiv = 1,
176  HasMin = 1,
177  HasMax = 1,
178  HasAbs = 1,
181  HasACos = 1,
182  HasASin = 1,
183  HasATan = 1,
184  HasATanh = 1,
185  HasLog = 1,
186  HasExp = 1,
187 #ifdef EIGEN_VECTORIZE_VSX
188  HasSqrt = 1,
189 #if !EIGEN_COMP_CLANG
190  HasRsqrt = 1,
191 #else
192  HasRsqrt = 0,
193 #endif
197 #else
198  HasSqrt = 0,
199  HasRsqrt = 0,
200  HasTanh = 0,
201  HasErf = 0,
202 #endif
204  HasBlend = 1
205  };
206 };
207 template <>
209  typedef Packet8bf type;
210  typedef Packet8bf half;
211  enum {
214  size = 8,
215 
216  HasAdd = 1,
217  HasSub = 1,
218  HasMul = 1,
219  HasDiv = 1,
220  HasMin = 1,
221  HasMax = 1,
222  HasAbs = 1,
225  HasLog = 1,
226  HasExp = 1,
227 #ifdef EIGEN_VECTORIZE_VSX
228  HasSqrt = 1,
229 #if !EIGEN_COMP_CLANG
230  HasRsqrt = 1,
231 #else
232  HasRsqrt = 0,
233 #endif
234 #else
235  HasSqrt = 0,
236  HasRsqrt = 0,
237 #endif
238  HasTanh = 0,
239  HasErf = 0,
241  HasBlend = 1
242  };
243 };
244 
245 template <>
247  typedef Packet4i type;
248  typedef Packet4i half;
249  enum {
252  size = 4,
253 
254  HasAdd = 1,
255  HasSub = 1,
256  HasShift = 1,
257  HasMul = 1,
258 #if defined(_ARCH_PWR10) && (EIGEN_COMP_LLVM || EIGEN_GNUC_STRICT_AT_LEAST(11, 0, 0))
259  HasDiv = 1,
260 #else
261  HasDiv = 0,
262 #endif
263  HasBlend = 1,
264  HasCmp = 1
265  };
266 };
267 
268 template <>
270  typedef Packet8s type;
271  typedef Packet8s half;
272  enum {
275  size = 8,
276 
277  HasAdd = 1,
278  HasSub = 1,
279  HasMul = 1,
280  HasDiv = 0,
281  HasBlend = 1,
282  HasCmp = 1
283  };
284 };
285 
286 template <>
288  typedef Packet8us type;
289  typedef Packet8us half;
290  enum {
293  size = 8,
294 
295  HasAdd = 1,
296  HasSub = 1,
297  HasMul = 1,
298  HasDiv = 0,
299  HasBlend = 1,
300  HasCmp = 1
301  };
302 };
303 
304 template <>
306  typedef Packet16c type;
307  typedef Packet16c half;
308  enum {
311  size = 16,
312 
313  HasAdd = 1,
314  HasSub = 1,
315  HasMul = 1,
316  HasDiv = 0,
317  HasBlend = 1,
318  HasCmp = 1
319  };
320 };
321 
322 template <>
324  typedef Packet16uc type;
325  typedef Packet16uc half;
326  enum {
329  size = 16,
330 
331  HasAdd = 1,
332  HasSub = 1,
333  HasMul = 1,
334  HasDiv = 0,
335  HasBlend = 1,
336  HasCmp = 1
337  };
338 };
339 
340 template <>
342  typedef float type;
343  typedef Packet4f half;
345  enum {
346  size = 4,
348  vectorizable = true,
350  masked_store_available = false
351  };
352 };
353 template <>
355  typedef int type;
356  typedef Packet4i half;
357  enum {
358  size = 4,
360  vectorizable = true,
362  masked_store_available = false
363  };
364 };
365 template <>
367  typedef short int type;
368  typedef Packet8s half;
369  enum {
370  size = 8,
372  vectorizable = true,
374  masked_store_available = false
375  };
376 };
377 template <>
379  typedef unsigned short int type;
380  typedef Packet8us half;
381  enum {
382  size = 8,
384  vectorizable = true,
386  masked_store_available = false
387  };
388 };
389 
390 template <>
392  typedef signed char type;
393  typedef Packet16c half;
394  enum {
395  size = 16,
397  vectorizable = true,
399  masked_store_available = false
400  };
401 };
402 template <>
404  typedef unsigned char type;
405  typedef Packet16uc half;
406  enum {
407  size = 16,
409  vectorizable = true,
411  masked_store_available = false
412  };
413 };
414 
415 template <>
417  typedef bfloat16 type;
418  typedef Packet8bf half;
419  enum {
420  size = 8,
422  vectorizable = true,
424  masked_store_available = false
425  };
426 };
427 inline std::ostream& operator<<(std::ostream& s, const Packet16c& v) {
428  union {
429  Packet16c v;
430  signed char n[16];
431  } vt;
432  vt.v = v;
433  for (int i = 0; i < 16; i++) s << vt.n[i] << ", ";
434  return s;
435 }
436 
437 inline std::ostream& operator<<(std::ostream& s, const Packet16uc& v) {
438  union {
439  Packet16uc v;
440  unsigned char n[16];
441  } vt;
442  vt.v = v;
443  for (int i = 0; i < 16; i++) s << vt.n[i] << ", ";
444  return s;
445 }
446 
447 inline std::ostream& operator<<(std::ostream& s, const Packet4f& v) {
448  union {
449  Packet4f v;
450  float n[4];
451  } vt;
452  vt.v = v;
453  s << vt.n[0] << ", " << vt.n[1] << ", " << vt.n[2] << ", " << vt.n[3];
454  return s;
455 }
456 
457 inline std::ostream& operator<<(std::ostream& s, const Packet4i& v) {
458  union {
459  Packet4i v;
460  int n[4];
461  } vt;
462  vt.v = v;
463  s << vt.n[0] << ", " << vt.n[1] << ", " << vt.n[2] << ", " << vt.n[3];
464  return s;
465 }
466 
467 inline std::ostream& operator<<(std::ostream& s, const Packet4ui& v) {
468  union {
469  Packet4ui v;
470  unsigned int n[4];
471  } vt;
472  vt.v = v;
473  s << vt.n[0] << ", " << vt.n[1] << ", " << vt.n[2] << ", " << vt.n[3];
474  return s;
475 }
476 
477 template <typename Packet>
479  // some versions of GCC throw "unused-but-set-parameter".
480  // ignoring these warnings for now.
481  EIGEN_UNUSED_VARIABLE(from);
483 #ifdef EIGEN_VECTORIZE_VSX
484  return vec_xl(0, const_cast<__UNPACK_TYPE__(Packet)*>(from));
485 #else
486  return vec_ld(0, from);
487 #endif
488 }
489 
490 // Need to define them first or we get specialization after instantiation errors
491 template <>
493  return pload_common<Packet4f>(from);
494 }
495 
496 template <>
498  return pload_common<Packet4i>(from);
499 }
500 
501 template <>
503  return pload_common<Packet8s>(from);
504 }
505 
506 template <>
507 EIGEN_STRONG_INLINE Packet8us pload<Packet8us>(const unsigned short int* from) {
508  return pload_common<Packet8us>(from);
509 }
510 
511 template <>
513  return pload_common<Packet16c>(from);
514 }
515 
516 template <>
518  return pload_common<Packet16uc>(from);
519 }
520 
521 template <>
523  return pload_common<Packet8us>(reinterpret_cast<const unsigned short int*>(from));
524 }
525 
526 template <typename Packet>
528  // some versions of GCC throw "unused-but-set-parameter".
529  // ignoring these warnings for now.
530  EIGEN_UNUSED_VARIABLE(from);
532  // Ignore partial input memory initialized
533 #if !EIGEN_COMP_LLVM
534 #pragma GCC diagnostic push
535 #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
536 #endif
537 #ifdef EIGEN_VECTORIZE_VSX
538  return vec_xl(0, const_cast<__UNPACK_TYPE__(Packet)*>(from));
539 #else
540  return vec_ld(0, from);
541 #endif
542 #if !EIGEN_COMP_LLVM
543 #pragma GCC diagnostic pop
544 #endif
545 }
546 
547 template <>
549  return pload_ignore<Packet8us>(reinterpret_cast<const unsigned short int*>(from));
550 }
551 
552 template <typename Packet>
554  const Index offset) {
555  // some versions of GCC throw "unused-but-set-parameter".
556  // ignoring these warnings for now.
557  const Index packet_size = unpacket_traits<Packet>::size;
558  eigen_internal_assert(n + offset <= packet_size && "number of elements plus offset will read past end of packet");
559  const Index size = sizeof(__UNPACK_TYPE__(Packet));
560 #ifdef _ARCH_PWR9
561  EIGEN_UNUSED_VARIABLE(packet_size);
563  EIGEN_UNUSED_VARIABLE(from);
564  Packet load = vec_xl_len(const_cast<__UNPACK_TYPE__(Packet)*>(from), n * size);
565  if (offset) {
566  Packet16uc shift = pset1<Packet16uc>(offset * 8 * size);
567 #ifdef _BIG_ENDIAN
568  load = Packet(vec_sro(Packet16uc(load), shift));
569 #else
570  load = Packet(vec_slo(Packet16uc(load), shift));
571 #endif
572  }
573  return load;
574 #else
575  if (n) {
577  unsigned char* load2 = reinterpret_cast<unsigned char*>(load + offset);
578  unsigned char* from2 = reinterpret_cast<unsigned char*>(const_cast<__UNPACK_TYPE__(Packet)*>(from));
579  Index n2 = n * size;
580  if (16 <= n2) {
581  pstoreu(load2, ploadu<Packet16uc>(from2));
582  } else {
583  memcpy((void*)load2, (void*)from2, n2);
584  }
585  return pload_ignore<Packet>(load);
586  } else {
587  return Packet(pset1<Packet16uc>(0));
588  }
589 #endif
590 }
591 
592 template <>
593 EIGEN_ALWAYS_INLINE Packet4f pload_partial<Packet4f>(const float* from, const Index n, const Index offset) {
594  return pload_partial_common<Packet4f>(from, n, offset);
595 }
596 
597 template <>
598 EIGEN_ALWAYS_INLINE Packet4i pload_partial<Packet4i>(const int* from, const Index n, const Index offset) {
599  return pload_partial_common<Packet4i>(from, n, offset);
600 }
601 
602 template <>
603 EIGEN_ALWAYS_INLINE Packet8s pload_partial<Packet8s>(const short int* from, const Index n, const Index offset) {
604  return pload_partial_common<Packet8s>(from, n, offset);
605 }
606 
607 template <>
608 EIGEN_ALWAYS_INLINE Packet8us pload_partial<Packet8us>(const unsigned short int* from, const Index n,
609  const Index offset) {
610  return pload_partial_common<Packet8us>(from, n, offset);
611 }
612 
613 template <>
615  return pload_partial_common<Packet8us>(reinterpret_cast<const unsigned short int*>(from), n, offset);
616 }
617 
618 template <>
619 EIGEN_ALWAYS_INLINE Packet16c pload_partial<Packet16c>(const signed char* from, const Index n, const Index offset) {
620  return pload_partial_common<Packet16c>(from, n, offset);
621 }
622 
623 template <>
624 EIGEN_ALWAYS_INLINE Packet16uc pload_partial<Packet16uc>(const unsigned char* from, const Index n, const Index offset) {
625  return pload_partial_common<Packet16uc>(from, n, offset);
626 }
627 
628 template <typename Packet>
630  // some versions of GCC throw "unused-but-set-parameter" (float *to).
631  // ignoring these warnings for now.
634 #ifdef EIGEN_VECTORIZE_VSX
635  vec_xst(from, 0, to);
636 #else
637  vec_st(from, 0, to);
638 #endif
639 }
640 
641 template <>
642 EIGEN_STRONG_INLINE void pstore<float>(float* to, const Packet4f& from) {
643  pstore_common<Packet4f>(to, from);
644 }
645 
646 template <>
647 EIGEN_STRONG_INLINE void pstore<int>(int* to, const Packet4i& from) {
648  pstore_common<Packet4i>(to, from);
649 }
650 
651 template <>
652 EIGEN_STRONG_INLINE void pstore<short int>(short int* to, const Packet8s& from) {
653  pstore_common<Packet8s>(to, from);
654 }
655 
656 template <>
657 EIGEN_STRONG_INLINE void pstore<unsigned short int>(unsigned short int* to, const Packet8us& from) {
658  pstore_common<Packet8us>(to, from);
659 }
660 
661 template <>
663  pstore_common<Packet8us>(reinterpret_cast<unsigned short int*>(to), from.m_val);
664 }
665 
666 template <>
667 EIGEN_STRONG_INLINE void pstore<signed char>(signed char* to, const Packet16c& from) {
668  pstore_common<Packet16c>(to, from);
669 }
670 
671 template <>
672 EIGEN_STRONG_INLINE void pstore<unsigned char>(unsigned char* to, const Packet16uc& from) {
673  pstore_common<Packet16uc>(to, from);
674 }
675 
676 template <typename Packet>
678  const Index offset) {
679  // some versions of GCC throw "unused-but-set-parameter" (float *to).
680  // ignoring these warnings for now.
681  const Index packet_size = unpacket_traits<Packet>::size;
682  eigen_internal_assert(n + offset <= packet_size && "number of elements plus offset will write past end of packet");
683  const Index size = sizeof(__UNPACK_TYPE__(Packet));
684 #ifdef _ARCH_PWR9
685  EIGEN_UNUSED_VARIABLE(packet_size);
688  Packet store = from;
689  if (offset) {
690  Packet16uc shift = pset1<Packet16uc>(offset * 8 * size);
691 #ifdef _BIG_ENDIAN
692  store = Packet(vec_slo(Packet16uc(store), shift));
693 #else
694  store = Packet(vec_sro(Packet16uc(store), shift));
695 #endif
696  }
697  vec_xst_len(store, to, n * size);
698 #else
699  if (n) {
700  EIGEN_ALIGN16 __UNPACK_TYPE__(Packet) store[packet_size];
701  pstore(store, from);
702  unsigned char* store2 = reinterpret_cast<unsigned char*>(store + offset);
703  unsigned char* to2 = reinterpret_cast<unsigned char*>(to);
704  Index n2 = n * size;
705  if (16 <= n2) {
706  pstore(to2, ploadu<Packet16uc>(store2));
707  } else {
708  memcpy((void*)to2, (void*)store2, n2);
709  }
710  }
711 #endif
712 }
713 
714 template <>
715 EIGEN_ALWAYS_INLINE void pstore_partial<float>(float* to, const Packet4f& from, const Index n, const Index offset) {
716  pstore_partial_common<Packet4f>(to, from, n, offset);
717 }
718 
719 template <>
720 EIGEN_ALWAYS_INLINE void pstore_partial<int>(int* to, const Packet4i& from, const Index n, const Index offset) {
721  pstore_partial_common<Packet4i>(to, from, n, offset);
722 }
723 
724 template <>
725 EIGEN_ALWAYS_INLINE void pstore_partial<short int>(short int* to, const Packet8s& from, const Index n,
726  const Index offset) {
727  pstore_partial_common<Packet8s>(to, from, n, offset);
728 }
729 
730 template <>
731 EIGEN_ALWAYS_INLINE void pstore_partial<unsigned short int>(unsigned short int* to, const Packet8us& from,
732  const Index n, const Index offset) {
733  pstore_partial_common<Packet8us>(to, from, n, offset);
734 }
735 
736 template <>
738  const Index offset) {
739  pstore_partial_common<Packet8us>(reinterpret_cast<unsigned short int*>(to), from.m_val, n, offset);
740 }
741 
742 template <>
743 EIGEN_ALWAYS_INLINE void pstore_partial<signed char>(signed char* to, const Packet16c& from, const Index n,
744  const Index offset) {
745  pstore_partial_common<Packet16c>(to, from, n, offset);
746 }
747 
748 template <>
749 EIGEN_ALWAYS_INLINE void pstore_partial<unsigned char>(unsigned char* to, const Packet16uc& from, const Index n,
750  const Index offset) {
751  pstore_partial_common<Packet16uc>(to, from, n, offset);
752 }
753 
754 template <typename Packet>
756  Packet v = {from, from, from, from};
757  return v;
758 }
759 
760 template <typename Packet>
762  Packet v = {from, from, from, from, from, from, from, from};
763  return v;
764 }
765 
766 template <typename Packet>
768  Packet v = {from, from, from, from, from, from, from, from, from, from, from, from, from, from, from, from};
769  return v;
770 }
771 
772 template <>
774  return pset1_size4<Packet4f>(from);
775 }
776 
777 template <>
779  return pset1_size4<Packet4i>(from);
780 }
781 
782 template <>
784  return pset1_size8<Packet8s>(from);
785 }
786 
787 template <>
788 EIGEN_STRONG_INLINE Packet8us pset1<Packet8us>(const unsigned short int& from) {
789  return pset1_size8<Packet8us>(from);
790 }
791 
792 template <>
794  return pset1_size16<Packet16c>(from);
795 }
796 
797 template <>
799  return pset1_size16<Packet16uc>(from);
800 }
801 
802 template <>
804  return reinterpret_cast<Packet4f>(pset1<Packet4i>(from));
805 }
806 
807 template <>
809  return pset1_size8<Packet8us>(reinterpret_cast<const unsigned short int&>(from));
810 }
811 
812 template <typename Packet>
814  Packet& a3) {
815  a3 = pload<Packet>(a);
816  a0 = vec_splat(a3, 0);
817  a1 = vec_splat(a3, 1);
818  a2 = vec_splat(a3, 2);
819  a3 = vec_splat(a3, 3);
820 }
821 
822 template <>
824  pbroadcast4_common<Packet4f>(a, a0, a1, a2, a3);
825 }
826 template <>
828  pbroadcast4_common<Packet4i>(a, a0, a1, a2, a3);
829 }
830 
831 template <typename Packet>
835  eigen_internal_assert(n <= unpacket_traits<Packet>::size && "number of elements will gather past end of packet");
836  if (stride == 1) {
838  return ploadu<Packet>(from);
839  } else {
840  return ploadu_partial<Packet>(from, n);
841  }
842  } else {
844  for (Index i = 0; i < n; i++) {
845  a[i] = from[i * stride];
846  }
847  // Leave rest of the array uninitialized
848  return pload_ignore<Packet>(a);
849  }
850 }
851 
852 template <>
854  return pgather_common<Packet4f>(from, stride);
855 }
856 
857 template <>
859  return pgather_common<Packet4i>(from, stride);
860 }
861 
862 template <>
864  return pgather_common<Packet8s>(from, stride);
865 }
866 
867 template <>
869  Index stride) {
870  return pgather_common<Packet8us>(from, stride);
871 }
872 
873 template <>
875  return pgather_common<Packet8bf>(from, stride);
876 }
877 
878 template <>
880  return pgather_common<Packet16c>(from, stride);
881 }
882 
883 template <>
885  Index stride) {
886  return pgather_common<Packet16uc>(from, stride);
887 }
888 
889 template <>
891  const Index n) {
892  return pgather_common<Packet4f>(from, stride, n);
893 }
894 
895 template <>
897  const Index n) {
898  return pgather_common<Packet4i>(from, stride, n);
899 }
900 
901 template <>
903  const Index n) {
904  return pgather_common<Packet8s>(from, stride, n);
905 }
906 
907 template <>
909 pgather_partial<unsigned short int, Packet8us>(const unsigned short int* from, Index stride, const Index n) {
910  return pgather_common<Packet8us>(from, stride, n);
911 }
912 
913 template <>
915  const Index n) {
916  return pgather_common<Packet8bf>(from, stride, n);
917 }
918 
919 template <>
921  Index stride, const Index n) {
922  return pgather_common<Packet16c>(from, stride, n);
923 }
924 
925 template <>
927  Index stride,
928  const Index n) {
929  return pgather_common<Packet16uc>(from, stride, n);
930 }
931 
932 template <typename Packet>
934  Index stride,
937  eigen_internal_assert(n <= unpacket_traits<Packet>::size && "number of elements will scatter past end of packet");
938  if (stride == 1) {
940  return pstoreu(to, from);
941  } else {
942  return pstoreu_partial(to, from, n);
943  }
944  } else {
945  pstore<__UNPACK_TYPE__(Packet)>(a, from);
947  for (Index i = 0; i < n; i++) {
948  to[i * stride] = a[i];
949  }
950  }
951 }
952 
953 template <>
955  pscatter_common<Packet4f>(to, from, stride);
956 }
957 
958 template <>
960  pscatter_common<Packet4i>(to, from, stride);
961 }
962 
963 template <>
965  Index stride) {
966  pscatter_common<Packet8s>(to, from, stride);
967 }
968 
969 template <>
971  const Packet8us& from,
972  Index stride) {
973  pscatter_common<Packet8us>(to, from, stride);
974 }
975 
976 template <>
978  Index stride) {
979  pscatter_common<Packet8bf>(to, from, stride);
980 }
981 
982 template <>
984  Index stride) {
985  pscatter_common<Packet16c>(to, from, stride);
986 }
987 
988 template <>
990  const Packet16uc& from, Index stride) {
991  pscatter_common<Packet16uc>(to, from, stride);
992 }
993 
994 template <>
996  Index stride, const Index n) {
997  pscatter_common<Packet4f>(to, from, stride, n);
998 }
999 
1000 template <>
1002  const Index n) {
1003  pscatter_common<Packet4i>(to, from, stride, n);
1004 }
1005 
1006 template <>
1008  Index stride, const Index n) {
1009  pscatter_common<Packet8s>(to, from, stride, n);
1010 }
1011 
1012 template <>
1014  const Packet8us& from,
1015  Index stride,
1016  const Index n) {
1017  pscatter_common<Packet8us>(to, from, stride, n);
1018 }
1019 
1020 template <>
1022  Index stride, const Index n) {
1023  pscatter_common<Packet8bf>(to, from, stride, n);
1024 }
1025 
1026 template <>
1028  const Packet16c& from, Index stride,
1029  const Index n) {
1030  pscatter_common<Packet16c>(to, from, stride, n);
1031 }
1032 
1033 template <>
1035  const Packet16uc& from,
1036  Index stride, const Index n) {
1037  pscatter_common<Packet16uc>(to, from, stride, n);
1038 }
1039 
1040 template <>
1042  return pset1<Packet4f>(a) + p4f_COUNTDOWN;
1043 }
1044 template <>
1046  return pset1<Packet4i>(a) + p4i_COUNTDOWN;
1047 }
1048 template <>
1050  return pset1<Packet8s>(a) + p8s_COUNTDOWN;
1051 }
1052 template <>
1053 EIGEN_STRONG_INLINE Packet8us plset<Packet8us>(const unsigned short int& a) {
1054  return pset1<Packet8us>(a) + p8us_COUNTDOWN;
1055 }
1056 template <>
1058  return pset1<Packet16c>(a) + p16c_COUNTDOWN;
1059 }
1060 template <>
1063 }
1064 
1065 template <>
1067  return a + b;
1068 }
1069 template <>
1071  return a + b;
1072 }
1073 template <>
1075  return a + b;
1076 }
1077 template <>
1079  return a + b;
1080 }
1081 template <>
1083  return a + b;
1084 }
1085 template <>
1087  return a + b;
1088 }
1089 template <>
1091  return a + b;
1092 }
1093 
1094 template <>
1096  return a - b;
1097 }
1098 template <>
1100  return a - b;
1101 }
1102 template <>
1104  return a - b;
1105 }
1106 template <>
1108  return a - b;
1109 }
1110 template <>
1112  return a - b;
1113 }
1114 template <>
1116  return a - b;
1117 }
1118 
1119 template <>
1121 #ifdef __POWER8_VECTOR__
1122  return vec_neg(a);
1123 #else
1124  return vec_xor(a, p4f_MZERO);
1125 #endif
1126 }
1127 template <>
1129 #ifdef __POWER8_VECTOR__
1130  return vec_neg(a);
1131 #else
1132  return reinterpret_cast<Packet16c>(p4i_ZERO) - a;
1133 #endif
1134 }
1135 template <>
1137 #ifdef __POWER8_VECTOR__
1138  return vec_neg(a);
1139 #else
1140  return reinterpret_cast<Packet8s>(p4i_ZERO) - a;
1141 #endif
1142 }
1143 template <>
1145 #ifdef __POWER8_VECTOR__
1146  return vec_neg(a);
1147 #else
1148  return p4i_ZERO - a;
1149 #endif
1150 }
1151 
1152 template <>
1154  return a;
1155 }
1156 template <>
1158  return a;
1159 }
1160 
1161 template <>
1163  return vec_madd(a, b, p4f_MZERO);
1164 }
1165 template <>
1167  return a * b;
1168 }
1169 template <>
1171  return vec_mul(a, b);
1172 }
1173 template <>
1175  return vec_mul(a, b);
1176 }
1177 template <>
1179  return vec_mul(a, b);
1180 }
1181 template <>
1183  return vec_mul(a, b);
1184 }
1185 
1186 template <>
1188 #ifndef __VSX__ // VSX actually provides a div instruction
1189  Packet4f t, y_0, y_1;
1190 
1191  // Altivec does not offer a divide instruction, we have to do a reciprocal approximation
1192  y_0 = vec_re(b);
1193 
1194  // Do one Newton-Raphson iteration to get the needed accuracy
1195  t = vec_nmsub(y_0, b, p4f_ONE);
1196  y_1 = vec_madd(y_0, t, y_0);
1197 
1198  return vec_madd(a, y_1, p4f_MZERO);
1199 #else
1200  return vec_div(a, b);
1201 #endif
1202 }
1203 
1204 template <>
1206 #if defined(_ARCH_PWR10) && (EIGEN_COMP_LLVM || EIGEN_GNUC_STRICT_AT_LEAST(11, 0, 0))
1207  return vec_div(a, b);
1208 #else
1211  eigen_assert(false && "packet integer division are not supported by AltiVec");
1212  return pset1<Packet4i>(0);
1213 #endif
1214 }
1215 
1216 // for some weird raisons, it has to be overloaded for packet of integers
1217 template <>
1219  return vec_madd(a, b, c);
1220 }
1221 template <>
1223  return a * b + c;
1224 }
1225 template <>
1227  return vec_madd(a, b, c);
1228 }
1229 template <>
1231  return vec_madd(a, b, c);
1232 }
1233 
1234 #ifdef EIGEN_VECTORIZE_VSX
1235 template <>
1236 EIGEN_STRONG_INLINE Packet4f pmsub(const Packet4f& a, const Packet4f& b, const Packet4f& c) {
1237  return vec_msub(a, b, c);
1238 }
1239 template <>
1240 EIGEN_STRONG_INLINE Packet4f pnmadd(const Packet4f& a, const Packet4f& b, const Packet4f& c) {
1241  return vec_nmsub(a, b, c);
1242 }
1243 template <>
1244 EIGEN_STRONG_INLINE Packet4f pnmsub(const Packet4f& a, const Packet4f& b, const Packet4f& c) {
1245  return vec_nmadd(a, b, c);
1246 }
1247 #endif
1248 
1249 template <>
1251 #ifdef EIGEN_VECTORIZE_VSX
1252  // NOTE: about 10% slower than vec_min, but consistent with std::min and SSE regarding NaN
1253  Packet4f ret;
1254  __asm__("xvcmpgesp %x0,%x1,%x2\n\txxsel %x0,%x1,%x2,%x0" : "=&wa"(ret) : "wa"(a), "wa"(b));
1255  return ret;
1256 #else
1257  return vec_min(a, b);
1258 #endif
1259 }
1260 template <>
1262  return vec_min(a, b);
1263 }
1264 template <>
1266  return vec_min(a, b);
1267 }
1268 template <>
1270  return vec_min(a, b);
1271 }
1272 template <>
1274  return vec_min(a, b);
1275 }
1276 template <>
1278  return vec_min(a, b);
1279 }
1280 
1281 template <>
1283 #ifdef EIGEN_VECTORIZE_VSX
1284  // NOTE: about 10% slower than vec_max, but consistent with std::max and SSE regarding NaN
1285  Packet4f ret;
1286  __asm__("xvcmpgtsp %x0,%x2,%x1\n\txxsel %x0,%x1,%x2,%x0" : "=&wa"(ret) : "wa"(a), "wa"(b));
1287  return ret;
1288 #else
1289  return vec_max(a, b);
1290 #endif
1291 }
1292 template <>
1294  return vec_max(a, b);
1295 }
1296 template <>
1298  return vec_max(a, b);
1299 }
1300 template <>
1302  return vec_max(a, b);
1303 }
1304 template <>
1306  return vec_max(a, b);
1307 }
1308 template <>
1310  return vec_max(a, b);
1311 }
1312 
1313 template <>
1315  return reinterpret_cast<Packet4f>(vec_cmple(a, b));
1316 }
1317 // To fix bug with vec_cmplt on older versions
1318 #ifdef EIGEN_VECTORIZE_VSX
1319 template <>
1321  return reinterpret_cast<Packet4f>(vec_cmplt(a, b));
1322 }
1323 #endif
1324 template <>
1326  return reinterpret_cast<Packet4f>(vec_cmpeq(a, b));
1327 }
1328 template <>
1330  Packet4f c = reinterpret_cast<Packet4f>(vec_cmpge(a, b));
1331  return vec_nor(c, c);
1332 }
1333 
1334 #ifdef EIGEN_VECTORIZE_VSX
1335 template <>
1337  return reinterpret_cast<Packet4i>(vec_cmple(a, b));
1338 }
1339 #endif
1340 template <>
1342  return reinterpret_cast<Packet4i>(vec_cmplt(a, b));
1343 }
1344 template <>
1346  return reinterpret_cast<Packet4i>(vec_cmpeq(a, b));
1347 }
1348 #ifdef EIGEN_VECTORIZE_VSX
1349 template <>
1351  return reinterpret_cast<Packet8s>(vec_cmple(a, b));
1352 }
1353 #endif
1354 template <>
1356  return reinterpret_cast<Packet8s>(vec_cmplt(a, b));
1357 }
1358 template <>
1360  return reinterpret_cast<Packet8s>(vec_cmpeq(a, b));
1361 }
1362 #ifdef EIGEN_VECTORIZE_VSX
1363 template <>
1365  return reinterpret_cast<Packet8us>(vec_cmple(a, b));
1366 }
1367 #endif
1368 template <>
1370  return reinterpret_cast<Packet8us>(vec_cmplt(a, b));
1371 }
1372 template <>
1374  return reinterpret_cast<Packet8us>(vec_cmpeq(a, b));
1375 }
1376 #ifdef EIGEN_VECTORIZE_VSX
1377 template <>
1379  return reinterpret_cast<Packet16c>(vec_cmple(a, b));
1380 }
1381 #endif
1382 template <>
1384  return reinterpret_cast<Packet16c>(vec_cmplt(a, b));
1385 }
1386 template <>
1388  return reinterpret_cast<Packet16c>(vec_cmpeq(a, b));
1389 }
1390 #ifdef EIGEN_VECTORIZE_VSX
1391 template <>
1393  return reinterpret_cast<Packet16uc>(vec_cmple(a, b));
1394 }
1395 #endif
1396 template <>
1398  return reinterpret_cast<Packet16uc>(vec_cmplt(a, b));
1399 }
1400 template <>
1402  return reinterpret_cast<Packet16uc>(vec_cmpeq(a, b));
1403 }
1404 
1405 template <>
1407  return vec_and(a, b);
1408 }
1409 template <>
1411  return vec_and(a, b);
1412 }
1413 template <>
1415  return vec_and(a, b);
1416 }
1417 template <>
1419  return vec_and(a, b);
1420 }
1421 template <>
1423  return pand<Packet8us>(a, b);
1424 }
1425 
1426 template <>
1428  return vec_or(a, b);
1429 }
1430 template <>
1432  return vec_or(a, b);
1433 }
1434 template <>
1436  return vec_or(a, b);
1437 }
1438 template <>
1440  return vec_or(a, b);
1441 }
1442 template <>
1444  return por<Packet8us>(a, b);
1445 }
1446 
1447 template <>
1449  return vec_xor(a, b);
1450 }
1451 template <>
1453  return vec_xor(a, b);
1454 }
1455 template <>
1457  return vec_xor(a, b);
1458 }
1459 template <>
1461  return pxor<Packet8us>(a, b);
1462 }
1463 
1464 template <>
1466  return vec_andc(a, b);
1467 }
1468 template <>
1470  return vec_andc(a, b);
1471 }
1472 
1473 template <>
1475  return vec_sel(b, a, reinterpret_cast<Packet4ui>(mask));
1476 }
1477 
1478 template <>
1480  Packet4f t = vec_add(
1481  reinterpret_cast<Packet4f>(vec_or(vec_and(reinterpret_cast<Packet4ui>(a), p4ui_SIGN), p4ui_PREV0DOT5)), a);
1482  Packet4f res;
1483 
1484 #ifdef EIGEN_VECTORIZE_VSX
1485  __asm__("xvrspiz %x0, %x1\n\t" : "=&wa"(res) : "wa"(t));
1486 #else
1487  __asm__("vrfiz %0, %1\n\t" : "=v"(res) : "v"(t));
1488 #endif
1489 
1490  return res;
1491 }
1492 template <>
1494  return vec_ceil(a);
1495 }
1496 template <>
1498  return vec_floor(a);
1499 }
1500 template <>
1502  return vec_trunc(a);
1503 }
1504 #ifdef EIGEN_VECTORIZE_VSX
1505 template <>
1507  Packet4f res;
1508 
1509  __asm__("xvrspic %x0, %x1\n\t" : "=&wa"(res) : "wa"(a));
1510 
1511  return res;
1512 }
1513 #endif
1514 
1515 template <typename Packet>
1518 #if defined(EIGEN_VECTORIZE_VSX) || !defined(_BIG_ENDIAN)
1520  return vec_xl(0, const_cast<__UNPACK_TYPE__(Packet)*>(from));
1521 #else
1522  Packet16uc MSQ, LSQ;
1523  Packet16uc mask;
1524  MSQ = vec_ld(0, (unsigned char*)from); // most significant quadword
1525  LSQ = vec_ld(15, (unsigned char*)from); // least significant quadword
1526  mask = vec_lvsl(0, from); // create the permute mask
1527  // TODO: Add static_cast here
1528  return (Packet)vec_perm(MSQ, LSQ, mask); // align the data
1529 #endif
1530 }
1531 
1532 template <>
1534  return ploadu_common<Packet4f>(from);
1535 }
1536 template <>
1538  return ploadu_common<Packet4i>(from);
1539 }
1540 template <>
1542  return ploadu_common<Packet8s>(from);
1543 }
1544 template <>
1545 EIGEN_STRONG_INLINE Packet8us ploadu<Packet8us>(const unsigned short int* from) {
1546  return ploadu_common<Packet8us>(from);
1547 }
1548 template <>
1550  return ploadu_common<Packet8us>(reinterpret_cast<const unsigned short int*>(from));
1551 }
1552 template <>
1554  return ploadu_common<Packet16c>(from);
1555 }
1556 template <>
1558  return ploadu_common<Packet16uc>(from);
1559 }
1560 
1561 template <typename Packet>
1563  const Index offset) {
1564  const Index packet_size = unpacket_traits<Packet>::size;
1565  eigen_internal_assert(n + offset <= packet_size && "number of elements plus offset will read past end of packet");
1566  const Index size = sizeof(__UNPACK_TYPE__(Packet));
1567 #ifdef _ARCH_PWR9
1568  EIGEN_UNUSED_VARIABLE(packet_size);
1571  Packet load = vec_xl_len(const_cast<__UNPACK_TYPE__(Packet)*>(from), n * size);
1572  if (offset) {
1573  Packet16uc shift = pset1<Packet16uc>(offset * 8 * size);
1574 #ifdef _BIG_ENDIAN
1575  load = Packet(vec_sro(Packet16uc(load), shift));
1576 #else
1577  load = Packet(vec_slo(Packet16uc(load), shift));
1578 #endif
1579  }
1580  return load;
1581 #else
1582  if (n) {
1583  EIGEN_ALIGN16 __UNPACK_TYPE__(Packet) load[packet_size];
1584  unsigned char* load2 = reinterpret_cast<unsigned char*>(load + offset);
1585  unsigned char* from2 = reinterpret_cast<unsigned char*>(const_cast<__UNPACK_TYPE__(Packet)*>(from));
1586  Index n2 = n * size;
1587  if (16 <= n2) {
1588  pstoreu(load2, ploadu<Packet16uc>(from2));
1589  } else {
1590  memcpy((void*)load2, (void*)from2, n2);
1591  }
1592  return pload_ignore<Packet>(load);
1593  } else {
1594  return Packet(pset1<Packet16uc>(0));
1595  }
1596 #endif
1597 }
1598 
1599 template <>
1600 EIGEN_ALWAYS_INLINE Packet4f ploadu_partial<Packet4f>(const float* from, const Index n, const Index offset) {
1601  return ploadu_partial_common<Packet4f>(from, n, offset);
1602 }
1603 template <>
1604 EIGEN_ALWAYS_INLINE Packet4i ploadu_partial<Packet4i>(const int* from, const Index n, const Index offset) {
1605  return ploadu_partial_common<Packet4i>(from, n, offset);
1606 }
1607 template <>
1608 EIGEN_ALWAYS_INLINE Packet8s ploadu_partial<Packet8s>(const short int* from, const Index n, const Index offset) {
1609  return ploadu_partial_common<Packet8s>(from, n, offset);
1610 }
1611 template <>
1612 EIGEN_ALWAYS_INLINE Packet8us ploadu_partial<Packet8us>(const unsigned short int* from, const Index n,
1613  const Index offset) {
1614  return ploadu_partial_common<Packet8us>(from, n, offset);
1615 }
1616 template <>
1618  return ploadu_partial_common<Packet8us>(reinterpret_cast<const unsigned short int*>(from), n, offset);
1619 }
1620 template <>
1621 EIGEN_ALWAYS_INLINE Packet16c ploadu_partial<Packet16c>(const signed char* from, const Index n, const Index offset) {
1622  return ploadu_partial_common<Packet16c>(from, n, offset);
1623 }
1624 template <>
1626  const Index offset) {
1627  return ploadu_partial_common<Packet16uc>(from, n, offset);
1628 }
1629 
1630 template <typename Packet>
1632  Packet p;
1633  if ((std::ptrdiff_t(from) % 16) == 0)
1634  p = pload<Packet>(from);
1635  else
1636  p = ploadu<Packet>(from);
1637  return vec_mergeh(p, p);
1638 }
1639 template <>
1641  return ploaddup_common<Packet4f>(from);
1642 }
1643 template <>
1645  return ploaddup_common<Packet4i>(from);
1646 }
1647 
1648 template <>
1650  Packet8s p;
1651  if ((std::ptrdiff_t(from) % 16) == 0)
1652  p = pload<Packet8s>(from);
1653  else
1654  p = ploadu<Packet8s>(from);
1655  return vec_mergeh(p, p);
1656 }
1657 
1658 template <>
1659 EIGEN_STRONG_INLINE Packet8us ploaddup<Packet8us>(const unsigned short int* from) {
1660  Packet8us p;
1661  if ((std::ptrdiff_t(from) % 16) == 0)
1662  p = pload<Packet8us>(from);
1663  else
1664  p = ploadu<Packet8us>(from);
1665  return vec_mergeh(p, p);
1666 }
1667 
1668 template <>
1670  Packet8s p;
1671  if ((std::ptrdiff_t(from) % 16) == 0)
1672  p = pload<Packet8s>(from);
1673  else
1674  p = ploadu<Packet8s>(from);
1675  return vec_perm(p, p, p16uc_QUADRUPLICATE16_HI);
1676 }
1677 
1678 template <>
1679 EIGEN_STRONG_INLINE Packet8us ploadquad<Packet8us>(const unsigned short int* from) {
1680  Packet8us p;
1681  if ((std::ptrdiff_t(from) % 16) == 0)
1682  p = pload<Packet8us>(from);
1683  else
1684  p = ploadu<Packet8us>(from);
1685  return vec_perm(p, p, p16uc_QUADRUPLICATE16_HI);
1686 }
1687 
1688 template <>
1690  return ploadquad<Packet8us>(reinterpret_cast<const unsigned short int*>(from));
1691 }
1692 
1693 template <>
1695  Packet16c p;
1696  if ((std::ptrdiff_t(from) % 16) == 0)
1697  p = pload<Packet16c>(from);
1698  else
1699  p = ploadu<Packet16c>(from);
1700  return vec_mergeh(p, p);
1701 }
1702 
1703 template <>
1705  Packet16uc p;
1706  if ((std::ptrdiff_t(from) % 16) == 0)
1707  p = pload<Packet16uc>(from);
1708  else
1709  p = ploadu<Packet16uc>(from);
1710  return vec_mergeh(p, p);
1711 }
1712 
1713 template <>
1715  Packet16c p;
1716  if ((std::ptrdiff_t(from) % 16) == 0)
1717  p = pload<Packet16c>(from);
1718  else
1719  p = ploadu<Packet16c>(from);
1720  return vec_perm(p, p, p16uc_QUADRUPLICATE16);
1721 }
1722 
1723 template <>
1725  Packet16uc p;
1726  if ((std::ptrdiff_t(from) % 16) == 0)
1727  p = pload<Packet16uc>(from);
1728  else
1729  p = ploadu<Packet16uc>(from);
1730  return vec_perm(p, p, p16uc_QUADRUPLICATE16);
1731 }
1732 
1733 template <typename Packet>
1736 #if defined(EIGEN_VECTORIZE_VSX) || !defined(_BIG_ENDIAN)
1737  vec_xst(from, 0, to);
1738 #else
1739  // Taken from http://developer.apple.com/hardwaredrivers/ve/alignment.html
1740  // Warning: not thread safe!
1741  Packet16uc MSQ, LSQ, edges;
1742  Packet16uc edgeAlign, align;
1743 
1744  MSQ = vec_ld(0, (unsigned char*)to); // most significant quadword
1745  LSQ = vec_ld(15, (unsigned char*)to); // least significant quadword
1746  edgeAlign = vec_lvsl(0, to); // permute map to extract edges
1747  edges = vec_perm(LSQ, MSQ, edgeAlign); // extract the edges
1748  align = vec_lvsr(0, to); // permute map to misalign data
1749  MSQ = vec_perm(edges, (Packet16uc)from, align); // misalign the data (MSQ)
1750  LSQ = vec_perm((Packet16uc)from, edges, align); // misalign the data (LSQ)
1751  vec_st(LSQ, 15, (unsigned char*)to); // Store the LSQ part first
1752  vec_st(MSQ, 0, (unsigned char*)to); // Store the MSQ part second
1753 #endif
1754 }
1755 template <>
1756 EIGEN_STRONG_INLINE void pstoreu<float>(float* to, const Packet4f& from) {
1757  pstoreu_common<Packet4f>(to, from);
1758 }
1759 template <>
1760 EIGEN_STRONG_INLINE void pstoreu<int>(int* to, const Packet4i& from) {
1761  pstoreu_common<Packet4i>(to, from);
1762 }
1763 template <>
1764 EIGEN_STRONG_INLINE void pstoreu<short int>(short int* to, const Packet8s& from) {
1765  pstoreu_common<Packet8s>(to, from);
1766 }
1767 template <>
1768 EIGEN_STRONG_INLINE void pstoreu<unsigned short int>(unsigned short int* to, const Packet8us& from) {
1769  pstoreu_common<Packet8us>(to, from);
1770 }
1771 template <>
1773  pstoreu_common<Packet8us>(reinterpret_cast<unsigned short int*>(to), from.m_val);
1774 }
1775 template <>
1776 EIGEN_STRONG_INLINE void pstoreu<signed char>(signed char* to, const Packet16c& from) {
1777  pstoreu_common<Packet16c>(to, from);
1778 }
1779 template <>
1780 EIGEN_STRONG_INLINE void pstoreu<unsigned char>(unsigned char* to, const Packet16uc& from) {
1781  pstoreu_common<Packet16uc>(to, from);
1782 }
1783 
1784 template <typename Packet>
1786  const Index offset) {
1787  const Index packet_size = unpacket_traits<Packet>::size;
1788  eigen_internal_assert(n + offset <= packet_size && "number of elements plus offset will write past end of packet");
1789  const Index size = sizeof(__UNPACK_TYPE__(Packet));
1790 #ifdef _ARCH_PWR9
1791  EIGEN_UNUSED_VARIABLE(packet_size);
1793  Packet store = from;
1794  if (offset) {
1795  Packet16uc shift = pset1<Packet16uc>(offset * 8 * size);
1796 #ifdef _BIG_ENDIAN
1797  store = Packet(vec_slo(Packet16uc(store), shift));
1798 #else
1799  store = Packet(vec_sro(Packet16uc(store), shift));
1800 #endif
1801  }
1802  vec_xst_len(store, to, n * size);
1803 #else
1804  if (n) {
1805  EIGEN_ALIGN16 __UNPACK_TYPE__(Packet) store[packet_size];
1806  pstore(store, from);
1807  unsigned char* store2 = reinterpret_cast<unsigned char*>(store + offset);
1808  unsigned char* to2 = reinterpret_cast<unsigned char*>(to);
1809  Index n2 = n * size;
1810  if (16 <= n2) {
1811  pstoreu(to2, ploadu<Packet16uc>(store2));
1812  } else {
1813  memcpy((void*)to2, (void*)store2, n2);
1814  }
1815  }
1816 #endif
1817 }
1818 
1819 template <>
1820 EIGEN_ALWAYS_INLINE void pstoreu_partial<float>(float* to, const Packet4f& from, const Index n, const Index offset) {
1821  pstoreu_partial_common<Packet4f>(to, from, n, offset);
1822 }
1823 template <>
1824 EIGEN_ALWAYS_INLINE void pstoreu_partial<int>(int* to, const Packet4i& from, const Index n, const Index offset) {
1825  pstoreu_partial_common<Packet4i>(to, from, n, offset);
1826 }
1827 template <>
1828 EIGEN_ALWAYS_INLINE void pstoreu_partial<short int>(short int* to, const Packet8s& from, const Index n,
1829  const Index offset) {
1830  pstoreu_partial_common<Packet8s>(to, from, n, offset);
1831 }
1832 template <>
1833 EIGEN_ALWAYS_INLINE void pstoreu_partial<unsigned short int>(unsigned short int* to, const Packet8us& from,
1834  const Index n, const Index offset) {
1835  pstoreu_partial_common<Packet8us>(to, from, n, offset);
1836 }
1837 template <>
1839  const Index offset) {
1840  pstoreu_partial_common<Packet8us>(reinterpret_cast<unsigned short int*>(to), from, n, offset);
1841 }
1842 template <>
1843 EIGEN_ALWAYS_INLINE void pstoreu_partial<signed char>(signed char* to, const Packet16c& from, const Index n,
1844  const Index offset) {
1845  pstoreu_partial_common<Packet16c>(to, from, n, offset);
1846 }
1847 template <>
1848 EIGEN_ALWAYS_INLINE void pstoreu_partial<unsigned char>(unsigned char* to, const Packet16uc& from, const Index n,
1849  const Index offset) {
1850  pstoreu_partial_common<Packet16uc>(to, from, n, offset);
1851 }
1852 
1853 template <>
1854 EIGEN_STRONG_INLINE void prefetch<float>(const float* addr) {
1855  EIGEN_PPC_PREFETCH(addr);
1856 }
1857 template <>
1858 EIGEN_STRONG_INLINE void prefetch<int>(const int* addr) {
1859  EIGEN_PPC_PREFETCH(addr);
1860 }
1861 
1862 template <>
1864  EIGEN_ALIGN16 float x;
1865  vec_ste(a, 0, &x);
1866  return x;
1867 }
1868 template <>
1870  EIGEN_ALIGN16 int x;
1871  vec_ste(a, 0, &x);
1872  return x;
1873 }
1874 
1875 template <typename Packet>
1878  vec_ste(a, 0, &x);
1879  return x;
1880 }
1881 
1882 template <>
1884  return pfirst_common<Packet8s>(a);
1885 }
1886 
1887 template <>
1888 EIGEN_STRONG_INLINE unsigned short int pfirst<Packet8us>(const Packet8us& a) {
1889  return pfirst_common<Packet8us>(a);
1890 }
1891 
1892 template <>
1894  return pfirst_common<Packet16c>(a);
1895 }
1896 
1897 template <>
1899  return pfirst_common<Packet16uc>(a);
1900 }
1901 
1902 template <>
1904  return reinterpret_cast<Packet4f>(
1905  vec_perm(reinterpret_cast<Packet16uc>(a), reinterpret_cast<Packet16uc>(a), p16uc_REVERSE32));
1906 }
1907 template <>
1909  return reinterpret_cast<Packet4i>(
1910  vec_perm(reinterpret_cast<Packet16uc>(a), reinterpret_cast<Packet16uc>(a), p16uc_REVERSE32));
1911 }
1912 template <>
1914  return reinterpret_cast<Packet8s>(
1915  vec_perm(reinterpret_cast<Packet16uc>(a), reinterpret_cast<Packet16uc>(a), p16uc_REVERSE16));
1916 }
1917 template <>
1919  return reinterpret_cast<Packet8us>(
1920  vec_perm(reinterpret_cast<Packet16uc>(a), reinterpret_cast<Packet16uc>(a), p16uc_REVERSE16));
1921 }
1922 template <>
1924  return vec_perm(a, a, p16uc_REVERSE8);
1925 }
1926 template <>
1928  return vec_perm(a, a, p16uc_REVERSE8);
1929 }
1930 template <>
1932  return preverse<Packet8us>(a);
1933 }
1934 
1935 template <>
1937  return vec_abs(a);
1938 }
1939 template <>
1941  return vec_abs(a);
1942 }
1943 template <>
1945  return vec_abs(a);
1946 }
1947 template <>
1949  return a;
1950 }
1951 template <>
1953  return vec_abs(a);
1954 }
1955 template <>
1957  return a;
1958 }
1959 template <>
1961  EIGEN_DECLARE_CONST_FAST_Packet8us(abs_mask, 0x7FFF);
1962  return pand<Packet8us>(p8us_abs_mask, a);
1963 }
1964 
1965 template <>
1967  return vec_sra(a.m_val, vec_splat_u16(15));
1968 }
1969 template <>
1971  return (Packet4f)vec_sra((Packet4i)a, vec_splats((unsigned int)(31)));
1972 }
1973 
1974 template <int N>
1976  return vec_sra(a, reinterpret_cast<Packet4ui>(pset1<Packet4i>(N)));
1977 }
1978 template <int N>
1980  return vec_sr(a, reinterpret_cast<Packet4ui>(pset1<Packet4i>(N)));
1981 }
1982 template <int N>
1984  return vec_sl(a, reinterpret_cast<Packet4ui>(pset1<Packet4i>(N)));
1985 }
1986 template <int N>
1989  Packet4ui r = vec_sl(reinterpret_cast<Packet4ui>(a), p4ui_mask);
1990  return reinterpret_cast<Packet4f>(r);
1991 }
1992 
1993 template <int N>
1996  Packet4ui r = vec_sr(reinterpret_cast<Packet4ui>(a), p4ui_mask);
1997  return reinterpret_cast<Packet4f>(r);
1998 }
1999 
2000 template <int N>
2003  return vec_sr(a, p4ui_mask);
2004 }
2005 
2006 template <int N>
2009  return vec_sl(a, p4ui_mask);
2010 }
2011 
2012 template <int N>
2015  return vec_sl(a, p8us_mask);
2016 }
2017 template <int N>
2020  return vec_sr(a, p8us_mask);
2021 }
2022 
2024  return plogical_shift_left<16>(reinterpret_cast<Packet4f>(bf.m_val));
2025 }
2026 
2028  const EIGEN_DECLARE_CONST_FAST_Packet4ui(high_mask, 0xFFFF0000);
2029  return pand<Packet4f>(reinterpret_cast<Packet4f>(bf.m_val), reinterpret_cast<Packet4f>(p4ui_high_mask));
2030 }
2031 
2033 #ifdef _BIG_ENDIAN
2034  return vec_perm(reinterpret_cast<Packet8us>(odd), reinterpret_cast<Packet8us>(even), p16uc_MERGEO16);
2035 #else
2036  return vec_perm(reinterpret_cast<Packet8us>(even), reinterpret_cast<Packet8us>(odd), p16uc_MERGEE16);
2037 #endif
2038 }
2039 
2040 // Simple interleaving of bool masks, prevents true values from being
2041 // converted to NaNs.
2043  return pmerge(reinterpret_cast<Packet4ui>(even), reinterpret_cast<Packet4ui>(odd));
2044 }
2045 
2046 // #define SUPPORT_BF16_SUBNORMALS
2047 
2048 #ifndef __VEC_CLASS_FP_NAN
2049 #define __VEC_CLASS_FP_NAN (1 << 6)
2050 #endif
2051 
2052 #if defined(SUPPORT_BF16_SUBNORMALS) && !defined(__VEC_CLASS_FP_SUBNORMAL)
2053 #define __VEC_CLASS_FP_SUBNORMAL_P (1 << 1)
2054 #define __VEC_CLASS_FP_SUBNORMAL_N (1 << 0)
2055 
2056 #define __VEC_CLASS_FP_SUBNORMAL (__VEC_CLASS_FP_SUBNORMAL_P | __VEC_CLASS_FP_SUBNORMAL_N)
2057 #endif
2058 
2060 #ifdef _ARCH_PWR10
2061  return reinterpret_cast<Packet8us>(__builtin_vsx_xvcvspbf16(reinterpret_cast<Packet16uc>(p4f)));
2062 #else
2063  Packet4ui input = reinterpret_cast<Packet4ui>(p4f);
2064  Packet4ui lsb = plogical_shift_right<16>(input);
2065  lsb = pand<Packet4ui>(lsb, reinterpret_cast<Packet4ui>(p4i_ONE));
2066 
2067  EIGEN_DECLARE_CONST_FAST_Packet4ui(BIAS, 0x7FFFu);
2068  Packet4ui rounding_bias = padd<Packet4ui>(lsb, p4ui_BIAS);
2069  input = padd<Packet4ui>(input, rounding_bias);
2070 
2071  const EIGEN_DECLARE_CONST_FAST_Packet4ui(nan, 0x7FC00000);
2072 #ifdef _ARCH_PWR9
2073  Packet4bi nan_selector = vec_test_data_class(p4f, __VEC_CLASS_FP_NAN);
2074  input = vec_sel(input, p4ui_nan, nan_selector);
2075 
2076 #ifdef SUPPORT_BF16_SUBNORMALS
2077  Packet4bi subnormal_selector = vec_test_data_class(p4f, __VEC_CLASS_FP_SUBNORMAL);
2078  input = vec_sel(input, reinterpret_cast<Packet4ui>(p4f), subnormal_selector);
2079 #endif
2080 #else
2081 #ifdef SUPPORT_BF16_SUBNORMALS
2082  // Test NaN and Subnormal
2083  const EIGEN_DECLARE_CONST_FAST_Packet4ui(exp_mask, 0x7F800000);
2084  Packet4ui exp = pand<Packet4ui>(p4ui_exp_mask, reinterpret_cast<Packet4ui>(p4f));
2085 
2086  const EIGEN_DECLARE_CONST_FAST_Packet4ui(mantissa_mask, 0x7FFFFF);
2087  Packet4ui mantissa = pand<Packet4ui>(p4ui_mantissa_mask, reinterpret_cast<Packet4ui>(p4f));
2088 
2089  Packet4bi is_max_exp = vec_cmpeq(exp, p4ui_exp_mask);
2090  Packet4bi is_mant_zero = vec_cmpeq(mantissa, reinterpret_cast<Packet4ui>(p4i_ZERO));
2091 
2092  Packet4ui nan_selector =
2093  pandnot<Packet4ui>(reinterpret_cast<Packet4ui>(is_max_exp), reinterpret_cast<Packet4ui>(is_mant_zero));
2094 
2095  Packet4bi is_zero_exp = vec_cmpeq(exp, reinterpret_cast<Packet4ui>(p4i_ZERO));
2096 
2097  Packet4ui subnormal_selector =
2098  pandnot<Packet4ui>(reinterpret_cast<Packet4ui>(is_zero_exp), reinterpret_cast<Packet4ui>(is_mant_zero));
2099 
2100  input = vec_sel(input, p4ui_nan, nan_selector);
2101  input = vec_sel(input, reinterpret_cast<Packet4ui>(p4f), subnormal_selector);
2102 #else
2103  // Test only NaN
2104  Packet4bi nan_selector = vec_cmpeq(p4f, p4f);
2105 
2106  input = vec_sel(p4ui_nan, input, nan_selector);
2107 #endif
2108 #endif
2109 
2110  input = plogical_shift_right<16>(input);
2111  return reinterpret_cast<Packet8us>(input);
2112 #endif
2113 }
2114 
2115 #ifdef _BIG_ENDIAN
2121 template <bool lohi>
2123  if (lohi) {
2124  return vec_perm(reinterpret_cast<Packet8us>(lo), reinterpret_cast<Packet8us>(hi), p16uc_MERGEH16);
2125  } else {
2126  return vec_perm(reinterpret_cast<Packet8us>(hi), reinterpret_cast<Packet8us>(lo), p16uc_MERGEE16);
2127  }
2128 }
2129 
2135 template <bool lohi>
2137  if (lohi) {
2138  return vec_pack(reinterpret_cast<Packet4ui>(lo), reinterpret_cast<Packet4ui>(hi));
2139  } else {
2140  return vec_perm(reinterpret_cast<Packet8us>(hi), reinterpret_cast<Packet8us>(lo), p16uc_MERGEO16);
2141  }
2142 }
2143 #else
2144 template <bool lohi>
2146  if (lohi) {
2147  return vec_pack(reinterpret_cast<Packet4ui>(hi), reinterpret_cast<Packet4ui>(lo));
2148  } else {
2149  return vec_perm(reinterpret_cast<Packet8us>(hi), reinterpret_cast<Packet8us>(lo), p16uc_MERGEE16);
2150  }
2151 }
2152 
2153 template <bool lohi>
2155  if (lohi) {
2156  return vec_perm(reinterpret_cast<Packet8us>(hi), reinterpret_cast<Packet8us>(lo), p16uc_MERGEL16);
2157  } else {
2158  return vec_perm(reinterpret_cast<Packet8us>(hi), reinterpret_cast<Packet8us>(lo), p16uc_MERGEO16);
2159  }
2160 }
2161 #endif
2162 
2168 template <bool lohi = true>
2170  Packet8us p4f = Bf16PackHigh<lohi>(lo, hi);
2171  Packet8us p4f2 = Bf16PackLow<lohi>(lo, hi);
2172 
2173  Packet8us lsb = pand<Packet8us>(p4f, p8us_ONE);
2174  EIGEN_DECLARE_CONST_FAST_Packet8us(BIAS, 0x7FFFu);
2175  lsb = padd<Packet8us>(lsb, p8us_BIAS);
2176  lsb = padd<Packet8us>(lsb, p4f2);
2177 
2178  Packet8bi rounding_bias = vec_cmplt(lsb, p4f2);
2179  Packet8us input = psub<Packet8us>(p4f, reinterpret_cast<Packet8us>(rounding_bias));
2180 
2181 #ifdef _ARCH_PWR9
2182  Packet4bi nan_selector_lo = vec_test_data_class(lo, __VEC_CLASS_FP_NAN);
2183  Packet4bi nan_selector_hi = vec_test_data_class(hi, __VEC_CLASS_FP_NAN);
2184  Packet8us nan_selector =
2185  Bf16PackLow<lohi>(reinterpret_cast<Packet4f>(nan_selector_lo), reinterpret_cast<Packet4f>(nan_selector_hi));
2186 
2187  input = vec_sel(input, p8us_BIAS, nan_selector);
2188 
2189 #ifdef SUPPORT_BF16_SUBNORMALS
2190  Packet4bi subnormal_selector_lo = vec_test_data_class(lo, __VEC_CLASS_FP_SUBNORMAL);
2191  Packet4bi subnormal_selector_hi = vec_test_data_class(hi, __VEC_CLASS_FP_SUBNORMAL);
2192  Packet8us subnormal_selector = Bf16PackLow<lohi>(reinterpret_cast<Packet4f>(subnormal_selector_lo),
2193  reinterpret_cast<Packet4f>(subnormal_selector_hi));
2194 
2195  input = vec_sel(input, reinterpret_cast<Packet8us>(p4f), subnormal_selector);
2196 #endif
2197 #else
2198 #ifdef SUPPORT_BF16_SUBNORMALS
2199  // Test NaN and Subnormal
2200  const EIGEN_DECLARE_CONST_FAST_Packet8us(exp_mask, 0x7F80);
2201  Packet8us exp = pand<Packet8us>(p8us_exp_mask, p4f);
2202 
2203  const EIGEN_DECLARE_CONST_FAST_Packet8us(mantissa_mask, 0x7Fu);
2204  Packet8us mantissa = pand<Packet8us>(p8us_mantissa_mask, p4f);
2205 
2206  Packet8bi is_max_exp = vec_cmpeq(exp, p8us_exp_mask);
2207  Packet8bi is_mant_zero = vec_cmpeq(mantissa, reinterpret_cast<Packet8us>(p4i_ZERO));
2208 
2209  Packet8us nan_selector =
2210  pandnot<Packet8us>(reinterpret_cast<Packet8us>(is_max_exp), reinterpret_cast<Packet8us>(is_mant_zero));
2211 
2212  Packet8bi is_zero_exp = vec_cmpeq(exp, reinterpret_cast<Packet8us>(p4i_ZERO));
2213 
2214  Packet8us subnormal_selector =
2215  pandnot<Packet8us>(reinterpret_cast<Packet8us>(is_zero_exp), reinterpret_cast<Packet8us>(is_mant_zero));
2216 
2217  // Using BIAS as NaN (since any or all of the last 7 bits can be set)
2218  input = vec_sel(input, p8us_BIAS, nan_selector);
2219  input = vec_sel(input, reinterpret_cast<Packet8us>(p4f), subnormal_selector);
2220 #else
2221  // Test only NaN
2222  Packet4bi nan_selector_lo = vec_cmpeq(lo, lo);
2223  Packet4bi nan_selector_hi = vec_cmpeq(hi, hi);
2224  Packet8us nan_selector =
2225  Bf16PackLow<lohi>(reinterpret_cast<Packet4f>(nan_selector_lo), reinterpret_cast<Packet4f>(nan_selector_hi));
2226 
2227  input = vec_sel(p8us_BIAS, input, nan_selector);
2228 #endif
2229 #endif
2230 
2231  return input;
2232 }
2233 
2238 #ifdef _ARCH_PWR10
2239  Packet8bf fp16_0 = F32ToBf16(lo);
2240  Packet8bf fp16_1 = F32ToBf16(hi);
2241  return vec_pack(reinterpret_cast<Packet4ui>(fp16_0.m_val), reinterpret_cast<Packet4ui>(fp16_1.m_val));
2242 #else
2243  return F32ToBf16Two(lo, hi);
2244 #endif
2245 }
2246 
2251 #ifdef _ARCH_PWR10
2252  return pmerge(reinterpret_cast<Packet4ui>(F32ToBf16(even).m_val), reinterpret_cast<Packet4ui>(F32ToBf16(odd).m_val));
2253 #else
2254  return F32ToBf16Two<false>(even, odd);
2255 #endif
2256 }
2257 #define BF16_TO_F32_UNARY_OP_WRAPPER(OP, A) \
2258  Packet4f a_even = Bf16ToF32Even(A); \
2259  Packet4f a_odd = Bf16ToF32Odd(A); \
2260  Packet4f op_even = OP(a_even); \
2261  Packet4f op_odd = OP(a_odd); \
2262  return F32ToBf16(op_even, op_odd);
2263 
2264 #define BF16_TO_F32_BINARY_OP_WRAPPER(OP, A, B) \
2265  Packet4f a_even = Bf16ToF32Even(A); \
2266  Packet4f a_odd = Bf16ToF32Odd(A); \
2267  Packet4f b_even = Bf16ToF32Even(B); \
2268  Packet4f b_odd = Bf16ToF32Odd(B); \
2269  Packet4f op_even = OP(a_even, b_even); \
2270  Packet4f op_odd = OP(a_odd, b_odd); \
2271  return F32ToBf16(op_even, op_odd);
2272 
2273 #define BF16_TO_F32_BINARY_OP_WRAPPER_BOOL(OP, A, B) \
2274  Packet4f a_even = Bf16ToF32Even(A); \
2275  Packet4f a_odd = Bf16ToF32Odd(A); \
2276  Packet4f b_even = Bf16ToF32Even(B); \
2277  Packet4f b_odd = Bf16ToF32Odd(B); \
2278  Packet4f op_even = OP(a_even, b_even); \
2279  Packet4f op_odd = OP(a_odd, b_odd); \
2280  return F32ToBf16Bool(op_even, op_odd);
2281 
2282 template <>
2285 }
2286 
2287 template <>
2290 }
2291 
2292 template <>
2295 }
2296 
2297 template <>
2299  EIGEN_DECLARE_CONST_FAST_Packet8us(neg_mask, 0x8000);
2300  return pxor<Packet8us>(p8us_neg_mask, a);
2301 }
2302 
2303 template <>
2306 }
2307 
2308 template <>
2311 }
2312 
2313 template <>
2316 }
2317 
2318 template <>
2320  return pldexp_generic(a, exponent);
2321 }
2322 template <>
2325 }
2326 
2327 template <>
2329  return pfrexp_generic(a, exponent);
2330 }
2331 template <>
2333  Packet4f a_even = Bf16ToF32Even(a);
2334  Packet4f a_odd = Bf16ToF32Odd(a);
2335  Packet4f e_even;
2336  Packet4f e_odd;
2337  Packet4f op_even = pfrexp<Packet4f>(a_even, e_even);
2338  Packet4f op_odd = pfrexp<Packet4f>(a_odd, e_odd);
2339  e = F32ToBf16(e_even, e_odd);
2340  return F32ToBf16(op_even, op_odd);
2341 }
2342 
2343 template <>
2346 }
2347 template <>
2350 }
2351 template <>
2354 }
2355 template <>
2358 }
2359 template <>
2362 }
2363 template <>
2366 }
2367 template <>
2370 }
2371 #ifdef EIGEN_VECTORIZE_VSX
2372 template <>
2375 }
2376 #endif
2377 template <>
2379  Packet4f a_even = Bf16ToF32Even(a);
2380  Packet4f a_odd = Bf16ToF32Odd(a);
2381  Packet4f b_even = Bf16ToF32Even(b);
2382  Packet4f b_odd = Bf16ToF32Odd(b);
2383  Packet4f c_even = Bf16ToF32Even(c);
2384  Packet4f c_odd = Bf16ToF32Odd(c);
2385  Packet4f pmadd_even = pmadd<Packet4f>(a_even, b_even, c_even);
2386  Packet4f pmadd_odd = pmadd<Packet4f>(a_odd, b_odd, c_odd);
2387  return F32ToBf16(pmadd_even, pmadd_odd);
2388 }
2389 
2390 template <>
2393 }
2394 
2395 template <>
2398 }
2399 
2400 template <>
2403 }
2404 template <>
2407 }
2408 template <>
2411 }
2412 template <>
2415 }
2416 
2417 template <>
2420 }
2421 
2422 template <>
2424  return ploaddup<Packet8us>(reinterpret_cast<const unsigned short int*>(from));
2425 }
2426 
2427 template <>
2429  bfloat16 countdown[8] = {bfloat16(0), bfloat16(1), bfloat16(2), bfloat16(3),
2430  bfloat16(4), bfloat16(5), bfloat16(6), bfloat16(7)};
2431  return padd<Packet8bf>(pset1<Packet8bf>(a), pload<Packet8bf>(countdown));
2432 }
2433 
2434 template <>
2436  Packet4f b, sum;
2437  b = vec_sld(a, a, 8);
2438  sum = a + b;
2439  b = vec_sld(sum, sum, 4);
2440  sum += b;
2441  return pfirst(sum);
2442 }
2443 
2444 template <>
2446  Packet4i b, sum;
2447  b = vec_sld(a, a, 8);
2448  sum = a + b;
2449  b = vec_sld(sum, sum, 4);
2450  sum += b;
2451  return pfirst(sum);
2452 }
2453 
2454 template <>
2456  float redux_even = predux<Packet4f>(Bf16ToF32Even(a));
2457  float redux_odd = predux<Packet4f>(Bf16ToF32Odd(a));
2458  float f32_result = redux_even + redux_odd;
2459  return bfloat16(f32_result);
2460 }
2461 template <typename Packet>
2462 EIGEN_STRONG_INLINE __UNPACK_TYPE__(Packet) predux_size8(const Packet& a) {
2463  union {
2464  Packet v;
2465  __UNPACK_TYPE__(Packet) n[8];
2466  } vt;
2467  vt.v = a;
2468 
2469  EIGEN_ALIGN16 int first_loader[4] = {vt.n[0], vt.n[1], vt.n[2], vt.n[3]};
2470  EIGEN_ALIGN16 int second_loader[4] = {vt.n[4], vt.n[5], vt.n[6], vt.n[7]};
2471  Packet4i first_half = pload<Packet4i>(first_loader);
2472  Packet4i second_half = pload<Packet4i>(second_loader);
2473 
2474  return static_cast<__UNPACK_TYPE__(Packet)>(predux(first_half) + predux(second_half));
2475 }
2476 
2477 template <>
2479  return predux_size8<Packet8s>(a);
2480 }
2481 
2482 template <>
2483 EIGEN_STRONG_INLINE unsigned short int predux<Packet8us>(const Packet8us& a) {
2484  return predux_size8<Packet8us>(a);
2485 }
2486 
2487 template <typename Packet>
2488 EIGEN_STRONG_INLINE __UNPACK_TYPE__(Packet) predux_size16(const Packet& a) {
2489  union {
2490  Packet v;
2491  __UNPACK_TYPE__(Packet) n[16];
2492  } vt;
2493  vt.v = a;
2494 
2495  EIGEN_ALIGN16 int first_loader[4] = {vt.n[0], vt.n[1], vt.n[2], vt.n[3]};
2496  EIGEN_ALIGN16 int second_loader[4] = {vt.n[4], vt.n[5], vt.n[6], vt.n[7]};
2497  EIGEN_ALIGN16 int third_loader[4] = {vt.n[8], vt.n[9], vt.n[10], vt.n[11]};
2498  EIGEN_ALIGN16 int fourth_loader[4] = {vt.n[12], vt.n[13], vt.n[14], vt.n[15]};
2499 
2500  Packet4i first_quarter = pload<Packet4i>(first_loader);
2501  Packet4i second_quarter = pload<Packet4i>(second_loader);
2502  Packet4i third_quarter = pload<Packet4i>(third_loader);
2503  Packet4i fourth_quarter = pload<Packet4i>(fourth_loader);
2504 
2505  return static_cast<__UNPACK_TYPE__(Packet)>(predux(first_quarter) + predux(second_quarter) + predux(third_quarter) +
2506  predux(fourth_quarter));
2507 }
2508 
2509 template <>
2511  return predux_size16<Packet16c>(a);
2512 }
2513 
2514 template <>
2516  return predux_size16<Packet16uc>(a);
2517 }
2518 
2519 // Other reduction functions:
2520 // mul
2521 template <>
2523  Packet4f prod;
2524  prod = pmul(a, vec_sld(a, a, 8));
2525  return pfirst(pmul(prod, vec_sld(prod, prod, 4)));
2526 }
2527 
2528 template <>
2530  EIGEN_ALIGN16 int aux[4];
2531  pstore(aux, a);
2532  return aux[0] * aux[1] * aux[2] * aux[3];
2533 }
2534 
2535 template <>
2537  Packet8s pair, quad, octo;
2538 
2539  pair = vec_mul(a, vec_sld(a, a, 8));
2540  quad = vec_mul(pair, vec_sld(pair, pair, 4));
2541  octo = vec_mul(quad, vec_sld(quad, quad, 2));
2542 
2543  return pfirst(octo);
2544 }
2545 
2546 template <>
2548  Packet8us pair, quad, octo;
2549 
2550  pair = vec_mul(a, vec_sld(a, a, 8));
2551  quad = vec_mul(pair, vec_sld(pair, pair, 4));
2552  octo = vec_mul(quad, vec_sld(quad, quad, 2));
2553 
2554  return pfirst(octo);
2555 }
2556 
2557 template <>
2559  float redux_even = predux_mul<Packet4f>(Bf16ToF32Even(a));
2560  float redux_odd = predux_mul<Packet4f>(Bf16ToF32Odd(a));
2561  float f32_result = redux_even * redux_odd;
2562  return bfloat16(f32_result);
2563 }
2564 
2565 template <>
2567  Packet16c pair, quad, octo, result;
2568 
2569  pair = vec_mul(a, vec_sld(a, a, 8));
2570  quad = vec_mul(pair, vec_sld(pair, pair, 4));
2571  octo = vec_mul(quad, vec_sld(quad, quad, 2));
2572  result = vec_mul(octo, vec_sld(octo, octo, 1));
2573 
2574  return pfirst(result);
2575 }
2576 
2577 template <>
2579  Packet16uc pair, quad, octo, result;
2580 
2581  pair = vec_mul(a, vec_sld(a, a, 8));
2582  quad = vec_mul(pair, vec_sld(pair, pair, 4));
2583  octo = vec_mul(quad, vec_sld(quad, quad, 2));
2584  result = vec_mul(octo, vec_sld(octo, octo, 1));
2585 
2586  return pfirst(result);
2587 }
2588 
2589 // min
2590 template <typename Packet>
2591 EIGEN_STRONG_INLINE __UNPACK_TYPE__(Packet) predux_min4(const Packet& a) {
2592  Packet b, res;
2593  b = vec_min(a, vec_sld(a, a, 8));
2594  res = vec_min(b, vec_sld(b, b, 4));
2595  return pfirst(res);
2596 }
2597 
2598 template <>
2600  return predux_min4<Packet4f>(a);
2601 }
2602 
2603 template <>
2605  return predux_min4<Packet4i>(a);
2606 }
2607 
2608 template <>
2610  float redux_even = predux_min<Packet4f>(Bf16ToF32Even(a));
2611  float redux_odd = predux_min<Packet4f>(Bf16ToF32Odd(a));
2612  float f32_result = (std::min)(redux_even, redux_odd);
2613  return bfloat16(f32_result);
2614 }
2615 
2616 template <>
2618  Packet8s pair, quad, octo;
2619 
2620  // pair = { Min(a0,a4), Min(a1,a5), Min(a2,a6), Min(a3,a7) }
2621  pair = vec_min(a, vec_sld(a, a, 8));
2622 
2623  // quad = { Min(a0, a4, a2, a6), Min(a1, a5, a3, a7) }
2624  quad = vec_min(pair, vec_sld(pair, pair, 4));
2625 
2626  // octo = { Min(a0, a4, a2, a6, a1, a5, a3, a7) }
2627  octo = vec_min(quad, vec_sld(quad, quad, 2));
2628  return pfirst(octo);
2629 }
2630 
2631 template <>
2633  Packet8us pair, quad, octo;
2634 
2635  // pair = { Min(a0,a4), Min(a1,a5), Min(a2,a6), Min(a3,a7) }
2636  pair = vec_min(a, vec_sld(a, a, 8));
2637 
2638  // quad = { Min(a0, a4, a2, a6), Min(a1, a5, a3, a7) }
2639  quad = vec_min(pair, vec_sld(pair, pair, 4));
2640 
2641  // octo = { Min(a0, a4, a2, a6, a1, a5, a3, a7) }
2642  octo = vec_min(quad, vec_sld(quad, quad, 2));
2643  return pfirst(octo);
2644 }
2645 
2646 template <>
2648  Packet16c pair, quad, octo, result;
2649 
2650  pair = vec_min(a, vec_sld(a, a, 8));
2651  quad = vec_min(pair, vec_sld(pair, pair, 4));
2652  octo = vec_min(quad, vec_sld(quad, quad, 2));
2653  result = vec_min(octo, vec_sld(octo, octo, 1));
2654 
2655  return pfirst(result);
2656 }
2657 
2658 template <>
2660  Packet16uc pair, quad, octo, result;
2661 
2662  pair = vec_min(a, vec_sld(a, a, 8));
2663  quad = vec_min(pair, vec_sld(pair, pair, 4));
2664  octo = vec_min(quad, vec_sld(quad, quad, 2));
2665  result = vec_min(octo, vec_sld(octo, octo, 1));
2666 
2667  return pfirst(result);
2668 }
2669 // max
2670 template <typename Packet>
2671 EIGEN_STRONG_INLINE __UNPACK_TYPE__(Packet) predux_max4(const Packet& a) {
2672  Packet b, res;
2673  b = vec_max(a, vec_sld(a, a, 8));
2674  res = vec_max(b, vec_sld(b, b, 4));
2675  return pfirst(res);
2676 }
2677 
2678 template <>
2680  return predux_max4<Packet4f>(a);
2681 }
2682 
2683 template <>
2685  return predux_max4<Packet4i>(a);
2686 }
2687 
2688 template <>
2690  float redux_even = predux_max<Packet4f>(Bf16ToF32Even(a));
2691  float redux_odd = predux_max<Packet4f>(Bf16ToF32Odd(a));
2692  float f32_result = (std::max)(redux_even, redux_odd);
2693  return bfloat16(f32_result);
2694 }
2695 
2696 template <>
2698  Packet8s pair, quad, octo;
2699 
2700  // pair = { Max(a0,a4), Max(a1,a5), Max(a2,a6), Max(a3,a7) }
2701  pair = vec_max(a, vec_sld(a, a, 8));
2702 
2703  // quad = { Max(a0, a4, a2, a6), Max(a1, a5, a3, a7) }
2704  quad = vec_max(pair, vec_sld(pair, pair, 4));
2705 
2706  // octo = { Max(a0, a4, a2, a6, a1, a5, a3, a7) }
2707  octo = vec_max(quad, vec_sld(quad, quad, 2));
2708  return pfirst(octo);
2709 }
2710 
2711 template <>
2713  Packet8us pair, quad, octo;
2714 
2715  // pair = { Max(a0,a4), Max(a1,a5), Max(a2,a6), Max(a3,a7) }
2716  pair = vec_max(a, vec_sld(a, a, 8));
2717 
2718  // quad = { Max(a0, a4, a2, a6), Max(a1, a5, a3, a7) }
2719  quad = vec_max(pair, vec_sld(pair, pair, 4));
2720 
2721  // octo = { Max(a0, a4, a2, a6, a1, a5, a3, a7) }
2722  octo = vec_max(quad, vec_sld(quad, quad, 2));
2723  return pfirst(octo);
2724 }
2725 
2726 template <>
2728  Packet16c pair, quad, octo, result;
2729 
2730  pair = vec_max(a, vec_sld(a, a, 8));
2731  quad = vec_max(pair, vec_sld(pair, pair, 4));
2732  octo = vec_max(quad, vec_sld(quad, quad, 2));
2733  result = vec_max(octo, vec_sld(octo, octo, 1));
2734 
2735  return pfirst(result);
2736 }
2737 
2738 template <>
2740  Packet16uc pair, quad, octo, result;
2741 
2742  pair = vec_max(a, vec_sld(a, a, 8));
2743  quad = vec_max(pair, vec_sld(pair, pair, 4));
2744  octo = vec_max(quad, vec_sld(quad, quad, 2));
2745  result = vec_max(octo, vec_sld(octo, octo, 1));
2746 
2747  return pfirst(result);
2748 }
2749 
2750 template <>
2752  return vec_any_ne(x, pzero(x));
2753 }
2754 
2755 template <typename T>
2757  T t0, t1, t2, t3;
2758  t0 = vec_mergeh(kernel.packet[0], kernel.packet[2]);
2759  t1 = vec_mergel(kernel.packet[0], kernel.packet[2]);
2760  t2 = vec_mergeh(kernel.packet[1], kernel.packet[3]);
2761  t3 = vec_mergel(kernel.packet[1], kernel.packet[3]);
2762  kernel.packet[0] = vec_mergeh(t0, t2);
2763  kernel.packet[1] = vec_mergel(t0, t2);
2764  kernel.packet[2] = vec_mergeh(t1, t3);
2765  kernel.packet[3] = vec_mergel(t1, t3);
2766 }
2767 
2768 EIGEN_DEVICE_FUNC inline void ptranspose(PacketBlock<Packet4f, 4>& kernel) { ptranpose_common<Packet4f>(kernel); }
2769 
2770 EIGEN_DEVICE_FUNC inline void ptranspose(PacketBlock<Packet4i, 4>& kernel) { ptranpose_common<Packet4i>(kernel); }
2771 
2773  Packet8s t0, t1, t2, t3;
2774  t0 = vec_mergeh(kernel.packet[0], kernel.packet[2]);
2775  t1 = vec_mergel(kernel.packet[0], kernel.packet[2]);
2776  t2 = vec_mergeh(kernel.packet[1], kernel.packet[3]);
2777  t3 = vec_mergel(kernel.packet[1], kernel.packet[3]);
2778  kernel.packet[0] = vec_mergeh(t0, t2);
2779  kernel.packet[1] = vec_mergel(t0, t2);
2780  kernel.packet[2] = vec_mergeh(t1, t3);
2781  kernel.packet[3] = vec_mergel(t1, t3);
2782 }
2783 
2785  Packet8us t0, t1, t2, t3;
2786  t0 = vec_mergeh(kernel.packet[0], kernel.packet[2]);
2787  t1 = vec_mergel(kernel.packet[0], kernel.packet[2]);
2788  t2 = vec_mergeh(kernel.packet[1], kernel.packet[3]);
2789  t3 = vec_mergel(kernel.packet[1], kernel.packet[3]);
2790  kernel.packet[0] = vec_mergeh(t0, t2);
2791  kernel.packet[1] = vec_mergel(t0, t2);
2792  kernel.packet[2] = vec_mergeh(t1, t3);
2793  kernel.packet[3] = vec_mergel(t1, t3);
2794 }
2795 
2797  Packet8us t0, t1, t2, t3;
2798 
2799  t0 = vec_mergeh(kernel.packet[0].m_val, kernel.packet[2].m_val);
2800  t1 = vec_mergel(kernel.packet[0].m_val, kernel.packet[2].m_val);
2801  t2 = vec_mergeh(kernel.packet[1].m_val, kernel.packet[3].m_val);
2802  t3 = vec_mergel(kernel.packet[1].m_val, kernel.packet[3].m_val);
2803  kernel.packet[0] = vec_mergeh(t0, t2);
2804  kernel.packet[1] = vec_mergel(t0, t2);
2805  kernel.packet[2] = vec_mergeh(t1, t3);
2806  kernel.packet[3] = vec_mergel(t1, t3);
2807 }
2808 
2810  Packet16c t0, t1, t2, t3;
2811  t0 = vec_mergeh(kernel.packet[0], kernel.packet[2]);
2812  t1 = vec_mergel(kernel.packet[0], kernel.packet[2]);
2813  t2 = vec_mergeh(kernel.packet[1], kernel.packet[3]);
2814  t3 = vec_mergel(kernel.packet[1], kernel.packet[3]);
2815  kernel.packet[0] = vec_mergeh(t0, t2);
2816  kernel.packet[1] = vec_mergel(t0, t2);
2817  kernel.packet[2] = vec_mergeh(t1, t3);
2818  kernel.packet[3] = vec_mergel(t1, t3);
2819 }
2820 
2822  Packet16uc t0, t1, t2, t3;
2823  t0 = vec_mergeh(kernel.packet[0], kernel.packet[2]);
2824  t1 = vec_mergel(kernel.packet[0], kernel.packet[2]);
2825  t2 = vec_mergeh(kernel.packet[1], kernel.packet[3]);
2826  t3 = vec_mergel(kernel.packet[1], kernel.packet[3]);
2827  kernel.packet[0] = vec_mergeh(t0, t2);
2828  kernel.packet[1] = vec_mergel(t0, t2);
2829  kernel.packet[2] = vec_mergeh(t1, t3);
2830  kernel.packet[3] = vec_mergel(t1, t3);
2831 }
2832 
2834  Packet8s v[8], sum[8];
2835 
2836  v[0] = vec_mergeh(kernel.packet[0], kernel.packet[4]);
2837  v[1] = vec_mergel(kernel.packet[0], kernel.packet[4]);
2838  v[2] = vec_mergeh(kernel.packet[1], kernel.packet[5]);
2839  v[3] = vec_mergel(kernel.packet[1], kernel.packet[5]);
2840  v[4] = vec_mergeh(kernel.packet[2], kernel.packet[6]);
2841  v[5] = vec_mergel(kernel.packet[2], kernel.packet[6]);
2842  v[6] = vec_mergeh(kernel.packet[3], kernel.packet[7]);
2843  v[7] = vec_mergel(kernel.packet[3], kernel.packet[7]);
2844  sum[0] = vec_mergeh(v[0], v[4]);
2845  sum[1] = vec_mergel(v[0], v[4]);
2846  sum[2] = vec_mergeh(v[1], v[5]);
2847  sum[3] = vec_mergel(v[1], v[5]);
2848  sum[4] = vec_mergeh(v[2], v[6]);
2849  sum[5] = vec_mergel(v[2], v[6]);
2850  sum[6] = vec_mergeh(v[3], v[7]);
2851  sum[7] = vec_mergel(v[3], v[7]);
2852 
2853  kernel.packet[0] = vec_mergeh(sum[0], sum[4]);
2854  kernel.packet[1] = vec_mergel(sum[0], sum[4]);
2855  kernel.packet[2] = vec_mergeh(sum[1], sum[5]);
2856  kernel.packet[3] = vec_mergel(sum[1], sum[5]);
2857  kernel.packet[4] = vec_mergeh(sum[2], sum[6]);
2858  kernel.packet[5] = vec_mergel(sum[2], sum[6]);
2859  kernel.packet[6] = vec_mergeh(sum[3], sum[7]);
2860  kernel.packet[7] = vec_mergel(sum[3], sum[7]);
2861 }
2862 
2864  Packet8us v[8], sum[8];
2865 
2866  v[0] = vec_mergeh(kernel.packet[0], kernel.packet[4]);
2867  v[1] = vec_mergel(kernel.packet[0], kernel.packet[4]);
2868  v[2] = vec_mergeh(kernel.packet[1], kernel.packet[5]);
2869  v[3] = vec_mergel(kernel.packet[1], kernel.packet[5]);
2870  v[4] = vec_mergeh(kernel.packet[2], kernel.packet[6]);
2871  v[5] = vec_mergel(kernel.packet[2], kernel.packet[6]);
2872  v[6] = vec_mergeh(kernel.packet[3], kernel.packet[7]);
2873  v[7] = vec_mergel(kernel.packet[3], kernel.packet[7]);
2874  sum[0] = vec_mergeh(v[0], v[4]);
2875  sum[1] = vec_mergel(v[0], v[4]);
2876  sum[2] = vec_mergeh(v[1], v[5]);
2877  sum[3] = vec_mergel(v[1], v[5]);
2878  sum[4] = vec_mergeh(v[2], v[6]);
2879  sum[5] = vec_mergel(v[2], v[6]);
2880  sum[6] = vec_mergeh(v[3], v[7]);
2881  sum[7] = vec_mergel(v[3], v[7]);
2882 
2883  kernel.packet[0] = vec_mergeh(sum[0], sum[4]);
2884  kernel.packet[1] = vec_mergel(sum[0], sum[4]);
2885  kernel.packet[2] = vec_mergeh(sum[1], sum[5]);
2886  kernel.packet[3] = vec_mergel(sum[1], sum[5]);
2887  kernel.packet[4] = vec_mergeh(sum[2], sum[6]);
2888  kernel.packet[5] = vec_mergel(sum[2], sum[6]);
2889  kernel.packet[6] = vec_mergeh(sum[3], sum[7]);
2890  kernel.packet[7] = vec_mergel(sum[3], sum[7]);
2891 }
2892 
2894  Packet8bf v[8], sum[8];
2895 
2896  v[0] = vec_mergeh(kernel.packet[0].m_val, kernel.packet[4].m_val);
2897  v[1] = vec_mergel(kernel.packet[0].m_val, kernel.packet[4].m_val);
2898  v[2] = vec_mergeh(kernel.packet[1].m_val, kernel.packet[5].m_val);
2899  v[3] = vec_mergel(kernel.packet[1].m_val, kernel.packet[5].m_val);
2900  v[4] = vec_mergeh(kernel.packet[2].m_val, kernel.packet[6].m_val);
2901  v[5] = vec_mergel(kernel.packet[2].m_val, kernel.packet[6].m_val);
2902  v[6] = vec_mergeh(kernel.packet[3].m_val, kernel.packet[7].m_val);
2903  v[7] = vec_mergel(kernel.packet[3].m_val, kernel.packet[7].m_val);
2904  sum[0] = vec_mergeh(v[0].m_val, v[4].m_val);
2905  sum[1] = vec_mergel(v[0].m_val, v[4].m_val);
2906  sum[2] = vec_mergeh(v[1].m_val, v[5].m_val);
2907  sum[3] = vec_mergel(v[1].m_val, v[5].m_val);
2908  sum[4] = vec_mergeh(v[2].m_val, v[6].m_val);
2909  sum[5] = vec_mergel(v[2].m_val, v[6].m_val);
2910  sum[6] = vec_mergeh(v[3].m_val, v[7].m_val);
2911  sum[7] = vec_mergel(v[3].m_val, v[7].m_val);
2912 
2913  kernel.packet[0] = vec_mergeh(sum[0].m_val, sum[4].m_val);
2914  kernel.packet[1] = vec_mergel(sum[0].m_val, sum[4].m_val);
2915  kernel.packet[2] = vec_mergeh(sum[1].m_val, sum[5].m_val);
2916  kernel.packet[3] = vec_mergel(sum[1].m_val, sum[5].m_val);
2917  kernel.packet[4] = vec_mergeh(sum[2].m_val, sum[6].m_val);
2918  kernel.packet[5] = vec_mergel(sum[2].m_val, sum[6].m_val);
2919  kernel.packet[6] = vec_mergeh(sum[3].m_val, sum[7].m_val);
2920  kernel.packet[7] = vec_mergel(sum[3].m_val, sum[7].m_val);
2921 }
2922 
2924  Packet16c step1[16], step2[16], step3[16];
2925 
2926  step1[0] = vec_mergeh(kernel.packet[0], kernel.packet[8]);
2927  step1[1] = vec_mergel(kernel.packet[0], kernel.packet[8]);
2928  step1[2] = vec_mergeh(kernel.packet[1], kernel.packet[9]);
2929  step1[3] = vec_mergel(kernel.packet[1], kernel.packet[9]);
2930  step1[4] = vec_mergeh(kernel.packet[2], kernel.packet[10]);
2931  step1[5] = vec_mergel(kernel.packet[2], kernel.packet[10]);
2932  step1[6] = vec_mergeh(kernel.packet[3], kernel.packet[11]);
2933  step1[7] = vec_mergel(kernel.packet[3], kernel.packet[11]);
2934  step1[8] = vec_mergeh(kernel.packet[4], kernel.packet[12]);
2935  step1[9] = vec_mergel(kernel.packet[4], kernel.packet[12]);
2936  step1[10] = vec_mergeh(kernel.packet[5], kernel.packet[13]);
2937  step1[11] = vec_mergel(kernel.packet[5], kernel.packet[13]);
2938  step1[12] = vec_mergeh(kernel.packet[6], kernel.packet[14]);
2939  step1[13] = vec_mergel(kernel.packet[6], kernel.packet[14]);
2940  step1[14] = vec_mergeh(kernel.packet[7], kernel.packet[15]);
2941  step1[15] = vec_mergel(kernel.packet[7], kernel.packet[15]);
2942 
2943  step2[0] = vec_mergeh(step1[0], step1[8]);
2944  step2[1] = vec_mergel(step1[0], step1[8]);
2945  step2[2] = vec_mergeh(step1[1], step1[9]);
2946  step2[3] = vec_mergel(step1[1], step1[9]);
2947  step2[4] = vec_mergeh(step1[2], step1[10]);
2948  step2[5] = vec_mergel(step1[2], step1[10]);
2949  step2[6] = vec_mergeh(step1[3], step1[11]);
2950  step2[7] = vec_mergel(step1[3], step1[11]);
2951  step2[8] = vec_mergeh(step1[4], step1[12]);
2952  step2[9] = vec_mergel(step1[4], step1[12]);
2953  step2[10] = vec_mergeh(step1[5], step1[13]);
2954  step2[11] = vec_mergel(step1[5], step1[13]);
2955  step2[12] = vec_mergeh(step1[6], step1[14]);
2956  step2[13] = vec_mergel(step1[6], step1[14]);
2957  step2[14] = vec_mergeh(step1[7], step1[15]);
2958  step2[15] = vec_mergel(step1[7], step1[15]);
2959 
2960  step3[0] = vec_mergeh(step2[0], step2[8]);
2961  step3[1] = vec_mergel(step2[0], step2[8]);
2962  step3[2] = vec_mergeh(step2[1], step2[9]);
2963  step3[3] = vec_mergel(step2[1], step2[9]);
2964  step3[4] = vec_mergeh(step2[2], step2[10]);
2965  step3[5] = vec_mergel(step2[2], step2[10]);
2966  step3[6] = vec_mergeh(step2[3], step2[11]);
2967  step3[7] = vec_mergel(step2[3], step2[11]);
2968  step3[8] = vec_mergeh(step2[4], step2[12]);
2969  step3[9] = vec_mergel(step2[4], step2[12]);
2970  step3[10] = vec_mergeh(step2[5], step2[13]);
2971  step3[11] = vec_mergel(step2[5], step2[13]);
2972  step3[12] = vec_mergeh(step2[6], step2[14]);
2973  step3[13] = vec_mergel(step2[6], step2[14]);
2974  step3[14] = vec_mergeh(step2[7], step2[15]);
2975  step3[15] = vec_mergel(step2[7], step2[15]);
2976 
2977  kernel.packet[0] = vec_mergeh(step3[0], step3[8]);
2978  kernel.packet[1] = vec_mergel(step3[0], step3[8]);
2979  kernel.packet[2] = vec_mergeh(step3[1], step3[9]);
2980  kernel.packet[3] = vec_mergel(step3[1], step3[9]);
2981  kernel.packet[4] = vec_mergeh(step3[2], step3[10]);
2982  kernel.packet[5] = vec_mergel(step3[2], step3[10]);
2983  kernel.packet[6] = vec_mergeh(step3[3], step3[11]);
2984  kernel.packet[7] = vec_mergel(step3[3], step3[11]);
2985  kernel.packet[8] = vec_mergeh(step3[4], step3[12]);
2986  kernel.packet[9] = vec_mergel(step3[4], step3[12]);
2987  kernel.packet[10] = vec_mergeh(step3[5], step3[13]);
2988  kernel.packet[11] = vec_mergel(step3[5], step3[13]);
2989  kernel.packet[12] = vec_mergeh(step3[6], step3[14]);
2990  kernel.packet[13] = vec_mergel(step3[6], step3[14]);
2991  kernel.packet[14] = vec_mergeh(step3[7], step3[15]);
2992  kernel.packet[15] = vec_mergel(step3[7], step3[15]);
2993 }
2994 
2996  Packet16uc step1[16], step2[16], step3[16];
2997 
2998  step1[0] = vec_mergeh(kernel.packet[0], kernel.packet[8]);
2999  step1[1] = vec_mergel(kernel.packet[0], kernel.packet[8]);
3000  step1[2] = vec_mergeh(kernel.packet[1], kernel.packet[9]);
3001  step1[3] = vec_mergel(kernel.packet[1], kernel.packet[9]);
3002  step1[4] = vec_mergeh(kernel.packet[2], kernel.packet[10]);
3003  step1[5] = vec_mergel(kernel.packet[2], kernel.packet[10]);
3004  step1[6] = vec_mergeh(kernel.packet[3], kernel.packet[11]);
3005  step1[7] = vec_mergel(kernel.packet[3], kernel.packet[11]);
3006  step1[8] = vec_mergeh(kernel.packet[4], kernel.packet[12]);
3007  step1[9] = vec_mergel(kernel.packet[4], kernel.packet[12]);
3008  step1[10] = vec_mergeh(kernel.packet[5], kernel.packet[13]);
3009  step1[11] = vec_mergel(kernel.packet[5], kernel.packet[13]);
3010  step1[12] = vec_mergeh(kernel.packet[6], kernel.packet[14]);
3011  step1[13] = vec_mergel(kernel.packet[6], kernel.packet[14]);
3012  step1[14] = vec_mergeh(kernel.packet[7], kernel.packet[15]);
3013  step1[15] = vec_mergel(kernel.packet[7], kernel.packet[15]);
3014 
3015  step2[0] = vec_mergeh(step1[0], step1[8]);
3016  step2[1] = vec_mergel(step1[0], step1[8]);
3017  step2[2] = vec_mergeh(step1[1], step1[9]);
3018  step2[3] = vec_mergel(step1[1], step1[9]);
3019  step2[4] = vec_mergeh(step1[2], step1[10]);
3020  step2[5] = vec_mergel(step1[2], step1[10]);
3021  step2[6] = vec_mergeh(step1[3], step1[11]);
3022  step2[7] = vec_mergel(step1[3], step1[11]);
3023  step2[8] = vec_mergeh(step1[4], step1[12]);
3024  step2[9] = vec_mergel(step1[4], step1[12]);
3025  step2[10] = vec_mergeh(step1[5], step1[13]);
3026  step2[11] = vec_mergel(step1[5], step1[13]);
3027  step2[12] = vec_mergeh(step1[6], step1[14]);
3028  step2[13] = vec_mergel(step1[6], step1[14]);
3029  step2[14] = vec_mergeh(step1[7], step1[15]);
3030  step2[15] = vec_mergel(step1[7], step1[15]);
3031 
3032  step3[0] = vec_mergeh(step2[0], step2[8]);
3033  step3[1] = vec_mergel(step2[0], step2[8]);
3034  step3[2] = vec_mergeh(step2[1], step2[9]);
3035  step3[3] = vec_mergel(step2[1], step2[9]);
3036  step3[4] = vec_mergeh(step2[2], step2[10]);
3037  step3[5] = vec_mergel(step2[2], step2[10]);
3038  step3[6] = vec_mergeh(step2[3], step2[11]);
3039  step3[7] = vec_mergel(step2[3], step2[11]);
3040  step3[8] = vec_mergeh(step2[4], step2[12]);
3041  step3[9] = vec_mergel(step2[4], step2[12]);
3042  step3[10] = vec_mergeh(step2[5], step2[13]);
3043  step3[11] = vec_mergel(step2[5], step2[13]);
3044  step3[12] = vec_mergeh(step2[6], step2[14]);
3045  step3[13] = vec_mergel(step2[6], step2[14]);
3046  step3[14] = vec_mergeh(step2[7], step2[15]);
3047  step3[15] = vec_mergel(step2[7], step2[15]);
3048 
3049  kernel.packet[0] = vec_mergeh(step3[0], step3[8]);
3050  kernel.packet[1] = vec_mergel(step3[0], step3[8]);
3051  kernel.packet[2] = vec_mergeh(step3[1], step3[9]);
3052  kernel.packet[3] = vec_mergel(step3[1], step3[9]);
3053  kernel.packet[4] = vec_mergeh(step3[2], step3[10]);
3054  kernel.packet[5] = vec_mergel(step3[2], step3[10]);
3055  kernel.packet[6] = vec_mergeh(step3[3], step3[11]);
3056  kernel.packet[7] = vec_mergel(step3[3], step3[11]);
3057  kernel.packet[8] = vec_mergeh(step3[4], step3[12]);
3058  kernel.packet[9] = vec_mergel(step3[4], step3[12]);
3059  kernel.packet[10] = vec_mergeh(step3[5], step3[13]);
3060  kernel.packet[11] = vec_mergel(step3[5], step3[13]);
3061  kernel.packet[12] = vec_mergeh(step3[6], step3[14]);
3062  kernel.packet[13] = vec_mergel(step3[6], step3[14]);
3063  kernel.packet[14] = vec_mergeh(step3[7], step3[15]);
3064  kernel.packet[15] = vec_mergel(step3[7], step3[15]);
3065 }
3066 
3067 template <typename Packet>
3068 EIGEN_STRONG_INLINE Packet pblend4(const Selector<4>& ifPacket, const Packet& thenPacket, const Packet& elsePacket) {
3069  Packet4ui select = {ifPacket.select[0], ifPacket.select[1], ifPacket.select[2], ifPacket.select[3]};
3070  Packet4ui mask = reinterpret_cast<Packet4ui>(pnegate(reinterpret_cast<Packet4i>(select)));
3071  return vec_sel(elsePacket, thenPacket, mask);
3072 }
3073 
3074 template <>
3075 EIGEN_STRONG_INLINE Packet4i pblend(const Selector<4>& ifPacket, const Packet4i& thenPacket,
3076  const Packet4i& elsePacket) {
3077  return pblend4<Packet4i>(ifPacket, thenPacket, elsePacket);
3078 }
3079 
3080 template <>
3081 EIGEN_STRONG_INLINE Packet4f pblend(const Selector<4>& ifPacket, const Packet4f& thenPacket,
3082  const Packet4f& elsePacket) {
3083  return pblend4<Packet4f>(ifPacket, thenPacket, elsePacket);
3084 }
3085 
3086 template <>
3087 EIGEN_STRONG_INLINE Packet8s pblend(const Selector<8>& ifPacket, const Packet8s& thenPacket,
3088  const Packet8s& elsePacket) {
3089  Packet8us select = {ifPacket.select[0], ifPacket.select[1], ifPacket.select[2], ifPacket.select[3],
3090  ifPacket.select[4], ifPacket.select[5], ifPacket.select[6], ifPacket.select[7]};
3091  Packet8us mask = reinterpret_cast<Packet8us>(pnegate(reinterpret_cast<Packet8s>(select)));
3092  Packet8s result = vec_sel(elsePacket, thenPacket, mask);
3093  return result;
3094 }
3095 
3096 template <>
3097 EIGEN_STRONG_INLINE Packet8us pblend(const Selector<8>& ifPacket, const Packet8us& thenPacket,
3098  const Packet8us& elsePacket) {
3099  Packet8us select = {ifPacket.select[0], ifPacket.select[1], ifPacket.select[2], ifPacket.select[3],
3100  ifPacket.select[4], ifPacket.select[5], ifPacket.select[6], ifPacket.select[7]};
3101  Packet8us mask = reinterpret_cast<Packet8us>(pnegate(reinterpret_cast<Packet8s>(select)));
3102  return vec_sel(elsePacket, thenPacket, mask);
3103 }
3104 
3105 template <>
3106 EIGEN_STRONG_INLINE Packet8bf pblend(const Selector<8>& ifPacket, const Packet8bf& thenPacket,
3107  const Packet8bf& elsePacket) {
3108  return pblend<Packet8us>(ifPacket, thenPacket, elsePacket);
3109 }
3110 
3111 template <>
3112 EIGEN_STRONG_INLINE Packet16c pblend(const Selector<16>& ifPacket, const Packet16c& thenPacket,
3113  const Packet16c& elsePacket) {
3114  Packet16uc select = {ifPacket.select[0], ifPacket.select[1], ifPacket.select[2], ifPacket.select[3],
3115  ifPacket.select[4], ifPacket.select[5], ifPacket.select[6], ifPacket.select[7],
3116  ifPacket.select[8], ifPacket.select[9], ifPacket.select[10], ifPacket.select[11],
3117  ifPacket.select[12], ifPacket.select[13], ifPacket.select[14], ifPacket.select[15]};
3118 
3119  Packet16uc mask = reinterpret_cast<Packet16uc>(pnegate(reinterpret_cast<Packet16c>(select)));
3120  return vec_sel(elsePacket, thenPacket, mask);
3121 }
3122 
3123 template <>
3124 EIGEN_STRONG_INLINE Packet16uc pblend(const Selector<16>& ifPacket, const Packet16uc& thenPacket,
3125  const Packet16uc& elsePacket) {
3126  Packet16uc select = {ifPacket.select[0], ifPacket.select[1], ifPacket.select[2], ifPacket.select[3],
3127  ifPacket.select[4], ifPacket.select[5], ifPacket.select[6], ifPacket.select[7],
3128  ifPacket.select[8], ifPacket.select[9], ifPacket.select[10], ifPacket.select[11],
3129  ifPacket.select[12], ifPacket.select[13], ifPacket.select[14], ifPacket.select[15]};
3130 
3131  Packet16uc mask = reinterpret_cast<Packet16uc>(pnegate(reinterpret_cast<Packet16c>(select)));
3132  return vec_sel(elsePacket, thenPacket, mask);
3133 }
3134 
3135 //---------- double ----------
3136 #ifdef EIGEN_VECTORIZE_VSX
3137 typedef __vector double Packet2d;
3138 typedef __vector unsigned long long Packet2ul;
3139 typedef __vector long long Packet2l;
3140 #if EIGEN_COMP_CLANG
3141 typedef Packet2ul Packet2bl;
3142 #else
3143 typedef __vector __bool long Packet2bl;
3144 #endif
3145 
3146 static Packet2l p2l_ZERO = reinterpret_cast<Packet2l>(p4i_ZERO);
3147 static Packet2ul p2ul_SIGN = {0x8000000000000000ull, 0x8000000000000000ull};
3148 static Packet2ul p2ul_PREV0DOT5 = {0x3FDFFFFFFFFFFFFFull, 0x3FDFFFFFFFFFFFFFull};
3149 static Packet2d p2d_ONE = {1.0, 1.0};
3150 static Packet2d p2d_ZERO = reinterpret_cast<Packet2d>(p4f_ZERO);
3151 static Packet2d p2d_MZERO = {numext::bit_cast<double>(0x8000000000000000ull),
3152  numext::bit_cast<double>(0x8000000000000000ull)};
3153 
3154 #ifdef _BIG_ENDIAN
3155 static Packet2d p2d_COUNTDOWN =
3156  reinterpret_cast<Packet2d>(vec_sld(reinterpret_cast<Packet4f>(p2d_ZERO), reinterpret_cast<Packet4f>(p2d_ONE), 8));
3157 #else
3158 static Packet2d p2d_COUNTDOWN =
3159  reinterpret_cast<Packet2d>(vec_sld(reinterpret_cast<Packet4f>(p2d_ONE), reinterpret_cast<Packet4f>(p2d_ZERO), 8));
3160 #endif
3161 
3162 template <int index>
3163 Packet2d vec_splat_dbl(Packet2d& a) {
3164  return vec_splat(a, index);
3165 }
3166 
3167 template <>
3168 struct packet_traits<double> : default_packet_traits {
3169  typedef Packet2d type;
3170  typedef Packet2d half;
3171  enum {
3172  Vectorizable = 1,
3173  AlignedOnScalar = 1,
3174  size = 2,
3175 
3176  HasAdd = 1,
3177  HasSub = 1,
3178  HasMul = 1,
3179  HasDiv = 1,
3180  HasMin = 1,
3181  HasMax = 1,
3182  HasAbs = 1,
3188  HasATanh = 1,
3189  HasATan = 0,
3190  HasLog = 0,
3191  HasExp = 1,
3192  HasSqrt = 1,
3193 #if !EIGEN_COMP_CLANG
3194  HasRsqrt = 1,
3195 #else
3196  HasRsqrt = 0,
3197 #endif
3198  HasNegate = 1,
3199  HasBlend = 1
3200  };
3201 };
3202 
3203 template <>
3204 struct unpacket_traits<Packet2d> {
3205  typedef double type;
3206  typedef Packet2l integer_packet;
3207  enum {
3208  size = 2,
3209  alignment = Aligned16,
3210  vectorizable = true,
3211  masked_load_available = false,
3212  masked_store_available = false
3213  };
3214  typedef Packet2d half;
3215 };
3216 template <>
3217 struct unpacket_traits<Packet2l> {
3218  typedef int64_t type;
3219  typedef Packet2l half;
3220  enum {
3221  size = 2,
3222  alignment = Aligned16,
3223  vectorizable = false,
3224  masked_load_available = false,
3225  masked_store_available = false
3226  };
3227 };
3228 
3229 inline std::ostream& operator<<(std::ostream& s, const Packet2l& v) {
3230  union {
3231  Packet2l v;
3232  int64_t n[2];
3233  } vt;
3234  vt.v = v;
3235  s << vt.n[0] << ", " << vt.n[1];
3236  return s;
3237 }
3238 
3239 inline std::ostream& operator<<(std::ostream& s, const Packet2d& v) {
3240  union {
3241  Packet2d v;
3242  double n[2];
3243  } vt;
3244  vt.v = v;
3245  s << vt.n[0] << ", " << vt.n[1];
3246  return s;
3247 }
3248 
3249 // Need to define them first or we get specialization after instantiation errors
3250 template <>
3251 EIGEN_STRONG_INLINE Packet2d pload<Packet2d>(const double* from) {
3253  return vec_xl(0, const_cast<double*>(from)); // cast needed by Clang
3254 }
3255 
3256 template <>
3257 EIGEN_ALWAYS_INLINE Packet2d pload_partial<Packet2d>(const double* from, const Index n, const Index offset) {
3258  return pload_partial_common<Packet2d>(from, n, offset);
3259 }
3260 
3261 template <>
3262 EIGEN_STRONG_INLINE void pstore<double>(double* to, const Packet2d& from) {
3264  vec_xst(from, 0, to);
3265 }
3266 
3267 template <>
3268 EIGEN_ALWAYS_INLINE void pstore_partial<double>(double* to, const Packet2d& from, const Index n, const Index offset) {
3269  pstore_partial_common<Packet2d>(to, from, n, offset);
3270 }
3271 
3272 template <>
3273 EIGEN_STRONG_INLINE Packet2d pset1<Packet2d>(const double& from) {
3274  Packet2d v = {from, from};
3275  return v;
3276 }
3277 template <>
3279  Packet2l v = {from, from};
3280  return v;
3281 }
3282 
3283 template <>
3285  Packet2l v = {static_cast<long long>(from), static_cast<long long>(from)};
3286  return reinterpret_cast<Packet2d>(v);
3287 }
3288 
3289 template <>
3290 EIGEN_STRONG_INLINE void pbroadcast4<Packet2d>(const double* a, Packet2d& a0, Packet2d& a1, Packet2d& a2,
3291  Packet2d& a3) {
3292  // This way is faster than vec_splat (at least for doubles in Power 9)
3293  a0 = pset1<Packet2d>(a[0]);
3294  a1 = pset1<Packet2d>(a[1]);
3295  a2 = pset1<Packet2d>(a[2]);
3296  a3 = pset1<Packet2d>(a[3]);
3297 }
3298 
3299 template <>
3301  return pgather_common<Packet2d>(from, stride);
3302 }
3303 template <>
3304 EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet2d pgather_partial<double, Packet2d>(const double* from, Index stride,
3305  const Index n) {
3306  return pgather_common<Packet2d>(from, stride, n);
3307 }
3308 template <>
3309 EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void pscatter<double, Packet2d>(double* to, const Packet2d& from, Index stride) {
3310  pscatter_common<Packet2d>(to, from, stride);
3311 }
3312 template <>
3313 EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void pscatter_partial<double, Packet2d>(double* to, const Packet2d& from,
3314  Index stride, const Index n) {
3315  pscatter_common<Packet2d>(to, from, stride, n);
3316 }
3317 
3318 template <>
3320  return pset1<Packet2d>(a) + p2d_COUNTDOWN;
3321 }
3322 
3323 template <>
3325  return a + b;
3326 }
3327 
3328 template <>
3330  return a - b;
3331 }
3332 
3333 template <>
3335 #ifdef __POWER8_VECTOR__
3336  return vec_neg(a);
3337 #else
3338  return vec_xor(a, p2d_MZERO);
3339 #endif
3340 }
3341 
3342 template <>
3344  return a;
3345 }
3346 
3347 template <>
3349  return vec_madd(a, b, p2d_MZERO);
3350 }
3351 template <>
3353  return vec_div(a, b);
3354 }
3355 
3356 // for some weird raisons, it has to be overloaded for packet of integers
3357 template <>
3358 EIGEN_STRONG_INLINE Packet2d pmadd(const Packet2d& a, const Packet2d& b, const Packet2d& c) {
3359  return vec_madd(a, b, c);
3360 }
3361 template <>
3362 EIGEN_STRONG_INLINE Packet2d pmsub(const Packet2d& a, const Packet2d& b, const Packet2d& c) {
3363  return vec_msub(a, b, c);
3364 }
3365 template <>
3366 EIGEN_STRONG_INLINE Packet2d pnmadd(const Packet2d& a, const Packet2d& b, const Packet2d& c) {
3367  return vec_nmsub(a, b, c);
3368 }
3369 template <>
3370 EIGEN_STRONG_INLINE Packet2d pnmsub(const Packet2d& a, const Packet2d& b, const Packet2d& c) {
3371  return vec_nmadd(a, b, c);
3372 }
3373 
3374 template <>
3376  // NOTE: about 10% slower than vec_min, but consistent with std::min and SSE regarding NaN
3377  Packet2d ret;
3378  __asm__("xvcmpgedp %x0,%x1,%x2\n\txxsel %x0,%x1,%x2,%x0" : "=&wa"(ret) : "wa"(a), "wa"(b));
3379  return ret;
3380 }
3381 
3382 template <>
3384  // NOTE: about 10% slower than vec_max, but consistent with std::max and SSE regarding NaN
3385  Packet2d ret;
3386  __asm__("xvcmpgtdp %x0,%x2,%x1\n\txxsel %x0,%x1,%x2,%x0" : "=&wa"(ret) : "wa"(a), "wa"(b));
3387  return ret;
3388 }
3389 
3390 template <>
3392  return reinterpret_cast<Packet2d>(vec_cmple(a, b));
3393 }
3394 template <>
3396  return reinterpret_cast<Packet2d>(vec_cmplt(a, b));
3397 }
3398 template <>
3400  return reinterpret_cast<Packet2d>(vec_cmpeq(a, b));
3401 }
3402 template <>
3404  return reinterpret_cast<Packet2l>(vec_cmpeq(a, b));
3405 }
3406 template <>
3408  Packet2d c = reinterpret_cast<Packet2d>(vec_cmpge(a, b));
3409  return vec_nor(c, c);
3410 }
3411 
3412 template <>
3414  return vec_and(a, b);
3415 }
3416 
3417 template <>
3419  return vec_or(a, b);
3420 }
3421 
3422 template <>
3424  return vec_xor(a, b);
3425 }
3426 
3427 template <>
3429  return vec_and(a, vec_nor(b, b));
3430 }
3431 
3432 template <>
3434  Packet2d t = vec_add(
3435  reinterpret_cast<Packet2d>(vec_or(vec_and(reinterpret_cast<Packet2ul>(a), p2ul_SIGN), p2ul_PREV0DOT5)), a);
3436  Packet2d res;
3437 
3438  __asm__("xvrdpiz %x0, %x1\n\t" : "=&wa"(res) : "wa"(t));
3439 
3440  return res;
3441 }
3442 template <>
3444  return vec_ceil(a);
3445 }
3446 template <>
3448  return vec_floor(a);
3449 }
3450 template <>
3452  return vec_trunc(a);
3453 }
3454 template <>
3456  Packet2d res;
3457 
3458  __asm__("xvrdpic %x0, %x1\n\t" : "=&wa"(res) : "wa"(a));
3459 
3460  return res;
3461 }
3462 
3463 template <>
3464 EIGEN_STRONG_INLINE Packet2d ploadu<Packet2d>(const double* from) {
3466  return vec_xl(0, const_cast<double*>(from));
3467 }
3468 
3469 template <>
3470 EIGEN_ALWAYS_INLINE Packet2d ploadu_partial<Packet2d>(const double* from, const Index n, const Index offset) {
3471  return ploadu_partial_common<Packet2d>(from, n, offset);
3472 }
3473 
3474 template <>
3475 EIGEN_STRONG_INLINE Packet2d ploaddup<Packet2d>(const double* from) {
3476  Packet2d p;
3477  if ((std::ptrdiff_t(from) % 16) == 0)
3478  p = pload<Packet2d>(from);
3479  else
3480  p = ploadu<Packet2d>(from);
3481  return vec_splat_dbl<0>(p);
3482 }
3483 
3484 template <>
3485 EIGEN_STRONG_INLINE void pstoreu<double>(double* to, const Packet2d& from) {
3487  vec_xst(from, 0, to);
3488 }
3489 
3490 template <>
3491 EIGEN_ALWAYS_INLINE void pstoreu_partial<double>(double* to, const Packet2d& from, const Index n, const Index offset) {
3492  pstoreu_partial_common<Packet2d>(to, from, n, offset);
3493 }
3494 
3495 template <>
3496 EIGEN_STRONG_INLINE void prefetch<double>(const double* addr) {
3497  EIGEN_PPC_PREFETCH(addr);
3498 }
3499 
3500 template <>
3502  EIGEN_ALIGN16 double x[2];
3503  pstore<double>(x, a);
3504  return x[0];
3505 }
3506 
3507 template <>
3509  return vec_sld(a, a, 8);
3510 }
3511 template <>
3513  return vec_abs(a);
3514 }
3515 #ifdef __POWER8_VECTOR__
3516 template <>
3518  return (Packet2d)vec_sra((Packet2l)a, vec_splats((unsigned long long)(63)));
3519 }
3520 #else
3521 #ifdef _BIG_ENDIAN
3522 static Packet16uc p16uc_DUPSIGN = {0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 8, 8};
3523 #else
3524 static Packet16uc p16uc_DUPSIGN = {7, 7, 7, 7, 7, 7, 7, 7, 15, 15, 15, 15, 15, 15, 15, 15};
3525 #endif
3526 
3527 template <>
3529  Packet16c tmp = vec_sra(reinterpret_cast<Packet16c>(a), vec_splats((unsigned char)(7)));
3530  return reinterpret_cast<Packet2d>(vec_perm(tmp, tmp, p16uc_DUPSIGN));
3531 }
3532 #endif
3533 
3534 template <>
3536 
3537 template <>
3539 
3540 // Packet2l shifts.
3541 // For POWER8 we simply use vec_sr/l.
3542 //
3543 // Things are more complicated for POWER7. There is actually a
3544 // vec_xxsxdi intrinsic but it is not supported by some gcc versions.
3545 // So we need to shift by N % 32 and rearrage bytes.
3546 #ifdef __POWER8_VECTOR__
3547 
3548 template <int N>
3550  const Packet2ul shift = {N, N};
3551  return vec_sl(a, shift);
3552 }
3553 
3554 template <int N>
3556  const Packet2ul shift = {N, N};
3557  return vec_sr(a, shift);
3558 }
3559 
3560 #else
3561 
3562 // Shifts [A, B, C, D] to [B, 0, D, 0].
3563 // Used to implement left shifts for Packet2l.
3564 EIGEN_ALWAYS_INLINE Packet4i shift_even_left(const Packet4i& a) {
3565  static const Packet16uc perm = {0x14, 0x15, 0x16, 0x17, 0x00, 0x01, 0x02, 0x03,
3566  0x1c, 0x1d, 0x1e, 0x1f, 0x08, 0x09, 0x0a, 0x0b};
3567 #ifdef _BIG_ENDIAN
3568  return vec_perm(p4i_ZERO, a, perm);
3569 #else
3570  return vec_perm(a, p4i_ZERO, perm);
3571 #endif
3572 }
3573 
3574 // Shifts [A, B, C, D] to [0, A, 0, C].
3575 // Used to implement right shifts for Packet2l.
3576 EIGEN_ALWAYS_INLINE Packet4i shift_odd_right(const Packet4i& a) {
3577  static const Packet16uc perm = {0x04, 0x05, 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
3578  0x0c, 0x0d, 0x0e, 0x0f, 0x18, 0x19, 0x1a, 0x1b};
3579 #ifdef _BIG_ENDIAN
3580  return vec_perm(p4i_ZERO, a, perm);
3581 #else
3582  return vec_perm(a, p4i_ZERO, perm);
3583 #endif
3584 }
3585 
3586 template <int N, typename EnableIf = void>
3587 struct plogical_shift_left_impl;
3588 
3589 template <int N>
3590 struct plogical_shift_left_impl<N, std::enable_if_t<(N < 32) && (N >= 0)> > {
3591  static EIGEN_STRONG_INLINE Packet2l run(const Packet2l& a) {
3592  static const unsigned n = static_cast<unsigned>(N);
3593  const Packet4ui shift = {n, n, n, n};
3594  const Packet4i ai = reinterpret_cast<Packet4i>(a);
3595  static const unsigned m = static_cast<unsigned>(32 - N);
3596  const Packet4ui shift_right = {m, m, m, m};
3597  const Packet4i out_hi = vec_sl(ai, shift);
3598  const Packet4i out_lo = shift_even_left(vec_sr(ai, shift_right));
3599  return reinterpret_cast<Packet2l>(por<Packet4i>(out_hi, out_lo));
3600  }
3601 };
3602 
3603 template <int N>
3604 struct plogical_shift_left_impl<N, std::enable_if_t<(N >= 32)> > {
3605  static EIGEN_STRONG_INLINE Packet2l run(const Packet2l& a) {
3606  static const unsigned m = static_cast<unsigned>(N - 32);
3607  const Packet4ui shift = {m, m, m, m};
3608  const Packet4i ai = reinterpret_cast<Packet4i>(a);
3609  return reinterpret_cast<Packet2l>(shift_even_left(vec_sl(ai, shift)));
3610  }
3611 };
3612 
3613 template <int N>
3616 }
3617 
3618 template <int N, typename EnableIf = void>
3619 struct plogical_shift_right_impl;
3620 
3621 template <int N>
3622 struct plogical_shift_right_impl<N, std::enable_if_t<(N < 32) && (N >= 0)> > {
3623  static EIGEN_STRONG_INLINE Packet2l run(const Packet2l& a) {
3624  static const unsigned n = static_cast<unsigned>(N);
3625  const Packet4ui shift = {n, n, n, n};
3626  const Packet4i ai = reinterpret_cast<Packet4i>(a);
3627  static const unsigned m = static_cast<unsigned>(32 - N);
3628  const Packet4ui shift_left = {m, m, m, m};
3629  const Packet4i out_lo = vec_sr(ai, shift);
3630  const Packet4i out_hi = shift_odd_right(vec_sl(ai, shift_left));
3631  return reinterpret_cast<Packet2l>(por<Packet4i>(out_hi, out_lo));
3632  }
3633 };
3634 
3635 template <int N>
3636 struct plogical_shift_right_impl<N, std::enable_if_t<(N >= 32)> > {
3637  static EIGEN_STRONG_INLINE Packet2l run(const Packet2l& a) {
3638  static const unsigned m = static_cast<unsigned>(N - 32);
3639  const Packet4ui shift = {m, m, m, m};
3640  const Packet4i ai = reinterpret_cast<Packet4i>(a);
3641  return reinterpret_cast<Packet2l>(shift_odd_right(vec_sr(ai, shift)));
3642  }
3643 };
3644 
3645 template <int N>
3648 }
3649 #endif
3650 
3651 template <>
3653  // Clamp exponent to [-2099, 2099]
3654  const Packet2d max_exponent = pset1<Packet2d>(2099.0);
3655  const Packet2l e = pcast<Packet2d, Packet2l>(pmin(pmax(exponent, pnegate(max_exponent)), max_exponent));
3656 
3657  // Split 2^e into four factors and multiply:
3658  const Packet2l bias = {1023, 1023};
3659  Packet2l b = plogical_shift_right<2>(e); // floor(e/4)
3660  Packet2d c = reinterpret_cast<Packet2d>(plogical_shift_left<52>(b + bias));
3661  Packet2d out = pmul(pmul(pmul(a, c), c), c); // a * 2^(3b)
3662  b = psub(psub(psub(e, b), b), b); // e - 3b
3663  c = reinterpret_cast<Packet2d>(plogical_shift_left<52>(b + bias)); // 2^(e - 3b)
3664  out = pmul(out, c); // a * 2^e
3665  return out;
3666 }
3667 
3668 // Extract exponent without existence of Packet2l.
3669 template <>
3671  return pcast<Packet2l, Packet2d>(plogical_shift_right<52>(reinterpret_cast<Packet2l>(pabs(a))));
3672 }
3673 
3674 template <>
3676  return pfrexp_generic(a, exponent);
3677 }
3678 
3679 template <>
3681  Packet2d b, sum;
3682  b = reinterpret_cast<Packet2d>(vec_sld(reinterpret_cast<Packet4f>(a), reinterpret_cast<Packet4f>(a), 8));
3683  sum = a + b;
3684  return pfirst<Packet2d>(sum);
3685 }
3686 
3687 // Other reduction functions:
3688 // mul
3689 template <>
3691  return pfirst(
3692  pmul(a, reinterpret_cast<Packet2d>(vec_sld(reinterpret_cast<Packet4ui>(a), reinterpret_cast<Packet4ui>(a), 8))));
3693 }
3694 
3695 // min
3696 template <>
3698  return pfirst(
3699  pmin(a, reinterpret_cast<Packet2d>(vec_sld(reinterpret_cast<Packet4ui>(a), reinterpret_cast<Packet4ui>(a), 8))));
3700 }
3701 
3702 // max
3703 template <>
3705  return pfirst(
3706  pmax(a, reinterpret_cast<Packet2d>(vec_sld(reinterpret_cast<Packet4ui>(a), reinterpret_cast<Packet4ui>(a), 8))));
3707 }
3708 
3709 EIGEN_DEVICE_FUNC inline void ptranspose(PacketBlock<Packet2d, 2>& kernel) {
3710  Packet2d t0, t1;
3711  t0 = vec_mergeh(kernel.packet[0], kernel.packet[1]);
3712  t1 = vec_mergel(kernel.packet[0], kernel.packet[1]);
3713  kernel.packet[0] = t0;
3714  kernel.packet[1] = t1;
3715 }
3716 
3717 template <>
3718 EIGEN_STRONG_INLINE Packet2d pblend(const Selector<2>& ifPacket, const Packet2d& thenPacket,
3719  const Packet2d& elsePacket) {
3720  Packet2l select = {ifPacket.select[0], ifPacket.select[1]};
3721  Packet2ul mask = reinterpret_cast<Packet2ul>(pnegate(reinterpret_cast<Packet2l>(select)));
3722  return vec_sel(elsePacket, thenPacket, mask);
3723 }
3724 
3725 #endif // __VSX__
3726 } // end namespace internal
3727 
3728 } // end namespace Eigen
3729 
3730 #endif // EIGEN_PACKET_MATH_ALTIVEC_H
#define EIGEN_PPC_PREFETCH(ADDR)
Definition: AltiVec/PacketMath.h:154
#define LOAD_STORE_UNROLL_16
Definition: AltiVec/PacketMath.h:160
#define BF16_TO_F32_UNARY_OP_WRAPPER(OP, A)
Definition: AltiVec/PacketMath.h:2257
#define __VEC_CLASS_FP_NAN
Definition: AltiVec/PacketMath.h:2049
#define BF16_TO_F32_BINARY_OP_WRAPPER_BOOL(OP, A, B)
Definition: AltiVec/PacketMath.h:2273
#define BF16_TO_F32_BINARY_OP_WRAPPER(OP, A, B)
Definition: AltiVec/PacketMath.h:2264
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
#define EIGEN_ALIGN16
Definition: ConfigureVectorization.h:142
Array< double, 1, 3 > e(1./3., 0.5, 2.)
#define EIGEN_DEBUG_ALIGNED_STORE
Definition: GenericPacketMath.h:38
#define EIGEN_DEBUG_ALIGNED_LOAD
Definition: GenericPacketMath.h:30
#define EIGEN_DEBUG_UNALIGNED_STORE
Definition: GenericPacketMath.h:42
#define EIGEN_DEBUG_UNALIGNED_LOAD
Definition: GenericPacketMath.h:34
#define EIGEN_ALWAYS_INLINE
Definition: Macros.h:845
#define eigen_internal_assert(x)
Definition: Macros.h:916
#define EIGEN_UNUSED_VARIABLE(var)
Definition: Macros.h:966
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:892
#define eigen_assert(x)
Definition: Macros.h:910
#define EIGEN_FAST_MATH
Definition: Macros.h:51
#define EIGEN_STRONG_INLINE
Definition: Macros.h:834
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Definition: PartialRedux_count.cpp:3
void load(Archive &ar, ParticleHandler &handl)
Definition: Particles.h:21
float * p
Definition: Tutorial_Map_using.cpp:9
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
Scalar * b
Definition: benchVecAdd.cpp:17
internal::packet_traits< Scalar >::type Packet
Definition: benchmark-blocking-sizes.cpp:54
@ N
Definition: constructor.cpp:22
#define min(a, b)
Definition: datatypes.h:22
#define max(a, b)
Definition: datatypes.h:23
@ Aligned16
Definition: Constants.h:237
RealScalar s
Definition: level1_cplx_impl.h:130
return int(ret)+1
Eigen::DenseIndex ret
Definition: level1_cplx_impl.h:43
const Scalar * a
Definition: level2_cplx_impl.h:32
int * m
Definition: level2_cplx_impl.h:294
Eigen::Matrix< Scalar, Dynamic, Dynamic, ColMajor > tmp
Definition: level3_impl.h:365
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR __bfloat16_raw raw_uint16_to_bfloat16(unsigned short value)
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 exp(const bfloat16 &a)
Definition: BFloat16.h:615
EIGEN_STRONG_INLINE unsigned char predux< Packet16uc >(const Packet16uc &a)
Definition: AltiVec/PacketMath.h:2515
EIGEN_ALWAYS_INLINE Packet4f pload_partial< Packet4f >(const float *from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:593
EIGEN_STRONG_INLINE Packet4f pandnot< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition: AltiVec/PacketMath.h:1465
EIGEN_STRONG_INLINE Packet8bf ptrunc< Packet8bf >(const Packet8bf &a)
Definition: AltiVec/PacketMath.h:2368
std::ostream & operator<<(std::ostream &s, const Packet16c &v)
Definition: AltiVec/PacketMath.h:427
EIGEN_STRONG_INLINE Packet16c pmin< Packet16c >(const Packet16c &a, const Packet16c &b)
Definition: AltiVec/PacketMath.h:1273
EIGEN_ALWAYS_INLINE void pstore_partial< signed char >(signed char *to, const Packet16c &from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:743
EIGEN_STRONG_INLINE Packet8us pand< Packet8us >(const Packet8us &a, const Packet8us &b)
Definition: AltiVec/PacketMath.h:1418
__m128d Packet2d
Definition: LSX/PacketMath.h:36
EIGEN_STRONG_INLINE void pstoreu< double >(double *to, const Packet4d &from)
Definition: AVX/PacketMath.h:1628
EIGEN_STRONG_INLINE Packet8s pmax< Packet8s >(const Packet8s &a, const Packet8s &b)
Definition: AltiVec/PacketMath.h:1297
EIGEN_ALWAYS_INLINE void pstore_partial< unsigned short int >(unsigned short int *to, const Packet8us &from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:731
EIGEN_STRONG_INLINE short int pfirst< Packet8s >(const Packet8s &a)
Definition: AltiVec/PacketMath.h:1883
EIGEN_STRONG_INLINE double predux< Packet2d >(const Packet2d &a)
Definition: LSX/PacketMath.h:1965
EIGEN_STRONG_INLINE Packet2cf pconj(const Packet2cf &a)
Definition: AltiVec/Complex.h:268
eigen_packet_wrapper< __m128i, 3 > Packet2l
Definition: LSX/PacketMath.h:41
EIGEN_STRONG_INLINE Packet16c pmax< Packet16c >(const Packet16c &a, const Packet16c &b)
Definition: AltiVec/PacketMath.h:1305
EIGEN_STRONG_INLINE Packet8bf print< Packet8bf >(const Packet8bf &a)
Definition: AVX/PacketMath.h:2718
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet8bf pgather< bfloat16, Packet8bf >(const bfloat16 *from, Index stride)
Definition: AltiVec/PacketMath.h:874
static Packet8us p8us_COUNTDOWN
Definition: AltiVec/PacketMath.h:90
EIGEN_STRONG_INLINE Packet4f pmin< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition: AltiVec/PacketMath.h:1250
EIGEN_STRONG_INLINE Packet2d padd< Packet2d >(const Packet2d &a, const Packet2d &b)
Definition: LSX/PacketMath.h:605
EIGEN_ALWAYS_INLINE void pstore_partial< int >(int *to, const Packet4i &from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:720
static Packet4i p4i_COUNTDOWN
Definition: AltiVec/PacketMath.h:88
EIGEN_STRONG_INLINE Packet2d pandnot< Packet2d >(const Packet2d &a, const Packet2d &b)
Definition: LSX/PacketMath.h:1003
EIGEN_STRONG_INLINE Packet8f pzero(const Packet8f &)
Definition: AVX/PacketMath.h:774
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet psin_float(const Packet &x)
Definition: GenericPacketMathFunctions.h:820
EIGEN_STRONG_INLINE Packet8bf F32ToBf16Bool(Packet4f even, Packet4f odd)
Definition: AltiVec/PacketMath.h:2042
static Packet4f p4f_ONE
Definition: AltiVec/PacketMath.h:84
__vector int Packet4i
Definition: AltiVec/PacketMath.h:34
EIGEN_STRONG_INLINE Packet16uc ploadu< Packet16uc >(const unsigned char *from)
Definition: AltiVec/PacketMath.h:1557
EIGEN_ALWAYS_INLINE Packet16c pload_partial< Packet16c >(const signed char *from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:619
EIGEN_STRONG_INLINE Packet4f padd< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition: AltiVec/PacketMath.h:1066
EIGEN_STRONG_INLINE Packet16uc pmul< Packet16uc >(const Packet16uc &a, const Packet16uc &b)
Definition: AltiVec/PacketMath.h:1182
EIGEN_STRONG_INLINE bfloat16 predux_mul< Packet8bf >(const Packet8bf &a)
Definition: AltiVec/PacketMath.h:2558
EIGEN_STRONG_INLINE Packet4i por< Packet4i >(const Packet4i &a, const Packet4i &b)
Definition: AltiVec/PacketMath.h:1431
static Packet16uc p16uc_MERGEO16
Definition: AltiVec/PacketMath.h:109
static Packet8s p8s_COUNTDOWN
Definition: AltiVec/PacketMath.h:89
static Packet16uc p16uc_REVERSE8
Definition: AltiVec/PacketMath.h:97
EIGEN_STRONG_INLINE short int predux_min< Packet8s >(const Packet8s &a)
Definition: AltiVec/PacketMath.h:2617
EIGEN_STRONG_INLINE Packet ploadu_common(const __UNPACK_TYPE__(Packet) *from)
Definition: AltiVec/PacketMath.h:1516
EIGEN_STRONG_INLINE Packet8bf pmin< Packet8bf >(const Packet8bf &a, const Packet8bf &b)
Definition: AltiVec/PacketMath.h:2391
EIGEN_STRONG_INLINE Packet4f pcmp_eq< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition: LSX/PacketMath.h:1131
static EIGEN_DECLARE_CONST_FAST_Packet4f(ZERO, 0)
EIGEN_DEVICE_FUNC void ptranpose_common(PacketBlock< T, 4 > &kernel)
Definition: AltiVec/PacketMath.h:2756
EIGEN_ALWAYS_INLINE Packet16uc pload_partial< Packet16uc >(const unsigned char *from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:624
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void pscatter_partial< int, Packet4i >(int *to, const Packet4i &from, Index stride, const Index n)
Definition: AltiVec/PacketMath.h:1001
__vector unsigned char Packet16uc
Definition: AltiVec/PacketMath.h:41
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet8bf pgather_partial< bfloat16, Packet8bf >(const bfloat16 *from, Index stride, const Index n)
Definition: AltiVec/PacketMath.h:914
static Packet16uc p16uc_MERGEE16
Definition: AltiVec/PacketMath.h:108
EIGEN_STRONG_INLINE Packet4i pset1< Packet4i >(const int &from)
Definition: AltiVec/PacketMath.h:778
EIGEN_STRONG_INLINE Packet16c pload< Packet16c >(const signed char *from)
Definition: AltiVec/PacketMath.h:512
EIGEN_ALWAYS_INLINE void pstore_partial< unsigned char >(unsigned char *to, const Packet16uc &from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:749
EIGEN_STRONG_INLINE Packet8bf pceil< Packet8bf >(const Packet8bf &a)
Definition: AltiVec/PacketMath.h:2360
static Packet16uc p16uc_REVERSE16
Definition: AltiVec/PacketMath.h:96
EIGEN_STRONG_INLINE Packet8us pmin< Packet8us >(const Packet8us &a, const Packet8us &b)
Definition: AltiVec/PacketMath.h:1269
EIGEN_ALWAYS_INLINE Packet pload_ignore(const __UNPACK_TYPE__(Packet) *from)
Definition: AltiVec/PacketMath.h:527
EIGEN_STRONG_INLINE Packet8bf pdiv< Packet8bf >(const Packet8bf &a, const Packet8bf &b)
Definition: AltiVec/PacketMath.h:2293
EIGEN_STRONG_INLINE Packet8bf pround< Packet8bf >(const Packet8bf &a)
Definition: AltiVec/PacketMath.h:2364
EIGEN_STRONG_INLINE Packet16c psub< Packet16c >(const Packet16c &a, const Packet16c &b)
Definition: AltiVec/PacketMath.h:1111
EIGEN_STRONG_INLINE short int predux_max< Packet8s >(const Packet8s &a)
Definition: AltiVec/PacketMath.h:2697
EIGEN_STRONG_INLINE Packet4f pcmp_le< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition: LSX/PacketMath.h:1040
static Packet16c p16c_COUNTDOWN
Definition: AltiVec/PacketMath.h:92
EIGEN_STRONG_INLINE unsigned short int predux_max< Packet8us >(const Packet8us &a)
Definition: AltiVec/PacketMath.h:2712
EIGEN_STRONG_INLINE float pfirst< Packet4f >(const Packet4f &a)
Definition: AltiVec/PacketMath.h:1863
EIGEN_STRONG_INLINE Packet2d pand< Packet2d >(const Packet2d &a, const Packet2d &b)
Definition: LSX/PacketMath.h:880
EIGEN_STRONG_INLINE Packet pblend4(const Selector< 4 > &ifPacket, const Packet &thenPacket, const Packet &elsePacket)
Definition: AltiVec/PacketMath.h:3068
EIGEN_STRONG_INLINE Packet16uc pmax< Packet16uc >(const Packet16uc &a, const Packet16uc &b)
Definition: AltiVec/PacketMath.h:1309
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void pscatter_partial< bfloat16, Packet8bf >(bfloat16 *to, const Packet8bf &from, Index stride, const Index n)
Definition: AltiVec/PacketMath.h:1021
EIGEN_STRONG_INLINE unsigned short int predux_min< Packet8us >(const Packet8us &a)
Definition: AltiVec/PacketMath.h:2632
EIGEN_STRONG_INLINE void pstoreu_common(__UNPACK_TYPE__(Packet) *to, const Packet &from)
Definition: AltiVec/PacketMath.h:1734
EIGEN_STRONG_INLINE Packet8s por< Packet8s >(const Packet8s &a, const Packet8s &b)
Definition: AltiVec/PacketMath.h:1435
EIGEN_ALWAYS_INLINE void pstoreu_partial< signed char >(signed char *to, const Packet16c &from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:1843
EIGEN_STRONG_INLINE Packet8us psub< Packet8us >(const Packet8us &a, const Packet8us &b)
Definition: AltiVec/PacketMath.h:1107
EIGEN_STRONG_INLINE Packet4ui padd< Packet4ui >(const Packet4ui &a, const Packet4ui &b)
Definition: AltiVec/PacketMath.h:1074
EIGEN_STRONG_INLINE void ptranspose(PacketBlock< Packet2cf, 2 > &kernel)
Definition: AltiVec/Complex.h:339
EIGEN_STRONG_INLINE Packet16c plset< Packet16c >(const signed char &a)
Definition: AltiVec/PacketMath.h:1057
EIGEN_STRONG_INLINE Packet4ui pand< Packet4ui >(const Packet4ui &a, const Packet4ui &b)
Definition: AltiVec/PacketMath.h:1414
EIGEN_STRONG_INLINE Packet pset1_size8(const __UNPACK_TYPE__(Packet) &from)
Definition: AltiVec/PacketMath.h:761
EIGEN_STRONG_INLINE signed char pfirst< Packet16c >(const Packet16c &a)
Definition: AltiVec/PacketMath.h:1893
EIGEN_ALWAYS_INLINE Packet8bf F32ToBf16Two(Packet4f lo, Packet4f hi)
Definition: AltiVec/PacketMath.h:2169
EIGEN_ALWAYS_INLINE void pstoreu_partial< bfloat16 >(bfloat16 *to, const Packet8bf &from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:1838
EIGEN_STRONG_INLINE Packet16uc pset1< Packet16uc >(const unsigned char &from)
Definition: AltiVec/PacketMath.h:798
EIGEN_ALWAYS_INLINE void pstoreu_partial_common(__UNPACK_TYPE__(Packet) *to, const Packet &from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:1785
EIGEN_ALWAYS_INLINE Packet8us pmerge(Packet4ui even, Packet4ui odd)
Definition: AltiVec/PacketMath.h:2032
EIGEN_STRONG_INLINE signed char predux_mul< Packet16c >(const Packet16c &a)
Definition: AltiVec/PacketMath.h:2566
EIGEN_STRONG_INLINE Packet4i ploaddup< Packet4i >(const int *from)
Definition: AltiVec/PacketMath.h:1644
EIGEN_ALWAYS_INLINE void pstoreu_partial< int >(int *to, const Packet4i &from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:1824
EIGEN_STRONG_INLINE bool predux_any(const Packet4f &x)
Definition: AltiVec/PacketMath.h:2751
EIGEN_ALWAYS_INLINE void pstore_partial< bfloat16 >(bfloat16 *to, const Packet8bf &from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:737
static Packet16uc p16uc_TRANSPOSE64_LO
Definition: AltiVec/PacketMath.h:145
EIGEN_STRONG_INLINE float predux_max< Packet4f >(const Packet4f &a)
Definition: AltiVec/PacketMath.h:2679
EIGEN_STRONG_INLINE signed char predux_min< Packet16c >(const Packet16c &a)
Definition: AltiVec/PacketMath.h:2647
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet16uc pgather< unsigned char, Packet16uc >(const unsigned char *from, Index stride)
Definition: AltiVec/PacketMath.h:884
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void pscatter_partial< float, Packet4f >(float *to, const Packet4f &from, Index stride, const Index n)
Definition: AltiVec/PacketMath.h:995
EIGEN_STRONG_INLINE Packet2d ploaddup< Packet2d >(const double *from)
Definition: LSX/PacketMath.h:1490
EIGEN_STRONG_INLINE Packet8us plset< Packet8us >(const unsigned short int &a)
Definition: AltiVec/PacketMath.h:1053
static Packet16uc p16uc_REVERSE32
Definition: AltiVec/PacketMath.h:95
__vector unsigned short int Packet8us
Definition: AltiVec/PacketMath.h:38
static Packet16uc p16uc_MERGEL16
Definition: AltiVec/PacketMath.h:113
EIGEN_STRONG_INLINE Packet2d pxor< Packet2d >(const Packet2d &a, const Packet2d &b)
Definition: LSX/PacketMath.h:962
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void pscatter_common(__UNPACK_TYPE__(Packet) *to, const Packet &from, Index stride, const Index n=unpacket_traits< Packet >::size)
Definition: AltiVec/PacketMath.h:933
EIGEN_STRONG_INLINE Packet2d por< Packet2d >(const Packet2d &a, const Packet2d &b)
Definition: LSX/PacketMath.h:921
__vector __bool short Packet8bi
Definition: AltiVec/PacketMath.h:39
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet8s pgather< short int, Packet8s >(const short int *from, Index stride)
Definition: AltiVec/PacketMath.h:863
EIGEN_STRONG_INLINE void pstore< bfloat16 >(bfloat16 *to, const Packet8bf &from)
Definition: AltiVec/PacketMath.h:662
EIGEN_STRONG_INLINE Packet2d pldexp< Packet2d >(const Packet2d &a, const Packet2d &exponent)
Definition: LSX/PacketMath.h:2753
EIGEN_STRONG_INLINE void pstore< unsigned short int >(unsigned short int *to, const Packet8us &from)
Definition: AltiVec/PacketMath.h:657
EIGEN_STRONG_INLINE Packet4i pdiv< Packet4i >(const Packet4i &a, const Packet4i &b)
Definition: AltiVec/PacketMath.h:1205
EIGEN_ALWAYS_INLINE void pstoreu_partial< unsigned char >(unsigned char *to, const Packet16uc &from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:1848
EIGEN_STRONG_INLINE Packet8bf plog< Packet8bf >(const Packet8bf &a)
Definition: AltiVec/PacketMath.h:2352
EIGEN_STRONG_INLINE Packet8s ploadu< Packet8s >(const short int *from)
Definition: AltiVec/PacketMath.h:1541
EIGEN_STRONG_INLINE void pstoreu< signed char >(signed char *to, const Packet16c &from)
Definition: AltiVec/PacketMath.h:1776
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void pscatter< int, Packet4i >(int *to, const Packet4i &from, Index stride)
Definition: AltiVec/PacketMath.h:959
EIGEN_STRONG_INLINE Packet4f ploaddup< Packet4f >(const float *from)
Definition: AltiVec/PacketMath.h:1640
EIGEN_STRONG_INLINE Packet2l pcast< Packet2d, Packet2l >(const Packet2d &a)
Definition: LSX/TypeCasting.h:433
EIGEN_STRONG_INLINE Packet4f por< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition: AltiVec/PacketMath.h:1427
EIGEN_ALWAYS_INLINE Packet8bf ploadu_partial< Packet8bf >(const bfloat16 *from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:1617
EIGEN_ALWAYS_INLINE Packet8s pload_partial< Packet8s >(const short int *from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:603
EIGEN_STRONG_INLINE Packet4i plogical_shift_left(const Packet4i &a)
Definition: AltiVec/PacketMath.h:1983
EIGEN_STRONG_INLINE Packet8s plset< Packet8s >(const short int &a)
Definition: AltiVec/PacketMath.h:1049
EIGEN_STRONG_INLINE Packet16uc padd< Packet16uc >(const Packet16uc &a, const Packet16uc &b)
Definition: AltiVec/PacketMath.h:1090
EIGEN_STRONG_INLINE int predux_min< Packet4i >(const Packet4i &a)
Definition: AltiVec/PacketMath.h:2604
EIGEN_STRONG_INLINE Packet16uc psub< Packet16uc >(const Packet16uc &a, const Packet16uc &b)
Definition: AltiVec/PacketMath.h:1115
EIGEN_ALWAYS_INLINE void pstore_partial_common(__UNPACK_TYPE__(Packet) *to, const Packet &from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:677
EIGEN_STRONG_INLINE Packet4i pxor< Packet4i >(const Packet4i &a, const Packet4i &b)
Definition: AltiVec/PacketMath.h:1452
EIGEN_STRONG_INLINE double predux_max< Packet2d >(const Packet2d &a)
Definition: LSX/PacketMath.h:2127
EIGEN_STRONG_INLINE Packet4f pmul< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition: AltiVec/PacketMath.h:1162
static Packet16uc p16uc_PSET32_WEVEN
Definition: AltiVec/PacketMath.h:132
EIGEN_DEVICE_FUNC Packet pmax(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:663
EIGEN_STRONG_INLINE Packet4i pblend(const Selector< 4 > &ifPacket, const Packet4i &thenPacket, const Packet4i &elsePacket)
Definition: AltiVec/PacketMath.h:3075
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet16uc pgather_partial< unsigned char, Packet16uc >(const unsigned char *from, Index stride, const Index n)
Definition: AltiVec/PacketMath.h:926
EIGEN_STRONG_INLINE Packet8bf padd< Packet8bf >(const Packet8bf &a, const Packet8bf &b)
Definition: AltiVec/PacketMath.h:2283
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet4f pgather< float, Packet4f >(const float *from, Index stride)
Definition: AltiVec/PacketMath.h:853
EIGEN_STRONG_INLINE Packet8us pmax< Packet8us >(const Packet8us &a, const Packet8us &b)
Definition: AltiVec/PacketMath.h:1301
EIGEN_STRONG_INLINE Packet8bf pexp< Packet8bf >(const Packet8bf &a)
Definition: AltiVec/PacketMath.h:2309
EIGEN_STRONG_INLINE Packet4f pcmp_le(const Packet4f &a, const Packet4f &b)
Definition: AltiVec/PacketMath.h:1314
EIGEN_ALWAYS_INLINE Packet4i pload_partial< Packet4i >(const int *from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:598
EIGEN_STRONG_INLINE Packet2d pset1< Packet2d >(const double &from)
Definition: LSX/PacketMath.h:503
EIGEN_STRONG_INLINE Packet4i plogical_shift_right(const Packet4i &a)
Definition: AltiVec/PacketMath.h:1979
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pcos_float(const Packet &x)
Definition: GenericPacketMathFunctions.h:825
static EIGEN_DECLARE_CONST_FAST_Packet4ui(SIGN, 0x80000000u)
EIGEN_STRONG_INLINE unsigned short int predux< Packet8us >(const Packet8us &a)
Definition: AltiVec/PacketMath.h:2483
EIGEN_STRONG_INLINE Packet4f pload< Packet4f >(const float *from)
Definition: AltiVec/PacketMath.h:492
__vector signed char Packet16c
Definition: AltiVec/PacketMath.h:40
EIGEN_STRONG_INLINE Packet16uc ploadquad< Packet16uc >(const unsigned char *from)
Definition: AltiVec/PacketMath.h:1724
EIGEN_STRONG_INLINE int predux_mul< Packet4i >(const Packet4i &a)
Definition: AltiVec/PacketMath.h:2529
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet4f pgather_partial< float, Packet4f >(const float *from, Index stride, const Index n)
Definition: AltiVec/PacketMath.h:890
EIGEN_STRONG_INLINE Packet16uc pload< Packet16uc >(const unsigned char *from)
Definition: AltiVec/PacketMath.h:517
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void pscatter_partial< short int, Packet8s >(short int *to, const Packet8s &from, Index stride, const Index n)
Definition: AltiVec/PacketMath.h:1007
EIGEN_STRONG_INLINE Packet8us ploadu< Packet8us >(const unsigned short int *from)
Definition: AltiVec/PacketMath.h:1545
EIGEN_STRONG_INLINE void pstore< int >(int *to, const Packet4i &from)
Definition: AltiVec/PacketMath.h:647
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet8s pgather_partial< short int, Packet8s >(const short int *from, Index stride, const Index n)
Definition: AltiVec/PacketMath.h:902
EIGEN_STRONG_INLINE Packet8bf plset< Packet8bf >(const bfloat16 &a)
Definition: AltiVec/PacketMath.h:2428
EIGEN_STRONG_INLINE Packet4i pcmp_lt(const Packet4i &a, const Packet4i &b)
Definition: AltiVec/PacketMath.h:1341
EIGEN_STRONG_INLINE Packet8bf pmul< Packet8bf >(const Packet8bf &a, const Packet8bf &b)
Definition: AltiVec/PacketMath.h:2288
EIGEN_STRONG_INLINE Packet8us pmul< Packet8us >(const Packet8us &a, const Packet8us &b)
Definition: AltiVec/PacketMath.h:1174
EIGEN_STRONG_INLINE Packet8bf ploaddup< Packet8bf >(const bfloat16 *from)
Definition: AltiVec/PacketMath.h:2423
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet16c pgather_partial< signed char, Packet16c >(const signed char *from, Index stride, const Index n)
Definition: AltiVec/PacketMath.h:920
__vector unsigned int Packet4ui
Definition: AltiVec/PacketMath.h:35
EIGEN_STRONG_INLINE Packet4f pcmp_lt_or_nan< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition: LSX/PacketMath.h:1122
EIGEN_STRONG_INLINE Packet2cf preverse(const Packet2cf &a)
Definition: AltiVec/Complex.h:303
__vector __bool int Packet4bi
Definition: AltiVec/PacketMath.h:36
EIGEN_STRONG_INLINE void pstore< double >(double *to, const Packet4d &from)
Definition: AVX/PacketMath.h:1611
EIGEN_STRONG_INLINE Packet4i padd< Packet4i >(const Packet4i &a, const Packet4i &b)
Definition: AltiVec/PacketMath.h:1070
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet pgather_common(const __UNPACK_TYPE__(Packet) *from, Index stride, const Index n=unpacket_traits< Packet >::size)
Definition: AltiVec/PacketMath.h:832
EIGEN_STRONG_INLINE Packet4f pfloor< Packet4f >(const Packet4f &a)
Definition: AltiVec/PacketMath.h:1497
EIGEN_STRONG_INLINE Packet4f pmadd(const Packet4f &a, const Packet4f &b, const Packet4f &c)
Definition: AltiVec/PacketMath.h:1218
EIGEN_STRONG_INLINE Packet4cf pmul(const Packet4cf &a, const Packet4cf &b)
Definition: AVX/Complex.h:88
EIGEN_STRONG_INLINE Packet4i pandnot< Packet4i >(const Packet4i &a, const Packet4i &b)
Definition: AltiVec/PacketMath.h:1469
EIGEN_STRONG_INLINE unsigned char predux_max< Packet16uc >(const Packet16uc &a)
Definition: AltiVec/PacketMath.h:2739
EIGEN_STRONG_INLINE signed char predux_max< Packet16c >(const Packet16c &a)
Definition: AltiVec/PacketMath.h:2727
EIGEN_STRONG_INLINE Packet8us pandnot< Packet8us >(const Packet8us &a, const Packet8us &b)
Definition: LSX/PacketMath.h:1027
EIGEN_STRONG_INLINE Packet4ui pandnot< Packet4ui >(const Packet4ui &a, const Packet4ui &b)
Definition: LSX/PacketMath.h:1031
EIGEN_STRONG_INLINE Packet8s ploaddup< Packet8s >(const short int *from)
Definition: AltiVec/PacketMath.h:1649
EIGEN_STRONG_INLINE void pstore< short int >(short int *to, const Packet8s &from)
Definition: AltiVec/PacketMath.h:652
EIGEN_DEVICE_FUNC Packet pmin(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:649
EIGEN_STRONG_INLINE Packet4f pdiv< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition: AltiVec/PacketMath.h:1187
EIGEN_STRONG_INLINE Packet2d pload< Packet2d >(const double *from)
Definition: LSX/PacketMath.h:1407
EIGEN_STRONG_INLINE Packet8us pload< Packet8us >(const unsigned short int *from)
Definition: AltiVec/PacketMath.h:507
EIGEN_STRONG_INLINE Packet2d pmul< Packet2d >(const Packet2d &a, const Packet2d &b)
Definition: LSX/PacketMath.h:741
eigen_packet_wrapper< __vector unsigned short int, 0 > Packet8bf
Definition: AltiVec/PacketMath.h:42
EIGEN_STRONG_INLINE Packet2cf pnegate(const Packet2cf &a)
Definition: AltiVec/Complex.h:264
EIGEN_STRONG_INLINE Packet4f pfrexp< Packet4f >(const Packet4f &a, Packet4f &exponent)
Definition: AltiVec/PacketMath.h:2328
EIGEN_STRONG_INLINE float predux_mul< Packet4f >(const Packet4f &a)
Definition: AltiVec/PacketMath.h:2522
EIGEN_STRONG_INLINE Packet8bf pexp2< Packet8bf >(const Packet8bf &a)
Definition: AltiVec/PacketMath.h:2314
static Packet16uc p16uc_HALF64_0_16
Definition: AltiVec/PacketMath.h:135
EIGEN_STRONG_INLINE void prefetch< float >(const float *addr)
Definition: AltiVec/PacketMath.h:1854
EIGEN_STRONG_INLINE void pstoreu< bfloat16 >(bfloat16 *to, const Packet8bf &from)
Definition: AltiVec/PacketMath.h:1772
EIGEN_STRONG_INLINE Packet8bf pldexp< Packet8bf >(const Packet8bf &a, const Packet8bf &exponent)
Definition: AltiVec/PacketMath.h:2323
EIGEN_STRONG_INLINE Packet4i parithmetic_shift_right(const Packet4i &a)
Definition: AltiVec/PacketMath.h:1975
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void pscatter_partial< unsigned char, Packet16uc >(unsigned char *to, const Packet16uc &from, Index stride, const Index n)
Definition: AltiVec/PacketMath.h:1034
EIGEN_STRONG_INLINE Packet4d pfrexp_generic_get_biased_exponent(const Packet4d &a)
Definition: AVX/PacketMath.h:1880
EIGEN_STRONG_INLINE Packet8bf F32ToBf16Both(Packet4f lo, Packet4f hi)
Definition: AltiVec/PacketMath.h:2237
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void pscatter< short int, Packet8s >(short int *to, const Packet8s &from, Index stride)
Definition: AltiVec/PacketMath.h:964
EIGEN_STRONG_INLINE Packet pset1_size16(const __UNPACK_TYPE__(Packet) &from)
Definition: AltiVec/PacketMath.h:767
EIGEN_STRONG_INLINE Packet8s padd< Packet8s >(const Packet8s &a, const Packet8s &b)
Definition: AltiVec/PacketMath.h:1078
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void pscatter< double, Packet2d >(double *to, const Packet2d &from, Index stride)
Definition: LSX/PacketMath.h:1734
EIGEN_STRONG_INLINE void pstore_common(__UNPACK_TYPE__(Packet) *to, const Packet &from)
Definition: AltiVec/PacketMath.h:629
EIGEN_DEVICE_FUNC void pstoreu_partial(Scalar *to, const Packet &from, const Index n, const Index offset=0)
Definition: GenericPacketMath.h:917
EIGEN_STRONG_INLINE Packet8us ploaddup< Packet8us >(const unsigned short int *from)
Definition: AltiVec/PacketMath.h:1659
EIGEN_STRONG_INLINE Packet4i ploadu< Packet4i >(const int *from)
Definition: AltiVec/PacketMath.h:1537
EIGEN_STRONG_INLINE double predux_mul< Packet2d >(const Packet2d &a)
Definition: LSX/PacketMath.h:2019
__vector short int Packet8s
Definition: AltiVec/PacketMath.h:37
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet8us pgather< unsigned short int, Packet8us >(const unsigned short int *from, Index stride)
Definition: AltiVec/PacketMath.h:868
EIGEN_STRONG_INLINE Packet2d pdiv< Packet2d >(const Packet2d &a, const Packet2d &b)
Definition: LSX/PacketMath.h:782
EIGEN_STRONG_INLINE Packet8bf psignbit(const Packet8bf &a)
Definition: AltiVec/PacketMath.h:1966
EIGEN_STRONG_INLINE Packet ploaddup_common(const __UNPACK_TYPE__(Packet) *from)
Definition: AltiVec/PacketMath.h:1631
EIGEN_ALWAYS_INLINE void pstoreu_partial< float >(float *to, const Packet4f &from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:1820
static Packet4f p4f_MZERO
Definition: AltiVec/PacketMath.h:81
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet4i pgather_partial< int, Packet4i >(const int *from, Index stride, const Index n)
Definition: AltiVec/PacketMath.h:896
EIGEN_STRONG_INLINE double predux_min< Packet2d >(const Packet2d &a)
Definition: LSX/PacketMath.h:2073
EIGEN_STRONG_INLINE Packet4f pset1< Packet4f >(const float &from)
Definition: AltiVec/PacketMath.h:773
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void pscatter_partial< signed char, Packet16c >(signed char *to, const Packet16c &from, Index stride, const Index n)
Definition: AltiVec/PacketMath.h:1027
EIGEN_STRONG_INLINE void pstoreu< unsigned short int >(unsigned short int *to, const Packet8us &from)
Definition: AltiVec/PacketMath.h:1768
EIGEN_STRONG_INLINE void pstoreu< unsigned char >(unsigned char *to, const Packet16uc &from)
Definition: AltiVec/PacketMath.h:1780
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void pscatter< unsigned char, Packet16uc >(unsigned char *to, const Packet16uc &from, Index stride)
Definition: AltiVec/PacketMath.h:989
EIGEN_STRONG_INLINE Packet4i psub< Packet4i >(const Packet4i &a, const Packet4i &b)
Definition: AltiVec/PacketMath.h:1099
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void pscatter< float, Packet4f >(float *to, const Packet4f &from, Index stride)
Definition: AltiVec/PacketMath.h:954
EIGEN_STRONG_INLINE Packet2d plset< Packet2d >(const double &a)
Definition: LSX/PacketMath.h:563
EIGEN_STRONG_INLINE Packet8bf pfloor< Packet8bf >(const Packet8bf &a)
Definition: AltiVec/PacketMath.h:2356
EIGEN_STRONG_INLINE Packet8s pload< Packet8s >(const short int *from)
Definition: AltiVec/PacketMath.h:502
EIGEN_STRONG_INLINE Packet8us pxor< Packet8us >(const Packet8us &a, const Packet8us &b)
Definition: AltiVec/PacketMath.h:1456
EIGEN_STRONG_INLINE Packet2d pcast< Packet2l, Packet2d >(const Packet2l &a)
Definition: LSX/TypeCasting.h:514
EIGEN_STRONG_INLINE Packet8us padd< Packet8us >(const Packet8us &a, const Packet8us &b)
Definition: AltiVec/PacketMath.h:1082
EIGEN_STRONG_INLINE Packet4f pceil< Packet4f >(const Packet4f &a)
Definition: AltiVec/PacketMath.h:1493
EIGEN_STRONG_INLINE void pstore< float >(float *to, const Packet4f &from)
Definition: AltiVec/PacketMath.h:642
EIGEN_STRONG_INLINE Packet2l pset1< Packet2l >(const int64_t &from)
Definition: LSX/PacketMath.h:478
EIGEN_ALWAYS_INLINE void pstoreu_partial< short int >(short int *to, const Packet8s &from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:1828
EIGEN_STRONG_INLINE Packet4f pabs(const Packet4f &a)
Definition: AltiVec/PacketMath.h:1936
static EIGEN_DECLARE_CONST_FAST_Packet4i(ZERO, 0)
EIGEN_STRONG_INLINE Packet4f ptrunc< Packet4f >(const Packet4f &a)
Definition: AltiVec/PacketMath.h:1501
EIGEN_STRONG_INLINE Packet4f Bf16ToF32Even(const Packet8bf &bf)
Definition: AltiVec/PacketMath.h:2023
static Packet2d p2d_ONE
Definition: ZVector/PacketMath.h:90
EIGEN_STRONG_INLINE bfloat16 pfirst(const Packet8bf &a)
Definition: AltiVec/PacketMath.h:2418
EIGEN_STRONG_INLINE Packet8us por< Packet8us >(const Packet8us &a, const Packet8us &b)
Definition: AltiVec/PacketMath.h:1439
EIGEN_ALWAYS_INLINE void pstore_partial< short int >(short int *to, const Packet8s &from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:725
EIGEN_STRONG_INLINE void pstore< signed char >(signed char *to, const Packet16c &from)
Definition: AltiVec/PacketMath.h:667
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet8us pgather_partial< unsigned short int, Packet8us >(const unsigned short int *from, Index stride, const Index n)
Definition: AltiVec/PacketMath.h:909
EIGEN_STRONG_INLINE void pbroadcast4< Packet2d >(const double *a, Packet2d &a0, Packet2d &a1, Packet2d &a2, Packet2d &a3)
Definition: SSE/PacketMath.h:1819
EIGEN_STRONG_INLINE Packet4f pset1frombits< Packet4f >(unsigned int from)
Definition: AltiVec/PacketMath.h:803
EIGEN_DEVICE_FUNC void pstore(Scalar *to, const Packet &from)
Definition: GenericPacketMath.h:891
EIGEN_STRONG_INLINE Packet4f pnmsub(const Packet4f &a, const Packet4f &b, const Packet4f &c)
Definition: LSX/PacketMath.h:835
static Packet16uc p16uc_PSET64_HI
Definition: AltiVec/PacketMath.h:139
EIGEN_STRONG_INLINE Packet4f pldexp< Packet4f >(const Packet4f &a, const Packet4f &exponent)
Definition: AltiVec/PacketMath.h:2319
EIGEN_STRONG_INLINE Packet2d ploadu< Packet2d >(const double *from)
Definition: LSX/PacketMath.h:1448
EIGEN_STRONG_INLINE Packet8bf pand< Packet8bf >(const Packet8bf &a, const Packet8bf &b)
Definition: AltiVec/PacketMath.h:1422
EIGEN_STRONG_INLINE void pstore< unsigned char >(unsigned char *to, const Packet16uc &from)
Definition: AltiVec/PacketMath.h:672
EIGEN_STRONG_INLINE Packet4f pcmp_lt< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition: LSX/PacketMath.h:1081
EIGEN_STRONG_INLINE short int predux_mul< Packet8s >(const Packet8s &a)
Definition: AltiVec/PacketMath.h:2536
EIGEN_STRONG_INLINE Packet4f pxor< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition: AltiVec/PacketMath.h:1448
EIGEN_STRONG_INLINE Packet4i pmin< Packet4i >(const Packet4i &a, const Packet4i &b)
Definition: AltiVec/PacketMath.h:1261
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type predux(const Packet &a)
Definition: GenericPacketMath.h:1232
EIGEN_STRONG_INLINE Packet8bf pcos< Packet8bf >(const Packet8bf &a)
Definition: AltiVec/PacketMath.h:2348
static EIGEN_DECLARE_CONST_FAST_Packet8us(ONE, 1)
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pexp_float(const Packet _x)
Definition: GenericPacketMathFunctions.h:509
EIGEN_STRONG_INLINE Packet8bf pnegate< Packet8bf >(const Packet8bf &a)
Definition: AltiVec/PacketMath.h:2298
EIGEN_STRONG_INLINE Packet16uc plset< Packet16uc >(const unsigned char &a)
Definition: AltiVec/PacketMath.h:1061
EIGEN_STRONG_INLINE Packet8bf psub< Packet8bf >(const Packet8bf &a, const Packet8bf &b)
Definition: AltiVec/PacketMath.h:2304
EIGEN_STRONG_INLINE Packet16c ploadu< Packet16c >(const signed char *from)
Definition: AltiVec/PacketMath.h:1553
EIGEN_STRONG_INLINE bfloat16 predux< Packet8bf >(const Packet8bf &a)
Definition: AltiVec/PacketMath.h:2455
EIGEN_STRONG_INLINE Packet2d pfrexp< Packet2d >(const Packet2d &a, Packet2d &exponent)
Definition: LSX/PacketMath.h:2677
EIGEN_STRONG_INLINE Packet2cf pcmp_eq(const Packet2cf &a, const Packet2cf &b)
Definition: AltiVec/Complex.h:353
EIGEN_ALWAYS_INLINE Packet8bf pload_partial< Packet8bf >(const bfloat16 *from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:614
static Packet16uc p16uc_COUNTDOWN
Definition: AltiVec/PacketMath.h:93
EIGEN_STRONG_INLINE Packet8s pmin< Packet8s >(const Packet8s &a, const Packet8s &b)
Definition: AltiVec/PacketMath.h:1265
EIGEN_STRONG_INLINE Packet8s pset1< Packet8s >(const short int &from)
Definition: AltiVec/PacketMath.h:783
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Packet pldexp_generic(const Packet &a, const Packet &exponent)
Definition: GenericPacketMathFunctions.h:226
EIGEN_STRONG_INLINE Packet8bf pload< Packet8bf >(const bfloat16 *from)
Definition: AltiVec/PacketMath.h:522
EIGEN_STRONG_INLINE Packet8s pmul< Packet8s >(const Packet8s &a, const Packet8s &b)
Definition: AltiVec/PacketMath.h:1170
EIGEN_STRONG_INLINE Packet4f pmsub(const Packet4f &a, const Packet4f &b, const Packet4f &c)
Definition: LSX/PacketMath.h:819
EIGEN_DEVICE_FUNC void pstoreu(Scalar *to, const Packet &from)
Definition: GenericPacketMath.h:911
static Packet16uc p16uc_FORWARD
Definition: AltiVec/PacketMath.h:128
EIGEN_ALWAYS_INLINE Packet4i ploadu_partial< Packet4i >(const int *from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:1604
EIGEN_STRONG_INLINE void pstoreu< int >(int *to, const Packet4i &from)
Definition: AltiVec/PacketMath.h:1760
EIGEN_STRONG_INLINE unsigned char pfirst< Packet16uc >(const Packet16uc &a)
Definition: AltiVec/PacketMath.h:1898
EIGEN_STRONG_INLINE Packet2d ptrunc< Packet2d >(const Packet2d &a)
Definition: LSX/PacketMath.h:2749
EIGEN_STRONG_INLINE Packet16uc pmin< Packet16uc >(const Packet16uc &a, const Packet16uc &b)
Definition: AltiVec/PacketMath.h:1277
EIGEN_STRONG_INLINE int pfirst< Packet4i >(const Packet4i &a)
Definition: AltiVec/PacketMath.h:1869
EIGEN_STRONG_INLINE Packet4i plset< Packet4i >(const int &a)
Definition: AltiVec/PacketMath.h:1045
EIGEN_STRONG_INLINE Packet4f Bf16ToF32Odd(const Packet8bf &bf)
Definition: AltiVec/PacketMath.h:2027
EIGEN_STRONG_INLINE __UNPACK_TYPE__(Packet) pfirst_common(const Packet &a)
Definition: AltiVec/PacketMath.h:1876
EIGEN_STRONG_INLINE float predux< Packet4f >(const Packet4f &a)
Definition: AltiVec/PacketMath.h:2435
EIGEN_STRONG_INLINE Packet8bf pfrexp< Packet8bf >(const Packet8bf &a, Packet8bf &e)
Definition: AltiVec/PacketMath.h:2332
EIGEN_ALWAYS_INLINE Packet8bf Bf16PackLow(Packet4f hi, Packet4f lo)
Definition: AltiVec/PacketMath.h:2145
EIGEN_STRONG_INLINE Packet2d pceil< Packet2d >(const Packet2d &a)
Definition: MSA/PacketMath.h:1186
EIGEN_STRONG_INLINE Packet4f pnmadd(const Packet4f &a, const Packet4f &b, const Packet4f &c)
Definition: LSX/PacketMath.h:827
EIGEN_STRONG_INLINE Packet4f ploadu< Packet4f >(const float *from)
Definition: AltiVec/PacketMath.h:1533
static Packet16uc p16uc_QUADRUPLICATE16
Definition: AltiVec/PacketMath.h:106
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet16c pgather< signed char, Packet16c >(const signed char *from, Index stride)
Definition: AltiVec/PacketMath.h:879
EIGEN_STRONG_INLINE Packet4i pmul< Packet4i >(const Packet4i &a, const Packet4i &b)
Definition: AltiVec/PacketMath.h:1166
EIGEN_STRONG_INLINE Packet2d print< Packet2d >(const Packet2d &a)
Definition: LSX/PacketMath.h:2745
EIGEN_STRONG_INLINE Packet pset1_size4(const __UNPACK_TYPE__(Packet) &from)
Definition: AltiVec/PacketMath.h:755
EIGEN_ALWAYS_INLINE void pstoreu_partial< unsigned short int >(unsigned short int *to, const Packet8us &from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:1833
static const Packet16uc p16uc_DUPLICATE16_EVEN
Definition: AltiVec/PacketMath.h:102
EIGEN_STRONG_INLINE Packet4i pand< Packet4i >(const Packet4i &a, const Packet4i &b)
Definition: AltiVec/PacketMath.h:1410
EIGEN_ALWAYS_INLINE Packet4f ploadu_partial< Packet4f >(const float *from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:1600
EIGEN_STRONG_INLINE Packet2d pmin< Packet2d >(const Packet2d &a, const Packet2d &b)
Definition: LSX/PacketMath.h:1244
EIGEN_STRONG_INLINE Packet16uc ploaddup< Packet16uc >(const unsigned char *from)
Definition: AltiVec/PacketMath.h:1704
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void pscatter< unsigned short int, Packet8us >(unsigned short int *to, const Packet8us &from, Index stride)
Definition: AltiVec/PacketMath.h:970
EIGEN_STRONG_INLINE Packet4f pselect(const Packet4f &mask, const Packet4f &a, const Packet4f &b)
Definition: AltiVec/PacketMath.h:1474
EIGEN_STRONG_INLINE int predux< Packet4i >(const Packet4i &a)
Definition: AltiVec/PacketMath.h:2445
static Packet2d p2d_COUNTDOWN
Definition: ZVector/PacketMath.h:109
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Packet pfrexp_generic(const Packet &a, Packet &exponent)
Definition: GenericPacketMathFunctions.h:184
EIGEN_STRONG_INLINE Packet4f pand< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition: AltiVec/PacketMath.h:1406
EIGEN_STRONG_INLINE Packet16c ploadquad< Packet16c >(const signed char *from)
Definition: AltiVec/PacketMath.h:1714
static Packet16uc p16uc_PSET32_WODD
Definition: AltiVec/PacketMath.h:129
EIGEN_DEVICE_FUNC Packet psub(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:337
EIGEN_ALWAYS_INLINE Packet8bf pload_ignore< Packet8bf >(const bfloat16 *from)
Definition: AltiVec/PacketMath.h:548
EIGEN_STRONG_INLINE void pstoreu< short int >(short int *to, const Packet8s &from)
Definition: AltiVec/PacketMath.h:1764
EIGEN_STRONG_INLINE bfloat16 predux_min< Packet8bf >(const Packet8bf &a)
Definition: AltiVec/PacketMath.h:2609
EIGEN_ALWAYS_INLINE Packet8us pload_partial< Packet8us >(const unsigned short int *from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:608
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet4i pgather< int, Packet4i >(const int *from, Index stride)
Definition: AltiVec/PacketMath.h:858
static Packet16uc p16uc_PSET64_LO
Definition: AltiVec/PacketMath.h:141
EIGEN_ALWAYS_INLINE Packet16uc ploadu_partial< Packet16uc >(const unsigned char *from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:1625
EIGEN_STRONG_INLINE int predux_max< Packet4i >(const Packet4i &a)
Definition: AltiVec/PacketMath.h:2684
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void pscatter< bfloat16, Packet8bf >(bfloat16 *to, const Packet8bf &from, Index stride)
Definition: AltiVec/PacketMath.h:977
EIGEN_STRONG_INLINE Packet8us pset1< Packet8us >(const unsigned short int &from)
Definition: AltiVec/PacketMath.h:788
static Packet16uc p16uc_COMPLEX32_REV
Definition: AltiVec/PacketMath.h:148
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet2d pgather< double, Packet2d >(const double *from, Index stride)
Definition: LSX/PacketMath.h:1621
EIGEN_STRONG_INLINE Packet16c ploaddup< Packet16c >(const signed char *from)
Definition: AltiVec/PacketMath.h:1694
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void pscatter< signed char, Packet16c >(signed char *to, const Packet16c &from, Index stride)
Definition: AltiVec/PacketMath.h:983
EIGEN_STRONG_INLINE unsigned short int pfirst< Packet8us >(const Packet8us &a)
Definition: AltiVec/PacketMath.h:1888
EIGEN_STRONG_INLINE Packet4i pmax< Packet4i >(const Packet4i &a, const Packet4i &b)
Definition: AltiVec/PacketMath.h:1293
static Packet16uc p16uc_QUADRUPLICATE16_HI
Definition: AltiVec/PacketMath.h:105
EIGEN_STRONG_INLINE Packet8bf ploadquad< Packet8bf >(const bfloat16 *from)
Definition: AltiVec/PacketMath.h:1689
EIGEN_STRONG_INLINE void pbroadcast4< Packet4f >(const float *a, Packet4f &a0, Packet4f &a1, Packet4f &a2, Packet4f &a3)
Definition: AltiVec/PacketMath.h:823
EIGEN_STRONG_INLINE signed char predux< Packet16c >(const Packet16c &a)
Definition: AltiVec/PacketMath.h:2510
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet plog_float(const Packet _x)
Definition: GenericPacketMathFunctions.h:352
EIGEN_STRONG_INLINE unsigned short int predux_mul< Packet8us >(const Packet8us &a)
Definition: AltiVec/PacketMath.h:2547
EIGEN_STRONG_INLINE Packet16c padd< Packet16c >(const Packet16c &a, const Packet16c &b)
Definition: AltiVec/PacketMath.h:1086
static const Packet16uc p16uc_DUPLICATE16_ODD
Definition: AltiVec/PacketMath.h:103
EIGEN_STRONG_INLINE unsigned char predux_min< Packet16uc >(const Packet16uc &a)
Definition: AltiVec/PacketMath.h:2659
EIGEN_STRONG_INLINE short int predux< Packet8s >(const Packet8s &a)
Definition: AltiVec/PacketMath.h:2478
EIGEN_STRONG_INLINE void pbroadcast4_common(const __UNPACK_TYPE__(Packet) *a, Packet &a0, Packet &a1, Packet &a2, Packet &a3)
Definition: AltiVec/PacketMath.h:813
EIGEN_ALWAYS_INLINE Packet ploadu_partial_common(const __UNPACK_TYPE__(Packet) *from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:1562
EIGEN_ALWAYS_INLINE void pstore_partial< float >(float *to, const Packet4f &from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:715
EIGEN_STRONG_INLINE Packet2d pset1frombits< Packet2d >(uint64_t from)
Definition: LSX/PacketMath.h:513
EIGEN_STRONG_INLINE Packet4i pload< Packet4i >(const int *from)
Definition: AltiVec/PacketMath.h:497
EIGEN_ALWAYS_INLINE Packet8s ploadu_partial< Packet8s >(const short int *from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:1608
__vector float Packet4f
Definition: AltiVec/PacketMath.h:33
EIGEN_STRONG_INLINE Packet2d psub< Packet2d >(const Packet2d &a, const Packet2d &b)
Definition: LSX/PacketMath.h:646
EIGEN_STRONG_INLINE Packet4f psub< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition: AltiVec/PacketMath.h:1095
EIGEN_STRONG_INLINE Packet8s psub< Packet8s >(const Packet8s &a, const Packet8s &b)
Definition: AltiVec/PacketMath.h:1103
static Packet4f p4f_COUNTDOWN
Definition: AltiVec/PacketMath.h:87
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet generic_exp2(const Packet &_x)
Definition: GenericPacketMathFunctions.h:2384
EIGEN_STRONG_INLINE Packet8bf pxor< Packet8bf >(const Packet8bf &a, const Packet8bf &b)
Definition: AltiVec/PacketMath.h:1460
EIGEN_STRONG_INLINE Packet4f plset< Packet4f >(const float &a)
Definition: AltiVec/PacketMath.h:1041
EIGEN_ALWAYS_INLINE Packet8us ploadu_partial< Packet8us >(const unsigned short int *from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:1612
EIGEN_ALWAYS_INLINE Packet16c ploadu_partial< Packet16c >(const signed char *from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:1621
EIGEN_STRONG_INLINE Packet8bf por< Packet8bf >(const Packet8bf &a, const Packet8bf &b)
Definition: AltiVec/PacketMath.h:1443
EIGEN_STRONG_INLINE Packet8s ploadquad< Packet8s >(const short int *from)
Definition: AltiVec/PacketMath.h:1669
EIGEN_STRONG_INLINE Packet8bf F32ToBf16(Packet4f p4f)
Definition: AltiVec/PacketMath.h:2059
EIGEN_STRONG_INLINE void pstoreu< float >(float *to, const Packet4f &from)
Definition: AltiVec/PacketMath.h:1756
EIGEN_STRONG_INLINE Packet2d pmax< Packet2d >(const Packet2d &a, const Packet2d &b)
Definition: LSX/PacketMath.h:1256
EIGEN_STRONG_INLINE Packet4f pround< Packet4f >(const Packet4f &a)
Definition: AltiVec/PacketMath.h:1479
EIGEN_STRONG_INLINE Packet4f pcmp_lt_or_nan(const Packet4f &a, const Packet4f &b)
Definition: AltiVec/PacketMath.h:1329
EIGEN_STRONG_INLINE Packet8bf ploadu< Packet8bf >(const bfloat16 *from)
Definition: AltiVec/PacketMath.h:1549
EIGEN_STRONG_INLINE Packet16c pset1< Packet16c >(const signed char &from)
Definition: AltiVec/PacketMath.h:793
EIGEN_STRONG_INLINE Packet8bf pmax< Packet8bf >(const Packet8bf &a, const Packet8bf &b)
Definition: AltiVec/PacketMath.h:2396
EIGEN_STRONG_INLINE Packet2d pround< Packet2d >(const Packet2d &a)
Definition: MSA/PacketMath.h:1206
EIGEN_STRONG_INLINE Packet8bf pset1< Packet8bf >(const bfloat16 &from)
Definition: AltiVec/PacketMath.h:808
EIGEN_STRONG_INLINE void prefetch< int >(const int *addr)
Definition: AltiVec/PacketMath.h:1858
EIGEN_STRONG_INLINE bfloat16 predux_max< Packet8bf >(const Packet8bf &a)
Definition: AltiVec/PacketMath.h:2689
EIGEN_STRONG_INLINE double pfirst< Packet2d >(const Packet2d &a)
Definition: LSX/PacketMath.h:1879
EIGEN_ALWAYS_INLINE Packet8bf Bf16PackHigh(Packet4f hi, Packet4f lo)
Definition: AltiVec/PacketMath.h:2154
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void pscatter_partial< unsigned short int, Packet8us >(unsigned short int *to, const Packet8us &from, Index stride, const Index n)
Definition: AltiVec/PacketMath.h:1013
EIGEN_STRONG_INLINE unsigned char predux_mul< Packet16uc >(const Packet16uc &a)
Definition: AltiVec/PacketMath.h:2578
EIGEN_ALWAYS_INLINE Packet pload_partial_common(const __UNPACK_TYPE__(Packet) *from, const Index n, const Index offset)
Definition: AltiVec/PacketMath.h:553
eigen_packet_wrapper< __m128i, 7 > Packet2ul
Definition: LSX/PacketMath.h:45
EIGEN_STRONG_INLINE Packet16c pmul< Packet16c >(const Packet16c &a, const Packet16c &b)
Definition: AltiVec/PacketMath.h:1178
EIGEN_STRONG_INLINE Packet8us ploadquad< Packet8us >(const unsigned short int *from)
Definition: AltiVec/PacketMath.h:1679
EIGEN_STRONG_INLINE Packet4f print< Packet4f >(const Packet4f &a)
Definition: LSX/PacketMath.h:2711
EIGEN_STRONG_INLINE Packet2d pfloor< Packet2d >(const Packet2d &a)
Definition: MSA/PacketMath.h:1167
EIGEN_STRONG_INLINE void pbroadcast4< Packet4i >(const int *a, Packet4i &a0, Packet4i &a1, Packet4i &a2, Packet4i &a3)
Definition: AltiVec/PacketMath.h:827
EIGEN_STRONG_INLINE float predux_min< Packet4f >(const Packet4f &a)
Definition: AltiVec/PacketMath.h:2599
EIGEN_STRONG_INLINE Packet8bf psin< Packet8bf >(const Packet8bf &a)
Definition: AltiVec/PacketMath.h:2344
EIGEN_STRONG_INLINE void prefetch< double >(const double *addr)
Definition: AVX/PacketMath.h:1750
static Packet16uc p16uc_DUPLICATE32_HI
Definition: ZVector/PacketMath.h:113
EIGEN_STRONG_INLINE Packet pload_common(const __UNPACK_TYPE__(Packet) *from)
Definition: AltiVec/PacketMath.h:478
EIGEN_STRONG_INLINE Packet4f pmax< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition: AltiVec/PacketMath.h:1282
static Packet16uc p16uc_TRANSPOSE64_HI
Definition: AltiVec/PacketMath.h:143
std::int64_t int64_t
Definition: Meta.h:43
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
auto run(Kernel kernel, Args &&... args) -> decltype(kernel(args...))
Definition: gpu_test_helper.h:414
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
const Product< Lhs, Rhs > prod(const Lhs &lhs, const Rhs &rhs)
Definition: evaluators.cpp:7
r
Definition: UniformPSDSelfTest.py:20
int c
Definition: calibrate.py:100
Definition: Eigen_Colamd.h:49
list x
Definition: plotDoE.py:28
t
Definition: plotPSD.py:36
Definition: BFloat16.h:101
Definition: GenericPacketMath.h:1407
Packet packet[N]
Definition: GenericPacketMath.h:1408
Definition: GenericPacketMath.h:1421
bool select[N]
Definition: GenericPacketMath.h:1422
Definition: GenericPacketMath.h:45
@ HasASin
Definition: GenericPacketMath.h:84
@ HasATanh
Definition: GenericPacketMath.h:87
@ HasRsqrt
Definition: GenericPacketMath.h:74
@ HasSin
Definition: GenericPacketMath.h:81
@ HasBlend
Definition: GenericPacketMath.h:66
@ HasErfc
Definition: GenericPacketMath.h:96
@ HasACos
Definition: GenericPacketMath.h:85
@ HasCos
Definition: GenericPacketMath.h:82
@ HasCmp
Definition: GenericPacketMath.h:69
@ HasShift
Definition: GenericPacketMath.h:50
@ HasExp
Definition: GenericPacketMath.h:75
@ HasSqrt
Definition: GenericPacketMath.h:73
@ HasErf
Definition: GenericPacketMath.h:95
@ HasLog
Definition: GenericPacketMath.h:77
@ HasTanh
Definition: GenericPacketMath.h:90
@ HasATan
Definition: GenericPacketMath.h:86
@ HasDiv
Definition: GenericPacketMath.h:71
Definition: GenericPacketMath.h:225
T m_val
Definition: GenericPacketMath.h:235
Packet8bf half
Definition: AltiVec/PacketMath.h:210
Packet8bf type
Definition: AltiVec/PacketMath.h:209
Packet4f type
Definition: AltiVec/PacketMath.h:165
Packet4f half
Definition: AltiVec/PacketMath.h:166
Packet4i type
Definition: AltiVec/PacketMath.h:247
Packet4i half
Definition: AltiVec/PacketMath.h:248
Packet8s type
Definition: AltiVec/PacketMath.h:270
Packet8s half
Definition: AltiVec/PacketMath.h:271
Packet16c type
Definition: AltiVec/PacketMath.h:306
Packet16c half
Definition: AltiVec/PacketMath.h:307
Packet16uc half
Definition: AltiVec/PacketMath.h:325
Packet16uc type
Definition: AltiVec/PacketMath.h:324
Packet8us half
Definition: AltiVec/PacketMath.h:289
Packet8us type
Definition: AltiVec/PacketMath.h:288
Definition: GenericPacketMath.h:108
T type
Definition: GenericPacketMath.h:109
@ size
Definition: GenericPacketMath.h:113
@ AlignedOnScalar
Definition: GenericPacketMath.h:114
@ Vectorizable
Definition: GenericPacketMath.h:112
T half
Definition: GenericPacketMath.h:110
@ HasSub
Definition: GenericPacketMath.h:118
@ HasMax
Definition: GenericPacketMath.h:124
@ HasNegate
Definition: GenericPacketMath.h:120
@ HasMul
Definition: GenericPacketMath.h:119
@ HasAdd
Definition: GenericPacketMath.h:117
@ HasMin
Definition: GenericPacketMath.h:123
@ HasAbs
Definition: GenericPacketMath.h:121
signed char type
Definition: AltiVec/PacketMath.h:392
Packet16c half
Definition: AltiVec/PacketMath.h:393
Packet16uc half
Definition: AltiVec/PacketMath.h:405
unsigned char type
Definition: AltiVec/PacketMath.h:404
Packet4i integer_packet
Definition: AltiVec/PacketMath.h:344
Packet4f half
Definition: AltiVec/PacketMath.h:343
float type
Definition: AltiVec/PacketMath.h:342
int type
Definition: AltiVec/PacketMath.h:355
Packet4i half
Definition: AltiVec/PacketMath.h:356
Packet8bf half
Definition: AltiVec/PacketMath.h:418
bfloat16 type
Definition: AltiVec/PacketMath.h:417
Packet8s half
Definition: AltiVec/PacketMath.h:368
short int type
Definition: AltiVec/PacketMath.h:367
unsigned short int type
Definition: AltiVec/PacketMath.h:379
Packet8us half
Definition: AltiVec/PacketMath.h:380
Definition: GenericPacketMath.h:134
numext::get_integer_by_size< sizeof(T)>::signed_type integer_packet
Definition: GenericPacketMath.h:137
T type
Definition: GenericPacketMath.h:135
T half
Definition: GenericPacketMath.h:136
@ masked_load_available
Definition: GenericPacketMath.h:142
@ size
Definition: GenericPacketMath.h:139
@ masked_store_available
Definition: GenericPacketMath.h:143
@ vectorizable
Definition: GenericPacketMath.h:141
@ alignment
Definition: GenericPacketMath.h:140
std::ofstream out("Result.txt")
void run(const string &dir_name, LinearSolver *linear_solver_pt, const unsigned nel_1d, bool mess_up_order)
Definition: two_d_poisson_compare_solvers.cc:317
Definition: ZVector/PacketMath.h:50