Go to the documentation of this file.
10 #ifndef EIGEN_COMPLEX_SSE_H
11 #define EIGEN_COMPLEX_SSE_H
27 #ifndef EIGEN_VECTORIZE_AVX
28 template<>
struct packet_traits<
std::
complex<float> > : default_packet_traits
54 template<>
struct unpacket_traits<Packet2cf> {
55 typedef std::complex<float>
type;
72 const __m128 mask = _mm_castsi128_ps(_mm_setr_epi32(0x80000000,0x80000000,0x80000000,0x80000000));
73 return Packet2cf(_mm_xor_ps(
a.v,mask));
77 const __m128 mask = _mm_castsi128_ps(_mm_setr_epi32(0x00000000,0x80000000,0x00000000,0x80000000));
78 return Packet2cf(_mm_xor_ps(
a.v,mask));
83 #ifdef EIGEN_VECTORIZE_SSE3
84 return Packet2cf(_mm_addsub_ps(_mm_mul_ps(_mm_moveldup_ps(
a.v),
b.v),
85 _mm_mul_ps(_mm_movehdup_ps(
a.v),
91 const __m128 mask = _mm_castsi128_ps(_mm_setr_epi32(0x80000000,0x00000000,0x80000000,0x00000000));
92 return Packet2cf(_mm_add_ps(_mm_mul_ps(
vec4f_swizzle1(
a.v, 0, 0, 2, 2),
b.v),
110 #ifdef EIGEN_VECTORIZE_SSE3
111 res.v = _mm_castpd_ps(_mm_loaddup_pd(
reinterpret_cast<double const*
>(&from)));
113 res.v = _mm_castpd_ps(_mm_load_sd(
reinterpret_cast<double const*
>(&from)));
125 template<>
EIGEN_DEVICE_FUNC inline Packet2cf pgather<std::complex<float>, Packet2cf>(
const std::complex<float>* from,
Index stride)
131 template<>
EIGEN_DEVICE_FUNC inline void pscatter<std::complex<float>, Packet2cf>(std::complex<float>* to,
const Packet2cf& from,
Index stride)
133 to[stride*0] = std::complex<float>(_mm_cvtss_f32(_mm_shuffle_ps(from.v, from.v, 0)),
134 _mm_cvtss_f32(_mm_shuffle_ps(from.v, from.v, 1)));
135 to[stride*1] = std::complex<float>(_mm_cvtss_f32(_mm_shuffle_ps(from.v, from.v, 2)),
136 _mm_cvtss_f32(_mm_shuffle_ps(from.v, from.v, 3)));
143 #if EIGEN_GNUC_AT_MOST(4,3)
147 _mm_store_ps((
float*)
res,
a.v);
150 std::complex<float>
res;
151 _mm_storel_pi((__m64*)&
res,
a.v);
160 return pfirst(Packet2cf(_mm_add_ps(
a.v, _mm_movehl_ps(
a.v,
a.v))));
179 __m128
s = _mm_mul_ps(
b.v,
b.v);
195 #ifndef EIGEN_VECTORIZE_AVX
196 template<>
struct packet_traits<
std::
complex<double> > : default_packet_traits
221 template<>
struct unpacket_traits<Packet1cd> {
222 typedef std::complex<double>
type;
239 const __m128d mask = _mm_castsi128_pd(_mm_set_epi32(0x80000000,0
x0,0
x0,0
x0));
240 return Packet1cd(_mm_xor_pd(
a.v,mask));
245 #ifdef EIGEN_VECTORIZE_SSE3
246 return Packet1cd(_mm_addsub_pd(_mm_mul_pd(_mm_movedup_pd(
a.v),
b.v),
250 const __m128d mask = _mm_castsi128_pd(_mm_set_epi32(0
x0,0
x0,0x80000000,0
x0));
282 _mm_store_pd(
res,
a.v);
283 return std::complex<double>(
res[0],
res[1]);
304 __m128d
s = _mm_mul_pd(
b.v,
b.v);
305 return Packet1cd(_mm_div_pd(
res.v, _mm_add_pd(
s,_mm_shuffle_pd(
s,
s, 0
x1))));
314 ptranspose(PacketBlock<Packet2cf,2>& kernel) {
315 __m128d w1 = _mm_castps_pd(kernel.packet[0].v);
316 __m128d w2 = _mm_castps_pd(kernel.packet[1].v);
318 __m128 tmp = _mm_castpd_ps(_mm_unpackhi_pd(w1, w2));
319 kernel.packet[0].v = _mm_castpd_ps(_mm_unpacklo_pd(w1, w2));
320 kernel.packet[1].v = tmp;
325 __m128 eq = _mm_cmpeq_ps(
a.v,
b.v);
331 __m128d eq = _mm_cmpeq_pd(
a.v,
b.v);
335 template<>
EIGEN_STRONG_INLINE Packet2cf
pblend(
const Selector<2>& ifPacket,
const Packet2cf& thenPacket,
const Packet2cf& elsePacket) {
336 __m128d
result = pblend<Packet2d>(ifPacket, _mm_castps_pd(thenPacket.v), _mm_castps_pd(elsePacket.v));
337 return Packet2cf(_mm_castpd_ps(
result));
341 return psqrt_complex<Packet1cd>(
a);
345 return psqrt_complex<Packet2cf>(
a);
351 #endif // EIGEN_COMPLEX_SSE_H
EIGEN_STRONG_INLINE Packet2cf ploadu< Packet2cf >(const std::complex< float > *from)
EIGEN_STRONG_INLINE Packet2cf pcmp_eq(const Packet2cf &a, const Packet2cf &b)
#define EIGEN_DEVICE_FUNC
Namespace containing all symbols from the Eigen library.
#define EIGEN_MAKE_CONJ_HELPER_CPLX_REAL(PACKET_CPLX, PACKET_REAL)
EIGEN_DEVICE_FUNC void pstoreu(Scalar *to, const Packet &from)
EIGEN_STRONG_INLINE Packet1cd pmul< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
EIGEN_STRONG_INLINE Packet2cf psqrt< Packet2cf >(const Packet2cf &a)
EIGEN_STRONG_INLINE Packet2cf pand< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
EIGEN_STRONG_INLINE std::complex< double > predux_mul< Packet1cd >(const Packet1cd &a)
EIGEN_STRONG_INLINE Packet2cf ploaddup< Packet2cf >(const std::complex< float > *from)
std::complex< double > type
EIGEN_STRONG_INLINE bfloat16 pfirst(const Packet8bf &a)
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 Packet2cf ptrue< Packet2cf >(const Packet2cf &a)
EIGEN_STRONG_INLINE std::complex< float > predux< Packet2cf >(const Packet2cf &a)
EIGEN_STRONG_INLINE Packet1cd pandnot< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
EIGEN_STRONG_INLINE Packet2cf preverse(const Packet2cf &a)
EIGEN_STRONG_INLINE Packet2d ploadu< Packet2d >(const double *from)
EIGEN_STRONG_INLINE Packet2cf pconj(const Packet2cf &a)
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
EIGEN_STRONG_INLINE Packet4f ploadu< Packet4f >(const float *from)
EIGEN_STRONG_INLINE Packet4f pload< Packet4f >(const float *from)
EIGEN_STRONG_INLINE Packet2cf(const __m128 &a)
EIGEN_STRONG_INLINE Packet1cd ploadu< Packet1cd >(const std::complex< double > *from)
std::complex< float > type
#define EIGEN_DEBUG_UNALIGNED_STORE
EIGEN_STRONG_INLINE Packet1cd pload< Packet1cd >(const std::complex< double > *from)
EIGEN_STRONG_INLINE Packet2d pand< Packet2d >(const Packet2d &a, const Packet2d &b)
EIGEN_STRONG_INLINE Packet1cd padd< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
EIGEN_STRONG_INLINE Packet1cd por< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
EIGEN_STRONG_INLINE Packet4f vec4f_swizzle1(const Packet4f &a, int p, int q, int r, int s)
EIGEN_STRONG_INLINE Packet1cd()
EIGEN_STRONG_INLINE Packet1cd(const __m128d &a)
EIGEN_STRONG_INLINE std::complex< double > pfirst< Packet1cd >(const Packet1cd &a)
EIGEN_STRONG_INLINE Packet1cd pdiv< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
EIGEN_STRONG_INLINE Packet1cd psub< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
EIGEN_STRONG_INLINE Packet2cf padd< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
EIGEN_STRONG_INLINE Packet2cf pload< Packet2cf >(const std::complex< float > *from)
EIGEN_STRONG_INLINE Packet2cf pnegate(const Packet2cf &a)
EIGEN_DEVICE_FUNC internal::add_const_on_value_type< EIGEN_MATHFUNC_RETVAL(real_ref, Scalar) >::type real_ref(const Scalar &x)
EIGEN_STRONG_INLINE Packet2cf pset1< Packet2cf >(const std::complex< float > &from)
EIGEN_STRONG_INLINE void ptranspose(PacketBlock< Packet2cf, 2 > &kernel)
EIGEN_STRONG_INLINE std::complex< float > pfirst< Packet2cf >(const Packet2cf &a)
#define vec2d_swizzle1(v, p, q)
#define EIGEN_DEBUG_ALIGNED_LOAD
#define EIGEN_STRONG_INLINE
EIGEN_STRONG_INLINE Packet2cf pmul< 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 Packet1cd pset1< Packet1cd >(const std::complex< double > &from)
EIGEN_STRONG_INLINE Packet2cf()
const EIGEN_DEVICE_FUNC ImagReturnType imag() const
EIGEN_DEVICE_FUNC void pstore(Scalar *to, const Packet &from)
EIGEN_STRONG_INLINE Packet2cf por< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
EIGEN_STRONG_INLINE Packet1cd ptrue< Packet1cd >(const Packet1cd &a)
EIGEN_DEVICE_FUNC Packet pmul(const Packet &a, const Packet &b)
#define EIGEN_DEBUG_UNALIGNED_LOAD
const typedef char * SsePrefetchPtrType
EIGEN_STRONG_INLINE Packet2cf pandnot< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
EIGEN_STRONG_INLINE Packet4f pand< Packet4f >(const Packet4f &a, const Packet4f &b)
EIGEN_STRONG_INLINE Packet1cd psqrt< Packet1cd >(const Packet1cd &a)
EIGEN_STRONG_INLINE Packet1cd pcplxflip(const Packet1cd &x)
EIGEN_STRONG_INLINE Packet1cd pxor< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
EIGEN_STRONG_INLINE Packet2cf psub< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
EIGEN_STRONG_INLINE Packet1cd ploaddup< Packet1cd >(const std::complex< double > *from)
EIGEN_STRONG_INLINE Packet2cf pxor< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
EIGEN_STRONG_INLINE Packet1cd pand< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
EIGEN_STRONG_INLINE std::complex< float > predux_mul< Packet2cf >(const Packet2cf &a)
EIGEN_STRONG_INLINE Packet2d pload< Packet2d >(const double *from)
#define EIGEN_DEBUG_ALIGNED_STORE
EIGEN_STRONG_INLINE Packet8h ptrue(const Packet8h &a)
EIGEN_STRONG_INLINE std::complex< double > predux< Packet1cd >(const Packet1cd &a)
EIGEN_STRONG_INLINE Packet2cf pdiv< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:02:00