mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-14 04:35:57 +08:00
Fix inconsistency between ptrue and pcmp_* in HVX
This commit is contained in:
parent
ddce1d7d12
commit
1c0048a08c
@ -399,9 +399,26 @@ EIGEN_STRONG_INLINE Packet8f pnegate(const Packet8f& a) {
|
||||
return pnegate_hvx(a);
|
||||
}
|
||||
|
||||
template <HVXPacketSize T>
|
||||
EIGEN_STRONG_INLINE HVXPacket<T> ptrue_hvx(const HVXPacket<T>& a) {
|
||||
return HVXPacket<T>::Create(Q6_V_vsplat_R(0x3f800000));
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet32f ptrue(const Packet32f& a) {
|
||||
return ptrue_hvx(a);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet16f ptrue(const Packet16f& a) {
|
||||
return ptrue_hvx(a);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet8f ptrue(const Packet8f& a) {
|
||||
return ptrue_hvx(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_V_vsplat_R(0x3f800000);
|
||||
HVX_Vector v_true = ptrue(a).Get();
|
||||
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 +437,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_V_vsplat_R(0x3f800000);
|
||||
HVX_Vector v_true = ptrue(a).Get();
|
||||
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 +456,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_V_vsplat_R(0x3f800000);
|
||||
HVX_Vector v_true = ptrue(a).Get();
|
||||
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 +475,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_V_vsplat_R(0x3f800000);
|
||||
HVX_Vector v_true = ptrue(a).Get();
|
||||
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()));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user