10 #ifndef EIGEN_COMPLEX_AVX512_H
11 #define EIGEN_COMPLEX_AVX512_H
50 typedef std::complex<float>
type;
71 const __m512 mask = _mm512_castsi512_ps(_mm512_setr_epi32(
72 0x00000000,0x80000000,0x00000000,0x80000000,0x00000000,0x80000000,0x00000000,0x80000000,
73 0x00000000,0x80000000,0x00000000,0x80000000,0x00000000,0x80000000,0x00000000,0x80000000));
79 __m512 tmp2 = _mm512_mul_ps(_mm512_movehdup_ps(
a.v), _mm512_permute_ps(b.
v, _MM_SHUFFLE(2,3,0,1)));
80 return Packet8cf(_mm512_fmaddsub_ps(_mm512_moveldup_ps(
a.v), b.
v, tmp2));
90 __m512 eq = pcmp_eq<Packet16f>(
a.v, b.
v);
122 pscatter((
double*)(
void*)to, _mm512_castps_pd(from.v), stride);
132 _mm512_permutexvar_epi64( _mm512_set_epi32(0, 0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7),
133 _mm512_castps_si512(
a.v))));
150 __m256 lane0 = extract256<0>(
a.v);
151 __m256 lane1 = extract256<1>(
a.v);
152 __m256 res = _mm256_add_ps(lane0, lane1);
161 __m512 tmp = _mm512_mul_ps(b.v, b.v);
162 __m512 tmp2 = _mm512_shuffle_ps(tmp,tmp,0xB1);
163 __m512 denom = _mm512_add_ps(tmp, tmp2);
164 return Packet8cf(_mm512_div_ps(num.
v, denom));
169 return Packet8cf(_mm512_shuffle_ps(x.
v, x.
v, _MM_SHUFFLE(2, 3, 0 ,1)));
205 typedef std::complex<double>
type;
222 const __m512d mask = _mm512_castsi512_pd(
223 _mm512_set_epi32(0x80000000,0x0,0x0,0x0,0x80000000,0x0,0x0,0x0,
224 0x80000000,0x0,0x0,0x0,0x80000000,0x0,0x0,0x0));
230 __m512d tmp1 = _mm512_shuffle_pd(
a.v,
a.v,0x0);
231 __m512d tmp2 = _mm512_shuffle_pd(
a.v,
a.v,0xFF);
232 __m512d tmp3 = _mm512_shuffle_pd(b.
v,b.
v,0x55);
233 __m512d odd = _mm512_mul_pd(tmp2, tmp3);
234 return Packet4cd(_mm512_fmaddsub_pd(tmp1, b.
v, odd));
245 __m512d eq = pcmp_eq<Packet8d>(
a.v, b.
v);
256 #ifdef EIGEN_VECTORIZE_AVX512DQ
273 return Packet4cd(_mm512_insertf64x4(_mm512_castpd256_pd512(
280 __m512i fromi = _mm512_castpd_si512(from.v);
281 double* tod = (
double*)(
void*)to;
282 _mm_storeu_pd(tod+0*stride, _mm_castsi128_pd(_mm512_extracti32x4_epi32(fromi,0)) );
283 _mm_storeu_pd(tod+2*stride, _mm_castsi128_pd(_mm512_extracti32x4_epi32(fromi,1)) );
284 _mm_storeu_pd(tod+4*stride, _mm_castsi128_pd(_mm512_extracti32x4_epi32(fromi,2)) );
285 _mm_storeu_pd(tod+6*stride, _mm_castsi128_pd(_mm512_extracti32x4_epi32(fromi,3)) );
290 __m128d low = extract128<0>(
a.v);
292 _mm_store_pd(res, low);
293 return std::complex<double>(res[0],res[1]);
350 __m512d tmp = _mm512_mul_pd(b.v, b.v);
351 __m512d denom =
padd(_mm512_permute_pd(tmp,0x55), tmp);
352 return Packet4cd(_mm512_div_pd(num.
v, denom));
357 return Packet4cd(_mm512_permute_pd(x.
v,0x55));
412 return psqrt_complex<Packet4cd>(
a);
416 return psqrt_complex<Packet8cf>(
a);
#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_DEVICE_FUNC
Definition: Macros.h:976
#define EIGEN_STRONG_INLINE
Definition: Macros.h:917
EIGEN_STRONG_INLINE std::complex< float > pfirst< Packet8cf >(const Packet8cf &a)
Definition: Complex.h:125
EIGEN_STRONG_INLINE Packet8cf ploaddup< Packet8cf >(const std::complex< float > *from)
Definition: Complex.h:103
EIGEN_STRONG_INLINE Packet2cf pconj(const Packet2cf &a)
Definition: Complex.h:167
EIGEN_STRONG_INLINE Packet8d pload< Packet8d >(const double *from)
Definition: PacketMath.h:683
EIGEN_STRONG_INLINE Packet8cf psqrt< Packet8cf >(const Packet8cf &a)
Definition: Complex.h:415
EIGEN_STRONG_INLINE Packet8d ploadquad< Packet8d >(const double *from)
Definition: PacketMath.h:761
EIGEN_STRONG_INLINE Packet8d ploadu< Packet8d >(const double *from)
Definition: PacketMath.h:697
EIGEN_DEVICE_FUNC Packet padd(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:215
EIGEN_STRONG_INLINE Packet8cf por< Packet8cf >(const Packet8cf &a, const Packet8cf &b)
Definition: Complex.h:84
EIGEN_STRONG_INLINE Packet8cf pand< Packet8cf >(const Packet8cf &a, const Packet8cf &b)
Definition: Complex.h:83
EIGEN_STRONG_INLINE std::complex< double > pfirst< Packet4cd >(const Packet4cd &a)
Definition: Complex.h:288
EIGEN_STRONG_INLINE Packet8cf ploadquad< Packet8cf >(const std::complex< float > *from)
Definition: Complex.h:107
EIGEN_STRONG_INLINE std::complex< double > predux< Packet4cd >(const Packet4cd &a)
Definition: Complex.h:300
EIGEN_STRONG_INLINE Packet2cd ploaddup< Packet2cd >(const std::complex< double > *from)
Definition: Complex.h:276
EIGEN_STRONG_INLINE Packet4cd pcplxflip< Packet4cd >(const Packet4cd &x)
Definition: Complex.h:355
EIGEN_STRONG_INLINE std::complex< double > predux_mul< Packet4cd >(const Packet4cd &a)
Definition: Complex.h:306
EIGEN_STRONG_INLINE Packet8cf pmul< Packet8cf >(const Packet8cf &a, const Packet8cf &b)
Definition: Complex.h:77
EIGEN_STRONG_INLINE void ptranspose(PacketBlock< Packet2cf, 2 > &kernel)
Definition: Complex.h:224
EIGEN_STRONG_INLINE Packet4cd pandnot< Packet4cd >(const Packet4cd &a, const Packet4cd &b)
Definition: Complex.h:241
__m512d Packet8d
Definition: PacketMath.h:33
const Scalar & y
Definition: MathFunctions.h:821
EIGEN_STRONG_INLINE Packet16f ploadu< Packet16f >(const float *from)
Definition: PacketMath.h:693
EIGEN_STRONG_INLINE Packet4cd pset1< Packet4cd >(const std::complex< double > &from)
Definition: Complex.h:254
EIGEN_DEVICE_FUNC Packet pdiv(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:244
EIGEN_STRONG_INLINE Packet4cd por< Packet4cd >(const Packet4cd &a, const Packet4cd &b)
Definition: Complex.h:239
EIGEN_STRONG_INLINE Packet8cf pandnot< Packet8cf >(const Packet8cf &a, const Packet8cf &b)
Definition: Complex.h:86
EIGEN_STRONG_INLINE Packet1cd ploadu< Packet1cd >(const std::complex< double > *from)
Definition: Complex.h:456
EIGEN_STRONG_INLINE Packet8h por(const Packet8h &a, const Packet8h &b)
Definition: PacketMath.h:1042
EIGEN_STRONG_INLINE Packet8d pload1< Packet8d >(const double *from)
Definition: PacketMath.h:241
EIGEN_STRONG_INLINE Packet2cf preverse(const Packet2cf &a)
Definition: Complex.h:184
EIGEN_STRONG_INLINE Packet4cd pand< Packet4cd >(const Packet4cd &a, const Packet4cd &b)
Definition: Complex.h:238
EIGEN_STRONG_INLINE Packet8d ploaddup< Packet8d >(const double *from)
Definition: PacketMath.h:739
EIGEN_STRONG_INLINE std::complex< float > predux_mul< Packet8cf >(const Packet8cf &a)
Definition: Complex.h:142
EIGEN_DEVICE_FUNC Packet pmul(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:237
EIGEN_STRONG_INLINE Packet8h ptrue(const Packet8h &a)
Definition: PacketMath.h:978
EIGEN_STRONG_INLINE Packet8h pandnot(const Packet8h &a, const Packet8h &b)
Definition: PacketMath.h:1053
EIGEN_STRONG_INLINE Packet2cf pnegate(const Packet2cf &a)
Definition: Complex.h:166
EIGEN_STRONG_INLINE Packet4cd ptrue< Packet4cd >(const Packet4cd &a)
Definition: Complex.h:237
EIGEN_STRONG_INLINE Packet4cd padd< Packet4cd >(const Packet4cd &a, const Packet4cd &b)
Definition: Complex.h:217
EIGEN_DEVICE_FUNC void pscatter(Scalar *to, const Packet &from, Index)
Definition: GenericPacketMath.h:715
EIGEN_STRONG_INLINE Packet8cf pxor< Packet8cf >(const Packet8cf &a, const Packet8cf &b)
Definition: Complex.h:85
EIGEN_STRONG_INLINE Packet4cd ploadu< Packet4cd >(const std::complex< double > *from)
Definition: Complex.h:251
EIGEN_STRONG_INLINE std::complex< float > predux< Packet8cf >(const Packet8cf &a)
Definition: Complex.h:136
EIGEN_STRONG_INLINE Packet8cf pcplxflip< Packet8cf >(const Packet8cf &x)
Definition: Complex.h:167
EIGEN_STRONG_INLINE Packet4cf predux_half_dowto4< Packet8cf >(const Packet8cf &a)
Definition: Complex.h:149
EIGEN_STRONG_INLINE Packet8cf ptrue< Packet8cf >(const Packet8cf &a)
Definition: Complex.h:62
EIGEN_STRONG_INLINE Packet16f pload< Packet16f >(const float *from)
Definition: PacketMath.h:679
EIGEN_STRONG_INLINE bfloat16 pfirst(const Packet8bf &a)
Definition: PacketMath.h:1429
EIGEN_STRONG_INLINE Packet8cf pload< Packet8cf >(const std::complex< float > *from)
Definition: Complex.h:94
EIGEN_STRONG_INLINE Packet8cf psub< Packet8cf >(const Packet8cf &a, const Packet8cf &b)
Definition: Complex.h:64
EIGEN_STRONG_INLINE Packet4cd pload< Packet4cd >(const std::complex< double > *from)
Definition: Complex.h:249
EIGEN_DEVICE_FUNC void pstore(Scalar *to, const Packet &from)
Definition: GenericPacketMath.h:696
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type predux(const Packet &a)
Definition: GenericPacketMath.h:875
EIGEN_DEVICE_FUNC Packet8d pgather< double, Packet8d >(const double *from, Index stride)
Definition: PacketMath.h:813
EIGEN_STRONG_INLINE Packet2cf pcmp_eq(const Packet2cf &a, const Packet2cf &b)
Definition: Complex.h:231
EIGEN_DEVICE_FUNC void pstoreu(Scalar *to, const Packet &from)
Definition: GenericPacketMath.h:700
EIGEN_STRONG_INLINE Packet8h pand(const Packet8h &a, const Packet8h &b)
Definition: PacketMath.h:1050
EIGEN_STRONG_INLINE Packet4cd pxor< Packet4cd >(const Packet4cd &a, const Packet4cd &b)
Definition: Complex.h:240
EIGEN_STRONG_INLINE Packet8h pxor(const Packet8h &a, const Packet8h &b)
Definition: PacketMath.h:1047
EIGEN_STRONG_INLINE Packet8cf ploadu< Packet8cf >(const std::complex< float > *from)
Definition: Complex.h:95
EIGEN_STRONG_INLINE Packet8cf pset1< Packet8cf >(const std::complex< float > &from)
Definition: Complex.h:98
EIGEN_STRONG_INLINE Packet4cd psub< Packet4cd >(const Packet4cd &a, const Packet4cd &b)
Definition: Complex.h:218
EIGEN_STRONG_INLINE Packet8cf padd< Packet8cf >(const Packet8cf &a, const Packet8cf &b)
Definition: Complex.h:63
EIGEN_STRONG_INLINE Packet1cd pset1< Packet1cd >(const std::complex< double > &from)
Definition: Complex.h:463
EIGEN_STRONG_INLINE Packet4cd pmul< Packet4cd >(const Packet4cd &a, const Packet4cd &b)
Definition: Complex.h:228
EIGEN_STRONG_INLINE Packet4cd psqrt< Packet4cd >(const Packet4cd &a)
Definition: Complex.h:411
__m512 Packet16f
Definition: PacketMath.h:31
EIGEN_STRONG_INLINE Packet4cd ploaddup< Packet4cd >(const std::complex< double > *from)
Definition: Complex.h:263
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type predux_mul(const Packet &a)
Definition: GenericPacketMath.h:882
EIGEN_DEVICE_FUNC internal::add_const_on_value_type< EIGEN_MATHFUNC_RETVAL(real_ref, Scalar) >::type real_ref(const Scalar &x)
Definition: MathFunctions.h:1237
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:188
Definition: Complex.h:174
__m512d v
Definition: Complex.h:177
EIGEN_STRONG_INLINE Packet4cd()
Definition: Complex.h:175
EIGEN_STRONG_INLINE Packet4cd(const __m512d &a)
Definition: Complex.h:176
__m512 v
Definition: Complex.h:22
EIGEN_STRONG_INLINE Packet8cf()
Definition: Complex.h:20
EIGEN_STRONG_INLINE Packet8cf(const __m512 &a)
Definition: Complex.h:21
Definition: GenericPacketMath.h:1014
Packet packet[N]
Definition: GenericPacketMath.h:1015
EIGEN_STRONG_INLINE Packet4cd pmul(const Packet4cd &a, const Packet4cd &b) const
Definition: Complex.h:317
EIGEN_STRONG_INLINE Packet4cd pmadd(const Packet4cd &x, const Packet4cd &y, const Packet4cd &c) const
Definition: Complex.h:314
EIGEN_STRONG_INLINE Packet4cd pmadd(const Packet4cd &x, const Packet4cd &y, const Packet4cd &c) const
Definition: Complex.h:325
EIGEN_STRONG_INLINE Packet4cd pmul(const Packet4cd &a, const Packet4cd &b) const
Definition: Complex.h:328
EIGEN_STRONG_INLINE Packet4cd pmul(const Packet4cd &a, const Packet4cd &b) const
Definition: Complex.h:339
EIGEN_STRONG_INLINE Packet4cd pmadd(const Packet4cd &x, const Packet4cd &y, const Packet4cd &c) const
Definition: Complex.h:336
Definition: ConjHelper.h:63
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ResultType pmul(const LhsType &x, const RhsType &y) const
Definition: ConjHelper.h:71
Definition: GenericPacketMath.h:43
@ HasSqrt
Definition: GenericPacketMath.h:66
@ HasDiv
Definition: GenericPacketMath.h:65
Packet2cd half
Definition: Complex.h:183
Packet4cd type
Definition: Complex.h:182
Packet8cf type
Definition: Complex.h:27
Packet4cf half
Definition: Complex.h:28
Definition: GenericPacketMath.h:107
@ 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
Definition: PacketMath.h:56
Packet8d as_real
Definition: Complex.h:207
Packet2cd half
Definition: Complex.h:206
std::complex< double > type
Definition: Complex.h:205
Packet16f as_real
Definition: Complex.h:52
std::complex< float > type
Definition: Complex.h:50
Packet4cf half
Definition: Complex.h:51
Definition: GenericPacketMath.h:133
@ 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
#define const
Definition: zconf.h:233