Fix pcmp_* for HVX to comply with the new definition of true = Scalar(1)

This commit is contained in:
Rasmus Munk Larsen 2025-08-04 20:56:24 +00:00
parent edcf4c135f
commit 4be7e6b4e0

View File

@ -401,7 +401,7 @@ EIGEN_STRONG_INLINE Packet8f pnegate(const Packet8f& a) {
template <HVXPacketSize T>
EIGEN_STRONG_INLINE HVXPacket<T> pcmp_le_hvx(const HVXPacket<T>& a, const HVXPacket<T>& 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<T>::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 <HVXPacketSize T>
EIGEN_STRONG_INLINE HVXPacket<T> pcmp_eq_hvx(const HVXPacket<T>& a, const HVXPacket<T>& 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<T>::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 <HVXPacketSize T>
EIGEN_STRONG_INLINE HVXPacket<T> pcmp_lt_hvx(const HVXPacket<T>& a, const HVXPacket<T>& 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<T>::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 <HVXPacketSize T>
EIGEN_STRONG_INLINE HVXPacket<T> pcmp_lt_or_nan_hvx(const HVXPacket<T>& a, const HVXPacket<T>& 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<T>::Create(Q6_V_vmux_QVV(pred, v_true, Q6_V_vzero()));
}