Eigen  3.3.9
 
Loading...
Searching...
No Matches
Complex.h
1// This file is part of Eigen, a lightweight C++ template library
2// for linear algebra.
3//
4// Copyright (C) 2010 Gael Guennebaud <gael.guennebaud@inria.fr>
5// Copyright (C) 2010-2016 Konstantinos Margaritis <markos@freevec.org>
6//
7// This Source Code Form is subject to the terms of the Mozilla
8// Public License v. 2.0. If a copy of the MPL was not distributed
9// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10
11#ifndef EIGEN_COMPLEX32_ALTIVEC_H
12#define EIGEN_COMPLEX32_ALTIVEC_H
13
14namespace Eigen {
15
16namespace internal {
17
18inline Packet4ui p4ui_CONJ_XOR() {
19 return vec_mergeh((Packet4ui)p4i_ZERO, (Packet4ui)p4f_MZERO);//{ 0x00000000, 0x80000000, 0x00000000, 0x80000000 };
20}
21#ifdef __VSX__
22#if defined(_BIG_ENDIAN)
23static Packet2ul p2ul_CONJ_XOR1 = (Packet2ul) vec_sld((Packet4ui) p2d_MZERO, (Packet4ui) p2l_ZERO, 8);//{ 0x8000000000000000, 0x0000000000000000 };
24static Packet2ul p2ul_CONJ_XOR2 = (Packet2ul) vec_sld((Packet4ui) p2l_ZERO, (Packet4ui) p2d_MZERO, 8);//{ 0x8000000000000000, 0x0000000000000000 };
25#else
26static Packet2ul p2ul_CONJ_XOR1 = (Packet2ul) vec_sld((Packet4ui) p2l_ZERO, (Packet4ui) p2d_MZERO, 8);//{ 0x8000000000000000, 0x0000000000000000 };
27static Packet2ul p2ul_CONJ_XOR2 = (Packet2ul) vec_sld((Packet4ui) p2d_MZERO, (Packet4ui) p2l_ZERO, 8);//{ 0x8000000000000000, 0x0000000000000000 };
28#endif
29#endif
30
31//---------- float ----------
32struct Packet2cf
33{
34 EIGEN_STRONG_INLINE explicit Packet2cf() {}
35 EIGEN_STRONG_INLINE explicit Packet2cf(const Packet4f& a) : v(a) {}
36
37 EIGEN_STRONG_INLINE Packet2cf pmul(const Packet2cf& a, const Packet2cf& b)
38 {
39 Packet4f v1, v2;
40
41 // Permute and multiply the real parts of a and b
42 v1 = vec_perm(a.v, a.v, p16uc_PSET32_WODD);
43 // Get the imaginary parts of a
44 v2 = vec_perm(a.v, a.v, p16uc_PSET32_WEVEN);
45 // multiply a_re * b
46 v1 = vec_madd(v1, b.v, p4f_ZERO);
47 // multiply a_im * b and get the conjugate result
48 v2 = vec_madd(v2, b.v, p4f_ZERO);
49 v2 = reinterpret_cast<Packet4f>(pxor(v2, reinterpret_cast<Packet4f>(p4ui_CONJ_XOR())));
50 // permute back to a proper order
51 v2 = vec_perm(v2, v2, p16uc_COMPLEX32_REV);
52
53 return Packet2cf(padd<Packet4f>(v1, v2));
54 }
55
56 EIGEN_STRONG_INLINE Packet2cf& operator*=(const Packet2cf& b) {
57 v = pmul(Packet2cf(*this), b).v;
58 return *this;
59 }
60 EIGEN_STRONG_INLINE Packet2cf operator*(const Packet2cf& b) const {
61 return Packet2cf(*this) *= b;
62 }
63
64 EIGEN_STRONG_INLINE Packet2cf& operator+=(const Packet2cf& b) {
65 v = padd(v, b.v);
66 return *this;
67 }
68 EIGEN_STRONG_INLINE Packet2cf operator+(const Packet2cf& b) const {
69 return Packet2cf(*this) += b;
70 }
71 EIGEN_STRONG_INLINE Packet2cf& operator-=(const Packet2cf& b) {
72 v = psub(v, b.v);
73 return *this;
74 }
75 EIGEN_STRONG_INLINE Packet2cf operator-(const Packet2cf& b) const {
76 return Packet2cf(*this) -= b;
77 }
78 EIGEN_STRONG_INLINE Packet2cf operator-(void) const {
79 return Packet2cf(-v);
80 }
81
82 Packet4f v;
83};
84
85template<> struct packet_traits<std::complex<float> > : default_packet_traits
86{
87 typedef Packet2cf type;
88 typedef Packet2cf half;
89 enum {
90 Vectorizable = 1,
91 AlignedOnScalar = 1,
92 size = 2,
93 HasHalfPacket = 0,
94
95 HasAdd = 1,
96 HasSub = 1,
97 HasMul = 1,
98 HasDiv = 1,
99 HasNegate = 1,
100 HasAbs = 0,
101 HasAbs2 = 0,
102 HasMin = 0,
103 HasMax = 0,
104#ifdef __VSX__
105 HasBlend = 1,
106#endif
107 HasSetLinear = 0
108 };
109};
110
111template<> struct unpacket_traits<Packet2cf> { typedef std::complex<float> type; enum {size=2, alignment=Aligned16}; typedef Packet2cf half; };
112
113template<> EIGEN_STRONG_INLINE Packet2cf pset1<Packet2cf>(const std::complex<float>& from)
114{
115 Packet2cf res;
116 if((std::ptrdiff_t(&from) % 16) == 0)
117 res.v = pload<Packet4f>((const float *)&from);
118 else
119 res.v = ploadu<Packet4f>((const float *)&from);
120 res.v = vec_perm(res.v, res.v, p16uc_PSET64_HI);
121 return res;
122}
123
124template<> EIGEN_STRONG_INLINE Packet2cf pload<Packet2cf>(const std::complex<float>* from) { return Packet2cf(pload<Packet4f>((const float *) from)); }
125template<> EIGEN_STRONG_INLINE Packet2cf ploadu<Packet2cf>(const std::complex<float>* from) { return Packet2cf(ploadu<Packet4f>((const float*) from)); }
126template<> EIGEN_STRONG_INLINE Packet2cf ploaddup<Packet2cf>(const std::complex<float>* from) { return pset1<Packet2cf>(*from); }
127
128template<> EIGEN_STRONG_INLINE void pstore <std::complex<float> >(std::complex<float> * to, const Packet2cf& from) { pstore((float*)to, from.v); }
129template<> EIGEN_STRONG_INLINE void pstoreu<std::complex<float> >(std::complex<float> * to, const Packet2cf& from) { pstoreu((float*)to, from.v); }
130
131template<> EIGEN_DEVICE_FUNC inline Packet2cf pgather<std::complex<float>, Packet2cf>(const std::complex<float>* from, Index stride)
132{
133 EIGEN_ALIGN16 std::complex<float> af[2];
134 af[0] = from[0*stride];
135 af[1] = from[1*stride];
136 return pload<Packet2cf>(af);
137}
138template<> EIGEN_DEVICE_FUNC inline void pscatter<std::complex<float>, Packet2cf>(std::complex<float>* to, const Packet2cf& from, Index stride)
139{
140 EIGEN_ALIGN16 std::complex<float> af[2];
141 pstore<std::complex<float> >((std::complex<float> *) af, from);
142 to[0*stride] = af[0];
143 to[1*stride] = af[1];
144}
145
146template<> EIGEN_STRONG_INLINE Packet2cf padd<Packet2cf>(const Packet2cf& a, const Packet2cf& b) { return Packet2cf(a.v + b.v); }
147template<> EIGEN_STRONG_INLINE Packet2cf psub<Packet2cf>(const Packet2cf& a, const Packet2cf& b) { return Packet2cf(a.v - b.v); }
148template<> EIGEN_STRONG_INLINE Packet2cf pnegate(const Packet2cf& a) { return Packet2cf(pnegate(a.v)); }
149template<> EIGEN_STRONG_INLINE Packet2cf pconj(const Packet2cf& a) { return Packet2cf(pxor<Packet4f>(a.v, reinterpret_cast<Packet4f>(p4ui_CONJ_XOR()))); }
150
151template<> EIGEN_STRONG_INLINE Packet2cf pand <Packet2cf>(const Packet2cf& a, const Packet2cf& b) { return Packet2cf(pand<Packet4f>(a.v, b.v)); }
152template<> EIGEN_STRONG_INLINE Packet2cf por <Packet2cf>(const Packet2cf& a, const Packet2cf& b) { return Packet2cf(por<Packet4f>(a.v, b.v)); }
153template<> EIGEN_STRONG_INLINE Packet2cf pxor <Packet2cf>(const Packet2cf& a, const Packet2cf& b) { return Packet2cf(pxor<Packet4f>(a.v, b.v)); }
154template<> EIGEN_STRONG_INLINE Packet2cf pandnot<Packet2cf>(const Packet2cf& a, const Packet2cf& b) { return Packet2cf(pandnot<Packet4f>(a.v, b.v)); }
155
156template<> EIGEN_STRONG_INLINE void prefetch<std::complex<float> >(const std::complex<float> * addr) { EIGEN_PPC_PREFETCH(addr); }
157
158template<> EIGEN_STRONG_INLINE std::complex<float> pfirst<Packet2cf>(const Packet2cf& a)
159{
160 EIGEN_ALIGN16 std::complex<float> res[2];
161 pstore((float *)&res, a.v);
162
163 return res[0];
164}
165
166template<> EIGEN_STRONG_INLINE Packet2cf preverse(const Packet2cf& a)
167{
168 Packet4f rev_a;
169 rev_a = vec_perm(a.v, a.v, p16uc_COMPLEX32_REV2);
170 return Packet2cf(rev_a);
171}
172
173template<> EIGEN_STRONG_INLINE std::complex<float> predux<Packet2cf>(const Packet2cf& a)
174{
175 Packet4f b;
176 b = vec_sld(a.v, a.v, 8);
177 b = padd<Packet4f>(a.v, b);
178 return pfirst<Packet2cf>(Packet2cf(b));
179}
180
181template<> EIGEN_STRONG_INLINE Packet2cf preduxp<Packet2cf>(const Packet2cf* vecs)
182{
183 Packet4f b1, b2;
184#ifdef _BIG_ENDIAN
185 b1 = vec_sld(vecs[0].v, vecs[1].v, 8);
186 b2 = vec_sld(vecs[1].v, vecs[0].v, 8);
187#else
188 b1 = vec_sld(vecs[1].v, vecs[0].v, 8);
189 b2 = vec_sld(vecs[0].v, vecs[1].v, 8);
190#endif
191 b2 = vec_sld(b2, b2, 8);
192 b2 = padd<Packet4f>(b1, b2);
193
194 return Packet2cf(b2);
195}
196
197template<> EIGEN_STRONG_INLINE std::complex<float> predux_mul<Packet2cf>(const Packet2cf& a)
198{
199 Packet4f b;
200 Packet2cf prod;
201 b = vec_sld(a.v, a.v, 8);
202 prod = pmul<Packet2cf>(a, Packet2cf(b));
203
204 return pfirst<Packet2cf>(prod);
205}
206
207template<int Offset>
208struct palign_impl<Offset,Packet2cf>
209{
210 static EIGEN_STRONG_INLINE void run(Packet2cf& first, const Packet2cf& second)
211 {
212 if (Offset==1)
213 {
214#ifdef _BIG_ENDIAN
215 first.v = vec_sld(first.v, second.v, 8);
216#else
217 first.v = vec_sld(second.v, first.v, 8);
218#endif
219 }
220 }
221};
222
223template<> struct conj_helper<Packet2cf, Packet2cf, false,true>
224{
225 EIGEN_STRONG_INLINE Packet2cf pmadd(const Packet2cf& x, const Packet2cf& y, const Packet2cf& c) const
226 { return padd(pmul(x,y),c); }
227
228 EIGEN_STRONG_INLINE Packet2cf pmul(const Packet2cf& a, const Packet2cf& b) const
229 {
230 return internal::pmul(a, pconj(b));
231 }
232};
233
234template<> struct conj_helper<Packet2cf, Packet2cf, true,false>
235{
236 EIGEN_STRONG_INLINE Packet2cf pmadd(const Packet2cf& x, const Packet2cf& y, const Packet2cf& c) const
237 { return padd(pmul(x,y),c); }
238
239 EIGEN_STRONG_INLINE Packet2cf pmul(const Packet2cf& a, const Packet2cf& b) const
240 {
241 return internal::pmul(pconj(a), b);
242 }
243};
244
245template<> struct conj_helper<Packet2cf, Packet2cf, true,true>
246{
247 EIGEN_STRONG_INLINE Packet2cf pmadd(const Packet2cf& x, const Packet2cf& y, const Packet2cf& c) const
248 { return padd(pmul(x,y),c); }
249
250 EIGEN_STRONG_INLINE Packet2cf pmul(const Packet2cf& a, const Packet2cf& b) const
251 {
252 return pconj(internal::pmul(a, b));
253 }
254};
255
256EIGEN_MAKE_CONJ_HELPER_CPLX_REAL(Packet2cf,Packet4f)
257
258template<> EIGEN_STRONG_INLINE Packet2cf pdiv<Packet2cf>(const Packet2cf& a, const Packet2cf& b)
259{
260 // TODO optimize it for AltiVec
261 Packet2cf res = conj_helper<Packet2cf,Packet2cf,false,true>().pmul(a, b);
262 Packet4f s = pmul<Packet4f>(b.v, b.v);
263 return Packet2cf(pdiv(res.v, padd<Packet4f>(s, vec_perm(s, s, p16uc_COMPLEX32_REV))));
264}
265
266template<> EIGEN_STRONG_INLINE Packet2cf pcplxflip<Packet2cf>(const Packet2cf& x)
267{
268 return Packet2cf(vec_perm(x.v, x.v, p16uc_COMPLEX32_REV));
269}
270
271EIGEN_STRONG_INLINE void ptranspose(PacketBlock<Packet2cf,2>& kernel)
272{
273 Packet4f tmp = vec_perm(kernel.packet[0].v, kernel.packet[1].v, p16uc_TRANSPOSE64_HI);
274 kernel.packet[1].v = vec_perm(kernel.packet[0].v, kernel.packet[1].v, p16uc_TRANSPOSE64_LO);
275 kernel.packet[0].v = tmp;
276}
277
278#ifdef __VSX__
279template<> EIGEN_STRONG_INLINE Packet2cf pblend(const Selector<2>& ifPacket, const Packet2cf& thenPacket, const Packet2cf& elsePacket) {
280 Packet2cf result;
281 result.v = reinterpret_cast<Packet4f>(pblend<Packet2d>(ifPacket, reinterpret_cast<Packet2d>(thenPacket.v), reinterpret_cast<Packet2d>(elsePacket.v)));
282 return result;
283}
284#endif
285
286//---------- double ----------
287#ifdef __VSX__
288struct Packet1cd
289{
290 EIGEN_STRONG_INLINE Packet1cd() {}
291 EIGEN_STRONG_INLINE explicit Packet1cd(const Packet2d& a) : v(a) {}
292
293 EIGEN_STRONG_INLINE Packet1cd pmul(const Packet1cd& a, const Packet1cd& b)
294 {
295 Packet2d a_re, a_im, v1, v2;
296
297 // Permute and multiply the real parts of a and b
298 a_re = vec_perm(a.v, a.v, p16uc_PSET64_HI);
299 // Get the imaginary parts of a
300 a_im = vec_perm(a.v, a.v, p16uc_PSET64_LO);
301 // multiply a_re * b
302 v1 = vec_madd(a_re, b.v, p2d_ZERO);
303 // multiply a_im * b and get the conjugate result
304 v2 = vec_madd(a_im, b.v, p2d_ZERO);
305 v2 = reinterpret_cast<Packet2d>(vec_sld(reinterpret_cast<Packet4ui>(v2), reinterpret_cast<Packet4ui>(v2), 8));
306 v2 = pxor(v2, reinterpret_cast<Packet2d>(p2ul_CONJ_XOR1));
307
308 return Packet1cd(padd<Packet2d>(v1, v2));
309 }
310
311 EIGEN_STRONG_INLINE Packet1cd& operator*=(const Packet1cd& b) {
312 v = pmul(Packet1cd(*this), b).v;
313 return *this;
314 }
315 EIGEN_STRONG_INLINE Packet1cd operator*(const Packet1cd& b) const {
316 return Packet1cd(*this) *= b;
317 }
318
319 EIGEN_STRONG_INLINE Packet1cd& operator+=(const Packet1cd& b) {
320 v = padd(v, b.v);
321 return *this;
322 }
323 EIGEN_STRONG_INLINE Packet1cd operator+(const Packet1cd& b) const {
324 return Packet1cd(*this) += b;
325 }
326 EIGEN_STRONG_INLINE Packet1cd& operator-=(const Packet1cd& b) {
327 v = psub(v, b.v);
328 return *this;
329 }
330 EIGEN_STRONG_INLINE Packet1cd operator-(const Packet1cd& b) const {
331 return Packet1cd(*this) -= b;
332 }
333 EIGEN_STRONG_INLINE Packet1cd operator-(void) const {
334 return Packet1cd(-v);
335 }
336
337 Packet2d v;
338};
339
340template<> struct packet_traits<std::complex<double> > : default_packet_traits
341{
342 typedef Packet1cd type;
343 typedef Packet1cd half;
344 enum {
345 Vectorizable = 1,
346 AlignedOnScalar = 0,
347 size = 1,
348 HasHalfPacket = 0,
349
350 HasAdd = 1,
351 HasSub = 1,
352 HasMul = 1,
353 HasDiv = 1,
354 HasNegate = 1,
355 HasAbs = 0,
356 HasAbs2 = 0,
357 HasMin = 0,
358 HasMax = 0,
359 HasSetLinear = 0
360 };
361};
362
363template<> struct unpacket_traits<Packet1cd> { typedef std::complex<double> type; enum {size=1, alignment=Aligned16}; typedef Packet1cd half; };
364
365template<> EIGEN_STRONG_INLINE Packet1cd pload <Packet1cd>(const std::complex<double>* from) { return Packet1cd(pload<Packet2d>((const double*)from)); }
366template<> EIGEN_STRONG_INLINE Packet1cd ploadu<Packet1cd>(const std::complex<double>* from) { return Packet1cd(ploadu<Packet2d>((const double*)from)); }
367template<> EIGEN_STRONG_INLINE void pstore <std::complex<double> >(std::complex<double> * to, const Packet1cd& from) { pstore((double*)to, from.v); }
368template<> EIGEN_STRONG_INLINE void pstoreu<std::complex<double> >(std::complex<double> * to, const Packet1cd& from) { pstoreu((double*)to, from.v); }
369
370template<> EIGEN_STRONG_INLINE Packet1cd pset1<Packet1cd>(const std::complex<double>& from)
371{ /* here we really have to use unaligned loads :( */ return ploadu<Packet1cd>(&from); }
372
373template<> EIGEN_DEVICE_FUNC inline Packet1cd pgather<std::complex<double>, Packet1cd>(const std::complex<double>* from, Index)
374{
375 return pload<Packet1cd>(from);
376}
377template<> EIGEN_DEVICE_FUNC inline void pscatter<std::complex<double>, Packet1cd>(std::complex<double>* to, const Packet1cd& from, Index)
378{
379 pstore<std::complex<double> >(to, from);
380}
381
382template<> EIGEN_STRONG_INLINE Packet1cd padd<Packet1cd>(const Packet1cd& a, const Packet1cd& b) { return Packet1cd(a.v + b.v); }
383template<> EIGEN_STRONG_INLINE Packet1cd psub<Packet1cd>(const Packet1cd& a, const Packet1cd& b) { return Packet1cd(a.v - b.v); }
384template<> EIGEN_STRONG_INLINE Packet1cd pnegate(const Packet1cd& a) { return Packet1cd(pnegate(Packet2d(a.v))); }
385template<> EIGEN_STRONG_INLINE Packet1cd pconj(const Packet1cd& a) { return Packet1cd(pxor(a.v, reinterpret_cast<Packet2d>(p2ul_CONJ_XOR2))); }
386
387template<> EIGEN_STRONG_INLINE Packet1cd pand <Packet1cd>(const Packet1cd& a, const Packet1cd& b) { return Packet1cd(pand(a.v,b.v)); }
388template<> EIGEN_STRONG_INLINE Packet1cd por <Packet1cd>(const Packet1cd& a, const Packet1cd& b) { return Packet1cd(por(a.v,b.v)); }
389template<> EIGEN_STRONG_INLINE Packet1cd pxor <Packet1cd>(const Packet1cd& a, const Packet1cd& b) { return Packet1cd(pxor(a.v,b.v)); }
390template<> EIGEN_STRONG_INLINE Packet1cd pandnot<Packet1cd>(const Packet1cd& a, const Packet1cd& b) { return Packet1cd(pandnot(a.v, b.v)); }
391
392template<> EIGEN_STRONG_INLINE Packet1cd ploaddup<Packet1cd>(const std::complex<double>* from) { return pset1<Packet1cd>(*from); }
393
394template<> EIGEN_STRONG_INLINE void prefetch<std::complex<double> >(const std::complex<double> * addr) { EIGEN_PPC_PREFETCH(addr); }
395
396template<> EIGEN_STRONG_INLINE std::complex<double> pfirst<Packet1cd>(const Packet1cd& a)
397{
398 EIGEN_ALIGN16 std::complex<double> res[2];
399 pstore<std::complex<double> >(res, a);
400
401 return res[0];
402}
403
404template<> EIGEN_STRONG_INLINE Packet1cd preverse(const Packet1cd& a) { return a; }
405
406template<> EIGEN_STRONG_INLINE std::complex<double> predux<Packet1cd>(const Packet1cd& a) { return pfirst(a); }
407template<> EIGEN_STRONG_INLINE Packet1cd preduxp<Packet1cd>(const Packet1cd* vecs) { return vecs[0]; }
408
409template<> EIGEN_STRONG_INLINE std::complex<double> predux_mul<Packet1cd>(const Packet1cd& a) { return pfirst(a); }
410
411template<int Offset>
412struct palign_impl<Offset,Packet1cd>
413{
414 static EIGEN_STRONG_INLINE void run(Packet1cd& /*first*/, const Packet1cd& /*second*/)
415 {
416 // FIXME is it sure we never have to align a Packet1cd?
417 // Even though a std::complex<double> has 16 bytes, it is not necessarily aligned on a 16 bytes boundary...
418 }
419};
420
421template<> struct conj_helper<Packet1cd, Packet1cd, false,true>
422{
423 EIGEN_STRONG_INLINE Packet1cd pmadd(const Packet1cd& x, const Packet1cd& y, const Packet1cd& c) const
424 { return padd(pmul(x,y),c); }
425
426 EIGEN_STRONG_INLINE Packet1cd pmul(const Packet1cd& a, const Packet1cd& b) const
427 {
428 return internal::pmul(a, pconj(b));
429 }
430};
431
432template<> struct conj_helper<Packet1cd, Packet1cd, true,false>
433{
434 EIGEN_STRONG_INLINE Packet1cd pmadd(const Packet1cd& x, const Packet1cd& y, const Packet1cd& c) const
435 { return padd(pmul(x,y),c); }
436
437 EIGEN_STRONG_INLINE Packet1cd pmul(const Packet1cd& a, const Packet1cd& b) const
438 {
439 return internal::pmul(pconj(a), b);
440 }
441};
442
443template<> struct conj_helper<Packet1cd, Packet1cd, true,true>
444{
445 EIGEN_STRONG_INLINE Packet1cd pmadd(const Packet1cd& x, const Packet1cd& y, const Packet1cd& c) const
446 { return padd(pmul(x,y),c); }
447
448 EIGEN_STRONG_INLINE Packet1cd pmul(const Packet1cd& a, const Packet1cd& b) const
449 {
450 return pconj(internal::pmul(a, b));
451 }
452};
453
454EIGEN_MAKE_CONJ_HELPER_CPLX_REAL(Packet1cd,Packet2d)
455
456template<> EIGEN_STRONG_INLINE Packet1cd pdiv<Packet1cd>(const Packet1cd& a, const Packet1cd& b)
457{
458 // TODO optimize it for AltiVec
459 Packet1cd res = conj_helper<Packet1cd,Packet1cd,false,true>().pmul(a,b);
460 Packet2d s = pmul<Packet2d>(b.v, b.v);
461 return Packet1cd(pdiv(res.v, padd<Packet2d>(s, vec_perm(s, s, p16uc_REVERSE64))));
462}
463
464EIGEN_STRONG_INLINE Packet1cd pcplxflip/*<Packet1cd>*/(const Packet1cd& x)
465{
466 return Packet1cd(preverse(Packet2d(x.v)));
467}
468
469EIGEN_STRONG_INLINE void ptranspose(PacketBlock<Packet1cd,2>& kernel)
470{
471 Packet2d tmp = vec_perm(kernel.packet[0].v, kernel.packet[1].v, p16uc_TRANSPOSE64_HI);
472 kernel.packet[1].v = vec_perm(kernel.packet[0].v, kernel.packet[1].v, p16uc_TRANSPOSE64_LO);
473 kernel.packet[0].v = tmp;
474}
475#endif // __VSX__
476} // end namespace internal
477
478} // end namespace Eigen
479
480#endif // EIGEN_COMPLEX32_ALTIVEC_H
@ Aligned16
Definition Constants.h:230
Namespace containing all symbols from the Eigen library.
Definition A05_PortingFrom2To3.dox:1
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:65
const Product< MatrixDerived, PermutationDerived, AliasFreeProduct > operator*(const MatrixBase< MatrixDerived > &matrix, const PermutationBase< PermutationDerived > &permutation)
Definition PermutationMatrix.h:515