10 #ifndef EIGEN_COMPLEX_AVX_H 11 #define EIGEN_COMPLEX_AVX_H 58 const __m256 mask = _mm256_castsi256_ps(_mm256_setr_epi32(0x00000000,0x80000000,0x00000000,0x80000000,0x00000000,0x80000000,0x00000000,0x80000000));
64 __m256 tmp1 = _mm256_mul_ps(_mm256_moveldup_ps(a.v),
b.v);
65 __m256 tmp2 = _mm256_mul_ps(_mm256_movehdup_ps(a.v), _mm256_permute_ps(
b.v, _MM_SHUFFLE(2,3,0,1)));
66 __m256
result = _mm256_addsub_ps(tmp1, tmp2);
81 return Packet4cf(_mm256_castpd_ps(_mm256_broadcast_sd((
const double*)(
const void*)&from)));
89 return Packet4cf(_mm256_insertf128_ps(_mm256_castps128_ps256(a.
v), b.v, 1));
95 template<> EIGEN_DEVICE_FUNC
inline Packet4cf pgather<std::complex<float>,
Packet4cf>(
const std::complex<float>* from,
Index stride)
103 template<> EIGEN_DEVICE_FUNC
inline void pscatter<std::complex<float>,
Packet4cf>(std::complex<float>* to,
const Packet4cf& from,
Index stride)
105 __m128 low = _mm256_extractf128_ps(from.v, 0);
106 to[stride*0] = std::complex<float>(_mm_cvtss_f32(_mm_shuffle_ps(low, low, 0)),
107 _mm_cvtss_f32(_mm_shuffle_ps(low, low, 1)));
108 to[stride*1] = std::complex<float>(_mm_cvtss_f32(_mm_shuffle_ps(low, low, 2)),
109 _mm_cvtss_f32(_mm_shuffle_ps(low, low, 3)));
111 __m128 high = _mm256_extractf128_ps(from.v, 1);
112 to[stride*2] = std::complex<float>(_mm_cvtss_f32(_mm_shuffle_ps(high, high, 0)),
113 _mm_cvtss_f32(_mm_shuffle_ps(high, high, 1)));
114 to[stride*3] = std::complex<float>(_mm_cvtss_f32(_mm_shuffle_ps(high, high, 2)),
115 _mm_cvtss_f32(_mm_shuffle_ps(high, high, 3)));
125 __m128 low = _mm256_extractf128_ps(a.
v, 0);
126 __m128 high = _mm256_extractf128_ps(a.
v, 1);
127 __m128d lowd = _mm_castps_pd(low);
128 __m128d highd = _mm_castps_pd(high);
129 low = _mm_castpd_ps(_mm_shuffle_pd(lowd,lowd,0
x1));
130 high = _mm_castpd_ps(_mm_shuffle_pd(highd,highd,0
x1));
131 __m256
result = _mm256_setzero_ps();
132 result = _mm256_insertf128_ps(result, low, 1);
133 result = _mm256_insertf128_ps(result, high, 0);
140 Packet2cf(_mm256_extractf128_ps(a.v,1))));
145 Packet8f t0 = _mm256_shuffle_ps(vecs[0].
v, vecs[0].v, _MM_SHUFFLE(3, 1, 2 ,0));
146 Packet8f t1 = _mm256_shuffle_ps(vecs[1].v, vecs[1].v, _MM_SHUFFLE(3, 1, 2 ,0));
147 t0 = _mm256_hadd_ps(t0,t1);
148 Packet8f t2 = _mm256_shuffle_ps(vecs[2].v, vecs[2].v, _MM_SHUFFLE(3, 1, 2 ,0));
149 Packet8f t3 = _mm256_shuffle_ps(vecs[3].v, vecs[3].v, _MM_SHUFFLE(3, 1, 2 ,0));
150 t2 = _mm256_hadd_ps(t2,t3);
152 t1 = _mm256_permute2f128_ps(t0,t2, 0 + (2<<4));
153 t3 = _mm256_permute2f128_ps(t0,t2, 1 + (3<<4));
161 Packet2cf(_mm256_extractf128_ps(a.v, 1))));
169 if (Offset==0)
return;
212 __m256 tmp = _mm256_mul_ps(b.v, b.v);
213 __m256 tmp2 = _mm256_shuffle_ps(tmp,tmp,0xB1);
214 __m256 denom = _mm256_add_ps(tmp, tmp2);
215 return Packet4cf(_mm256_div_ps(num.
v, denom));
220 return Packet4cf(_mm256_shuffle_ps(
x.v,
x.v, _MM_SHUFFLE(2, 3, 0 ,1)));
261 const __m256d mask = _mm256_castsi256_pd(_mm256_set_epi32(0x80000000,0
x0,0
x0,0
x0,0x80000000,0
x0,0
x0,0
x0));
267 __m256d tmp1 = _mm256_shuffle_pd(a.v,a.v,0
x0);
268 __m256d even = _mm256_mul_pd(tmp1,
b.v);
269 __m256d tmp2 = _mm256_shuffle_pd(a.v,a.v,0xF);
270 __m256d tmp3 = _mm256_shuffle_pd(
b.v,
b.v,0
x5);
271 __m256d odd = _mm256_mul_pd(tmp2, tmp3);
272 return Packet2cd(_mm256_addsub_pd(even, odd));
289 return Packet2cd(_mm256_broadcast_pd((
const __m128d*)(
const void*)&from));
297 template<> EIGEN_DEVICE_FUNC
inline Packet2cd pgather<std::complex<double>,
Packet2cd>(
const std::complex<double>* from,
Index stride)
303 template<> EIGEN_DEVICE_FUNC
inline void pscatter<std::complex<double>,
Packet2cd>(std::complex<double>* to,
const Packet2cd& from,
Index stride)
305 __m128d low = _mm256_extractf128_pd(from.v, 0);
306 to[stride*0] = std::complex<double>(_mm_cvtsd_f64(low), _mm_cvtsd_f64(_mm_shuffle_pd(low, low, 1)));
307 __m128d high = _mm256_extractf128_pd(from.v, 1);
308 to[stride*1] = std::complex<double>(_mm_cvtsd_f64(high), _mm_cvtsd_f64(_mm_shuffle_pd(high, high, 1)));
313 __m128d low = _mm256_extractf128_pd(a.v, 0);
315 _mm_store_pd(res, low);
316 return std::complex<double>(res[0],res[1]);
320 __m256d
result = _mm256_permute2f128_pd(a.
v, a.
v, 1);
327 Packet1cd(_mm256_extractf128_pd(a.v,1))));
332 Packet4d t0 = _mm256_permute2f128_pd(vecs[0].
v,vecs[1].v, 0 + (2<<4));
333 Packet4d t1 = _mm256_permute2f128_pd(vecs[0].v,vecs[1].v, 1 + (3<<4));
341 Packet1cd(_mm256_extractf128_pd(a.v,1))));
349 if (Offset==0)
return;
392 __m256d tmp = _mm256_mul_pd(b.v, b.v);
393 __m256d denom = _mm256_hadd_pd(tmp, tmp);
394 return Packet2cd(_mm256_div_pd(num.
v, denom));
402 EIGEN_DEVICE_FUNC
inline void 404 __m256d
P0 = _mm256_castps_pd(kernel.
packet[0].v);
405 __m256d P1 = _mm256_castps_pd(kernel.
packet[1].v);
406 __m256d
P2 = _mm256_castps_pd(kernel.
packet[2].v);
407 __m256d
P3 = _mm256_castps_pd(kernel.
packet[3].v);
409 __m256d T0 = _mm256_shuffle_pd(P0, P1, 15);
410 __m256d
T1 = _mm256_shuffle_pd(P0, P1, 0);
411 __m256d
T2 = _mm256_shuffle_pd(P2, P3, 15);
412 __m256d
T3 = _mm256_shuffle_pd(P2, P3, 0);
414 kernel.
packet[1].v = _mm256_castpd_ps(_mm256_permute2f128_pd(T0, T2, 32));
415 kernel.
packet[3].v = _mm256_castpd_ps(_mm256_permute2f128_pd(T0, T2, 49));
416 kernel.
packet[0].v = _mm256_castpd_ps(_mm256_permute2f128_pd(T1, T3, 32));
417 kernel.
packet[2].v = _mm256_castpd_ps(_mm256_permute2f128_pd(T1, T3, 49));
420 EIGEN_DEVICE_FUNC
inline void 422 __m256d tmp = _mm256_permute2f128_pd(kernel.
packet[0].v, kernel.
packet[1].v, 0+(2<<4));
423 kernel.
packet[1].v = _mm256_permute2f128_pd(kernel.
packet[0].v, kernel.
packet[1].v, 1+(3<<4));
451 #endif // EIGEN_COMPLEX_AVX_H EIGEN_STRONG_INLINE std::complex< double > pfirst< Packet2cd >(const Packet2cd &a)
EIGEN_STRONG_INLINE Packet4cf pmul< Packet4cf >(const Packet4cf &a, const Packet4cf &b)
EIGEN_STRONG_INLINE Packet2cd pxor< Packet2cd >(const Packet2cd &a, const Packet2cd &b)
EIGEN_STRONG_INLINE Packet4cf pxor< Packet4cf >(const Packet4cf &a, const Packet4cf &b)
#define EIGEN_STRONG_INLINE
EIGEN_STRONG_INLINE std::complex< double > predux< Packet2cd >(const Packet2cd &a)
EIGEN_STRONG_INLINE Packet2cd pcplxflip< Packet2cd >(const Packet2cd &x)
EIGEN_DEVICE_FUNC internal::add_const_on_value_type< EIGEN_MATHFUNC_RETVAL(real_ref, Scalar) >::type real_ref(const Scalar &x)
static const Pose3 T3(Rot3::Rodrigues(-90, 0, 0), Point3(1, 2, 3))
EIGEN_STRONG_INLINE Packet2cd pmadd(const Packet2cd &x, const Packet2cd &y, const Packet2cd &c) const
EIGEN_STRONG_INLINE Packet4cf pmadd(const Packet4cf &x, const Packet4cf &y, const Packet4cf &c) const
#define EIGEN_MAKE_CONJ_HELPER_CPLX_REAL(PACKET_CPLX, PACKET_REAL)
EIGEN_STRONG_INLINE Packet4cf pinsertfirst(const Packet4cf &a, std::complex< float > b)
#define EIGEN_DEBUG_UNALIGNED_LOAD
EIGEN_STRONG_INLINE Packet2cd ploaddup< Packet2cd >(const std::complex< double > *from)
EIGEN_STRONG_INLINE Packet4cf pand< Packet4cf >(const Packet4cf &a, const Packet4cf &b)
EIGEN_STRONG_INLINE Packet4cf pload< Packet4cf >(const std::complex< float > *from)
EIGEN_STRONG_INLINE Packet4cf pmul(const Packet4cf &a, const Packet4cf &b) const
std::complex< float > type
EIGEN_STRONG_INLINE Packet4cf pmul(const Packet4cf &a, const Packet4cf &b) const
#define EIGEN_DEBUG_ALIGNED_STORE
Namespace containing all symbols from the Eigen library.
EIGEN_STRONG_INLINE Packet4cf ploadu< Packet4cf >(const std::complex< float > *from)
Pose2 T2(M_PI/2.0, Point2(0.0, 2.0))
EIGEN_STRONG_INLINE Packet2cd pmadd(const Packet2cd &x, const Packet2cd &y, const Packet2cd &c) const
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type predux(const Packet &a)
#define EIGEN_DEBUG_UNALIGNED_STORE
std::complex< double > type
EIGEN_STRONG_INLINE Packet2cd padd< Packet2cd >(const Packet2cd &a, const Packet2cd &b)
#define EIGEN_DEBUG_ALIGNED_LOAD
EIGEN_STRONG_INLINE Packet4d ploadu< Packet4d >(const double *from)
EIGEN_STRONG_INLINE Packet4cf ploaddup< Packet4cf >(const std::complex< float > *from)
EIGEN_STRONG_INLINE Packet2cd()
static EIGEN_STRONG_INLINE void run(Packet2cd &first, const Packet2cd &second)
EIGEN_STRONG_INLINE Packet4cf psub< Packet4cf >(const Packet4cf &a, const Packet4cf &b)
EIGEN_STRONG_INLINE Packet4cf pmul(const Packet4cf &a, const Packet4cf &b) const
EIGEN_DEVICE_FUNC Packet padd(const Packet &a, const Packet &b)
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
EIGEN_STRONG_INLINE Packet4cf preduxp< Packet4cf >(const Packet4cf *vecs)
EIGEN_DEVICE_FUNC void pstoreu(Scalar *to, const Packet &from)
constexpr int first(int i)
Implementation details for constexpr functions.
EIGEN_STRONG_INLINE Packet2cd por< Packet2cd >(const Packet2cd &a, const Packet2cd &b)
EIGEN_STRONG_INLINE Packet2cd pandnot< Packet2cd >(const Packet2cd &a, const Packet2cd &b)
EIGEN_STRONG_INLINE Packet2cd pload< Packet2cd >(const std::complex< double > *from)
EIGEN_STRONG_INLINE Packet2cd pmul(const Packet2cd &a, const Packet2cd &b) const
EIGEN_STRONG_INLINE Packet4cf pset1< Packet4cf >(const std::complex< float > &from)
EIGEN_STRONG_INLINE void ptranspose(PacketBlock< Packet2cf, 2 > &kernel)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type pfirst(const Packet &a)
EIGEN_STRONG_INLINE Packet4d pload< Packet4d >(const double *from)
EIGEN_STRONG_INLINE Packet2cf pconj(const Packet2cf &a)
EIGEN_STRONG_INLINE Packet4cf pmadd(const Packet4cf &x, const Packet4cf &y, const Packet4cf &c) const
EIGEN_STRONG_INLINE Packet2cf ploaddup< Packet2cf >(const std::complex< float > *from)
EIGEN_STRONG_INLINE Packet4cf()
EIGEN_STRONG_INLINE Packet4cf por< Packet4cf >(const Packet4cf &a, const Packet4cf &b)
EIGEN_DEVICE_FUNC void pstore(Scalar *to, const Packet &from)
static const Point3 P2(3.5,-8.2, 4.2)
EIGEN_STRONG_INLINE Packet2cd(const __m256d &a)
EIGEN_STRONG_INLINE Packet2cd ploadu< Packet2cd >(const std::complex< double > *from)
EIGEN_STRONG_INLINE Packet2cd pmul(const Packet2cd &a, const Packet2cd &b) const
EIGEN_STRONG_INLINE Packet2cf pnegate(const Packet2cf &a)
EIGEN_DEVICE_FUNC Packet pdiv(const Packet &a, const Packet &b)
EIGEN_STRONG_INLINE Packet2cd psub< Packet2cd >(const Packet2cd &a, const Packet2cd &b)
EIGEN_STRONG_INLINE Packet8f ploadu< Packet8f >(const float *from)
EIGEN_STRONG_INLINE std::complex< double > predux_mul< Packet2cd >(const Packet2cd &a)
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type predux_mul(const Packet &a)
EIGEN_STRONG_INLINE Packet4cf pandnot< Packet4cf >(const Packet4cf &a, const Packet4cf &b)
EIGEN_STRONG_INLINE Packet4cf pcplxflip< Packet4cf >(const Packet4cf &x)
EIGEN_STRONG_INLINE Packet8f pload< Packet8f >(const float *from)
EIGEN_STRONG_INLINE Packet4cf pinsertlast(const Packet4cf &a, std::complex< float > b)
EIGEN_DEVICE_FUNC const ImagReturnType imag() const
EIGEN_STRONG_INLINE Packet2cd pmadd(const Packet2cd &x, const Packet2cd &y, const Packet2cd &c) const
EIGEN_STRONG_INLINE Packet4cf pmadd(const Packet4cf &x, const Packet4cf &y, const Packet4cf &c) const
EIGEN_STRONG_INLINE Packet2cd pset1< Packet2cd >(const std::complex< double > &from)
EIGEN_STRONG_INLINE Packet2cd preduxp< Packet2cd >(const Packet2cd *vecs)
Pose2 T1(M_PI/4.0, Point2(sqrt(0.5), sqrt(0.5)))
static void run(PacketType &, const PacketType &)
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
EIGEN_STRONG_INLINE Packet4cf(const __m256 &a)
static EIGEN_STRONG_INLINE void run(Packet4cf &first, const Packet4cf &second)
EIGEN_STRONG_INLINE std::complex< float > predux< Packet4cf >(const Packet4cf &a)
EIGEN_DEVICE_FUNC Packet pmul(const Packet &a, const Packet &b)
EIGEN_STRONG_INLINE std::complex< float > predux_mul< Packet4cf >(const Packet4cf &a)
EIGEN_STRONG_INLINE Packet4cf padd< Packet4cf >(const Packet4cf &a, const Packet4cf &b)
EIGEN_STRONG_INLINE Packet2cd pand< Packet2cd >(const Packet2cd &a, const Packet2cd &b)
EIGEN_STRONG_INLINE Packet2cd pmul(const Packet2cd &a, const Packet2cd &b) const
EIGEN_STRONG_INLINE Packet2cf preverse(const Packet2cf &a)
EIGEN_STRONG_INLINE Packet2cd pmul< Packet2cd >(const Packet2cd &a, const Packet2cd &b)
EIGEN_STRONG_INLINE std::complex< float > pfirst< Packet4cf >(const Packet4cf &a)