Guard AVX2 implementation of psignbit in PacketMath.h

This commit is contained in:
Rasmus Munk Larsen 2024-04-03 21:03:26 +00:00
parent be54cc8ded
commit 283d69294b

View File

@ -1837,7 +1837,11 @@ EIGEN_STRONG_INLINE Packet8bf psignbit(const Packet8bf& a) {
}
template <>
EIGEN_STRONG_INLINE Packet8f psignbit(const Packet8f& a) {
#ifdef EIGEN_VECTORIZE_AVX2
return _mm256_castsi256_ps(_mm256_cmpgt_epi32(_mm256_setzero_si256(), _mm256_castps_si256(a)));
#else
return _mm256_castsi256_ps(parithmetic_shift_right<31>(Packet8i(_mm256_castps_si256(a))));
#endif
}
template <>
EIGEN_STRONG_INLINE Packet8ui psignbit(const Packet8ui& a) {