11 #ifndef EIGEN_COMPLEX_NEON_H 12 #define EIGEN_COMPLEX_NEON_H 21 #if EIGEN_COMP_CLANG || EIGEN_COMP_CASTXML 22 uint32x4_t
ret = { 0x00000000, 0x80000000, 0x00000000, 0x80000000 };
25 static const uint32_t conj_XOR_DATA[] = { 0x00000000, 0x80000000, 0x00000000, 0x80000000 };
26 return vld1q_u32( conj_XOR_DATA );
32 static const uint32_t conj_XOR_DATA[] = { 0x00000000, 0x80000000 };
33 return vld1_u32( conj_XOR_DATA );
77 typedef std::complex<float>
type;
85 masked_load_available =
false,
86 masked_store_available =
false 91 typedef std::complex<float>
type;
99 masked_load_available =
false,
100 masked_store_available =
false 105 {
return Packet1cf(vset_lane_f32(
a, vdup_n_f32(0.
f), 0)); }
107 {
return Packet2cf(vreinterpretq_f32_u64(vmovl_u32(vreinterpret_u32_f32(
a)))); }
110 {
return Packet1cf(vld1_f32(reinterpret_cast<const float*>(&from))); }
113 const float32x2_t r64 = vld1_f32(reinterpret_cast<const float*>(&from));
114 return Packet2cf(vcombine_f32(r64, r64));
146 v1 = vdup_lane_f32(a.v, 0);
148 v2 = vdup_lane_f32(a.v, 1);
150 v1 = vmul_f32(v1,
b.v);
152 v2 = vmul_f32(v2,
b.v);
154 v2 = vreinterpret_f32_u32(veor_u32(vreinterpret_u32_f32(v2),
p2ui_CONJ_XOR()));
165 v1 = vcombine_f32(vdup_lane_f32(vget_low_f32(a.v), 0), vdup_lane_f32(vget_high_f32(a.v), 0));
167 v2 = vcombine_f32(vdup_lane_f32(vget_low_f32(a.v), 1), vdup_lane_f32(vget_high_f32(a.v), 1));
169 v1 = vmulq_f32(v1,
b.v);
171 v2 = vmulq_f32(v2,
b.v);
173 v2 = vreinterpretq_f32_u32(veorq_u32(vreinterpretq_u32_f32(v2),
p4ui_CONJ_XOR()));
175 v2 = vrev64q_f32(v2);
187 Packet2f eq_swapped = vrev64_f32(eq);
198 Packet4f eq_swapped = vrev64q_f32(eq);
204 {
return Packet1cf(vreinterpret_f32_u32(vand_u32(vreinterpret_u32_f32(a.v), vreinterpret_u32_f32(b.
v)))); }
206 {
return Packet2cf(vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(a.v), vreinterpretq_u32_f32(b.
v)))); }
209 {
return Packet1cf(vreinterpret_f32_u32(vorr_u32(vreinterpret_u32_f32(a.v), vreinterpret_u32_f32(b.
v)))); }
211 {
return Packet2cf(vreinterpretq_f32_u32(vorrq_u32(vreinterpretq_u32_f32(a.v), vreinterpretq_u32_f32(b.
v)))); }
214 {
return Packet1cf(vreinterpret_f32_u32(veor_u32(vreinterpret_u32_f32(a.v), vreinterpret_u32_f32(b.
v)))); }
216 {
return Packet2cf(vreinterpretq_f32_u32(veorq_u32(vreinterpretq_u32_f32(a.v), vreinterpretq_u32_f32(b.
v)))); }
219 {
return Packet1cf(vreinterpret_f32_u32(vbic_u32(vreinterpret_u32_f32(a.v), vreinterpret_u32_f32(b.
v)))); }
221 {
return Packet2cf(vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(a.v), vreinterpretq_u32_f32(b.
v)))); }
249 const std::complex<float>* from,
Index stride)
255 const std::complex<float>* from,
Index stride)
258 res = vsetq_lane_f32(
std::imag(from[0*stride]), res, 1);
259 res = vsetq_lane_f32(
std::real(from[1*stride]), res, 2);
260 res = vsetq_lane_f32(
std::imag(from[1*stride]), res, 3);
266 { to[stride*0] = std::complex<float>(vget_lane_f32(from.v, 0), vget_lane_f32(from.v, 1)); }
270 to[stride*0] = std::complex<float>(vgetq_lane_f32(from.v, 0), vgetq_lane_f32(from.v, 1));
271 to[stride*1] = std::complex<float>(vgetq_lane_f32(from.v, 2), vgetq_lane_f32(from.v, 3));
274 template<>
EIGEN_STRONG_INLINE void prefetch<std::complex<float> >(
const std::complex<float> *addr)
280 vst1_f32(reinterpret_cast<float*>(&x), a.v);
286 vst1q_f32(reinterpret_cast<float*>(x), a.v);
292 {
return Packet2cf(vcombine_f32(vget_high_f32(a.
v), vget_low_f32(a.
v))); }
301 std::complex<float>
s;
302 vst1_f32((
float *)&s, a.
v);
307 std::complex<float>
s;
308 vst1_f32(reinterpret_cast<float*>(&s), vadd_f32(vget_low_f32(a.
v), vget_high_f32(a.
v)));
314 std::complex<float>
s;
315 vst1_f32((
float *)&s, a.
v);
321 std::complex<float>
s;
323 a1 = vget_low_f32(a.
v);
324 a2 = vget_high_f32(a.
v);
326 v1 = vdup_lane_f32(a1, 0);
328 v2 = vdup_lane_f32(a1, 1);
330 v1 = vmul_f32(v1, a2);
332 v2 = vmul_f32(v2, a2);
334 v2 = vreinterpret_f32_u32(veor_u32(vreinterpret_u32_f32(v2),
p2ui_CONJ_XOR()));
338 prod = vadd_f32(v1, v2);
340 vst1_f32(reinterpret_cast<float*>(&s), prod);
355 s = vmul_f32(b.v, b.v);
356 rev_s = vrev64_f32(s);
367 s = vmulq_f32(
b.v,
b.v);
368 rev_s = vrev64q_f32(s);
376 Packet4f tmp = vcombine_f32(vget_high_f32(kernel.
packet[0].v), vget_high_f32(kernel.
packet[1].v));
377 kernel.
packet[0].v = vcombine_f32(vget_low_f32(kernel.
packet[0].v), vget_low_f32(kernel.
packet[1].v));
382 return psqrt_complex<Packet1cf>(
a);
386 return psqrt_complex<Packet2cf>(
a);
390 #if EIGEN_ARCH_ARM64 && !EIGEN_APPLE_DOUBLE_NEON_BUG 393 #if EIGEN_COMP_CLANG || EIGEN_COMP_CASTXML 394 static uint64x2_t p2ul_CONJ_XOR = {0x0, 0x8000000000000000};
396 const uint64_t p2ul_conj_XOR_DATA[] = { 0x0, 0x8000000000000000 };
397 static uint64x2_t p2ul_CONJ_XOR = vld1q_u64( p2ul_conj_XOR_DATA );
433 typedef std::complex<double>
type;
434 typedef Packet1cd
half;
441 masked_load_available=
false,
442 masked_store_available=
false 465 {
return Packet1cd(pnegate<Packet2d>(a.
v)); }
468 {
return Packet1cd(vreinterpretq_f64_u64(veorq_u64(vreinterpretq_u64_f64(a.
v), p2ul_CONJ_XOR))); }
475 v1 = vdupq_lane_f64(vget_low_f64(a.v), 0);
477 v2 = vdupq_lane_f64(vget_high_f64(a.v), 0);
479 v1 = vmulq_f64(v1,
b.v);
481 v2 = vmulq_f64(v2,
b.v);
483 v2 = vreinterpretq_f64_u64(veorq_u64(vreinterpretq_u64_f64(v2), p2ul_CONJ_XOR));
485 v2 = preverse<Packet2d>(
v2);
487 return Packet1cd(vaddq_f64(v1, v2));
497 Packet2d eq_swapped = vreinterpretq_f64_u32(vrev64q_u32(vreinterpretq_u32_f64(eq)));
503 {
return Packet1cd(vreinterpretq_f64_u64(vandq_u64(vreinterpretq_u64_f64(a.v),vreinterpretq_u64_f64(b.
v)))); }
506 {
return Packet1cd(vreinterpretq_f64_u64(vorrq_u64(vreinterpretq_u64_f64(a.v),vreinterpretq_u64_f64(b.
v)))); }
509 {
return Packet1cd(vreinterpretq_f64_u64(veorq_u64(vreinterpretq_u64_f64(a.v),vreinterpretq_u64_f64(b.
v)))); }
512 {
return Packet1cd(vreinterpretq_f64_u64(vbicq_u64(vreinterpretq_u64_f64(a.v),vreinterpretq_u64_f64(b.
v)))); }
517 template<>
EIGEN_STRONG_INLINE void pstore <std::complex<double> >(std::complex<double> *to,
const Packet1cd& from)
520 template<>
EIGEN_STRONG_INLINE void pstoreu<std::complex<double> >(std::complex<double> *to,
const Packet1cd& from)
523 template<>
EIGEN_STRONG_INLINE void prefetch<std::complex<double> >(
const std::complex<double> *addr)
526 template<>
EIGEN_DEVICE_FUNC inline Packet1cd pgather<std::complex<double>, Packet1cd>(
527 const std::complex<double>* from,
Index stride)
530 res = vsetq_lane_f64(
std::real(from[0*stride]), res, 0);
531 res = vsetq_lane_f64(
std::imag(from[0*stride]), res, 1);
532 return Packet1cd(res);
535 template<>
EIGEN_DEVICE_FUNC inline void pscatter<std::complex<double>, Packet1cd>(
536 std::complex<double>* to,
const Packet1cd& from,
Index stride)
537 { to[stride*0] = std::complex<double>(vgetq_lane_f64(from.v, 0), vgetq_lane_f64(from.v, 1)); }
542 pstore<std::complex<double> >(&
res,
a);
569 Packet2d tmp = vcombine_f64(vget_high_f64(kernel.
packet[0].v), vget_high_f64(kernel.
packet[1].v));
570 kernel.
packet[0].v = vcombine_f64(vget_low_f64(kernel.
packet[0].v), vget_low_f64(kernel.
packet[1].v));
575 return psqrt_complex<Packet1cd>(
a);
578 #endif // EIGEN_ARCH_ARM64 584 #endif // EIGEN_COMPLEX_NEON_H EIGEN_STRONG_INLINE std::complex< float > pfirst< Packet1cf >(const Packet1cf &a)
EIGEN_STRONG_INLINE Packet1cd ploaddup< Packet1cd >(const std::complex< double > *from)
#define EIGEN_STRONG_INLINE
EIGEN_STRONG_INLINE Packet1cf pload< Packet1cf >(const std::complex< float > *from)
EIGEN_STRONG_INLINE Packet2cf por< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
EIGEN_STRONG_INLINE Packet1cf pandnot< Packet1cf >(const Packet1cf &a, const Packet1cf &b)
EIGEN_STRONG_INLINE Packet2f pload< Packet2f >(const float *from)
#define EIGEN_MAKE_CONJ_HELPER_CPLX_REAL(PACKET_CPLX, PACKET_REAL)
EIGEN_STRONG_INLINE Packet1cd padd< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
EIGEN_STRONG_INLINE Packet2cf pcast< Packet2f, Packet2cf >(const Packet2f &a)
#define EIGEN_DEBUG_UNALIGNED_LOAD
EIGEN_STRONG_INLINE Packet2cf pmul< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
EIGEN_STRONG_INLINE Packet2f ploadu< Packet2f >(const float *from)
EIGEN_STRONG_INLINE Packet1cf()
EIGEN_STRONG_INLINE Packet1cf pmul< Packet1cf >(const Packet1cf &a, const Packet1cf &b)
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
__vector unsigned int Packet4ui
Namespace containing all symbols from the Eigen library.
EIGEN_STRONG_INLINE Packet1cf psqrt< Packet1cf >(const Packet1cf &a)
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 Packet2f padd< Packet2f >(const Packet2f &a, const Packet2f &b)
EIGEN_STRONG_INLINE Packet2f psub< Packet2f >(const Packet2f &a, const Packet2f &b)
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)
EIGEN_STRONG_INLINE std::complex< float > predux< Packet1cf >(const Packet1cf &a)
#define EIGEN_DEBUG_UNALIGNED_STORE
EIGEN_STRONG_INLINE Packet1cd pset1< Packet1cd >(const std::complex< double > &from)
EIGEN_STRONG_INLINE Packet1cf(const Packet2f &a)
EIGEN_STRONG_INLINE Packet1cf pand< Packet1cf >(const Packet1cf &a, const Packet1cf &b)
EIGEN_STRONG_INLINE std::complex< float > predux_mul< Packet1cf >(const Packet1cf &a)
#define EIGEN_DEBUG_ALIGNED_LOAD
EIGEN_STRONG_INLINE Packet2cf psub< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
EIGEN_STRONG_INLINE Packet2d padd< Packet2d >(const Packet2d &a, const Packet2d &b)
EIGEN_STRONG_INLINE Packet1cf por< Packet1cf >(const Packet1cf &a, const Packet1cf &b)
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
EIGEN_STRONG_INLINE Packet2cf(const Packet4f &a)
EIGEN_STRONG_INLINE bfloat16 pfirst(const Packet8bf &a)
EIGEN_STRONG_INLINE std::complex< double > predux< Packet1cd >(const Packet1cd &a)
EIGEN_STRONG_INLINE Packet2f pdiv< Packet2f >(const Packet2f &a, const Packet2f &b)
EIGEN_STRONG_INLINE Packet4f pdiv< Packet4f >(const Packet4f &a, const Packet4f &b)
EIGEN_DEVICE_FUNC void pstoreu(Scalar *to, const Packet &from)
EIGEN_STRONG_INLINE Packet2cf pcmp_eq(const Packet2cf &a, const Packet2cf &b)
EIGEN_STRONG_INLINE Packet4f ploadu< Packet4f >(const float *from)
EIGEN_STRONG_INLINE void ptranspose(PacketBlock< Packet2cf, 2 > &kernel)
EIGEN_STRONG_INLINE Packet2cf pand< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
EIGEN_STRONG_INLINE Packet2cf()
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
unsigned __int64 uint64_t
EIGEN_STRONG_INLINE Packet1cd pandnot< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
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 Packet2d pand< Packet2d >(const Packet2d &a, const Packet2d &b)
EIGEN_STRONG_INLINE Packet1cf padd< Packet1cf >(const Packet1cf &a, const Packet1cf &b)
EIGEN_STRONG_INLINE Packet1cf pxor< Packet1cf >(const Packet1cf &a, const Packet1cf &b)
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 Packet1cf pcast< float, Packet1cf >(const float &a)
EIGEN_STRONG_INLINE Packet2d psub< Packet2d >(const Packet2d &a, const Packet2d &b)
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 Packet2f pcmp_eq< Packet2f >(const Packet2f &a, const Packet2f &b)
EIGEN_DEVICE_FUNC void pstore(Scalar *to, const Packet &from)
EIGEN_STRONG_INLINE Packet1cf ploaddup< Packet1cf >(const std::complex< float > *from)
EIGEN_STRONG_INLINE Packet4f pload< Packet4f >(const float *from)
uint32x2_t p2ui_CONJ_XOR()
EIGEN_CONSTEXPR Index size(const T &x)
#define EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE Packet1cd psub< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
EIGEN_STRONG_INLINE Packet2cf pnegate(const Packet2cf &a)
EIGEN_DEVICE_FUNC Packet pdiv(const Packet &a, const Packet &b)
EIGEN_STRONG_INLINE Packet1cf pset1< Packet1cf >(const std::complex< float > &from)
EIGEN_STRONG_INLINE Packet1cf psub< Packet1cf >(const Packet1cf &a, const Packet1cf &b)
std::complex< float > type
EIGEN_STRONG_INLINE Packet4f padd< Packet4f >(const Packet4f &a, const Packet4f &b)
EIGEN_STRONG_INLINE Packet1cd pmul< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
#define EIGEN_ARM_PREFETCH(ADDR)
static Packet4ui p4ui_CONJ_XOR
EIGEN_STRONG_INLINE Packet1cd ploadu< Packet1cd >(const std::complex< double > *from)
EIGEN_STRONG_INLINE Packet1cf pcplxflip< Packet1cf >(const Packet1cf &a)
EIGEN_STRONG_INLINE Packet1cd pcplxflip(const Packet1cd &x)
EIGEN_STRONG_INLINE Packet2d pset1< Packet2d >(const double &from)
EIGEN_DEVICE_FUNC const ImagReturnType imag() const
EIGEN_STRONG_INLINE Packet4f pcmp_eq< Packet4f >(const Packet4f &a, const Packet4f &b)
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 Packet2f pand< Packet2f >(const Packet2f &a, const Packet2f &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)
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 Packet1cf ploadu< Packet1cf >(const std::complex< float > *from)
EIGEN_DEVICE_FUNC Packet pmul(const Packet &a, const Packet &b)
EIGEN_STRONG_INLINE Packet2cf psqrt< Packet2cf >(const Packet2cf &a)
EIGEN_STRONG_INLINE Packet4f psub< Packet4f >(const Packet4f &a, const Packet4f &b)
EIGEN_STRONG_INLINE Packet2cf pandnot< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
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 pcplxflip< Packet2cf >(const Packet2cf &x)
EIGEN_STRONG_INLINE Packet2cf preverse(const Packet2cf &a)
const Product< Lhs, Rhs > prod(const Lhs &lhs, const Rhs &rhs)
EIGEN_STRONG_INLINE Packet4f pand< Packet4f >(const Packet4f &a, const Packet4f &b)
EIGEN_STRONG_INLINE Packet1cd psqrt< Packet1cd >(const Packet1cd &a)