From 4be7e6b4e0a82853e853c0c7c4ef72f395e1f497 Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen Date: Mon, 4 Aug 2025 20:56:24 +0000 Subject: [PATCH] Fix pcmp_* for HVX to comply with the new definition of true = Scalar(1) --- Eigen/src/Core/arch/HVX/PacketMath.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Eigen/src/Core/arch/HVX/PacketMath.h b/Eigen/src/Core/arch/HVX/PacketMath.h index ccba96efd..b9080d988 100644 --- a/Eigen/src/Core/arch/HVX/PacketMath.h +++ b/Eigen/src/Core/arch/HVX/PacketMath.h @@ -401,7 +401,7 @@ EIGEN_STRONG_INLINE Packet8f pnegate(const Packet8f& a) { template EIGEN_STRONG_INLINE HVXPacket pcmp_le_hvx(const HVXPacket& a, const HVXPacket& b) { - HVX_Vector v_true = Q6_Vb_vsplat_R(0xff); + HVX_Vector v_true = Q6_V_vsplat_R(0x3f800000); HVX_VectorPred pred = Q6_Q_vcmp_gt_VsfVsf(a.Get(), b.Get()); return HVXPacket::Create(Q6_V_vmux_QVV(pred, Q6_V_vzero(), v_true)); } @@ -420,7 +420,7 @@ EIGEN_STRONG_INLINE Packet8f pcmp_le(const Packet8f& a, const Packet8f& b) { template EIGEN_STRONG_INLINE HVXPacket pcmp_eq_hvx(const HVXPacket& a, const HVXPacket& b) { - HVX_Vector v_true = Q6_Vb_vsplat_R(0xff); + HVX_Vector v_true = Q6_V_vsplat_R(0x3f800000); HVX_VectorPred pred = Q6_Q_vcmp_eq_VwVw(a.Get(), b.Get()); return HVXPacket::Create(Q6_V_vmux_QVV(pred, v_true, Q6_V_vzero())); } @@ -439,7 +439,7 @@ EIGEN_STRONG_INLINE Packet8f pcmp_eq(const Packet8f& a, const Packet8f& b) { template EIGEN_STRONG_INLINE HVXPacket pcmp_lt_hvx(const HVXPacket& a, const HVXPacket& b) { - HVX_Vector v_true = Q6_Vb_vsplat_R(0xff); + HVX_Vector v_true = Q6_V_vsplat_R(0x3f800000); HVX_VectorPred pred = Q6_Q_vcmp_gt_VsfVsf(b.Get(), a.Get()); return HVXPacket::Create(Q6_V_vmux_QVV(pred, v_true, Q6_V_vzero())); } @@ -458,7 +458,7 @@ EIGEN_STRONG_INLINE Packet8f pcmp_lt(const Packet8f& a, const Packet8f& b) { template EIGEN_STRONG_INLINE HVXPacket pcmp_lt_or_nan_hvx(const HVXPacket& a, const HVXPacket& b) { - HVX_Vector v_true = Q6_Vb_vsplat_R(0xff); + HVX_Vector v_true = Q6_V_vsplat_R(0x3f800000); HVX_VectorPred pred = Q6_Q_vcmp_gt_VsfVsf(b.Get(), a.Get()); return HVXPacket::Create(Q6_V_vmux_QVV(pred, v_true, Q6_V_vzero())); }