Fix "unary minus operator applied to unsigned type, result still unsigned" on MSVC and other stupid warnings

This commit is contained in:
Charles Schlosser
2024-04-12 19:35:04 +00:00
committed by Rasmus Munk Larsen
parent dcdb0233c1
commit 122befe54c
15 changed files with 215 additions and 128 deletions

View File

@@ -2147,20 +2147,13 @@ EIGEN_DEVICE_FUNC inline void ptranspose(PacketBlock<Packet16i, 4>& kernel) {
template <>
EIGEN_STRONG_INLINE Packet16f pblend(const Selector<16>& ifPacket, const Packet16f& thenPacket,
const Packet16f& elsePacket) {
__mmask16 m = (ifPacket.select[0]) | (ifPacket.select[1] << 1) | (ifPacket.select[2] << 2) |
(ifPacket.select[3] << 3) | (ifPacket.select[4] << 4) | (ifPacket.select[5] << 5) |
(ifPacket.select[6] << 6) | (ifPacket.select[7] << 7) | (ifPacket.select[8] << 8) |
(ifPacket.select[9] << 9) | (ifPacket.select[10] << 10) | (ifPacket.select[11] << 11) |
(ifPacket.select[12] << 12) | (ifPacket.select[13] << 13) | (ifPacket.select[14] << 14) |
(ifPacket.select[15] << 15);
__mmask16 m = ifPacket.mask<__mmask16>();
return _mm512_mask_blend_ps(m, elsePacket, thenPacket);
}
template <>
EIGEN_STRONG_INLINE Packet8d pblend(const Selector<8>& ifPacket, const Packet8d& thenPacket,
const Packet8d& elsePacket) {
__mmask8 m = (ifPacket.select[0]) | (ifPacket.select[1] << 1) | (ifPacket.select[2] << 2) |
(ifPacket.select[3] << 3) | (ifPacket.select[4] << 4) | (ifPacket.select[5] << 5) |
(ifPacket.select[6] << 6) | (ifPacket.select[7] << 7);
__mmask8 m = ifPacket.mask<__mmask8>();
return _mm512_mask_blend_pd(m, elsePacket, thenPacket);
}

View File

@@ -296,6 +296,7 @@ struct packet_traits<bool> : default_packet_traits {
HasMax = 0,
HasConj = 0,
HasSqrt = 1,
HasNegate = 0,
HasSign = 0 // Don't try to vectorize psign<bool> = identity.
};
};
@@ -601,11 +602,6 @@ EIGEN_STRONG_INLINE Packet4i pnegate(const Packet4i& a) {
return psub(pzero(a), a);
}
template <>
EIGEN_STRONG_INLINE Packet16b pnegate(const Packet16b& a) {
return a;
}
template <>
EIGEN_STRONG_INLINE Packet4f pconj(const Packet4f& a) {
return a;