$darkmode
Eigen  5.0.1-dev
Complex.h
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2018 Wave Computing, Inc.
5 // Written by:
6 // Chris Larsen
7 // Alexey Frunze (afrunze@wavecomp.com)
8 //
9 // This Source Code Form is subject to the terms of the Mozilla
10 // Public License v. 2.0. If a copy of the MPL was not distributed
11 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 
13 #ifndef EIGEN_COMPLEX_MSA_H
14 #define EIGEN_COMPLEX_MSA_H
15 
16 #include <iostream>
17 
18 // IWYU pragma: private
19 #include "../../InternalHeaderCheck.h"
20 
21 namespace Eigen {
22 
23 namespace internal {
24 
25 //---------- float ----------
26 struct Packet2cf {
27  EIGEN_STRONG_INLINE Packet2cf() {}
28  EIGEN_STRONG_INLINE explicit Packet2cf(const std::complex<float>& a, const std::complex<float>& b) {
29  Packet4f t = {std::real(a), std::imag(a), std::real(b), std::imag(b)};
30  v = t;
31  }
32  EIGEN_STRONG_INLINE explicit Packet2cf(const Packet4f& a) : v(a) {}
33  EIGEN_STRONG_INLINE Packet2cf(const Packet2cf& a) : v(a.v) {}
34  EIGEN_STRONG_INLINE Packet2cf& operator=(const Packet2cf& b) {
35  v = b.v;
36  return *this;
37  }
38  EIGEN_STRONG_INLINE Packet2cf conjugate(void) const {
39  return Packet2cf((Packet4f)__builtin_msa_bnegi_d((v2u64)v, 63));
40  }
41  EIGEN_STRONG_INLINE Packet2cf& operator*=(const Packet2cf& b) {
42  Packet4f v1, v2;
43 
44  // Get the real values of a | a1_re | a1_re | a2_re | a2_re |
45  v1 = (Packet4f)__builtin_msa_ilvev_w((v4i32)v, (v4i32)v);
46  // Get the imag values of a | a1_im | a1_im | a2_im | a2_im |
47  v2 = (Packet4f)__builtin_msa_ilvod_w((v4i32)v, (v4i32)v);
48  // Multiply the real a with b
49  v1 = pmul(v1, b.v);
50  // Multiply the imag a with b
51  v2 = pmul(v2, b.v);
52  // Conjugate v2
53  v2 = Packet2cf(v2).conjugate().v;
54  // Swap real/imag elements in v2.
55  v2 = (Packet4f)__builtin_msa_shf_w((v4i32)v2, EIGEN_MSA_SHF_I8(1, 0, 3, 2));
56  // Add and return the result
57  v = padd(v1, v2);
58  return *this;
59  }
60  EIGEN_STRONG_INLINE Packet2cf operator*(const Packet2cf& b) const { return Packet2cf(*this) *= b; }
61  EIGEN_STRONG_INLINE Packet2cf& operator+=(const Packet2cf& b) {
62  v = padd(v, b.v);
63  return *this;
64  }
65  EIGEN_STRONG_INLINE Packet2cf operator+(const Packet2cf& b) const { return Packet2cf(*this) += b; }
66  EIGEN_STRONG_INLINE Packet2cf& operator-=(const Packet2cf& b) {
67  v = psub(v, b.v);
68  return *this;
69  }
70  EIGEN_STRONG_INLINE Packet2cf operator-(const Packet2cf& b) const { return Packet2cf(*this) -= b; }
71  EIGEN_STRONG_INLINE Packet2cf operator/(const Packet2cf& b) const { return pdiv_complex(Packet2cf(*this), b); }
72  EIGEN_STRONG_INLINE Packet2cf& operator/=(const Packet2cf& b) {
73  *this = Packet2cf(*this) / b;
74  return *this;
75  }
76  EIGEN_STRONG_INLINE Packet2cf operator-(void) const { return Packet2cf(pnegate(v)); }
77 
78  Packet4f v;
79 };
80 
81 inline std::ostream& operator<<(std::ostream& os, const Packet2cf& value) {
82  os << "[ (" << value.v[0] << ", " << value.v[1]
83  << "i),"
84  " ("
85  << value.v[2] << ", " << value.v[3] << "i) ]";
86  return os;
87 }
88 
89 template <>
90 struct packet_traits<std::complex<float> > : default_packet_traits {
91  typedef Packet2cf type;
92  typedef Packet2cf half;
93  enum {
94  Vectorizable = 1,
95  AlignedOnScalar = 1,
96  size = 2,
97 
98  HasAdd = 1,
99  HasSub = 1,
100  HasMul = 1,
101  HasDiv = 1,
102  HasNegate = 1,
103  HasAbs = 0,
104  HasAbs2 = 0,
105  HasMin = 0,
106  HasMax = 0,
107  HasSetLinear = 0,
108  HasBlend = 1
109  };
110 };
111 
112 template <>
113 struct unpacket_traits<Packet2cf> {
114  typedef std::complex<float> type;
115  enum {
116  size = 2,
117  alignment = Aligned16,
118  vectorizable = true,
119  masked_load_available = false,
120  masked_store_available = false
121  };
122  typedef Packet2cf half;
123 };
124 
125 template <>
126 EIGEN_STRONG_INLINE Packet2cf pset1<Packet2cf>(const std::complex<float>& from) {
127  EIGEN_MSA_DEBUG;
128 
129  float f0 = from.real(), f1 = from.imag();
130  Packet4f v0 = {f0, f0, f0, f0};
131  Packet4f v1 = {f1, f1, f1, f1};
132  return Packet2cf((Packet4f)__builtin_msa_ilvr_w((Packet4i)v1, (Packet4i)v0));
133 }
134 
135 template <>
136 EIGEN_STRONG_INLINE Packet2cf padd<Packet2cf>(const Packet2cf& a, const Packet2cf& b) {
137  EIGEN_MSA_DEBUG;
138 
139  return a + b;
140 }
141 
142 template <>
143 EIGEN_STRONG_INLINE Packet2cf psub<Packet2cf>(const Packet2cf& a, const Packet2cf& b) {
144  EIGEN_MSA_DEBUG;
145 
146  return a - b;
147 }
148 
149 template <>
150 EIGEN_STRONG_INLINE Packet2cf pnegate(const Packet2cf& a) {
151  EIGEN_MSA_DEBUG;
152 
153  return -a;
154 }
155 
156 template <>
157 EIGEN_STRONG_INLINE Packet2cf pconj(const Packet2cf& a) {
158  EIGEN_MSA_DEBUG;
159 
160  return a.conjugate();
161 }
162 
163 template <>
164 EIGEN_STRONG_INLINE Packet2cf pmul<Packet2cf>(const Packet2cf& a, const Packet2cf& b) {
165  EIGEN_MSA_DEBUG;
166 
167  return a * b;
168 }
169 
170 template <>
171 EIGEN_STRONG_INLINE Packet2cf pand<Packet2cf>(const Packet2cf& a, const Packet2cf& b) {
172  EIGEN_MSA_DEBUG;
173 
174  return Packet2cf(pand(a.v, b.v));
175 }
176 
177 template <>
178 EIGEN_STRONG_INLINE Packet2cf por<Packet2cf>(const Packet2cf& a, const Packet2cf& b) {
179  EIGEN_MSA_DEBUG;
180 
181  return Packet2cf(por(a.v, b.v));
182 }
183 
184 template <>
185 EIGEN_STRONG_INLINE Packet2cf pxor<Packet2cf>(const Packet2cf& a, const Packet2cf& b) {
186  EIGEN_MSA_DEBUG;
187 
188  return Packet2cf(pxor(a.v, b.v));
189 }
190 
191 template <>
192 EIGEN_STRONG_INLINE Packet2cf pandnot<Packet2cf>(const Packet2cf& a, const Packet2cf& b) {
193  EIGEN_MSA_DEBUG;
194 
195  return Packet2cf(pandnot(a.v, b.v));
196 }
197 
198 template <>
199 EIGEN_STRONG_INLINE Packet2cf pload<Packet2cf>(const std::complex<float>* from) {
200  EIGEN_MSA_DEBUG;
201 
202  EIGEN_DEBUG_ALIGNED_LOAD return Packet2cf(pload<Packet4f>((const float*)from));
203 }
204 
205 template <>
206 EIGEN_STRONG_INLINE Packet2cf ploadu<Packet2cf>(const std::complex<float>* from) {
207  EIGEN_MSA_DEBUG;
208 
209  EIGEN_DEBUG_UNALIGNED_LOAD return Packet2cf(ploadu<Packet4f>((const float*)from));
210 }
211 
212 template <>
213 EIGEN_STRONG_INLINE Packet2cf ploaddup<Packet2cf>(const std::complex<float>* from) {
214  EIGEN_MSA_DEBUG;
215 
216  return pset1<Packet2cf>(*from);
217 }
218 
219 template <>
220 EIGEN_STRONG_INLINE void pstore<std::complex<float> >(std::complex<float>* to, const Packet2cf& from) {
221  EIGEN_MSA_DEBUG;
222 
223  EIGEN_DEBUG_ALIGNED_STORE pstore<float>((float*)to, from.v);
224 }
225 
226 template <>
227 EIGEN_STRONG_INLINE void pstoreu<std::complex<float> >(std::complex<float>* to, const Packet2cf& from) {
228  EIGEN_MSA_DEBUG;
229 
230  EIGEN_DEBUG_UNALIGNED_STORE pstoreu<float>((float*)to, from.v);
231 }
232 
233 template <>
234 EIGEN_DEVICE_FUNC inline Packet2cf pgather<std::complex<float>, Packet2cf>(const std::complex<float>* from,
235  Index stride) {
236  EIGEN_MSA_DEBUG;
237 
238  return Packet2cf(from[0 * stride], from[1 * stride]);
239 }
240 
241 template <>
242 EIGEN_DEVICE_FUNC inline void pscatter<std::complex<float>, Packet2cf>(std::complex<float>* to, const Packet2cf& from,
243  Index stride) {
244  EIGEN_MSA_DEBUG;
245 
246  *to = std::complex<float>(from.v[0], from.v[1]);
247  to += stride;
248  *to = std::complex<float>(from.v[2], from.v[3]);
249 }
250 
251 template <>
252 EIGEN_STRONG_INLINE void prefetch<std::complex<float> >(const std::complex<float>* addr) {
253  EIGEN_MSA_DEBUG;
254 
255  prefetch(reinterpret_cast<const float*>(addr));
256 }
257 
258 template <>
259 EIGEN_STRONG_INLINE std::complex<float> pfirst<Packet2cf>(const Packet2cf& a) {
260  EIGEN_MSA_DEBUG;
261 
262  return std::complex<float>(a.v[0], a.v[1]);
263 }
264 
265 template <>
266 EIGEN_STRONG_INLINE Packet2cf preverse(const Packet2cf& a) {
267  EIGEN_MSA_DEBUG;
268 
269  return Packet2cf((Packet4f)__builtin_msa_shf_w((v4i32)a.v, EIGEN_MSA_SHF_I8(2, 3, 0, 1)));
270 }
271 
272 template <>
273 EIGEN_STRONG_INLINE Packet2cf pcplxflip<Packet2cf>(const Packet2cf& a) {
274  EIGEN_MSA_DEBUG;
275 
276  return Packet2cf((Packet4f)__builtin_msa_shf_w((v4i32)a.v, EIGEN_MSA_SHF_I8(1, 0, 3, 2)));
277 }
278 
279 template <>
280 EIGEN_STRONG_INLINE std::complex<float> predux<Packet2cf>(const Packet2cf& a) {
281  EIGEN_MSA_DEBUG;
282 
283  Packet4f value = (Packet4f)preverse((Packet2d)a.v);
284  value += a.v;
285  return std::complex<float>(value[0], value[1]);
286 }
287 
288 template <>
289 EIGEN_STRONG_INLINE std::complex<float> predux_mul<Packet2cf>(const Packet2cf& a) {
290  EIGEN_MSA_DEBUG;
291 
292  return std::complex<float>((a.v[0] * a.v[2]) - (a.v[1] * a.v[3]), (a.v[0] * a.v[3]) + (a.v[1] * a.v[2]));
293 }
294 
295 EIGEN_MAKE_CONJ_HELPER_CPLX_REAL(Packet2cf, Packet4f)
296 
297 template <>
298 EIGEN_STRONG_INLINE Packet2cf pdiv<Packet2cf>(const Packet2cf& a, const Packet2cf& b) {
299  EIGEN_MSA_DEBUG;
300 
301  return a / b;
302 }
303 
304 inline std::ostream& operator<<(std::ostream& os, const PacketBlock<Packet2cf, 2>& value) {
305  os << "[ " << value.packet[0] << ", " << std::endl << " " << value.packet[1] << " ]";
306  return os;
307 }
308 
309 EIGEN_DEVICE_FUNC inline void ptranspose(PacketBlock<Packet2cf, 2>& kernel) {
310  EIGEN_MSA_DEBUG;
311 
312  Packet4f tmp = (Packet4f)__builtin_msa_ilvl_d((v2i64)kernel.packet[1].v, (v2i64)kernel.packet[0].v);
313  kernel.packet[0].v = (Packet4f)__builtin_msa_ilvr_d((v2i64)kernel.packet[1].v, (v2i64)kernel.packet[0].v);
314  kernel.packet[1].v = tmp;
315 }
316 
317 template <>
318 EIGEN_STRONG_INLINE Packet2cf pblend(const Selector<2>& ifPacket, const Packet2cf& thenPacket,
319  const Packet2cf& elsePacket) {
320  return (Packet2cf)(Packet4f)pblend<Packet2d>(ifPacket, (Packet2d)thenPacket.v, (Packet2d)elsePacket.v);
321 }
322 
323 //---------- double ----------
324 
325 struct Packet1cd {
326  EIGEN_STRONG_INLINE Packet1cd() {}
327  EIGEN_STRONG_INLINE explicit Packet1cd(const std::complex<double>& a) {
328  v[0] = std::real(a);
329  v[1] = std::imag(a);
330  }
331  EIGEN_STRONG_INLINE explicit Packet1cd(const Packet2d& a) : v(a) {}
332  EIGEN_STRONG_INLINE Packet1cd(const Packet1cd& a) : v(a.v) {}
333  EIGEN_STRONG_INLINE Packet1cd& operator=(const Packet1cd& b) {
334  v = b.v;
335  return *this;
336  }
337  EIGEN_STRONG_INLINE Packet1cd conjugate(void) const {
338  static const v2u64 p2ul_CONJ_XOR = {0x0, 0x8000000000000000};
339  return (Packet1cd)pxor(v, (Packet2d)p2ul_CONJ_XOR);
340  }
341  EIGEN_STRONG_INLINE Packet1cd& operator*=(const Packet1cd& b) {
342  Packet2d v1, v2;
343 
344  // Get the real values of a | a1_re | a1_re
345  v1 = (Packet2d)__builtin_msa_ilvev_d((v2i64)v, (v2i64)v);
346  // Get the imag values of a | a1_im | a1_im
347  v2 = (Packet2d)__builtin_msa_ilvod_d((v2i64)v, (v2i64)v);
348  // Multiply the real a with b
349  v1 = pmul(v1, b.v);
350  // Multiply the imag a with b
351  v2 = pmul(v2, b.v);
352  // Conjugate v2
353  v2 = Packet1cd(v2).conjugate().v;
354  // Swap real/imag elements in v2.
355  v2 = (Packet2d)__builtin_msa_shf_w((v4i32)v2, EIGEN_MSA_SHF_I8(2, 3, 0, 1));
356  // Add and return the result
357  v = padd(v1, v2);
358  return *this;
359  }
360  EIGEN_STRONG_INLINE Packet1cd operator*(const Packet1cd& b) const { return Packet1cd(*this) *= b; }
361  EIGEN_STRONG_INLINE Packet1cd& operator+=(const Packet1cd& b) {
362  v = padd(v, b.v);
363  return *this;
364  }
365  EIGEN_STRONG_INLINE Packet1cd operator+(const Packet1cd& b) const { return Packet1cd(*this) += b; }
366  EIGEN_STRONG_INLINE Packet1cd& operator-=(const Packet1cd& b) {
367  v = psub(v, b.v);
368  return *this;
369  }
370  EIGEN_STRONG_INLINE Packet1cd operator-(const Packet1cd& b) const { return Packet1cd(*this) -= b; }
371  EIGEN_STRONG_INLINE Packet1cd& operator/=(const Packet1cd& b) {
372  *this *= b.conjugate();
373  Packet2d s = pmul<Packet2d>(b.v, b.v);
374  s = padd(s, preverse<Packet2d>(s));
375  v = pdiv(v, s);
376  return *this;
377  }
378  EIGEN_STRONG_INLINE Packet1cd operator/(const Packet1cd& b) const { return Packet1cd(*this) /= b; }
379  EIGEN_STRONG_INLINE Packet1cd operator-(void) const { return Packet1cd(pnegate(v)); }
380 
381  Packet2d v;
382 };
383 
384 inline std::ostream& operator<<(std::ostream& os, const Packet1cd& value) {
385  os << "[ (" << value.v[0] << ", " << value.v[1] << "i) ]";
386  return os;
387 }
388 
389 template <>
390 struct packet_traits<std::complex<double> > : default_packet_traits {
391  typedef Packet1cd type;
392  typedef Packet1cd half;
393  enum {
394  Vectorizable = 1,
395  AlignedOnScalar = 0,
396  size = 1,
397 
398  HasAdd = 1,
399  HasSub = 1,
400  HasMul = 1,
401  HasDiv = 1,
402  HasNegate = 1,
403  HasAbs = 0,
404  HasAbs2 = 0,
405  HasMin = 0,
406  HasMax = 0,
407  HasSetLinear = 0
408  };
409 };
410 
411 template <>
412 struct unpacket_traits<Packet1cd> {
413  typedef std::complex<double> type;
414  enum {
415  size = 1,
416  alignment = Aligned16,
417  vectorizable = true,
418  masked_load_available = false,
419  masked_store_available = false
420  };
421  typedef Packet1cd half;
422 };
423 
424 template <>
425 EIGEN_STRONG_INLINE Packet1cd pload<Packet1cd>(const std::complex<double>* from) {
426  EIGEN_MSA_DEBUG;
427 
428  EIGEN_DEBUG_ALIGNED_LOAD return Packet1cd(pload<Packet2d>((const double*)from));
429 }
430 
431 template <>
432 EIGEN_STRONG_INLINE Packet1cd ploadu<Packet1cd>(const std::complex<double>* from) {
433  EIGEN_MSA_DEBUG;
434 
435  EIGEN_DEBUG_UNALIGNED_LOAD return Packet1cd(ploadu<Packet2d>((const double*)from));
436 }
437 
438 template <>
439 EIGEN_STRONG_INLINE Packet1cd pset1<Packet1cd>(const std::complex<double>& from) {
440  EIGEN_MSA_DEBUG;
441 
442  return Packet1cd(from);
443 }
444 
445 template <>
446 EIGEN_STRONG_INLINE Packet1cd padd<Packet1cd>(const Packet1cd& a, const Packet1cd& b) {
447  EIGEN_MSA_DEBUG;
448 
449  return a + b;
450 }
451 
452 template <>
453 EIGEN_STRONG_INLINE Packet1cd psub<Packet1cd>(const Packet1cd& a, const Packet1cd& b) {
454  EIGEN_MSA_DEBUG;
455 
456  return a - b;
457 }
458 
459 template <>
460 EIGEN_STRONG_INLINE Packet1cd pnegate(const Packet1cd& a) {
461  EIGEN_MSA_DEBUG;
462 
463  return -a;
464 }
465 
466 template <>
467 EIGEN_STRONG_INLINE Packet1cd pconj(const Packet1cd& a) {
468  EIGEN_MSA_DEBUG;
469 
470  return a.conjugate();
471 }
472 
473 template <>
474 EIGEN_STRONG_INLINE Packet1cd pmul<Packet1cd>(const Packet1cd& a, const Packet1cd& b) {
475  EIGEN_MSA_DEBUG;
476 
477  return a * b;
478 }
479 
480 template <>
481 EIGEN_STRONG_INLINE Packet1cd pand<Packet1cd>(const Packet1cd& a, const Packet1cd& b) {
482  EIGEN_MSA_DEBUG;
483 
484  return Packet1cd(pand(a.v, b.v));
485 }
486 
487 template <>
488 EIGEN_STRONG_INLINE Packet1cd por<Packet1cd>(const Packet1cd& a, const Packet1cd& b) {
489  EIGEN_MSA_DEBUG;
490 
491  return Packet1cd(por(a.v, b.v));
492 }
493 
494 template <>
495 EIGEN_STRONG_INLINE Packet1cd pxor<Packet1cd>(const Packet1cd& a, const Packet1cd& b) {
496  EIGEN_MSA_DEBUG;
497 
498  return Packet1cd(pxor(a.v, b.v));
499 }
500 
501 template <>
502 EIGEN_STRONG_INLINE Packet1cd pandnot<Packet1cd>(const Packet1cd& a, const Packet1cd& b) {
503  EIGEN_MSA_DEBUG;
504 
505  return Packet1cd(pandnot(a.v, b.v));
506 }
507 
508 template <>
509 EIGEN_STRONG_INLINE Packet1cd ploaddup<Packet1cd>(const std::complex<double>* from) {
510  EIGEN_MSA_DEBUG;
511 
512  return pset1<Packet1cd>(*from);
513 }
514 
515 template <>
516 EIGEN_STRONG_INLINE void pstore<std::complex<double> >(std::complex<double>* to, const Packet1cd& from) {
517  EIGEN_MSA_DEBUG;
518 
519  EIGEN_DEBUG_ALIGNED_STORE pstore<double>((double*)to, from.v);
520 }
521 
522 template <>
523 EIGEN_STRONG_INLINE void pstoreu<std::complex<double> >(std::complex<double>* to, const Packet1cd& from) {
524  EIGEN_MSA_DEBUG;
525 
526  EIGEN_DEBUG_UNALIGNED_STORE pstoreu<double>((double*)to, from.v);
527 }
528 
529 template <>
530 EIGEN_STRONG_INLINE void prefetch<std::complex<double> >(const std::complex<double>* addr) {
531  EIGEN_MSA_DEBUG;
532 
533  prefetch(reinterpret_cast<const double*>(addr));
534 }
535 
536 template <>
537 EIGEN_DEVICE_FUNC inline Packet1cd pgather<std::complex<double>, Packet1cd>(const std::complex<double>* from,
538  Index stride __attribute__((unused))) {
539  EIGEN_MSA_DEBUG;
540 
541  Packet1cd res;
542  res.v[0] = std::real(from[0]);
543  res.v[1] = std::imag(from[0]);
544  return res;
545 }
546 
547 template <>
548 EIGEN_DEVICE_FUNC inline void pscatter<std::complex<double>, Packet1cd>(std::complex<double>* to, const Packet1cd& from,
549  Index stride __attribute__((unused))) {
550  EIGEN_MSA_DEBUG;
551 
552  pstore(to, from);
553 }
554 
555 template <>
556 EIGEN_STRONG_INLINE std::complex<double> pfirst<Packet1cd>(const Packet1cd& a) {
557  EIGEN_MSA_DEBUG;
558 
559  return std::complex<double>(a.v[0], a.v[1]);
560 }
561 
562 template <>
563 EIGEN_STRONG_INLINE Packet1cd preverse(const Packet1cd& a) {
564  EIGEN_MSA_DEBUG;
565 
566  return a;
567 }
568 
569 template <>
570 EIGEN_STRONG_INLINE std::complex<double> predux<Packet1cd>(const Packet1cd& a) {
571  EIGEN_MSA_DEBUG;
572 
573  return pfirst(a);
574 }
575 
576 template <>
577 EIGEN_STRONG_INLINE std::complex<double> predux_mul<Packet1cd>(const Packet1cd& a) {
578  EIGEN_MSA_DEBUG;
579 
580  return pfirst(a);
581 }
582 
583 EIGEN_MAKE_CONJ_HELPER_CPLX_REAL(Packet1cd, Packet2d)
584 
585 template <>
586 EIGEN_STRONG_INLINE Packet1cd pdiv<Packet1cd>(const Packet1cd& a, const Packet1cd& b) {
587  EIGEN_MSA_DEBUG;
588 
589  return a / b;
590 }
591 
592 EIGEN_STRONG_INLINE Packet1cd pcplxflip /*<Packet1cd>*/ (const Packet1cd& x) {
593  EIGEN_MSA_DEBUG;
594 
595  return Packet1cd(preverse(Packet2d(x.v)));
596 }
597 
598 inline std::ostream& operator<<(std::ostream& os, const PacketBlock<Packet1cd, 2>& value) {
599  os << "[ " << value.packet[0] << ", " << std::endl << " " << value.packet[1] << " ]";
600  return os;
601 }
602 
603 EIGEN_STRONG_INLINE void ptranspose(PacketBlock<Packet1cd, 2>& kernel) {
604  EIGEN_MSA_DEBUG;
605 
606  Packet2d v1, v2;
607 
608  v1 = (Packet2d)__builtin_msa_ilvev_d((v2i64)kernel.packet[0].v, (v2i64)kernel.packet[1].v);
609  // Get the imag values of a
610  v2 = (Packet2d)__builtin_msa_ilvod_d((v2i64)kernel.packet[0].v, (v2i64)kernel.packet[1].v);
611 
612  kernel.packet[0].v = v1;
613  kernel.packet[1].v = v2;
614 }
615 
616 } // end namespace internal
617 
618 } // end namespace Eigen
619 
620 #endif // EIGEN_COMPLEX_MSA_H
const Product< MatrixDerived, PermutationDerived, DefaultProduct > operator*(const MatrixBase< MatrixDerived > &matrix, const PermutationBase< PermutationDerived > &permutation)
Definition: PermutationMatrix.h:474
Definition: Constants.h:237
Namespace containing all symbols from the Eigen library.
Definition: B01_Experimental.dox:1
Definition: BFloat16.h:231
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:82