aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/arch/NEON
diff options
context:
space:
mode:
authorGravatar David Tellenbach <david.tellenbach@me.com>2020-12-10 15:23:23 +0000
committerGravatar David Tellenbach <david.tellenbach@me.com>2020-12-10 15:23:23 +0000
commit00be0a7ff39caef76bbd4767fca86e89f4a5b45e (patch)
tree27560905472e53fa44e7f71b51b3d91371174f42 /Eigen/src/Core/arch/NEON
parent8eb461a4312f61ea4d951a20d15dbefeceb60f60 (diff)
Fix vectorization of complex sqrt on NEON
Diffstat (limited to 'Eigen/src/Core/arch/NEON')
-rw-r--r--Eigen/src/Core/arch/NEON/Complex.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/Eigen/src/Core/arch/NEON/Complex.h b/Eigen/src/Core/arch/NEON/Complex.h
index 448600bb3..2210d5a78 100644
--- a/Eigen/src/Core/arch/NEON/Complex.h
+++ b/Eigen/src/Core/arch/NEON/Complex.h
@@ -76,6 +76,7 @@ template<> struct unpacket_traits<Packet1cf>
{
typedef std::complex<float> type;
typedef Packet1cf half;
+ typedef Packet2f as_real;
enum
{
size = 1,
@@ -89,6 +90,7 @@ template<> struct unpacket_traits<Packet2cf>
{
typedef std::complex<float> type;
typedef Packet1cf half;
+ typedef Packet4f as_real;
enum
{
size = 2,
@@ -475,6 +477,8 @@ template<> struct packet_traits<std::complex<double> > : default_packet_traits
template<> struct unpacket_traits<Packet1cd>
{
typedef std::complex<double> type;
+ typedef Packet1cd half;
+ typedef Packet2d as_real;
enum
{
size=1,
@@ -483,7 +487,6 @@ template<> struct unpacket_traits<Packet1cd>
masked_load_available=false,
masked_store_available=false
};
- typedef Packet1cd half;
};
template<> EIGEN_STRONG_INLINE Packet1cd pload<Packet1cd>(const std::complex<double>* from)
@@ -640,6 +643,19 @@ EIGEN_STRONG_INLINE void ptranspose(PacketBlock<Packet1cd,2>& kernel)
kernel.packet[0].v = vcombine_f64(vget_low_f64(kernel.packet[0].v), vget_low_f64(kernel.packet[1].v));
kernel.packet[1].v = tmp;
}
+
+template<> EIGEN_STRONG_INLINE Packet1cf psqrt<Packet1cf>(const Packet1cf& a) {
+ return psqrt_complex<Packet1cf>(a);
+}
+
+template<> EIGEN_STRONG_INLINE Packet2cf psqrt<Packet2cf>(const Packet2cf& a) {
+ return psqrt_complex<Packet2cf>(a);
+}
+
+template<> EIGEN_STRONG_INLINE Packet1cd psqrt<Packet1cd>(const Packet1cd& a) {
+ return psqrt_complex<Packet1cd>(a);
+}
+
#endif // EIGEN_ARCH_ARM64
} // end namespace internal