TR-mbed 1.0
Loading...
Searching...
No Matches
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) 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_ZVECTOR_H
11#define EIGEN_PACKET_MATH_ZVECTOR_H
12
13namespace Eigen {
14
15namespace internal {
16
17#ifndef EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD
18#define EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 16
19#endif
20
21#ifndef EIGEN_HAS_SINGLE_INSTRUCTION_MADD
22#define EIGEN_HAS_SINGLE_INSTRUCTION_MADD
23#endif
24
25#ifndef EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS
26#define EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS 32
27#endif
28
29typedef __vector int Packet4i;
30typedef __vector unsigned int Packet4ui;
31typedef __vector __bool int Packet4bi;
32typedef __vector short int Packet8i;
33typedef __vector unsigned char Packet16uc;
34typedef __vector double Packet2d;
35typedef __vector unsigned long long Packet2ul;
36typedef __vector long long Packet2l;
37
38// Z14 has builtin support for float vectors
39#if !defined(__ARCH__) || (defined(__ARCH__) && __ARCH__ >= 12)
40typedef __vector float Packet4f;
41#else
42typedef struct {
43 Packet2d v4f[2];
44} Packet4f;
45#endif
46
47typedef union {
52 double d[2];
53 float f[4];
59#if !defined(__ARCH__) || (defined(__ARCH__) && __ARCH__ >= 12)
61#endif
62} Packet;
63
64// We don't want to write the same code all the time, but we need to reuse the constants
65// and it doesn't really work to declare them global, so we define macros instead
66
67#define _EIGEN_DECLARE_CONST_FAST_Packet4i(NAME,X) \
68 Packet4i p4i_##NAME = reinterpret_cast<Packet4i>(vec_splat_s32(X))
69
70#define _EIGEN_DECLARE_CONST_FAST_Packet2d(NAME,X) \
71 Packet2d p2d_##NAME = reinterpret_cast<Packet2d>(vec_splat_s64(X))
72
73#define _EIGEN_DECLARE_CONST_FAST_Packet2l(NAME,X) \
74 Packet2l p2l_##NAME = reinterpret_cast<Packet2l>(vec_splat_s64(X))
75
76#define _EIGEN_DECLARE_CONST_Packet4i(NAME,X) \
77 Packet4i p4i_##NAME = pset1<Packet4i>(X)
78
79#define _EIGEN_DECLARE_CONST_Packet2d(NAME,X) \
80 Packet2d p2d_##NAME = pset1<Packet2d>(X)
81
82#define _EIGEN_DECLARE_CONST_Packet2l(NAME,X) \
83 Packet2l p2l_##NAME = pset1<Packet2l>(X)
84
85// These constants are endian-agnostic
86static _EIGEN_DECLARE_CONST_FAST_Packet4i(ZERO, 0); //{ 0, 0, 0, 0,}
87static _EIGEN_DECLARE_CONST_FAST_Packet4i(ONE, 1); //{ 1, 1, 1, 1}
88
92
93static Packet2d p2d_ONE = { 1.0, 1.0 };
94static Packet2d p2d_ZERO_ = { numext::bit_cast<double>0x8000000000000000ull),
95 numext::bit_cast<double>0x8000000000000000ull) };
96
97#if !defined(__ARCH__) || (defined(__ARCH__) && __ARCH__ >= 12)
98#define _EIGEN_DECLARE_CONST_FAST_Packet4f(NAME,X) \
99 Packet4f p4f_##NAME = reinterpret_cast<Packet4f>(vec_splat_s32(X))
100
101#define _EIGEN_DECLARE_CONST_Packet4f(NAME,X) \
102 Packet4f p4f_##NAME = pset1<Packet4f>(X)
103
104#define _EIGEN_DECLARE_CONST_Packet4f_FROM_INT(NAME,X) \
105 const Packet4f p4f_##NAME = reinterpret_cast<Packet4f>(pset1<Packet4i>(X))
106
107static _EIGEN_DECLARE_CONST_FAST_Packet4f(ZERO, 0); //{ 0.0, 0.0, 0.0, 0.0}
108static _EIGEN_DECLARE_CONST_FAST_Packet4i(MINUS1,-1); //{ -1, -1, -1, -1}
109static Packet4f p4f_MZERO = { 0x80000000, 0x80000000, 0x80000000, 0x80000000};
110#endif
111
112static Packet4i p4i_COUNTDOWN = { 0, 1, 2, 3 };
113static Packet4f p4f_COUNTDOWN = { 0.0, 1.0, 2.0, 3.0 };
114static Packet2d p2d_COUNTDOWN = reinterpret_cast<Packet2d>(vec_sld(reinterpret_cast<Packet16uc>(p2d_ZERO), reinterpret_cast<Packet16uc>(p2d_ONE), 8));
115
116static Packet16uc p16uc_PSET64_HI = { 0,1,2,3, 4,5,6,7, 0,1,2,3, 4,5,6,7 };
117static Packet16uc p16uc_DUPLICATE32_HI = { 0,1,2,3, 0,1,2,3, 4,5,6,7, 4,5,6,7 };
118
119// Mask alignment
120#define _EIGEN_MASK_ALIGNMENT 0xfffffffffffffff0
121
122#define _EIGEN_ALIGNED_PTR(x) ((std::ptrdiff_t)(x) & _EIGEN_MASK_ALIGNMENT)
123
124// Handle endianness properly while loading constants
125// Define global static constants:
126
127static Packet16uc p16uc_FORWARD = { 0,1,2,3, 4,5,6,7, 8,9,10,11, 12,13,14,15 };
128static Packet16uc p16uc_REVERSE32 = { 12,13,14,15, 8,9,10,11, 4,5,6,7, 0,1,2,3 };
129static Packet16uc p16uc_REVERSE64 = { 8,9,10,11, 12,13,14,15, 0,1,2,3, 4,5,6,7 };
130
131static Packet16uc p16uc_PSET32_WODD = vec_sld((Packet16uc) vec_splat((Packet4ui)p16uc_FORWARD, 0), (Packet16uc) vec_splat((Packet4ui)p16uc_FORWARD, 2), 8);//{ 0,1,2,3, 0,1,2,3, 8,9,10,11, 8,9,10,11 };
132static Packet16uc p16uc_PSET32_WEVEN = vec_sld(p16uc_DUPLICATE32_HI, (Packet16uc) vec_splat((Packet4ui)p16uc_FORWARD, 3), 8);//{ 4,5,6,7, 4,5,6,7, 12,13,14,15, 12,13,14,15 };
133/*static Packet16uc p16uc_HALF64_0_16 = vec_sld((Packet16uc)p4i_ZERO, vec_splat((Packet16uc) vec_abs(p4i_MINUS16), 3), 8); //{ 0,0,0,0, 0,0,0,0, 16,16,16,16, 16,16,16,16};
134
135static Packet16uc p16uc_PSET64_HI = (Packet16uc) vec_mergeh((Packet4ui)p16uc_PSET32_WODD, (Packet4ui)p16uc_PSET32_WEVEN); //{ 0,1,2,3, 4,5,6,7, 0,1,2,3, 4,5,6,7 };*/
136static Packet16uc p16uc_PSET64_LO = (Packet16uc) vec_mergel((Packet4ui)p16uc_PSET32_WODD, (Packet4ui)p16uc_PSET32_WEVEN); //{ 8,9,10,11, 12,13,14,15, 8,9,10,11, 12,13,14,15 };
137/*static Packet16uc p16uc_TRANSPOSE64_HI = vec_add(p16uc_PSET64_HI, p16uc_HALF64_0_16); //{ 0,1,2,3, 4,5,6,7, 16,17,18,19, 20,21,22,23};
138static Packet16uc p16uc_TRANSPOSE64_LO = vec_add(p16uc_PSET64_LO, p16uc_HALF64_0_16); //{ 8,9,10,11, 12,13,14,15, 24,25,26,27, 28,29,30,31};*/
139static Packet16uc p16uc_TRANSPOSE64_HI = { 0,1,2,3, 4,5,6,7, 16,17,18,19, 20,21,22,23};
140static Packet16uc p16uc_TRANSPOSE64_LO = { 8,9,10,11, 12,13,14,15, 24,25,26,27, 28,29,30,31};
141
142static Packet16uc p16uc_COMPLEX32_REV = vec_sld(p16uc_REVERSE32, p16uc_REVERSE32, 8); //{ 4,5,6,7, 0,1,2,3, 12,13,14,15, 8,9,10,11 };
143
144static Packet16uc p16uc_COMPLEX32_REV2 = vec_sld(p16uc_FORWARD, p16uc_FORWARD, 8); //{ 8,9,10,11, 12,13,14,15, 0,1,2,3, 4,5,6,7 };
145
146
147#if EIGEN_HAS_BUILTIN(__builtin_prefetch) || EIGEN_COMP_GNUC
148 #define EIGEN_ZVECTOR_PREFETCH(ADDR) __builtin_prefetch(ADDR);
149#else
150 #define EIGEN_ZVECTOR_PREFETCH(ADDR) asm( " pfd [%[addr]]\n" :: [addr] "r" (ADDR) : "cc" );
151#endif
152
153template<> struct packet_traits<int> : default_packet_traits
154{
155 typedef Packet4i type;
156 typedef Packet4i half;
157 enum {
158 Vectorizable = 1,
159 AlignedOnScalar = 1,
160 size = 4,
161 HasHalfPacket = 0,
162
163 HasAdd = 1,
164 HasSub = 1,
165 HasMul = 1,
166 HasDiv = 1,
167 HasBlend = 1
168 };
169};
170
171template <>
172struct packet_traits<float> : default_packet_traits {
173 typedef Packet4f type;
174 typedef Packet4f half;
175 enum {
176 Vectorizable = 1,
177 AlignedOnScalar = 1,
178 size = 4,
179 HasHalfPacket = 0,
180
181 HasAdd = 1,
182 HasSub = 1,
183 HasMul = 1,
184 HasDiv = 1,
185 HasMin = 1,
186 HasMax = 1,
187 HasAbs = 1,
188 HasSin = 0,
189 HasCos = 0,
190 HasLog = 0,
191 HasExp = 1,
192 HasSqrt = 1,
193 HasRsqrt = 1,
194 HasTanh = 1,
195 HasErf = 1,
196 HasRound = 1,
197 HasFloor = 1,
198 HasCeil = 1,
199 HasNegate = 1,
200 HasBlend = 1
201 };
202};
203
204template<> struct packet_traits<double> : default_packet_traits
205{
206 typedef Packet2d type;
207 typedef Packet2d half;
208 enum {
209 Vectorizable = 1,
210 AlignedOnScalar = 1,
211 size=2,
212 HasHalfPacket = 1,
213
217 HasDiv = 1,
223 HasLog = 0,
224 HasExp = 1,
225 HasSqrt = 1,
226 HasRsqrt = 1,
227 HasRound = 1,
228 HasFloor = 1,
229 HasCeil = 1,
231 HasBlend = 1
232 };
233};
234
235template<> struct unpacket_traits<Packet4i> { typedef int type; enum {size=4, alignment=Aligned16, vectorizable=true, masked_load_available=false, masked_store_available=false}; typedef Packet4i half; };
236template<> struct unpacket_traits<Packet4f> { typedef float type; enum {size=4, alignment=Aligned16, vectorizable=true, masked_load_available=false, masked_store_available=false}; typedef Packet4f half; };
237template<> struct unpacket_traits<Packet2d> { typedef double type; enum {size=2, alignment=Aligned16, vectorizable=true, masked_load_available=false, masked_store_available=false}; typedef Packet2d half; };
238
239/* Forward declaration */
241
242inline std::ostream & operator <<(std::ostream & s, const Packet4i & v)
243{
244 Packet vt;
245 vt.v4i = v;
246 s << vt.i[0] << ", " << vt.i[1] << ", " << vt.i[2] << ", " << vt.i[3];
247 return s;
248}
249
250inline std::ostream & operator <<(std::ostream & s, const Packet4ui & v)
251{
252 Packet vt;
253 vt.v4ui = v;
254 s << vt.ui[0] << ", " << vt.ui[1] << ", " << vt.ui[2] << ", " << vt.ui[3];
255 return s;
256}
257
258inline std::ostream & operator <<(std::ostream & s, const Packet2l & v)
259{
260 Packet vt;
261 vt.v2l = v;
262 s << vt.l[0] << ", " << vt.l[1];
263 return s;
264}
265
266inline std::ostream & operator <<(std::ostream & s, const Packet2ul & v)
267{
268 Packet vt;
269 vt.v2ul = v;
270 s << vt.ul[0] << ", " << vt.ul[1] ;
271 return s;
272}
273
274inline std::ostream & operator <<(std::ostream & s, const Packet2d & v)
275{
276 Packet vt;
277 vt.v2d = v;
278 s << vt.d[0] << ", " << vt.d[1];
279 return s;
280}
281
282#if !defined(__ARCH__) || (defined(__ARCH__) && __ARCH__ >= 12)
283inline std::ostream & operator <<(std::ostream & s, const Packet4f & v)
284{
285 Packet vt;
286 vt.v4f = v;
287 s << vt.f[0] << ", " << vt.f[1] << ", " << vt.f[2] << ", " << vt.f[3];
288 return s;
289}
290#endif
291
293{
294 // FIXME: No intrinsic yet
296 Packet *vfrom;
297 vfrom = (Packet *) from;
298 return vfrom->v4i;
299}
300
302{
303 // FIXME: No intrinsic yet
305 Packet *vfrom;
306 vfrom = (Packet *) from;
307 return vfrom->v2d;
308}
309
310template<> EIGEN_STRONG_INLINE void pstore<int>(int* to, const Packet4i& from)
311{
312 // FIXME: No intrinsic yet
314 Packet *vto;
315 vto = (Packet *) to;
316 vto->v4i = from;
317}
318
319template<> EIGEN_STRONG_INLINE void pstore<double>(double* to, const Packet2d& from)
320{
321 // FIXME: No intrinsic yet
323 Packet *vto;
324 vto = (Packet *) to;
325 vto->v2d = from;
326}
327
329{
330 return vec_splats(from);
331}
333 return vec_splats(from);
334}
335
336template<> EIGEN_STRONG_INLINE void
337pbroadcast4<Packet4i>(const int *a,
339{
341 a0 = vec_splat(a3, 0);
342 a1 = vec_splat(a3, 1);
343 a2 = vec_splat(a3, 2);
344 a3 = vec_splat(a3, 3);
345}
346
347template<> EIGEN_STRONG_INLINE void
348pbroadcast4<Packet2d>(const double *a,
350{
352 a0 = vec_splat(a1, 0);
353 a1 = vec_splat(a1, 1);
354 a3 = pload<Packet2d>(a+2);
355 a2 = vec_splat(a3, 0);
356 a3 = vec_splat(a3, 1);
357}
358
359template<> EIGEN_DEVICE_FUNC inline Packet4i pgather<int, Packet4i>(const int* from, Index stride)
360{
361 int EIGEN_ALIGN16 ai[4];
362 ai[0] = from[0*stride];
363 ai[1] = from[1*stride];
364 ai[2] = from[2*stride];
365 ai[3] = from[3*stride];
366 return pload<Packet4i>(ai);
367}
368
369template<> EIGEN_DEVICE_FUNC inline Packet2d pgather<double, Packet2d>(const double* from, Index stride)
370{
371 double EIGEN_ALIGN16 af[2];
372 af[0] = from[0*stride];
373 af[1] = from[1*stride];
374 return pload<Packet2d>(af);
375}
376
377template<> EIGEN_DEVICE_FUNC inline void pscatter<int, Packet4i>(int* to, const Packet4i& from, Index stride)
378{
379 int EIGEN_ALIGN16 ai[4];
380 pstore<int>((int *)ai, from);
381 to[0*stride] = ai[0];
382 to[1*stride] = ai[1];
383 to[2*stride] = ai[2];
384 to[3*stride] = ai[3];
385}
386
387template<> EIGEN_DEVICE_FUNC inline void pscatter<double, Packet2d>(double* to, const Packet2d& from, Index stride)
388{
389 double EIGEN_ALIGN16 af[2];
391 to[0*stride] = af[0];
392 to[1*stride] = af[1];
393}
394
395template<> EIGEN_STRONG_INLINE Packet4i padd<Packet4i>(const Packet4i& a, const Packet4i& b) { return (a + b); }
396template<> EIGEN_STRONG_INLINE Packet2d padd<Packet2d>(const Packet2d& a, const Packet2d& b) { return (a + b); }
397
398template<> EIGEN_STRONG_INLINE Packet4i psub<Packet4i>(const Packet4i& a, const Packet4i& b) { return (a - b); }
399template<> EIGEN_STRONG_INLINE Packet2d psub<Packet2d>(const Packet2d& a, const Packet2d& b) { return (a - b); }
400
401template<> EIGEN_STRONG_INLINE Packet4i pmul<Packet4i>(const Packet4i& a, const Packet4i& b) { return (a * b); }
402template<> EIGEN_STRONG_INLINE Packet2d pmul<Packet2d>(const Packet2d& a, const Packet2d& b) { return (a * b); }
403
404template<> EIGEN_STRONG_INLINE Packet4i pdiv<Packet4i>(const Packet4i& a, const Packet4i& b) { return (a / b); }
405template<> EIGEN_STRONG_INLINE Packet2d pdiv<Packet2d>(const Packet2d& a, const Packet2d& b) { return (a / b); }
406
407template<> EIGEN_STRONG_INLINE Packet4i pnegate(const Packet4i& a) { return (-a); }
408template<> EIGEN_STRONG_INLINE Packet2d pnegate(const Packet2d& a) { return (-a); }
409
410template<> EIGEN_STRONG_INLINE Packet4i pconj(const Packet4i& a) { return a; }
411template<> EIGEN_STRONG_INLINE Packet2d pconj(const Packet2d& a) { return a; }
412
413template<> EIGEN_STRONG_INLINE Packet4i pmadd(const Packet4i& a, const Packet4i& b, const Packet4i& c) { return padd<Packet4i>(pmul<Packet4i>(a, b), c); }
414template<> EIGEN_STRONG_INLINE Packet2d pmadd(const Packet2d& a, const Packet2d& b, const Packet2d& c) { return vec_madd(a, b, c); }
415
416template<> EIGEN_STRONG_INLINE Packet4i plset<Packet4i>(const int& a) { return padd<Packet4i>(pset1<Packet4i>(a), p4i_COUNTDOWN); }
417template<> EIGEN_STRONG_INLINE Packet2d plset<Packet2d>(const double& a) { return padd<Packet2d>(pset1<Packet2d>(a), p2d_COUNTDOWN); }
418
419template<> EIGEN_STRONG_INLINE Packet4i pmin<Packet4i>(const Packet4i& a, const Packet4i& b) { return vec_min(a, b); }
420template<> EIGEN_STRONG_INLINE Packet2d pmin<Packet2d>(const Packet2d& a, const Packet2d& b) { return vec_min(a, b); }
421
422template<> EIGEN_STRONG_INLINE Packet4i pmax<Packet4i>(const Packet4i& a, const Packet4i& b) { return vec_max(a, b); }
423template<> EIGEN_STRONG_INLINE Packet2d pmax<Packet2d>(const Packet2d& a, const Packet2d& b) { return vec_max(a, b); }
424
425template<> EIGEN_STRONG_INLINE Packet4i pand<Packet4i>(const Packet4i& a, const Packet4i& b) { return vec_and(a, b); }
426template<> EIGEN_STRONG_INLINE Packet2d pand<Packet2d>(const Packet2d& a, const Packet2d& b) { return vec_and(a, b); }
427
428template<> EIGEN_STRONG_INLINE Packet4i por<Packet4i>(const Packet4i& a, const Packet4i& b) { return vec_or(a, b); }
429template<> EIGEN_STRONG_INLINE Packet2d por<Packet2d>(const Packet2d& a, const Packet2d& b) { return vec_or(a, b); }
430
431template<> EIGEN_STRONG_INLINE Packet4i pxor<Packet4i>(const Packet4i& a, const Packet4i& b) { return vec_xor(a, b); }
432template<> EIGEN_STRONG_INLINE Packet2d pxor<Packet2d>(const Packet2d& a, const Packet2d& b) { return vec_xor(a, b); }
433
436
440
443
444
446{
448 return vec_perm(p, p, p16uc_DUPLICATE32_HI);
449}
450
452{
454 return vec_perm(p, p, p16uc_PSET64_HI);
455}
456
457template<> EIGEN_STRONG_INLINE void pstoreu<int>(int* to, const Packet4i& from) { pstore<int>(to, from); }
459
462
463template<> EIGEN_STRONG_INLINE int pfirst<Packet4i>(const Packet4i& a) { int EIGEN_ALIGN16 x[4]; pstore(x, a); return x[0]; }
464template<> EIGEN_STRONG_INLINE double pfirst<Packet2d>(const Packet2d& a) { double EIGEN_ALIGN16 x[2]; pstore(x, a); return x[0]; }
465
467{
468 return reinterpret_cast<Packet4i>(vec_perm(reinterpret_cast<Packet16uc>(a), reinterpret_cast<Packet16uc>(a), p16uc_REVERSE32));
469}
470
472{
473 return reinterpret_cast<Packet2d>(vec_perm(reinterpret_cast<Packet16uc>(a), reinterpret_cast<Packet16uc>(a), p16uc_REVERSE64));
474}
475
478
480{
481 Packet4i b, sum;
482 b = vec_sld(a, a, 8);
483 sum = padd<Packet4i>(a, b);
484 b = vec_sld(sum, sum, 4);
485 sum = padd<Packet4i>(sum, b);
486 return pfirst(sum);
487}
488
490{
491 Packet2d b, sum;
492 b = reinterpret_cast<Packet2d>(vec_sld(reinterpret_cast<Packet4i>(a), reinterpret_cast<Packet4i>(a), 8));
493 sum = padd<Packet2d>(a, b);
494 return pfirst(sum);
495}
496
497// Other reduction functions:
498// mul
500{
501 EIGEN_ALIGN16 int aux[4];
502 pstore(aux, a);
503 return aux[0] * aux[1] * aux[2] * aux[3];
504}
505
507{
508 return pfirst(pmul(a, reinterpret_cast<Packet2d>(vec_sld(reinterpret_cast<Packet4i>(a), reinterpret_cast<Packet4i>(a), 8))));
509}
510
511// min
513{
514 Packet4i b, res;
515 b = pmin<Packet4i>(a, vec_sld(a, a, 8));
516 res = pmin<Packet4i>(b, vec_sld(b, b, 4));
517 return pfirst(res);
518}
519
521{
522 return pfirst(pmin<Packet2d>(a, reinterpret_cast<Packet2d>(vec_sld(reinterpret_cast<Packet4i>(a), reinterpret_cast<Packet4i>(a), 8))));
523}
524
525// max
527{
528 Packet4i b, res;
529 b = pmax<Packet4i>(a, vec_sld(a, a, 8));
530 res = pmax<Packet4i>(b, vec_sld(b, b, 4));
531 return pfirst(res);
532}
533
534// max
536{
537 return pfirst(pmax<Packet2d>(a, reinterpret_cast<Packet2d>(vec_sld(reinterpret_cast<Packet4i>(a), reinterpret_cast<Packet4i>(a), 8))));
538}
539
540EIGEN_DEVICE_FUNC inline void
541ptranspose(PacketBlock<Packet4i,4>& kernel) {
542 Packet4i t0 = vec_mergeh(kernel.packet[0], kernel.packet[2]);
543 Packet4i t1 = vec_mergel(kernel.packet[0], kernel.packet[2]);
544 Packet4i t2 = vec_mergeh(kernel.packet[1], kernel.packet[3]);
545 Packet4i t3 = vec_mergel(kernel.packet[1], kernel.packet[3]);
546 kernel.packet[0] = vec_mergeh(t0, t2);
547 kernel.packet[1] = vec_mergel(t0, t2);
548 kernel.packet[2] = vec_mergeh(t1, t3);
549 kernel.packet[3] = vec_mergel(t1, t3);
550}
551
552EIGEN_DEVICE_FUNC inline void
553ptranspose(PacketBlock<Packet2d,2>& kernel) {
554 Packet2d t0 = vec_perm(kernel.packet[0], kernel.packet[1], p16uc_TRANSPOSE64_HI);
555 Packet2d t1 = vec_perm(kernel.packet[0], kernel.packet[1], p16uc_TRANSPOSE64_LO);
556 kernel.packet[0] = t0;
557 kernel.packet[1] = t1;
558}
559
561 Packet4ui select = { ifPacket.select[0], ifPacket.select[1], ifPacket.select[2], ifPacket.select[3] };
562 Packet4ui mask = vec_cmpeq(select, reinterpret_cast<Packet4ui>(p4i_ONE));
563 return vec_sel(elsePacket, thenPacket, mask);
564}
565
566
568 Packet2ul select = { ifPacket.select[0], ifPacket.select[1] };
569 Packet2ul mask = vec_cmpeq(select, reinterpret_cast<Packet2ul>(p2l_ONE));
570 return vec_sel(elsePacket, thenPacket, mask);
571}
572
573/* z13 has no vector float support so we emulate that with double
574 z14 has proper vector float support.
575*/
576#if !defined(__ARCH__) || (defined(__ARCH__) && __ARCH__ < 12)
577/* Helper function to simulate a vec_splat_packet4f
578 */
580{
582 switch (element) {
583 case 0:
584 splat.v4f[0] = vec_splat(from.v4f[0], 0);
585 splat.v4f[1] = splat.v4f[0];
586 break;
587 case 1:
588 splat.v4f[0] = vec_splat(from.v4f[0], 1);
589 splat.v4f[1] = splat.v4f[0];
590 break;
591 case 2:
592 splat.v4f[0] = vec_splat(from.v4f[1], 0);
593 splat.v4f[1] = splat.v4f[0];
594 break;
595 case 3:
596 splat.v4f[0] = vec_splat(from.v4f[1], 1);
597 splat.v4f[1] = splat.v4f[0];
598 break;
599 }
600 return splat;
601}
602
604{
605 // FIXME: No intrinsic yet
608 vfrom.v4f[0] = vec_ld2f(&from[0]);
609 vfrom.v4f[1] = vec_ld2f(&from[2]);
610 return vfrom;
611}
612
613template<> EIGEN_STRONG_INLINE void pstore<float>(float* to, const Packet4f& from)
614{
615 // FIXME: No intrinsic yet
617 vec_st2f(from.v4f[0], &to[0]);
618 vec_st2f(from.v4f[1], &to[2]);
619}
620
622{
623 Packet4f to;
624 to.v4f[0] = pset1<Packet2d>(static_cast<const double&>(from));
625 to.v4f[1] = to.v4f[0];
626 return to;
627}
628
639
640template<> EIGEN_DEVICE_FUNC inline Packet4f pgather<float, Packet4f>(const float* from, Index stride)
641{
642 float EIGEN_ALIGN16 ai[4];
643 ai[0] = from[0*stride];
644 ai[1] = from[1*stride];
645 ai[2] = from[2*stride];
646 ai[3] = from[3*stride];
647 return pload<Packet4f>(ai);
648}
649
650template<> EIGEN_DEVICE_FUNC inline void pscatter<float, Packet4f>(float* to, const Packet4f& from, Index stride)
651{
652 float EIGEN_ALIGN16 ai[4];
653 pstore<float>((float *)ai, from);
654 to[0*stride] = ai[0];
655 to[1*stride] = ai[1];
656 to[2*stride] = ai[2];
657 to[3*stride] = ai[3];
658}
659
661{
662 Packet4f c;
663 c.v4f[0] = a.v4f[0] + b.v4f[0];
664 c.v4f[1] = a.v4f[1] + b.v4f[1];
665 return c;
666}
667
669{
670 Packet4f c;
671 c.v4f[0] = a.v4f[0] - b.v4f[0];
672 c.v4f[1] = a.v4f[1] - b.v4f[1];
673 return c;
674}
675
677{
678 Packet4f c;
679 c.v4f[0] = a.v4f[0] * b.v4f[0];
680 c.v4f[1] = a.v4f[1] * b.v4f[1];
681 return c;
682}
683
685{
686 Packet4f c;
687 c.v4f[0] = a.v4f[0] / b.v4f[0];
688 c.v4f[1] = a.v4f[1] / b.v4f[1];
689 return c;
690}
691
693{
694 Packet4f c;
695 c.v4f[0] = -a.v4f[0];
696 c.v4f[1] = -a.v4f[1];
697 return c;
698}
699
700template<> EIGEN_STRONG_INLINE Packet4f pmadd(const Packet4f& a, const Packet4f& b, const Packet4f& c)
701{
703 res.v4f[0] = vec_madd(a.v4f[0], b.v4f[0], c.v4f[0]);
704 res.v4f[1] = vec_madd(a.v4f[1], b.v4f[1], c.v4f[1]);
705 return res;
706}
707
709{
711 res.v4f[0] = pmin(a.v4f[0], b.v4f[0]);
712 res.v4f[1] = pmin(a.v4f[1], b.v4f[1]);
713 return res;
714}
715
717{
719 res.v4f[0] = pmax(a.v4f[0], b.v4f[0]);
720 res.v4f[1] = pmax(a.v4f[1], b.v4f[1]);
721 return res;
722}
723
725{
727 res.v4f[0] = pand(a.v4f[0], b.v4f[0]);
728 res.v4f[1] = pand(a.v4f[1], b.v4f[1]);
729 return res;
730}
731
733{
735 res.v4f[0] = por(a.v4f[0], b.v4f[0]);
736 res.v4f[1] = por(a.v4f[1], b.v4f[1]);
737 return res;
738}
739
741{
743 res.v4f[0] = pxor(a.v4f[0], b.v4f[0]);
744 res.v4f[1] = pxor(a.v4f[1], b.v4f[1]);
745 return res;
746}
747
749{
751 res.v4f[0] = pandnot(a.v4f[0], b.v4f[0]);
752 res.v4f[1] = pandnot(a.v4f[1], b.v4f[1]);
753 return res;
754}
755
757{
759 res.v4f[0] = vec_round(a.v4f[0]);
760 res.v4f[1] = vec_round(a.v4f[1]);
761 return res;
762}
763
765{
767 res.v4f[0] = vec_ceil(a.v4f[0]);
768 res.v4f[1] = vec_ceil(a.v4f[1]);
769 return res;
770}
771
773{
775 res.v4f[0] = vec_floor(a.v4f[0]);
776 res.v4f[1] = vec_floor(a.v4f[1]);
777 return res;
778}
779
781{
783 p.v4f[1] = vec_splat(p.v4f[0], 1);
784 p.v4f[0] = vec_splat(p.v4f[0], 0);
785 return p;
786}
787
788template<> EIGEN_STRONG_INLINE float pfirst<Packet4f>(const Packet4f& a) { float EIGEN_ALIGN16 x[2]; vec_st2f(a.v4f[0], &x[0]); return x[0]; }
789
791{
793 rev.v4f[0] = preverse<Packet2d>(a.v4f[1]);
794 rev.v4f[1] = preverse<Packet2d>(a.v4f[0]);
795 return rev;
796}
797
799{
801 res.v4f[0] = pabs(a.v4f[0]);
802 res.v4f[1] = pabs(a.v4f[1]);
803 return res;
804}
805
807{
808 Packet2d sum;
809 sum = padd<Packet2d>(a.v4f[0], a.v4f[1]);
810 double first = predux<Packet2d>(sum);
811 return static_cast<float>(first);
812}
813
815{
816 // Return predux_mul<Packet2d> of the subvectors product
817 return static_cast<float>(pfirst(predux_mul(pmul(a.v4f[0], a.v4f[1]))));
818}
819
821{
822 Packet2d b, res;
823 b = pmin<Packet2d>(a.v4f[0], a.v4f[1]);
824 res = pmin<Packet2d>(b, reinterpret_cast<Packet2d>(vec_sld(reinterpret_cast<Packet4i>(b), reinterpret_cast<Packet4i>(b), 8)));
825 return static_cast<float>(pfirst(res));
826}
827
829{
830 Packet2d b, res;
831 b = pmax<Packet2d>(a.v4f[0], a.v4f[1]);
832 res = pmax<Packet2d>(b, reinterpret_cast<Packet2d>(vec_sld(reinterpret_cast<Packet4i>(b), reinterpret_cast<Packet4i>(b), 8)));
833 return static_cast<float>(pfirst(res));
834}
835
836/* Split the Packet4f PacketBlock into 4 Packet2d PacketBlocks and transpose each one
837 */
838EIGEN_DEVICE_FUNC inline void
839ptranspose(PacketBlock<Packet4f,4>& kernel) {
840 PacketBlock<Packet2d,2> t0,t1,t2,t3;
841 // copy top-left 2x2 Packet2d block
842 t0.packet[0] = kernel.packet[0].v4f[0];
843 t0.packet[1] = kernel.packet[1].v4f[0];
844
845 // copy top-right 2x2 Packet2d block
846 t1.packet[0] = kernel.packet[0].v4f[1];
847 t1.packet[1] = kernel.packet[1].v4f[1];
848
849 // copy bottom-left 2x2 Packet2d block
850 t2.packet[0] = kernel.packet[2].v4f[0];
851 t2.packet[1] = kernel.packet[3].v4f[0];
852
853 // copy bottom-right 2x2 Packet2d block
854 t3.packet[0] = kernel.packet[2].v4f[1];
855 t3.packet[1] = kernel.packet[3].v4f[1];
856
857 // Transpose all 2x2 blocks
858 ptranspose(t0);
859 ptranspose(t1);
860 ptranspose(t2);
861 ptranspose(t3);
862
863 // Copy back transposed blocks, but exchange t1 and t2 due to transposition
864 kernel.packet[0].v4f[0] = t0.packet[0];
865 kernel.packet[0].v4f[1] = t2.packet[0];
866 kernel.packet[1].v4f[0] = t0.packet[1];
867 kernel.packet[1].v4f[1] = t2.packet[1];
868 kernel.packet[2].v4f[0] = t1.packet[0];
869 kernel.packet[2].v4f[1] = t3.packet[0];
870 kernel.packet[3].v4f[0] = t1.packet[1];
871 kernel.packet[3].v4f[1] = t3.packet[1];
872}
873
875 Packet2ul select_hi = { ifPacket.select[0], ifPacket.select[1] };
876 Packet2ul select_lo = { ifPacket.select[2], ifPacket.select[3] };
877 Packet2ul mask_hi = vec_cmpeq(select_hi, reinterpret_cast<Packet2ul>(p2l_ONE));
878 Packet2ul mask_lo = vec_cmpeq(select_lo, reinterpret_cast<Packet2ul>(p2l_ONE));
880 result.v4f[0] = vec_sel(elsePacket.v4f[0], thenPacket.v4f[0], mask_hi);
881 result.v4f[1] = vec_sel(elsePacket.v4f[1], thenPacket.v4f[1], mask_lo);
882 return result;
883}
884
886{
888 res.v4f[0] = pcmp_le(a.v4f[0], b.v4f[0]);
889 res.v4f[1] = pcmp_le(a.v4f[1], b.v4f[1]);
890 return res;
891}
892
894{
896 res.v4f[0] = pcmp_lt(a.v4f[0], b.v4f[0]);
897 res.v4f[1] = pcmp_lt(a.v4f[1], b.v4f[1]);
898 return res;
899}
900
902{
904 res.v4f[0] = pcmp_eq(a.v4f[0], b.v4f[0]);
905 res.v4f[1] = pcmp_eq(a.v4f[1], b.v4f[1]);
906 return res;
907}
908
909#else
910template<> EIGEN_STRONG_INLINE Packet4f pload<Packet4f>(const float* from)
911{
912 // FIXME: No intrinsic yet
914 Packet *vfrom;
915 vfrom = (Packet *) from;
916 return vfrom->v4f;
917}
918
919template<> EIGEN_STRONG_INLINE void pstore<float>(float* to, const Packet4f& from)
920{
921 // FIXME: No intrinsic yet
923 Packet *vto;
924 vto = (Packet *) to;
925 vto->v4f = from;
926}
927
928template<> EIGEN_STRONG_INLINE Packet4f pset1<Packet4f>(const float& from)
929{
930 return vec_splats(from);
931}
932
933template<> EIGEN_STRONG_INLINE void
934pbroadcast4<Packet4f>(const float *a,
935 Packet4f& a0, Packet4f& a1, Packet4f& a2, Packet4f& a3)
936{
937 a3 = pload<Packet4f>(a);
938 a0 = vec_splat(a3, 0);
939 a1 = vec_splat(a3, 1);
940 a2 = vec_splat(a3, 2);
941 a3 = vec_splat(a3, 3);
942}
943
944template<> EIGEN_DEVICE_FUNC inline Packet4f pgather<float, Packet4f>(const float* from, Index stride)
945{
946 float EIGEN_ALIGN16 af[4];
947 af[0] = from[0*stride];
948 af[1] = from[1*stride];
949 af[2] = from[2*stride];
950 af[3] = from[3*stride];
951 return pload<Packet4f>(af);
952}
953
954template<> EIGEN_DEVICE_FUNC inline void pscatter<float, Packet4f>(float* to, const Packet4f& from, Index stride)
955{
956 float EIGEN_ALIGN16 af[4];
957 pstore<float>((float*)af, from);
958 to[0*stride] = af[0];
959 to[1*stride] = af[1];
960 to[2*stride] = af[2];
961 to[3*stride] = af[3];
962}
963
964template<> EIGEN_STRONG_INLINE Packet4f padd<Packet4f>(const Packet4f& a, const Packet4f& b) { return (a + b); }
965template<> EIGEN_STRONG_INLINE Packet4f psub<Packet4f>(const Packet4f& a, const Packet4f& b) { return (a - b); }
966template<> EIGEN_STRONG_INLINE Packet4f pmul<Packet4f>(const Packet4f& a, const Packet4f& b) { return (a * b); }
967template<> EIGEN_STRONG_INLINE Packet4f pdiv<Packet4f>(const Packet4f& a, const Packet4f& b) { return (a / b); }
968template<> EIGEN_STRONG_INLINE Packet4f pnegate<Packet4f>(const Packet4f& a) { return (-a); }
969template<> EIGEN_STRONG_INLINE Packet4f pconj<Packet4f> (const Packet4f& a) { return a; }
970template<> EIGEN_STRONG_INLINE Packet4f pmadd<Packet4f> (const Packet4f& a, const Packet4f& b, const Packet4f& c) { return vec_madd(a, b, c); }
971template<> EIGEN_STRONG_INLINE Packet4f pmin<Packet4f> (const Packet4f& a, const Packet4f& b) { return vec_min(a, b); }
972template<> EIGEN_STRONG_INLINE Packet4f pmax<Packet4f> (const Packet4f& a, const Packet4f& b) { return vec_max(a, b); }
973template<> EIGEN_STRONG_INLINE Packet4f pand<Packet4f> (const Packet4f& a, const Packet4f& b) { return vec_and(a, b); }
974template<> EIGEN_STRONG_INLINE Packet4f por<Packet4f> (const Packet4f& a, const Packet4f& b) { return vec_or(a, b); }
975template<> EIGEN_STRONG_INLINE Packet4f pxor<Packet4f> (const Packet4f& a, const Packet4f& b) { return vec_xor(a, b); }
976template<> EIGEN_STRONG_INLINE Packet4f pandnot<Packet4f>(const Packet4f& a, const Packet4f& b) { return vec_and(a, vec_nor(b, b)); }
977template<> EIGEN_STRONG_INLINE Packet4f pround<Packet4f> (const Packet4f& a) { return vec_round(a); }
978template<> EIGEN_STRONG_INLINE Packet4f pceil<Packet4f> (const Packet4f& a) { return vec_ceil(a); }
979template<> EIGEN_STRONG_INLINE Packet4f pfloor<Packet4f> (const Packet4f& a) { return vec_floor(a); }
980template<> EIGEN_STRONG_INLINE Packet4f pabs<Packet4f> (const Packet4f& a) { return vec_abs(a); }
981template<> EIGEN_STRONG_INLINE float pfirst<Packet4f>(const Packet4f& a) { float EIGEN_ALIGN16 x[4]; pstore(x, a); return x[0]; }
982
983template<> EIGEN_STRONG_INLINE Packet4f ploaddup<Packet4f>(const float* from)
984{
985 Packet4f p = pload<Packet4f>(from);
986 return vec_perm(p, p, p16uc_DUPLICATE32_HI);
987}
988
990{
991 return reinterpret_cast<Packet4f>(vec_perm(reinterpret_cast<Packet16uc>(a), reinterpret_cast<Packet16uc>(a), p16uc_REVERSE32));
992}
993
994template<> EIGEN_STRONG_INLINE float predux<Packet4f>(const Packet4f& a)
995{
996 Packet4f b, sum;
997 b = vec_sld(a, a, 8);
998 sum = padd<Packet4f>(a, b);
999 b = vec_sld(sum, sum, 4);
1000 sum = padd<Packet4f>(sum, b);
1001 return pfirst(sum);
1002}
1003
1004// Other reduction functions:
1005// mul
1006template<> EIGEN_STRONG_INLINE float predux_mul<Packet4f>(const Packet4f& a)
1007{
1008 Packet4f prod;
1009 prod = pmul(a, vec_sld(a, a, 8));
1010 return pfirst(pmul(prod, vec_sld(prod, prod, 4)));
1011}
1012
1013// min
1014template<> EIGEN_STRONG_INLINE float predux_min<Packet4f>(const Packet4f& a)
1015{
1016 Packet4f b, res;
1017 b = pmin<Packet4f>(a, vec_sld(a, a, 8));
1018 res = pmin<Packet4f>(b, vec_sld(b, b, 4));
1019 return pfirst(res);
1020}
1021
1022// max
1023template<> EIGEN_STRONG_INLINE float predux_max<Packet4f>(const Packet4f& a)
1024{
1025 Packet4f b, res;
1026 b = pmax<Packet4f>(a, vec_sld(a, a, 8));
1027 res = pmax<Packet4f>(b, vec_sld(b, b, 4));
1028 return pfirst(res);
1029}
1030
1031EIGEN_DEVICE_FUNC inline void
1032ptranspose(PacketBlock<Packet4f,4>& kernel) {
1033 Packet4f t0 = vec_mergeh(kernel.packet[0], kernel.packet[2]);
1034 Packet4f t1 = vec_mergel(kernel.packet[0], kernel.packet[2]);
1035 Packet4f t2 = vec_mergeh(kernel.packet[1], kernel.packet[3]);
1036 Packet4f t3 = vec_mergel(kernel.packet[1], kernel.packet[3]);
1037 kernel.packet[0] = vec_mergeh(t0, t2);
1038 kernel.packet[1] = vec_mergel(t0, t2);
1039 kernel.packet[2] = vec_mergeh(t1, t3);
1040 kernel.packet[3] = vec_mergel(t1, t3);
1041}
1042
1043template<> EIGEN_STRONG_INLINE Packet4f pblend(const Selector<4>& ifPacket, const Packet4f& thenPacket, const Packet4f& elsePacket) {
1044 Packet4ui select = { ifPacket.select[0], ifPacket.select[1], ifPacket.select[2], ifPacket.select[3] };
1045 Packet4ui mask = vec_cmpeq(select, reinterpret_cast<Packet4ui>(p4i_ONE));
1046 return vec_sel(elsePacket, thenPacket, mask);
1047}
1048
1049#endif
1050
1054template<> EIGEN_STRONG_INLINE Packet4f plset<Packet4f> (const float& a) { return padd<Packet4f>(pset1<Packet4f>(a), p4f_COUNTDOWN); }
1055
1056} // end namespace internal
1057
1058} // end namespace Eigen
1059
1060#endif // EIGEN_PACKET_MATH_ZVECTOR_H
#define _EIGEN_DECLARE_CONST_FAST_Packet4f(NAME, X)
Definition PacketMath.h:42
#define _EIGEN_DECLARE_CONST_FAST_Packet4i(NAME, X)
Definition PacketMath.h:45
ArrayXXi a
Definition Array_initializer_list_23_cxx11.cpp:1
Array< int, Dynamic, 1 > v
Definition Array_initializer_list_vector_cxx11.cpp:1
int i
Definition BiCGSTAB_step_by_step.cpp:9
#define EIGEN_ALIGN16
Definition ConfigureVectorization.h:153
#define EIGEN_DEBUG_ALIGNED_STORE
Definition GenericPacketMath.h:35
#define EIGEN_DEBUG_ALIGNED_LOAD
Definition GenericPacketMath.h:27
#define EIGEN_DEVICE_FUNC
Definition Macros.h:976
#define EIGEN_STRONG_INLINE
Definition Macros.h:917
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Definition PartialRedux_count.cpp:3
float * p
Definition Tutorial_Map_using.cpp:9
#define _EIGEN_DECLARE_CONST_FAST_Packet2l(NAME, X)
Definition PacketMath.h:73
#define _EIGEN_DECLARE_CONST_FAST_Packet2d(NAME, X)
Definition PacketMath.h:70
#define EIGEN_ZVECTOR_PREFETCH(ADDR)
Definition PacketMath.h:150
Scalar Scalar * c
Definition benchVecAdd.cpp:17
Scalar * b
Definition benchVecAdd.cpp:17
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Definition gnuplot_common_settings.hh:12
@ Aligned16
Definition Constants.h:235
RealScalar s
Definition level1_cplx_impl.h:126
return int(ret)+1
EIGEN_STRONG_INLINE Packet4f pandnot< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition PacketMath.h:914
v2f64 Packet2d
Definition PacketMath.h:820
EIGEN_STRONG_INLINE void pstoreu< double >(double *to, const Packet4d &from)
Definition PacketMath.h:627
EIGEN_STRONG_INLINE Packet4f vec_splat_packet4f(const Packet4f &from)
Definition PacketMath.h:579
EIGEN_STRONG_INLINE double predux< Packet2d >(const Packet2d &a)
Definition PacketMath.h:1082
EIGEN_STRONG_INLINE Packet2cf pconj(const Packet2cf &a)
Definition Complex.h:167
v2i64 Packet2l
Definition PacketMath.h:821
EIGEN_STRONG_INLINE Packet4f pmin< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition PacketMath.h:832
EIGEN_STRONG_INLINE Packet2d padd< Packet2d >(const Packet2d &a, const Packet2d &b)
Definition PacketMath.h:880
EIGEN_STRONG_INLINE Packet2d pandnot< Packet2d >(const Packet2d &a, const Packet2d &b)
Definition PacketMath.h:960
__vector int Packet4i
Definition PacketMath.h:31
EIGEN_STRONG_INLINE Packet4i pabs< Packet4i >(const Packet4i &a)
Definition PacketMath.h:476
EIGEN_STRONG_INLINE Packet4f pcmp_eq< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition PacketMath.h:1400
EIGEN_STRONG_INLINE Packet4f padd< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition PacketMath.h:774
EIGEN_STRONG_INLINE Packet4i por< Packet4i >(const Packet4i &a, const Packet4i &b)
Definition PacketMath.h:901
__vector unsigned char Packet16uc
Definition PacketMath.h:37
EIGEN_STRONG_INLINE Packet4i pset1< Packet4i >(const int &from)
Definition PacketMath.h:551
EIGEN_STRONG_INLINE Packet4f pabs< Packet4f >(const Packet4f &a)
Definition PacketMath.h:798
EIGEN_STRONG_INLINE float pfirst< Packet4f >(const Packet4f &a)
Definition PacketMath.h:1120
EIGEN_STRONG_INLINE Packet2d pand< Packet2d >(const Packet2d &a, const Packet2d &b)
Definition PacketMath.h:939
EIGEN_STRONG_INLINE void ptranspose(PacketBlock< Packet2cf, 2 > &kernel)
Definition Complex.h:224
EIGEN_STRONG_INLINE Packet4i ploaddup< Packet4i >(const int *from)
Definition PacketMath.h:1008
EIGEN_STRONG_INLINE float predux_max< Packet4f >(const Packet4f &a)
Definition PacketMath.h:1693
EIGEN_STRONG_INLINE Packet2d ploaddup< Packet2d >(const double *from)
Definition PacketMath.h:1011
EIGEN_STRONG_INLINE Packet2d pxor< Packet2d >(const Packet2d &a, const Packet2d &b)
Definition PacketMath.h:953
EIGEN_STRONG_INLINE Packet2d por< Packet2d >(const Packet2d &a, const Packet2d &b)
Definition PacketMath.h:946
EIGEN_DEVICE_FUNC void pscatter< int, Packet4i >(int *to, const Packet4i &from, Index stride)
Definition PacketMath.h:700
EIGEN_STRONG_INLINE Packet4f ploaddup< Packet4f >(const float *from)
Definition PacketMath.h:1004
EIGEN_STRONG_INLINE Packet4f por< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition PacketMath.h:900
EIGEN_STRONG_INLINE int predux_min< Packet4i >(const Packet4i &a)
Definition PacketMath.h:1618
EIGEN_STRONG_INLINE Packet4i pxor< Packet4i >(const Packet4i &a, const Packet4i &b)
Definition PacketMath.h:909
EIGEN_STRONG_INLINE double predux_max< Packet2d >(const Packet2d &a)
Definition PacketMath.h:1116
EIGEN_STRONG_INLINE Packet4f pmul< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition PacketMath.h:795
EIGEN_DEVICE_FUNC Packet pmax(const Packet &a, const Packet &b)
Definition GenericPacketMath.h:524
EIGEN_STRONG_INLINE Packet4i pblend(const Selector< 4 > &ifPacket, const Packet4i &thenPacket, const Packet4i &elsePacket)
Definition PacketMath.h:2107
EIGEN_DEVICE_FUNC Packet4f pgather< float, Packet4f >(const float *from, Index stride)
Definition PacketMath.h:613
EIGEN_STRONG_INLINE Packet4f pcmp_le(const Packet4f &a, const Packet4f &b)
Definition PacketMath.h:867
EIGEN_STRONG_INLINE Packet2d pset1< Packet2d >(const double &from)
Definition PacketMath.h:872
EIGEN_STRONG_INLINE Packet4f pload< Packet4f >(const float *from)
Definition PacketMath.h:443
EIGEN_STRONG_INLINE int predux_mul< Packet4i >(const Packet4i &a)
Definition PacketMath.h:1540
EIGEN_STRONG_INLINE void pstore< int >(int *to, const Packet4i &from)
Definition PacketMath.h:496
EIGEN_STRONG_INLINE Packet8h por(const Packet8h &a, const Packet8h &b)
Definition PacketMath.h:1042
__vector unsigned int Packet4ui
Definition PacketMath.h:32
EIGEN_STRONG_INLINE Packet2cf preverse(const Packet2cf &a)
Definition Complex.h:184
__vector __bool int Packet4bi
Definition PacketMath.h:33
EIGEN_STRONG_INLINE void pstore< double >(double *to, const Packet4d &from)
Definition PacketMath.h:623
EIGEN_STRONG_INLINE Packet4f pcmp_le< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition PacketMath.h:1278
EIGEN_STRONG_INLINE Packet4i padd< Packet4i >(const Packet4i &a, const Packet4i &b)
Definition PacketMath.h:775
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type predux_mul(const Packet &a)
Definition GenericPacketMath.h:882
EIGEN_STRONG_INLINE Packet4f pfloor< Packet4f >(const Packet4f &a)
Definition PacketMath.h:939
EIGEN_STRONG_INLINE Packet4f pmadd(const Packet4f &a, const Packet4f &b, const Packet4f &c)
Definition PacketMath.h:827
EIGEN_STRONG_INLINE Packet4i pandnot< Packet4i >(const Packet4i &a, const Packet4i &b)
Definition PacketMath.h:915
EIGEN_DEVICE_FUNC Packet pmul(const Packet &a, const Packet &b)
Definition GenericPacketMath.h:237
EIGEN_DEVICE_FUNC Packet pmin(const Packet &a, const Packet &b)
Definition GenericPacketMath.h:512
EIGEN_STRONG_INLINE Packet4f pdiv< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition PacketMath.h:803
EIGEN_STRONG_INLINE Packet8h pandnot(const Packet8h &a, const Packet8h &b)
Definition PacketMath.h:1053
EIGEN_STRONG_INLINE Packet2d pload< Packet2d >(const double *from)
Definition PacketMath.h:967
EIGEN_STRONG_INLINE Packet2d pmul< Packet2d >(const Packet2d &a, const Packet2d &b)
Definition PacketMath.h:916
EIGEN_STRONG_INLINE Packet2cf pnegate(const Packet2cf &a)
Definition Complex.h:166
EIGEN_STRONG_INLINE float predux_mul< Packet4f >(const Packet4f &a)
Definition PacketMath.h:1533
EIGEN_STRONG_INLINE Packet4f pcmp_lt(const Packet4f &a, const Packet4f &b)
Definition PacketMath.h:868
EIGEN_STRONG_INLINE void prefetch< float >(const float *addr)
Definition PacketMath.h:1117
EIGEN_DEVICE_FUNC void pscatter< double, Packet2d >(double *to, const Packet2d &from, Index stride)
Definition PacketMath.h:1044
EIGEN_STRONG_INLINE Packet4i ploadu< Packet4i >(const int *from)
Definition PacketMath.h:972
EIGEN_STRONG_INLINE double predux_mul< Packet2d >(const Packet2d &a)
Definition PacketMath.h:1092
EIGEN_STRONG_INLINE Packet2d pdiv< Packet2d >(const Packet2d &a, const Packet2d &b)
Definition PacketMath.h:923
EIGEN_STRONG_INLINE double predux_min< Packet2d >(const Packet2d &a)
Definition PacketMath.h:1101
EIGEN_STRONG_INLINE Packet4f pset1< Packet4f >(const float &from)
Definition PacketMath.h:547
EIGEN_STRONG_INLINE Packet4i psub< Packet4i >(const Packet4i &a, const Packet4i &b)
Definition PacketMath.h:783
EIGEN_DEVICE_FUNC void pscatter< float, Packet4f >(float *to, const Packet4f &from, Index stride)
Definition PacketMath.h:695
EIGEN_STRONG_INLINE Packet2d plset< Packet2d >(const double &a)
Definition PacketMath.h:887
EIGEN_STRONG_INLINE Packet4f pcmp_lt< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition PacketMath.h:1339
EIGEN_STRONG_INLINE Packet4f pceil< Packet4f >(const Packet4f &a)
Definition PacketMath.h:938
EIGEN_STRONG_INLINE void pstore< float >(float *to, const Packet4f &from)
Definition PacketMath.h:491
EIGEN_STRONG_INLINE Packet4f pabs(const Packet4f &a)
Definition PacketMath.h:1176
std::ostream & operator<<(std::ostream &s, const Packet16c &v)
Definition PacketMath.h:371
EIGEN_STRONG_INLINE bfloat16 pfirst(const Packet8bf &a)
Definition PacketMath.h:1429
EIGEN_STRONG_INLINE void pbroadcast4< Packet2d >(const double *a, Packet2d &a0, Packet2d &a1, Packet2d &a2, Packet2d &a3)
Definition PacketMath.h:960
__m256i Packet8i
Definition PacketMath.h:32
EIGEN_CONSTEXPR Index first(const T &x) EIGEN_NOEXCEPT
Definition IndexedViewHelper.h:81
EIGEN_DEVICE_FUNC void pstore(Scalar *to, const Packet &from)
Definition GenericPacketMath.h:696
EIGEN_STRONG_INLINE Packet2d ploadu< Packet2d >(const double *from)
Definition PacketMath.h:1004
EIGEN_STRONG_INLINE Packet4f pxor< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition PacketMath.h:908
EIGEN_STRONG_INLINE Packet4i pmin< Packet4i >(const Packet4i &a, const Packet4i &b)
Definition PacketMath.h:843
EIGEN_STRONG_INLINE Packet2d pabs< Packet2d >(const Packet2d &a)
Definition PacketMath.h:477
EIGEN_STRONG_INLINE Packet2cf pcmp_eq(const Packet2cf &a, const Packet2cf &b)
Definition Complex.h:231
EIGEN_STRONG_INLINE void pstoreu< int >(int *to, const Packet4i &from)
Definition PacketMath.h:1092
EIGEN_STRONG_INLINE Packet8h pand(const Packet8h &a, const Packet8h &b)
Definition PacketMath.h:1050
EIGEN_STRONG_INLINE Packet8h pxor(const Packet8h &a, const Packet8h &b)
Definition PacketMath.h:1047
EIGEN_STRONG_INLINE int pfirst< Packet4i >(const Packet4i &a)
Definition PacketMath.h:1121
EIGEN_STRONG_INLINE Packet4i plset< Packet4i >(const int &a)
Definition PacketMath.h:768
EIGEN_STRONG_INLINE float predux< Packet4f >(const Packet4f &a)
Definition PacketMath.h:1444
EIGEN_STRONG_INLINE Packet2d pceil< Packet2d >(const Packet2d &a)
Definition PacketMath.h:1182
EIGEN_STRONG_INLINE Packet4f ploadu< Packet4f >(const float *from)
Definition PacketMath.h:968
EIGEN_STRONG_INLINE Packet4i pmul< Packet4i >(const Packet4i &a, const Packet4i &b)
Definition PacketMath.h:796
EIGEN_STRONG_INLINE Packet4i pand< Packet4i >(const Packet4i &a, const Packet4i &b)
Definition PacketMath.h:892
EIGEN_STRONG_INLINE Packet2d pmin< Packet2d >(const Packet2d &a, const Packet2d &b)
Definition PacketMath.h:974
EIGEN_STRONG_INLINE int predux< Packet4i >(const Packet4i &a)
Definition PacketMath.h:1454
EIGEN_STRONG_INLINE Packet4f pand< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition PacketMath.h:891
EIGEN_DEVICE_FUNC Packet4i pgather< int, Packet4i >(const int *from, Index stride)
Definition PacketMath.h:618
EIGEN_STRONG_INLINE int predux_max< Packet4i >(const Packet4i &a)
Definition PacketMath.h:1698
EIGEN_DEVICE_FUNC Packet2d pgather< double, Packet2d >(const double *from, Index stride)
Definition PacketMath.h:1033
EIGEN_STRONG_INLINE Packet4i pmax< Packet4i >(const Packet4i &a, const Packet4i &b)
Definition PacketMath.h:861
EIGEN_STRONG_INLINE Packet4i pdiv< Packet4i >(const Packet4i &, const Packet4i &)
Definition PacketMath.h:821
EIGEN_STRONG_INLINE void pbroadcast4< Packet4f >(const float *a, Packet4f &a0, Packet4f &a1, Packet4f &a2, Packet4f &a3)
Definition PacketMath.h:591
EIGEN_STRONG_INLINE Packet4i pload< Packet4i >(const int *from)
Definition PacketMath.h:448
__vector float Packet4f
Definition PacketMath.h:30
EIGEN_STRONG_INLINE Packet2d psub< Packet2d >(const Packet2d &a, const Packet2d &b)
Definition PacketMath.h:895
EIGEN_STRONG_INLINE Packet4f psub< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition PacketMath.h:782
EIGEN_STRONG_INLINE Packet4f plset< Packet4f >(const float &a)
Definition PacketMath.h:767
EIGEN_STRONG_INLINE void pstoreu< float >(float *to, const Packet4f &from)
Definition PacketMath.h:1088
EIGEN_STRONG_INLINE Packet2d pmax< Packet2d >(const Packet2d &a, const Packet2d &b)
Definition PacketMath.h:989
EIGEN_STRONG_INLINE Packet4f pround< Packet4f >(const Packet4f &a)
Definition PacketMath.h:921
EIGEN_STRONG_INLINE Packet2d pround< Packet2d >(const Packet2d &a)
Definition PacketMath.h:1202
EIGEN_STRONG_INLINE void prefetch< int >(const int *addr)
Definition PacketMath.h:1118
EIGEN_STRONG_INLINE double pfirst< Packet2d >(const Packet2d &a)
Definition PacketMath.h:1061
v2u64 Packet2ul
Definition PacketMath.h:822
EIGEN_STRONG_INLINE Packet2d pfloor< Packet2d >(const Packet2d &a)
Definition PacketMath.h:1163
EIGEN_STRONG_INLINE void pbroadcast4< Packet4i >(const int *a, Packet4i &a0, Packet4i &a1, Packet4i &a2, Packet4i &a3)
Definition PacketMath.h:597
EIGEN_STRONG_INLINE float predux_min< Packet4f >(const Packet4f &a)
Definition PacketMath.h:1613
EIGEN_STRONG_INLINE void prefetch< double >(const double *addr)
Definition PacketMath.h:692
EIGEN_STRONG_INLINE Packet4f pmax< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition PacketMath.h:850
::uint64_t uint64_t
Definition Meta.h:58
::uint32_t uint32_t
Definition Meta.h:56
::int32_t int32_t
Definition Meta.h:57
::int64_t int64_t
Definition Meta.h:59
Namespace containing all symbols from the Eigen library.
Definition bench_norm.cpp:85
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:74
const Product< Lhs, Rhs > prod(const Lhs &lhs, const Rhs &rhs)
Definition evaluators.cpp:8
Definition BandTriangularSolver.h:13
@ HasRsqrt
Definition GenericPacketMath.h:67
@ HasSin
Definition GenericPacketMath.h:75
@ HasBlend
Definition GenericPacketMath.h:60
@ HasCos
Definition GenericPacketMath.h:76
@ HasCeil
Definition GenericPacketMath.h:101
@ HasExp
Definition GenericPacketMath.h:68
@ HasRound
Definition GenericPacketMath.h:98
@ HasSqrt
Definition GenericPacketMath.h:66
@ HasErf
Definition GenericPacketMath.h:88
@ HasLog
Definition GenericPacketMath.h:70
@ HasTanh
Definition GenericPacketMath.h:83
@ HasFloor
Definition GenericPacketMath.h:100
@ HasDiv
Definition GenericPacketMath.h:65
Packet2d half
Definition PacketMath.h:207
Packet2d type
Definition PacketMath.h:206
Packet4f type
Definition PacketMath.h:173
Packet4f half
Definition PacketMath.h:174
Packet4i type
Definition PacketMath.h:155
Packet4i half
Definition PacketMath.h:156
@ 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
@ HasHalfPacket
Definition GenericPacketMath.h:114
@ size
Definition GenericPacketMath.h:112
@ AlignedOnScalar
Definition GenericPacketMath.h:113
@ Vectorizable
Definition GenericPacketMath.h:111
Definition ForwardDeclarations.h:17
Packet2d half
Definition PacketMath.h:237
Packet4f half
Definition PacketMath.h:236
Packet4i half
Definition PacketMath.h:235
Definition GenericPacketMath.h:133
T type
Definition GenericPacketMath.h:134
@ masked_load_available
Definition GenericPacketMath.h:141
@ size
Definition GenericPacketMath.h:138
@ masked_store_available
Definition GenericPacketMath.h:142
@ vectorizable
Definition GenericPacketMath.h:140
@ alignment
Definition GenericPacketMath.h:139
Definition PacketMath.h:47
Packet4f v4f
Definition PacketMath.h:60
Packet2ul v2ul
Definition PacketMath.h:57
Packet4i v4i
Definition PacketMath.h:54
Packet4ui v4ui
Definition PacketMath.h:55
Packet2l v2l
Definition PacketMath.h:56
Packet2d v2d
Definition PacketMath.h:58