10 #ifndef EIGEN_COMPLEX_SSE_H 11 #define EIGEN_COMPLEX_SSE_H 27 #ifndef EIGEN_VECTORIZE_AVX 59 const __m128 mask = _mm_castsi128_ps(_mm_setr_epi32(0x80000000,0x80000000,0x80000000,0x80000000));
64 const __m128 mask = _mm_castsi128_ps(_mm_setr_epi32(0x00000000,0x80000000,0x00000000,0x80000000));
70 #ifdef EIGEN_VECTORIZE_SSE3 71 return Packet2cf(_mm_addsub_ps(_mm_mul_ps(_mm_moveldup_ps(a.v),
b.v),
72 _mm_mul_ps(_mm_movehdup_ps(a.v),
78 const __m128 mask = _mm_castsi128_ps(_mm_setr_epi32(0x80000000,0x00000000,0x80000000,0x00000000));
96 #if EIGEN_GNUC_AT_MOST(4,2) 98 res.v = _mm_loadl_pi(_mm_set1_ps(0.0
f), reinterpret_cast<const __m64*>(&from));
99 #elif EIGEN_GNUC_AT_LEAST(4,6) 101 #pragma GCC diagnostic push 102 #pragma GCC diagnostic ignored "-Wuninitialized" 103 res.v = _mm_loadl_pi(res.v, (
const __m64*)&from);
104 #pragma GCC diagnostic pop 106 res.v = _mm_loadl_pi(res.v, (
const __m64*)&from);
108 return Packet2cf(_mm_movelh_ps(res.v,res.v));
117 template<> EIGEN_DEVICE_FUNC
inline Packet2cf pgather<std::complex<float>,
Packet2cf>(
const std::complex<float>* from,
Index stride)
123 template<> EIGEN_DEVICE_FUNC
inline void pscatter<std::complex<float>,
Packet2cf>(std::complex<float>* to,
const Packet2cf& from,
Index stride)
125 to[stride*0] = std::complex<float>(_mm_cvtss_f32(_mm_shuffle_ps(from.v, from.v, 0)),
126 _mm_cvtss_f32(_mm_shuffle_ps(from.v, from.v, 1)));
127 to[stride*1] = std::complex<float>(_mm_cvtss_f32(_mm_shuffle_ps(from.v, from.v, 2)),
128 _mm_cvtss_f32(_mm_shuffle_ps(from.v, from.v, 3)));
131 template<>
EIGEN_STRONG_INLINE void prefetch<std::complex<float> >(
const std::complex<float> * addr) { _mm_prefetch((
const char*)(addr), _MM_HINT_T0); }
135 #if EIGEN_GNUC_AT_MOST(4,3) 139 _mm_store_ps((
float*)res, a.v);
142 std::complex<float> res;
143 _mm_storel_pi((__m64*)&res, a.v);
157 return Packet2cf(_mm_add_ps(_mm_movelh_ps(vecs[0].
v,vecs[1].v), _mm_movehl_ps(vecs[1].v,vecs[0].v)));
172 first.v = _mm_movehl_ps(first.v, first.v);
173 first.v = _mm_movelh_ps(first.v, second.v);
178 template<>
struct conj_helper<Packet2cf, Packet2cf, false,true>
185 #ifdef EIGEN_VECTORIZE_SSE3 188 const __m128 mask = _mm_castsi128_ps(_mm_setr_epi32(0x00000000,0x80000000,0x00000000,0x80000000));
196 template<>
struct conj_helper<Packet2cf, Packet2cf, true,false>
203 #ifdef EIGEN_VECTORIZE_SSE3 206 const __m128 mask = _mm_castsi128_ps(_mm_setr_epi32(0x00000000,0x80000000,0x00000000,0x80000000));
214 template<>
struct conj_helper<Packet2cf, Packet2cf, true,true>
221 #ifdef EIGEN_VECTORIZE_SSE3 224 const __m128 mask = _mm_castsi128_ps(_mm_setr_epi32(0x00000000,0x80000000,0x00000000,0x80000000));
232 template<>
struct conj_helper<Packet4f, Packet2cf, false,false>
241 template<>
struct conj_helper<Packet2cf, Packet4f, false,false>
254 __m128
s = _mm_mul_ps(
b.v,
b.v);
255 return Packet2cf(_mm_div_ps(res.v,_mm_add_ps(s,_mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(s), 0xb1)))));
274 #ifndef EIGEN_VECTORIZE_AVX 306 const __m128d mask = _mm_castsi128_pd(_mm_set_epi32(0x80000000,0x0,0x0,0x0));
312 #ifdef EIGEN_VECTORIZE_SSE3 313 return Packet1cd(_mm_addsub_pd(_mm_mul_pd(_mm_movedup_pd(a.v),
b.v),
317 const __m128d mask = _mm_castsi128_pd(_mm_set_epi32(0x0,0x0,0x80000000,0x0));
343 template<>
EIGEN_STRONG_INLINE void prefetch<std::complex<double> >(
const std::complex<double> * addr) { _mm_prefetch((
const char*)(addr), _MM_HINT_T0); }
348 _mm_store_pd(res, a.v);
349 return std::complex<double>(res[0],res[1]);
386 #ifdef EIGEN_VECTORIZE_SSE3 389 const __m128d mask = _mm_castsi128_pd(_mm_set_epi32(0x80000000,0x0,0x0,0x0));
404 #ifdef EIGEN_VECTORIZE_SSE3 407 const __m128d mask = _mm_castsi128_pd(_mm_set_epi32(0x80000000,0x0,0x0,0x0));
422 #ifdef EIGEN_VECTORIZE_SSE3 425 const __m128d mask = _mm_castsi128_pd(_mm_set_epi32(0x80000000,0x0,0x0,0x0));
455 __m128d
s = _mm_mul_pd(
b.v,
b.v);
456 return Packet1cd(_mm_div_pd(res.
v, _mm_add_pd(s,_mm_shuffle_pd(s, s, 0x1))));
464 EIGEN_DEVICE_FUNC
inline void 466 __m128d w1 = _mm_castps_pd(kernel.
packet[0].v);
467 __m128d w2 = _mm_castps_pd(kernel.
packet[1].v);
469 __m128 tmp = _mm_castpd_ps(_mm_unpackhi_pd(w1, w2));
470 kernel.
packet[0].v = _mm_castpd_ps(_mm_unpacklo_pd(w1, w2));
475 __m128d result = pblend<Packet2d>(ifPacket, _mm_castps_pd(thenPacket.v), _mm_castps_pd(elsePacket.v));
481 return Packet2cf(_mm_loadl_pi(a.v, reinterpret_cast<const __m64*>(&b)));
491 return Packet2cf(_mm_loadh_pi(a.v, reinterpret_cast<const __m64*>(&b)));
503 #endif // EIGEN_COMPLEX_SSE_H EIGEN_STRONG_INLINE Packet2cf pmul(const Packet2cf &a, const Packet2cf &b) const
EIGEN_STRONG_INLINE Packet2cf pmadd(const Packet4f &x, const Packet2cf &y, const Packet2cf &c) const
static EIGEN_STRONG_INLINE void run(Packet1cd &, const Packet1cd &)
EIGEN_STRONG_INLINE Packet1cd ploaddup< Packet1cd >(const std::complex< double > *from)
EIGEN_STRONG_INLINE Packet1cd pmul(const Packet1cd &a, const Packet1cd &b) const
std::complex< double > type
#define EIGEN_STRONG_INLINE
EIGEN_STRONG_INLINE Packet2cf(const __m128 &a)
EIGEN_DEVICE_FUNC RealReturnType real() const
EIGEN_STRONG_INLINE Packet2cf por< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
EIGEN_STRONG_INLINE Packet4cf pinsertfirst(const Packet4cf &a, std::complex< float > b)
EIGEN_STRONG_INLINE Packet2cf preduxp< Packet2cf >(const Packet2cf *vecs)
EIGEN_STRONG_INLINE Packet1cd padd< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
EIGEN_STRONG_INLINE Packet1cd preduxp< Packet1cd >(const Packet1cd *vecs)
#define EIGEN_DEBUG_UNALIGNED_LOAD
EIGEN_STRONG_INLINE Packet2cf pmul< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
EIGEN_STRONG_INLINE Packet1cd pmul(const Packet2d &x, const Packet1cd &y) const
static int f(const TensorMap< Tensor< int, 3 > > &tensor)
EIGEN_STRONG_INLINE Packet1cd pand< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
EIGEN_STRONG_INLINE Packet2cf ploadu< Packet2cf >(const std::complex< float > *from)
#define EIGEN_DEBUG_ALIGNED_STORE
EIGEN_STRONG_INLINE Packet2cf pmadd(const Packet2cf &x, const Packet2cf &y, const Packet2cf &c) const
static constexpr size_t size(Tuple< Args... > &)
Provides access to the number of elements in a tuple as a compile-time constant expression.
EIGEN_STRONG_INLINE Packet2cf pmadd(const Packet2cf &x, const Packet2cf &y, const Packet2cf &c) const
EIGEN_STRONG_INLINE Packet1cd()
EIGEN_STRONG_INLINE Packet1cd pdiv< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
EIGEN_STRONG_INLINE Packet2cf pload< Packet2cf >(const std::complex< float > *from)
EIGEN_STRONG_INLINE Packet2cf pset1< Packet2cf >(const std::complex< float > &from)
EIGEN_STRONG_INLINE Packet1cd pxor< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
EIGEN_STRONG_INLINE std::complex< float > pfirst< Packet2cf >(const Packet2cf &a)
#define EIGEN_DEBUG_UNALIGNED_STORE
EIGEN_STRONG_INLINE Packet1cd pset1< Packet1cd >(const std::complex< double > &from)
EIGEN_STRONG_INLINE Packet1cd(const __m128d &a)
#define EIGEN_DEBUG_ALIGNED_LOAD
EIGEN_STRONG_INLINE Packet2cf pcplxflip(const Packet2cf &x)
EIGEN_STRONG_INLINE Packet2cf psub< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
EIGEN_DEVICE_FUNC Packet padd(const Packet &a, const Packet &b)
EIGEN_STRONG_INLINE Packet1cd pmul(const Packet1cd &a, const Packet1cd &b) const
#define vec2d_swizzle1(v, p, q)
EIGEN_STRONG_INLINE Packet2cf pmul(const Packet2cf &a, const Packet2cf &b) const
EIGEN_STRONG_INLINE Packet2cf pmadd(const Packet2cf &x, const Packet2cf &y, const Packet2cf &c) const
EIGEN_STRONG_INLINE std::complex< double > predux< Packet1cd >(const Packet1cd &a)
EIGEN_STRONG_INLINE Packet1cd pmadd(const Packet2d &x, const Packet1cd &y, const Packet1cd &c) const
EIGEN_DEVICE_FUNC void pstoreu(Scalar *to, const Packet &from)
EIGEN_STRONG_INLINE Packet1cd pmadd(const Packet1cd &x, const Packet1cd &y, const Packet1cd &c) const
EIGEN_STRONG_INLINE Packet1cd pmadd(const Packet1cd &x, const Packet1cd &y, const Packet1cd &c) const
EIGEN_STRONG_INLINE Packet4f ploadu< Packet4f >(const float *from)
EIGEN_STRONG_INLINE void ptranspose(PacketBlock< Packet2cf, 2 > &kernel)
EIGEN_STRONG_INLINE Packet2cf pmul(const Packet4f &x, const Packet2cf &y) const
EIGEN_STRONG_INLINE Packet2cf pand< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
#define vec4f_swizzle1(v, p, q, r, s)
EIGEN_STRONG_INLINE Packet2cf()
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
EIGEN_STRONG_INLINE Packet1cd pandnot< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type pfirst(const Packet &a)
EIGEN_STRONG_INLINE Packet1cd pload< Packet1cd >(const std::complex< double > *from)
EIGEN_STRONG_INLINE std::complex< float > predux_mul< Packet2cf >(const Packet2cf &a)
EIGEN_STRONG_INLINE Packet1cd pmul(const Packet1cd &a, const Packet1cd &b) const
EIGEN_STRONG_INLINE Packet2cf pmul(const Packet2cf &a, const Packet2cf &b) const
EIGEN_STRONG_INLINE Packet2d ploadu< Packet2d >(const double *from)
EIGEN_STRONG_INLINE Packet2cf pconj(const Packet2cf &a)
EIGEN_STRONG_INLINE Packet2d pload< Packet2d >(const double *from)
EIGEN_STRONG_INLINE Packet1cd pmadd(const Packet1cd &x, const Packet1cd &y, const Packet1cd &c) const
EIGEN_STRONG_INLINE std::complex< float > predux< Packet2cf >(const Packet2cf &a)
EIGEN_STRONG_INLINE Packet2cf ploaddup< Packet2cf >(const std::complex< float > *from)
EIGEN_STRONG_INLINE std::complex< double > predux_mul< Packet1cd >(const Packet1cd &a)
EIGEN_STRONG_INLINE Packet1cd pmadd(const Packet1cd &x, const Packet2d &y, const Packet1cd &c) const
EIGEN_STRONG_INLINE Packet4f pmul< Packet4f >(const Packet4f &a, const Packet4f &b)
EIGEN_DEVICE_FUNC void pstore(Scalar *to, const Packet &from)
EIGEN_STRONG_INLINE Packet4f pload< Packet4f >(const float *from)
EIGEN_STRONG_INLINE Packet1cd psub< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
EIGEN_STRONG_INLINE Packet2cf pnegate(const Packet2cf &a)
EIGEN_STRONG_INLINE Packet1cd pmul(const Packet1cd &x, const Packet2d &y) const
EIGEN_STRONG_INLINE Packet2cf pmadd(const Packet2cf &x, const Packet4f &y, const Packet2cf &c) const
static EIGEN_STRONG_INLINE void run(Packet2cf &first, const Packet2cf &second)
EIGEN_STRONG_INLINE Packet2cf pmul(const Packet2cf &x, const Packet4f &y) const
EIGEN_STRONG_INLINE Packet1cd pmul< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
EIGEN_STRONG_INLINE Packet1cd ploadu< Packet1cd >(const std::complex< double > *from)
EIGEN_STRONG_INLINE Packet4cf pinsertlast(const Packet4cf &a, std::complex< float > b)
EIGEN_DEVICE_FUNC const ImagReturnType imag() const
std::complex< float > type
EIGEN_STRONG_INLINE Packet1cd por< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
EIGEN_STRONG_INLINE Packet2cf pxor< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
EIGEN_STRONG_INLINE Packet2d pmul< Packet2d >(const Packet2d &a, const Packet2d &b)
EIGEN_STRONG_INLINE Packet2cf padd< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
EIGEN_DEVICE_FUNC const Scalar & b
EIGEN_DEVICE_FUNC Packet pmul(const Packet &a, const Packet &b)
EIGEN_STRONG_INLINE Packet2cf pandnot< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
EIGEN_STRONG_INLINE Packet4i pblend(const Selector< 4 > &ifPacket, const Packet4i &thenPacket, const Packet4i &elsePacket)
EIGEN_STRONG_INLINE std::complex< double > pfirst< Packet1cd >(const Packet1cd &a)
EIGEN_STRONG_INLINE Packet2cf pdiv< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
EIGEN_STRONG_INLINE Packet2cf preverse(const Packet2cf &a)