diff options
author | Guoqiang QI <425418567@qq.com> | 2021-01-13 22:54:03 +0000 |
---|---|---|
committer | Rasmus Munk Larsen <rmlarsen@google.com> | 2021-01-13 22:54:03 +0000 |
commit | 38ae5353ab6f1050aed64821ac56a1561096cdce (patch) | |
tree | bc2cbea514d3843d300695559b96abeac4ceefc3 /Eigen/src/Core/arch/Default | |
parent | 352f1422d3ceea19a04cab297c6339e0870e1c6c (diff) |
1)provide a better generic paddsub op implementation
2)make paddsub op support the Packet2cf/Packet4f/Packet2f in NEON
3)make paddsub op support the Packet2cf/Packet4f in SSE
Diffstat (limited to 'Eigen/src/Core/arch/Default')
-rw-r--r-- | Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h | 6 | ||||
-rw-r--r-- | Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h index 9253d8cab..f40093455 100644 --- a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +++ b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h @@ -19,6 +19,12 @@ namespace Eigen { namespace internal { +template<typename Packet, int N> EIGEN_DEVICE_FUNC inline Packet +pset(const typename unpacket_traits<Packet>::type (&a)[N] /* a */) { + EIGEN_STATIC_ASSERT(unpacket_traits<Packet>::size == N, THE_ARRAY_SIZE_SHOULD_EQUAL_WITH_PACKET_SIZE); + return pload<Packet>(a); +} + template<typename Packet> EIGEN_STRONG_INLINE Packet pfrexp_float(const Packet& a, Packet& exponent) { typedef typename unpacket_traits<Packet>::integer_packet PacketI; diff --git a/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h b/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h index 491f1c927..a623f54cb 100644 --- a/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +++ b/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h @@ -17,6 +17,10 @@ namespace internal { // implemented in GenericPacketMathFunctions.h // This is needed to workaround a circular dependency. +/** \internal \returns a packet with constant coefficients \a a, e.g.: (a[N-1],...,a[0]) */ +template<typename Packet, int N> EIGEN_DEVICE_FUNC inline Packet +pset(const typename unpacket_traits<Packet>::type (&a)[N] /* a */); + template<typename Packet> EIGEN_STRONG_INLINE Packet pfrexp_float(const Packet& a, Packet& exponent); |