From ddfc68d399241ba1a3e4a57b7e7532d9867757c2 Mon Sep 17 00:00:00 2001 From: Sean Talts Date: Thu, 29 Jan 2026 17:17:03 +0000 Subject: [PATCH] Fix clang vector backend type compatibility issues. libeigen/eigen!2116 --- Eigen/src/Core/arch/clang/PacketMath.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Eigen/src/Core/arch/clang/PacketMath.h b/Eigen/src/Core/arch/clang/PacketMath.h index 19e5e8f24..3f5fe933a 100644 --- a/Eigen/src/Core/arch/clang/PacketMath.h +++ b/Eigen/src/Core/arch/clang/PacketMath.h @@ -338,7 +338,7 @@ EIGEN_STRONG_INLINE Packet8d pcast_long_to_double(const Packet8l& a) { return re } \ template <> \ constexpr EIGEN_STRONG_INLINE PACKET_TYPE ptrue(const PACKET_TYPE& /*unused*/) { \ - return PACKET_TYPE(0) == PACKET_TYPE(0); \ + return numext::bit_cast(PACKET_TYPE(0) == PACKET_TYPE(0)); \ } \ template <> \ EIGEN_STRONG_INLINE PACKET_TYPE pand(const PACKET_TYPE& a, const PACKET_TYPE& b) { \ @@ -377,9 +377,9 @@ EIGEN_CLANG_PACKET_BITWISE_INT(Packet8l) // Bitwise ops for floating point packets #define EIGEN_CLANG_PACKET_BITWISE_FLOAT(PACKET_TYPE, CAST_TO_INT, CAST_FROM_INT) \ template <> \ - EIGEN_STRONG_INLINE PACKET_TYPE ptrue(const PACKET_TYPE& /* unused */) { \ + constexpr EIGEN_STRONG_INLINE PACKET_TYPE ptrue(const PACKET_TYPE& /* unused */) { \ using Scalar = detail::scalar_type_of_vector_t; \ - return CAST_FROM_INT(PACKET_TYPE(Scalar(0)) == PACKET_TYPE(Scalar(0))); \ + return numext::bit_cast(PACKET_TYPE(Scalar(0)) == PACKET_TYPE(Scalar(0))); \ } \ template <> \ EIGEN_STRONG_INLINE PACKET_TYPE pand(const PACKET_TYPE& a, const PACKET_TYPE& b) { \