11 #ifndef EIGEN_COMPLEX32_ALTIVEC_H
12 #define EIGEN_COMPLEX32_ALTIVEC_H
18 #if !defined(__ARCH__) || (defined(__ARCH__) && __ARCH__ >= 12)
36 #if !defined(__ARCH__) || (defined(__ARCH__) && __ARCH__ < 12)
46 template<>
struct packet_traits<
std::complex<float> > : default_packet_traits
71 template<>
struct packet_traits<
std::complex<double> > : default_packet_traits
115 pstore<std::complex<double> >(to, from);
130 v1 = vec_madd(a_re, b.v, p2d_ZERO);
132 v2 = vec_madd(a_im, b.v, p2d_ZERO);
136 return Packet1cd(v1 + v2);
154 pstore<std::complex<double> >(&res,
a);
187 kernel.packet[0].v = tmp;
199 pstore<std::complex<float> >(res,
a);
205 #if !defined(__ARCH__) || (defined(__ARCH__) && __ARCH__ < 12)
209 res.
cd[0] = Packet1cd(vec_ld2f((
const float *)&from));
210 res.cd[1] = res.cd[0];
217 if((std::ptrdiff_t(&from) % 16) == 0)
226 template<>
EIGEN_DEVICE_FUNC inline Packet2cf pgather<std::complex<float>, Packet2cf>(
const std::complex<float>* from,
Index stride)
229 af[0] = from[0*stride];
230 af[1] = from[1*stride];
233 template<>
EIGEN_DEVICE_FUNC inline void pscatter<std::complex<float>, Packet2cf>(std::complex<float>* to,
const Packet2cf& from,
Index stride)
236 pstore<std::complex<float> >((std::complex<float> *) af, from);
237 to[0*stride] = af[0];
238 to[1*stride] = af[1];
255 #if !defined(__ARCH__) || (defined(__ARCH__) && __ARCH__ < 12)
260 Packet2d tmp1 = { eq.v4f[0][1], eq.v4f[0][0] };
261 Packet2d tmp2 = { eq.v4f[1][1], eq.v4f[1][0] };
271 res.v.v4f[1] =
pconj(Packet1cd(
reinterpret_cast<Packet2d>(
a.v.v4f[1]))).
v;
278 res.
v.v4f[0] =
pmul(Packet1cd(
reinterpret_cast<Packet2d>(
a.v.v4f[0])), Packet1cd(
reinterpret_cast<Packet2d>(b.v.v4f[0]))).v;
279 res.v.
v4f[1] =
pmul(Packet1cd(
reinterpret_cast<Packet2d>(
a.v.v4f[1])), Packet1cd(
reinterpret_cast<Packet2d>(b.v.v4f[1]))).v;
293 std::complex<float> res;
295 vec_st2f(b.v, (
float*)&res);
301 std::complex<float> res;
303 vec_st2f(b.v, (
float*)&res);
328 Packet1cd tmp = kernel.packet[0].cd[1];
329 kernel.packet[0].cd[1] = kernel.packet[1].cd[0];
330 kernel.packet[1].cd[0] = tmp;
333 template<>
EIGEN_STRONG_INLINE Packet2cf
pblend(
const Selector<2>& ifPacket,
const Packet2cf& thenPacket,
const Packet2cf& elsePacket) {
335 const Selector<4> ifPacket4 = { ifPacket.select[0], ifPacket.select[0], ifPacket.select[1], ifPacket.select[1] };
336 result.v = pblend<Packet4f>(ifPacket4, thenPacket.v, elsePacket.v);
342 Packet4f tmp = { eq[1], eq[0], eq[3], eq[2] };
357 prod_im = a_im * b.v;
363 prod = pmadd<Packet4f>(a_re, b.v, prod_im);
365 return Packet2cf(prod);
372 return Packet2cf(rev_a);
378 b = vec_sld(
a.v,
a.v, 8);
387 b = vec_sld(
a.v,
a.v, 8);
412 kernel.packet[0].v = tmp;
415 template<>
EIGEN_STRONG_INLINE Packet2cf
pblend(
const Selector<2>& ifPacket,
const Packet2cf& thenPacket,
const Packet2cf& elsePacket) {
417 result.v =
reinterpret_cast<Packet4f>(pblend<Packet2d>(ifPacket,
reinterpret_cast<Packet2d>(thenPacket.v),
reinterpret_cast<Packet2d>(elsePacket.v)));
#define EIGEN_MAKE_CONJ_HELPER_CPLX_REAL(PACKET_CPLX, PACKET_REAL)
Definition: ConjHelper.h:14
#define EIGEN_DEBUG_ALIGNED_STORE
Definition: GenericPacketMath.h:35
#define EIGEN_DEBUG_ALIGNED_LOAD
Definition: GenericPacketMath.h:27
#define EIGEN_DEBUG_UNALIGNED_STORE
Definition: GenericPacketMath.h:39
#define EIGEN_DEBUG_UNALIGNED_LOAD
Definition: GenericPacketMath.h:31
#define EIGEN_UNUSED
Definition: Macros.h:1067
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:976
#define EIGEN_STRONG_INLINE
Definition: Macros.h:917
#define EIGEN_ZVECTOR_PREFETCH(ADDR)
Definition: PacketMath.h:150
@ Aligned16
Definition: Constants.h:235
EIGEN_STRONG_INLINE Packet4f pandnot< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition: PacketMath.h:914
static Packet16uc p16uc_REVERSE64
Definition: PacketMath.h:125
v2f64 Packet2d
Definition: PacketMath.h:820
static Packet2ul p2ul_CONJ_XOR2
Definition: Complex.h:23
EIGEN_STRONG_INLINE Packet2cf pconj(const Packet2cf &a)
Definition: Complex.h:167
EIGEN_STRONG_INLINE std::complex< float > predux_mul< Packet2cf >(const Packet2cf &a)
Definition: Complex.h:199
EIGEN_STRONG_INLINE std::complex< float > predux< Packet2cf >(const Packet2cf &a)
Definition: Complex.h:191
EIGEN_STRONG_INLINE Packet4f padd< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition: PacketMath.h:774
EIGEN_STRONG_INLINE Packet4f pcmp_eq< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition: PacketMath.h:1400
EIGEN_STRONG_INLINE std::complex< double > predux_mul< Packet1cd >(const Packet1cd &a)
Definition: Complex.h:605
EIGEN_STRONG_INLINE Packet2cf pandnot< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
Definition: Complex.h:172
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 Packet2cf ploaddup< Packet2cf >(const std::complex< float > *from)
Definition: Complex.h:125
static Packet16uc p16uc_TRANSPOSE64_LO
Definition: PacketMath.h:134
EIGEN_DEVICE_FUNC Packet pdiv(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:244
EIGEN_STRONG_INLINE Packet2cf pmul< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
Definition: Complex.h:173
EIGEN_STRONG_INLINE Packet4f por< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition: PacketMath.h:900
EIGEN_STRONG_INLINE Packet4f pmul< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition: PacketMath.h:795
static Packet16uc p16uc_PSET32_WEVEN
Definition: PacketMath.h:127
EIGEN_STRONG_INLINE Packet4i pblend(const Selector< 4 > &ifPacket, const Packet4i &thenPacket, const Packet4i &elsePacket)
Definition: PacketMath.h:2107
EIGEN_STRONG_INLINE Packet1cd pmul< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
Definition: Complex.h:498
EIGEN_STRONG_INLINE std::complex< float > pfirst< Packet2cf >(const Packet2cf &a)
Definition: Complex.h:176
EIGEN_STRONG_INLINE Packet4f pload< Packet4f >(const float *from)
Definition: PacketMath.h:443
EIGEN_STRONG_INLINE Packet1cd ploadu< Packet1cd >(const std::complex< double > *from)
Definition: Complex.h:456
EIGEN_STRONG_INLINE Packet2cf por< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
Definition: Complex.h:170
EIGEN_STRONG_INLINE Packet2cf pset1< Packet2cf >(const std::complex< float > &from)
Definition: Complex.h:112
__vector unsigned int Packet4ui
Definition: PacketMath.h:32
EIGEN_STRONG_INLINE Packet2cf preverse(const Packet2cf &a)
Definition: Complex.h:184
static Packet4ui p4ui_CONJ_XOR
Definition: Complex.h:18
EIGEN_DEVICE_FUNC Packet pmul(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:237
EIGEN_STRONG_INLINE Packet1cd pcplxflip(const Packet1cd &x)
Definition: Complex.h:620
static Packet2ul p2ul_CONJ_XOR1
Definition: Complex.h:22
EIGEN_STRONG_INLINE Packet2d pload< Packet2d >(const double *from)
Definition: PacketMath.h:967
EIGEN_STRONG_INLINE Packet2cf pnegate(const Packet2cf &a)
Definition: Complex.h:166
EIGEN_STRONG_INLINE Packet1cd pxor< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
Definition: Complex.h:519
EIGEN_STRONG_INLINE Packet2cf pdiv< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
Definition: Complex.h:211
EIGEN_STRONG_INLINE Packet1cd padd< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
Definition: Complex.h:470
EIGEN_STRONG_INLINE Packet2cf ploadu< Packet2cf >(const std::complex< float > *from)
Definition: Complex.h:124
static Packet2d p2d_ZERO_
Definition: PacketMath.h:94
EIGEN_STRONG_INLINE Packet1cd ploaddup< Packet1cd >(const std::complex< double > *from)
Definition: Complex.h:533
EIGEN_STRONG_INLINE Packet2cf pload< Packet2cf >(const std::complex< float > *from)
Definition: Complex.h:123
EIGEN_STRONG_INLINE bfloat16 pfirst(const Packet8bf &a)
Definition: PacketMath.h:1429
EIGEN_STRONG_INLINE std::complex< double > predux< Packet1cd >(const Packet1cd &a)
Definition: Complex.h:598
EIGEN_DEVICE_FUNC void pstore(Scalar *to, const Packet &from)
Definition: GenericPacketMath.h:696
static Packet16uc p16uc_PSET64_HI
Definition: PacketMath.h:131
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 Packet1cd pload< Packet1cd >(const std::complex< double > *from)
Definition: Complex.h:449
EIGEN_STRONG_INLINE Packet2cf pcplxflip< Packet2cf >(const Packet2cf &x)
Definition: Complex.h:219
EIGEN_STRONG_INLINE Packet1cd pand< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
Definition: Complex.h:505
EIGEN_STRONG_INLINE Packet2cf pand< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
Definition: Complex.h:169
EIGEN_STRONG_INLINE Packet2cf pcmp_eq(const Packet2cf &a, const Packet2cf &b)
Definition: Complex.h:231
EIGEN_STRONG_INLINE Packet1cd pandnot< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
Definition: Complex.h:526
EIGEN_DEVICE_FUNC void pstoreu(Scalar *to, const Packet &from)
Definition: GenericPacketMath.h:700
EIGEN_STRONG_INLINE Packet2cf pxor< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
Definition: Complex.h:171
EIGEN_STRONG_INLINE Packet4f ploadu< Packet4f >(const float *from)
Definition: PacketMath.h:968
EIGEN_STRONG_INLINE Packet2cf psub< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
Definition: Complex.h:165
EIGEN_STRONG_INLINE Packet4f pand< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition: PacketMath.h:891
static Packet16uc p16uc_PSET32_WODD
Definition: PacketMath.h:126
static Packet16uc p16uc_PSET64_LO
Definition: PacketMath.h:132
static Packet16uc p16uc_COMPLEX32_REV
Definition: PacketMath.h:136
EIGEN_STRONG_INLINE Packet2cf padd< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
Definition: Complex.h:164
EIGEN_STRONG_INLINE Packet1cd por< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
Definition: Complex.h:512
__vector float Packet4f
Definition: PacketMath.h:30
EIGEN_STRONG_INLINE Packet4f psub< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition: PacketMath.h:782
EIGEN_STRONG_INLINE Packet1cd pset1< Packet1cd >(const std::complex< double > &from)
Definition: Complex.h:463
EIGEN_STRONG_INLINE std::complex< double > pfirst< Packet1cd >(const Packet1cd &a)
Definition: Complex.h:584
static Packet16uc p16uc_COMPLEX32_REV2
Definition: PacketMath.h:141
EIGEN_STRONG_INLINE Packet1cd pdiv< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
Definition: Complex.h:614
v2u64 Packet2ul
Definition: PacketMath.h:822
EIGEN_STRONG_INLINE Packet1cd psub< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
Definition: Complex.h:477
static Packet16uc p16uc_TRANSPOSE64_HI
Definition: PacketMath.h:133
Namespace containing all symbols from the Eigen library.
Definition: LDLT.h:16
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
Definition: document.h:416
Definition: json.hpp:5678
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1181
Definition: Complex.h:341
EIGEN_STRONG_INLINE Packet1cd(const Packet2d &a)
Definition: Complex.h:28
EIGEN_STRONG_INLINE Packet1cd()
Definition: Complex.h:27
Packet2d v
Definition: Complex.h:410
Packet4f v
Definition: Complex.h:80
EIGEN_STRONG_INLINE Packet2cf()
Definition: Complex.h:34
Packet1cd cd[2]
Definition: Complex.h:39
EIGEN_STRONG_INLINE Packet2cf(const Packet4f &a)
Definition: Complex.h:35
Definition: GenericPacketMath.h:1014
@ HasBlend
Definition: GenericPacketMath.h:60
@ HasDiv
Definition: GenericPacketMath.h:65
Packet1cd half
Definition: Complex.h:74
Packet1cd type
Definition: Complex.h:73
Packet2cf half
Definition: Complex.h:49
Packet2cf type
Definition: Complex.h:48
@ 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
@ HasSetLinear
Definition: GenericPacketMath.h:126
@ HasMin
Definition: GenericPacketMath.h:123
@ HasAbs2
Definition: GenericPacketMath.h:122
@ 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
Packet1cd half
Definition: Complex.h:95
Packet2cf half
Definition: Complex.h:94
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
Packet4f v4f
Definition: PacketMath.h:60