11 #ifndef EIGEN_COMPLEX_LSX_H
12 #define EIGEN_COMPLEX_LSX_H
15 #include "../../InternalHeaderCheck.h"
29 struct packet_traits<std::
complex<float> > : default_packet_traits {
54 struct unpacket_traits<Packet2cf> {
55 typedef std::complex<float>
type;
69 return Packet2cf(__lsx_vfadd_s(
a.v,
b.v));
73 return Packet2cf(__lsx_vfsub_s(
a.v,
b.v));
78 const uint32_t b[4] = {0x80000000u, 0x80000000u, 0x80000000u, 0x80000000u};
87 const uint32_t b[4] = {0x00000000u, 0x80000000u, 0x00000000u, 0x80000000u};
97 Packet4f part0 = __lsx_vfsub_s(part0_tmp, (__m128)__lsx_vshuf4i_w(part0_tmp, 0x31));
98 Packet4f part1_tmp = __lsx_vfmul_s((__m128)__lsx_vshuf4i_w(
a.v, 0xb1),
b.v);
99 Packet4f part1 = __lsx_vfadd_s(part1_tmp, (__m128)__lsx_vshuf4i_w(part1_tmp, 0x31));
101 res.v = (
Packet4f)__lsx_vpackev_w((__m128i)part1, (__m128i)part0);
150 float f0 = from.real(),
f1 = from.imag();
153 return Packet2cf((
Packet4f)__lsx_vilvl_w((__m128i)im, (__m128i)re));
162 EIGEN_STRONG_INLINE void pstore<std::complex<float> >(std::complex<float>* to,
const Packet2cf& from) {
167 EIGEN_STRONG_INLINE void pstoreu<std::complex<float> >(std::complex<float>* to,
const Packet2cf& from) {
172 EIGEN_DEVICE_FUNC inline Packet2cf pgather<std::complex<float>, Packet2cf>(
const std::complex<float>* from,
175 __m128i
tmp = __lsx_vldrepl_d(from, 0);
176 __m128i tmp1 = __lsx_vldrepl_d(from + stride, 0);
177 tmp = __lsx_vilvl_d(tmp1,
tmp);
183 EIGEN_DEVICE_FUNC inline void pscatter<std::complex<float>, Packet2cf>(std::complex<float>* to,
const Packet2cf& from,
185 __lsx_vstelm_d((__m128i)from.v, to, 0, 0);
186 __lsx_vstelm_d((__m128i)from.v, to + stride, 0, 1);
191 __builtin_prefetch(addr);
197 __lsx_vst(
a.v,
res, 0);
236 __m128
v = {0.0f, 0.0f, 0.0f, 0.0f};
244 t0.v = (__m128)__lsx_vpackev_w((__m128i)
a.v, (__m128i)
a.v);
245 t2.v = __lsx_vfmadd_s(t0.v,
b.v,
c.v);
246 result.v = __lsx_vfadd_s(t2.v, t1.v);
247 t1.v = __lsx_vfsub_s(t1.v,
a.v);
248 t1.v = (__m128)__lsx_vpackod_w((__m128i)
a.v, (__m128i)t1.v);
249 t2.v = (__m128)__lsx_vshuf4i_w((__m128i)
b.v, 0xb1);
250 result.v = __lsx_vfmadd_s(t1.v, t2.v, result.v);
292 typedef std::complex<double>
type;
319 const uint64_t tmp[2] = {0x0000000000000000u, 0x8000000000000000u};
320 __m128i mask = __lsx_vld(
tmp, 0);
334 res.v = (__m128d)__lsx_vilvl_d((__m128i)
imag, (__m128i)
real);
399 __builtin_prefetch(addr);
405 __lsx_vst(
a.v,
res, 0);
406 return std::complex<double>(
res[0],
res[1]);
436 Packet4f tmp1 = (
Packet4f)__lsx_vilvl_w((__m128i)kernel.packet[1].v, (__m128i)kernel.packet[0].v);
437 Packet4f tmp2 = (
Packet4f)__lsx_vilvh_w((__m128i)kernel.packet[1].v, (__m128i)kernel.packet[0].v);
438 kernel.packet[0].v = (
Packet4f)__lsx_vshuf4i_w(tmp1, 0xd8);
439 kernel.packet[1].v = (
Packet4f)__lsx_vshuf4i_w(tmp2, 0xd8);
457 res.v = (
Packet4f)__lsx_vbitsel_v((__m128i)
b.v, (__m128i)
a.v, (__m128i)mask.v);
463 return psqrt_complex<Packet1cd>(
a);
468 return psqrt_complex<Packet2cf>(
a);
478 __m128d
v = {0.0, 0.0};
486 t0.
v = (__m128d)__lsx_vpackev_d((__m128i)
a.v, (__m128i)
a.v);
487 t2.
v = __lsx_vfmadd_d(t0.
v,
b.v,
c.v);
488 result.
v = __lsx_vfadd_d(t2.
v, t1.
v);
489 t1.
v = __lsx_vfsub_d(t1.
v,
a.v);
490 t1.
v = (__m128d)__lsx_vpackod_d((__m128i)
a.v, (__m128i)t1.
v);
491 t2.
v = (__m128d)__lsx_vshuf4i_d((__m128i)t2.
v, (__m128i)
b.v, 0xb);
492 result.
v = __lsx_vfmadd_d(t1.
v, t2.
v, result.
v);
500 __m128i
tmp = __lsx_vld((
void*)from, 0);
508 __lsx_vst((__m128i)from.v, (
void*)to, 0);
513 kernel.
packet[1].v = (__m128d)__lsx_vilvh_d((__m128i)kernel.
packet[1].v, (__m128i)kernel.
packet[0].v);
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
#define EIGEN_MAKE_CONJ_HELPER_CPLX_REAL(PACKET_CPLX, PACKET_REAL)
Definition: ConjHelper.h:14
#define EIGEN_DEBUG_ALIGNED_STORE
Definition: GenericPacketMath.h:38
#define EIGEN_DEBUG_ALIGNED_LOAD
Definition: GenericPacketMath.h:30
#define EIGEN_DEBUG_UNALIGNED_STORE
Definition: GenericPacketMath.h:42
#define EIGEN_DEBUG_UNALIGNED_LOAD
Definition: GenericPacketMath.h:34
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:892
#define EIGEN_STRONG_INLINE
Definition: Macros.h:834
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Definition: PartialRedux_count.cpp:3
Scalar * b
Definition: benchVecAdd.cpp:17
@ Aligned16
Definition: Constants.h:237
const Scalar * a
Definition: level2_cplx_impl.h:32
Eigen::Matrix< Scalar, Dynamic, Dynamic, ColMajor > tmp
Definition: level3_impl.h:365
__m128d Packet2d
Definition: LSX/PacketMath.h:36
EIGEN_STRONG_INLINE Packet2cf pconj(const Packet2cf &a)
Definition: AltiVec/Complex.h:268
EIGEN_STRONG_INLINE std::complex< float > predux_mul< Packet2cf >(const Packet2cf &a)
Definition: AltiVec/Complex.h:318
EIGEN_STRONG_INLINE std::complex< float > predux< Packet2cf >(const Packet2cf &a)
Definition: AltiVec/Complex.h:310
EIGEN_STRONG_INLINE Packet8f pzero(const Packet8f &)
Definition: AVX/PacketMath.h:774
EIGEN_STRONG_INLINE Packet2cf psqrt< Packet2cf >(const Packet2cf &a)
Definition: AltiVec/Complex.h:370
__vector int Packet4i
Definition: AltiVec/PacketMath.h:34
EIGEN_STRONG_INLINE std::complex< double > predux_mul< Packet1cd >(const Packet1cd &a)
Definition: LSX/Complex.h:420
EIGEN_STRONG_INLINE Packet2cf ptrue< Packet2cf >(const Packet2cf &a)
Definition: LSX/Complex.h:106
EIGEN_STRONG_INLINE Packet2cf pandnot< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
Definition: AltiVec/Complex.h:285
EIGEN_STRONG_INLINE Packet2d pand< Packet2d >(const Packet2d &a, const Packet2d &b)
Definition: LSX/PacketMath.h:880
EIGEN_STRONG_INLINE Packet1cd psqrt< Packet1cd >(const Packet1cd &a)
Definition: LSX/Complex.h:462
EIGEN_STRONG_INLINE void ptranspose(PacketBlock< Packet2cf, 2 > &kernel)
Definition: AltiVec/Complex.h:339
EIGEN_STRONG_INLINE Packet1cd plog< Packet1cd >(const Packet1cd &a)
Definition: LSX/Complex.h:472
EIGEN_STRONG_INLINE Packet2cf ploaddup< Packet2cf >(const std::complex< float > *from)
Definition: AltiVec/Complex.h:162
EIGEN_STRONG_INLINE Packet4f vec4f_movehl(const Packet4f &a, const Packet4f &b)
Definition: LSX/PacketMath.h:135
EIGEN_STRONG_INLINE Packet2cf pmul< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
Definition: LSX/Complex.h:95
EIGEN_STRONG_INLINE Packet1cd pzero< Packet1cd >(const Packet1cd &)
Definition: LSX/Complex.h:477
EIGEN_STRONG_INLINE Packet1cd pmul< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
Definition: LSX/Complex.h:327
EIGEN_STRONG_INLINE std::complex< float > pfirst< Packet2cf >(const Packet2cf &a)
Definition: AltiVec/Complex.h:295
EIGEN_STRONG_INLINE Packet4f pload< Packet4f >(const float *from)
Definition: AltiVec/PacketMath.h:492
EIGEN_STRONG_INLINE Packet1cd ploadu< Packet1cd >(const std::complex< double > *from)
Definition: LSX/Complex.h:373
EIGEN_STRONG_INLINE Packet2cf por< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
Definition: AltiVec/Complex.h:277
EIGEN_STRONG_INLINE Packet2cf pset1< Packet2cf >(const std::complex< float > &from)
Definition: AltiVec/Complex.h:125
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet plog_complex(const Packet &x)
Definition: GenericPacketMathFunctions.h:1338
EIGEN_STRONG_INLINE Packet2cf preverse(const Packet2cf &a)
Definition: AltiVec/Complex.h:303
EIGEN_STRONG_INLINE Packet2cf pcplxflip(const Packet2cf &x)
Definition: LSX/Complex.h:218
EIGEN_STRONG_INLINE Packet4cf pmul(const Packet4cf &a, const Packet4cf &b)
Definition: AVX/Complex.h:88
EIGEN_STRONG_INLINE Packet8h ptrue(const Packet8h &a)
Definition: AVX/PacketMath.h:2263
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pexp_complex(const Packet &a)
Definition: GenericPacketMathFunctions.h:1366
EIGEN_STRONG_INLINE Packet2d pload< Packet2d >(const double *from)
Definition: LSX/PacketMath.h:1407
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pdiv_complex(const Packet &x, const Packet &y)
Definition: GenericPacketMathFunctions.h:1318
EIGEN_STRONG_INLINE Packet2cf pnegate(const Packet2cf &a)
Definition: AltiVec/Complex.h:264
EIGEN_STRONG_INLINE Packet1cd pxor< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
Definition: LSX/Complex.h:355
EIGEN_STRONG_INLINE Packet2cf pdiv< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
Definition: AltiVec/Complex.h:330
EIGEN_STRONG_INLINE Packet1cd padd< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
Definition: LSX/Complex.h:305
EIGEN_STRONG_INLINE Packet2cf ploadu< Packet2cf >(const std::complex< float > *from)
Definition: AltiVec/Complex.h:148
EIGEN_STRONG_INLINE Packet1cd ploaddup< Packet1cd >(const std::complex< double > *from)
Definition: LSX/Complex.h:383
EIGEN_STRONG_INLINE Packet2cf pload< Packet2cf >(const std::complex< float > *from)
Definition: AltiVec/Complex.h:144
EIGEN_STRONG_INLINE bfloat16 pfirst(const Packet8bf &a)
Definition: AltiVec/PacketMath.h:2418
EIGEN_STRONG_INLINE std::complex< double > predux< Packet1cd >(const Packet1cd &a)
Definition: LSX/Complex.h:415
EIGEN_DEVICE_FUNC void pstore(Scalar *to, const Packet &from)
Definition: GenericPacketMath.h:891
EIGEN_STRONG_INLINE Packet2d ploadu< Packet2d >(const double *from)
Definition: LSX/PacketMath.h:1448
EIGEN_STRONG_INLINE Packet1cd pmadd< Packet1cd >(const Packet1cd &a, const Packet1cd &b, const Packet1cd &c)
Definition: LSX/Complex.h:483
EIGEN_STRONG_INLINE Packet1cd pload< Packet1cd >(const std::complex< double > *from)
Definition: LSX/Complex.h:369
EIGEN_STRONG_INLINE Packet1cd pand< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
Definition: LSX/Complex.h:343
EIGEN_STRONG_INLINE Packet2cf pand< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
Definition: AltiVec/Complex.h:273
EIGEN_STRONG_INLINE Packet2cf pmadd< Packet2cf >(const Packet2cf &a, const Packet2cf &b, const Packet2cf &c)
Definition: LSX/Complex.h:241
EIGEN_STRONG_INLINE Packet2cf pcmp_eq(const Packet2cf &a, const Packet2cf &b)
Definition: AltiVec/Complex.h:353
EIGEN_STRONG_INLINE Packet4f vec4f_swizzle1(const Packet4f &a, int p, int q, int r, int s)
Definition: LSX/PacketMath.h:126
EIGEN_STRONG_INLINE Packet2cf pexp< Packet2cf >(const Packet2cf &a)
Definition: AltiVec/Complex.h:380
EIGEN_STRONG_INLINE Packet1cd pandnot< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
Definition: LSX/Complex.h:361
EIGEN_DEVICE_FUNC void pstoreu(Scalar *to, const Packet &from)
Definition: GenericPacketMath.h:911
EIGEN_STRONG_INLINE Packet2cf pxor< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
Definition: AltiVec/Complex.h:281
EIGEN_STRONG_INLINE Packet4f ploadu< Packet4f >(const float *from)
Definition: AltiVec/PacketMath.h:1533
EIGEN_STRONG_INLINE Packet2cf psub< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
Definition: AltiVec/Complex.h:260
EIGEN_STRONG_INLINE Packet4f pselect(const Packet4f &mask, const Packet4f &a, const Packet4f &b)
Definition: AltiVec/PacketMath.h:1474
EIGEN_STRONG_INLINE Packet1cd ptrue< Packet1cd >(const Packet1cd &a)
Definition: LSX/Complex.h:339
EIGEN_STRONG_INLINE Packet4f pand< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition: AltiVec/PacketMath.h:1406
EIGEN_STRONG_INLINE Packet2cf plog< Packet2cf >(const Packet2cf &a)
Definition: AltiVec/Complex.h:375
EIGEN_STRONG_INLINE Packet2cf padd< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
Definition: AltiVec/Complex.h:256
EIGEN_STRONG_INLINE Packet1cd por< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
Definition: LSX/Complex.h:349
__vector float Packet4f
Definition: AltiVec/PacketMath.h:33
EIGEN_STRONG_INLINE Packet1cd pset1< Packet1cd >(const std::complex< double > &from)
Definition: LSX/Complex.h:378
EIGEN_STRONG_INLINE std::complex< double > pfirst< Packet1cd >(const Packet1cd &a)
Definition: LSX/Complex.h:403
EIGEN_STRONG_INLINE Packet1cd pdiv< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
Definition: LSX/Complex.h:427
EIGEN_STRONG_INLINE Packet1cd psub< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
Definition: LSX/Complex.h:309
EIGEN_DEVICE_FUNC internal::add_const_on_value_type_t< EIGEN_MATHFUNC_RETVAL(real_ref, Scalar)> real_ref(const Scalar &x)
Definition: MathFunctions.h:1051
std::uint32_t uint32_t
Definition: Meta.h:40
std::uint64_t uint64_t
Definition: Meta.h:42
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
DerType::Scalar imag(const AutoDiffScalar< DerType > &)
Definition: AutoDiffScalar.h:490
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
double f1(const Vector< double > &coord)
f1 function, in front of the C1 unknown
Definition: poisson/poisson_with_singularity/two_d_poisson.cc:147
int c
Definition: calibrate.py:100
Definition: Eigen_Colamd.h:49
list x
Definition: plotDoE.py:28
Definition: LSX/Complex.h:260
EIGEN_STRONG_INLINE Packet1cd()
Definition: LSX/Complex.h:261
Packet2d v
Definition: LSX/Complex.h:263
EIGEN_STRONG_INLINE Packet1cd(const __m128d &a)
Definition: LSX/Complex.h:262
Definition: AltiVec/Complex.h:38
Packet4f v
Definition: AltiVec/Complex.h:78
EIGEN_STRONG_INLINE Packet2cf(const __m128 &a)
Definition: LSX/Complex.h:24
EIGEN_STRONG_INLINE Packet2cf()
Definition: LSX/Complex.h:23
Definition: GenericPacketMath.h:1407
Packet packet[N]
Definition: GenericPacketMath.h:1408
Definition: GenericPacketMath.h:45
@ HasExp
Definition: GenericPacketMath.h:75
@ HasSqrt
Definition: GenericPacketMath.h:73
@ HasLog
Definition: GenericPacketMath.h:77
@ HasDiv
Definition: GenericPacketMath.h:71
Packet1cd half
Definition: LSX/Complex.h:269
Packet1cd type
Definition: LSX/Complex.h:268
Packet2cf half
Definition: LSX/Complex.h:31
Packet2cf type
Definition: LSX/Complex.h:30
Definition: GenericPacketMath.h:108
@ size
Definition: GenericPacketMath.h:113
@ AlignedOnScalar
Definition: GenericPacketMath.h:114
@ Vectorizable
Definition: GenericPacketMath.h:112
@ 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
Packet2d as_real
Definition: LSX/Complex.h:294
Packet1cd half
Definition: LSX/Complex.h:293
std::complex< double > type
Definition: LSX/Complex.h:292
std::complex< float > type
Definition: LSX/Complex.h:55
Packet4f as_real
Definition: LSX/Complex.h:57
Packet2cf half
Definition: LSX/Complex.h:56
Definition: GenericPacketMath.h:134
@ masked_load_available
Definition: GenericPacketMath.h:142
@ size
Definition: GenericPacketMath.h:139
@ masked_store_available
Definition: GenericPacketMath.h:143
@ vectorizable
Definition: GenericPacketMath.h:141
@ alignment
Definition: GenericPacketMath.h:140
Definition: datatypes.h:12