From ad452e575d577420de250312b6917bf1123b89f0 Mon Sep 17 00:00:00 2001 From: Chip Kerchner Date: Thu, 18 Apr 2024 14:55:15 +0000 Subject: [PATCH] Fix compilation problems with PacketI on PowerPC. --- Eigen/src/Core/arch/AltiVec/PacketMath.h | 17 +++++++++++++++++ .../arch/Default/GenericPacketMathFunctions.h | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Eigen/src/Core/arch/AltiVec/PacketMath.h b/Eigen/src/Core/arch/AltiVec/PacketMath.h index 6a2f0e646..06901df1a 100644 --- a/Eigen/src/Core/arch/AltiVec/PacketMath.h +++ b/Eigen/src/Core/arch/AltiVec/PacketMath.h @@ -3201,6 +3201,7 @@ struct packet_traits : default_packet_traits { template <> struct unpacket_traits { typedef double type; + typedef Packet2l integer_packet; enum { size = 2, alignment = Aligned16, @@ -3210,6 +3211,17 @@ struct unpacket_traits { }; typedef Packet2d half; }; +template <> +struct unpacket_traits { + typedef int64_t type; + enum { + size = 2, + alignment = Aligned16, + vectorizable = true, + masked_load_available = false, + masked_store_available = false + }; +}; inline std::ostream& operator<<(std::ostream& s, const Packet2l& v) { union { @@ -3259,6 +3271,11 @@ EIGEN_STRONG_INLINE Packet2d pset1(const double& from) { Packet2d v = {from, from}; return v; } +template <> +EIGEN_STRONG_INLINE Packet2l pset1(const int64_t& from) { + Packet2l v = {from, from}; + return v; +} template <> EIGEN_STRONG_INLINE Packet2d pset1frombits(unsigned long from) { diff --git a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h index 1a700a205..4ee035de8 100644 --- a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +++ b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h @@ -741,6 +741,7 @@ EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet psincos_double(const Packet& x) { typedef typename unpacket_traits::integer_packet PacketI; + typedef typename unpacket_traits::type ScalarI; const Packet cst_sign_mask = pset1frombits(static_cast(0x8000000000000000u)); @@ -751,7 +752,7 @@ EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS const Packet cst_2oPI = pset1(0.63661977236758134307553505349006); // 2/PI // Integer Packet constants - const PacketI cst_one = pset1(1); + const PacketI cst_one = pset1(ScalarI(1)); // Constant for splitting const Packet cst_split = pset1(1 << 24);