diff --git a/Eigen/src/Core/AssignEvaluator.h b/Eigen/src/Core/AssignEvaluator.h index abaa429ed..66efe8f51 100644 --- a/Eigen/src/Core/AssignEvaluator.h +++ b/Eigen/src/Core/AssignEvaluator.h @@ -474,8 +474,8 @@ struct dense_assignment_loop_impl::alignment; - static constexpr bool Alignable = - (DstAlignment >= RequestedAlignment) || ((RequestedAlignment - DstAlignment) % sizeof(Scalar) == 0); + static constexpr bool Alignable = (DstAlignment >= RequestedAlignment) || + (static_cast(RequestedAlignment - DstAlignment) % sizeof(Scalar) == 0); static constexpr int Alignment = Alignable ? RequestedAlignment : DstAlignment; static constexpr bool DstIsAligned = DstAlignment >= Alignment; static constexpr bool UsePacketSegment = Kernel::AssignmentTraits::UsePacketSegment; @@ -587,8 +587,8 @@ struct dense_assignment_loop_impl static constexpr int SrcAlignment = Kernel::AssignmentTraits::JointAlignment; static constexpr int DstAlignment = plain_enum_max(Kernel::AssignmentTraits::DstAlignment, alignof(Scalar)); static constexpr int RequestedAlignment = unpacket_traits::alignment; - static constexpr bool Alignable = - (DstAlignment >= RequestedAlignment) || ((RequestedAlignment - DstAlignment) % sizeof(Scalar) == 0); + static constexpr bool Alignable = (DstAlignment >= RequestedAlignment) || + (static_cast(RequestedAlignment - DstAlignment) % sizeof(Scalar) == 0); static constexpr int Alignment = Alignable ? RequestedAlignment : DstAlignment; static constexpr bool DstIsAligned = DstAlignment >= Alignment; static constexpr bool UsePacketSegment = Kernel::AssignmentTraits::UsePacketSegment; diff --git a/Eigen/src/Core/Visitor.h b/Eigen/src/Core/Visitor.h index fa6293fea..079429cef 100644 --- a/Eigen/src/Core/Visitor.h +++ b/Eigen/src/Core/Visitor.h @@ -46,6 +46,7 @@ struct visitor_impl= PacketSize); } diff --git a/Eigen/src/Core/arch/AVX/PacketMath.h b/Eigen/src/Core/arch/AVX/PacketMath.h index df94f70be..d28a53b49 100644 --- a/Eigen/src/Core/arch/AVX/PacketMath.h +++ b/Eigen/src/Core/arch/AVX/PacketMath.h @@ -2127,7 +2127,7 @@ EIGEN_STRONG_INLINE Packet8h ptrue(const Packet8h& a) { template <> EIGEN_STRONG_INLINE Packet8h pabs(const Packet8h& a) { - const __m128i sign_mask = _mm_set1_epi16(static_cast(0x8000)); + const __m128i sign_mask = _mm_set1_epi16(static_cast(0x8000u)); return _mm_andnot_si128(sign_mask, a); } @@ -2282,7 +2282,7 @@ EIGEN_STRONG_INLINE Packet8h pconj(const Packet8h& a) { template <> EIGEN_STRONG_INLINE Packet8h pnegate(const Packet8h& a) { - Packet8h sign_mask = _mm_set1_epi16(static_cast(0x8000)); + Packet8h sign_mask = _mm_set1_epi16(static_cast(0x8000u)); return _mm_xor_si128(a, sign_mask); } @@ -2561,7 +2561,7 @@ EIGEN_STRONG_INLINE Packet8bf ptrue(const Packet8bf& a) { template <> EIGEN_STRONG_INLINE Packet8bf pabs(const Packet8bf& a) { - const __m128i sign_mask = _mm_set1_epi16(static_cast(0x8000)); + const __m128i sign_mask = _mm_set1_epi16(static_cast(0x8000u)); return _mm_andnot_si128(sign_mask, a); } @@ -2654,7 +2654,7 @@ EIGEN_STRONG_INLINE Packet8bf pconj(const Packet8bf& a) { template <> EIGEN_STRONG_INLINE Packet8bf pnegate(const Packet8bf& a) { - Packet8bf sign_mask = _mm_set1_epi16(static_cast(0x8000)); + Packet8bf sign_mask = _mm_set1_epi16(static_cast(0x8000u)); return _mm_xor_si128(a, sign_mask); } diff --git a/Eigen/src/Core/arch/AVX512/PacketMath.h b/Eigen/src/Core/arch/AVX512/PacketMath.h index 22271e1a8..0c271e116 100644 --- a/Eigen/src/Core/arch/AVX512/PacketMath.h +++ b/Eigen/src/Core/arch/AVX512/PacketMath.h @@ -2178,7 +2178,7 @@ EIGEN_STRONG_INLINE Packet16h ptrue(const Packet16h& a) { template <> EIGEN_STRONG_INLINE Packet16h pabs(const Packet16h& a) { - const __m256i sign_mask = _mm256_set1_epi16(static_cast(0x8000)); + const __m256i sign_mask = _mm256_set1_epi16(static_cast(0x8000u)); return _mm256_andnot_si256(sign_mask, a); } @@ -2275,7 +2275,7 @@ EIGEN_STRONG_INLINE Packet16h pconj(const Packet16h& a) { template <> EIGEN_STRONG_INLINE Packet16h pnegate(const Packet16h& a) { - Packet16h sign_mask = _mm256_set1_epi16(static_cast(0x8000)); + Packet16h sign_mask = _mm256_set1_epi16(static_cast(0x8000u)); return _mm256_xor_si256(a, sign_mask); } @@ -2766,7 +2766,7 @@ EIGEN_STRONG_INLINE Packet16bf pcmp_lt_or_nan(const Packet16bf& a, const Packet1 template <> EIGEN_STRONG_INLINE Packet16bf pnegate(const Packet16bf& a) { - Packet16bf sign_mask = _mm256_set1_epi16(static_cast(0x8000)); + Packet16bf sign_mask = _mm256_set1_epi16(static_cast(0x8000u)); return _mm256_xor_si256(a, sign_mask); } @@ -2777,7 +2777,7 @@ EIGEN_STRONG_INLINE Packet16bf pconj(const Packet16bf& a) { template <> EIGEN_STRONG_INLINE Packet16bf pabs(const Packet16bf& a) { - const __m256i sign_mask = _mm256_set1_epi16(static_cast(0x8000)); + const __m256i sign_mask = _mm256_set1_epi16(static_cast(0x8000u)); return _mm256_andnot_si256(sign_mask, a); } diff --git a/Eigen/src/Core/arch/AVX512/PacketMathFP16.h b/Eigen/src/Core/arch/AVX512/PacketMathFP16.h index 370fb8336..551a94a5c 100644 --- a/Eigen/src/Core/arch/AVX512/PacketMathFP16.h +++ b/Eigen/src/Core/arch/AVX512/PacketMathFP16.h @@ -878,19 +878,17 @@ EIGEN_STRONG_INLINE Packet8h pnmsub(const Packet8h& a, const Packet8h& b, const template <> EIGEN_STRONG_INLINE Packet32h pnegate(const Packet32h& a) { - return _mm512_castsi512_ph( - _mm512_xor_si512(_mm512_castph_si512(a), _mm512_set1_epi16(static_cast(0x8000u)))); + return _mm512_castsi512_ph(_mm512_xor_si512(_mm512_castph_si512(a), _mm512_set1_epi16(static_cast(0x8000u)))); } template <> EIGEN_STRONG_INLINE Packet16h pnegate(const Packet16h& a) { - return _mm256_castsi256_ph( - _mm256_xor_si256(_mm256_castph_si256(a), _mm256_set1_epi16(static_cast(0x8000u)))); + return _mm256_castsi256_ph(_mm256_xor_si256(_mm256_castph_si256(a), _mm256_set1_epi16(static_cast(0x8000u)))); } template <> EIGEN_STRONG_INLINE Packet8h pnegate(const Packet8h& a) { - return _mm_castsi128_ph(_mm_xor_si128(_mm_castph_si128(a), _mm_set1_epi16(static_cast(0x8000u)))); + return _mm_castsi128_ph(_mm_xor_si128(_mm_castph_si128(a), _mm_set1_epi16(static_cast(0x8000u)))); } // pconj diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h index 64bceb3d1..fe34b0b23 100644 --- a/Eigen/src/Core/util/Memory.h +++ b/Eigen/src/Core/util/Memory.h @@ -420,7 +420,7 @@ template EIGEN_DEVICE_FUNC inline T* aligned_new(std::size_t size) { check_size_for_overflow(size); T* result = static_cast(aligned_malloc(sizeof(T) * size)); - EIGEN_TRY { return default_construct_elements_of_array(result, size); } + EIGEN_TRY { default_construct_elements_of_array(result, size); } EIGEN_CATCH(...) { aligned_free(result); EIGEN_THROW; @@ -432,7 +432,7 @@ template EIGEN_DEVICE_FUNC inline T* conditional_aligned_new(std::size_t size) { check_size_for_overflow(size); T* result = static_cast(conditional_aligned_malloc(sizeof(T) * size)); - EIGEN_TRY { return default_construct_elements_of_array(result, size); } + EIGEN_TRY { default_construct_elements_of_array(result, size); } EIGEN_CATCH(...) { conditional_aligned_free(result); EIGEN_THROW; diff --git a/test/mixingtypes.cpp b/test/mixingtypes.cpp index 78032b5fc..1deae95da 100644 --- a/test/mixingtypes.cpp +++ b/test/mixingtypes.cpp @@ -293,7 +293,8 @@ void mixingtypes(int size = SizeAtCompileType) { } EIGEN_DECLARE_TEST(mixingtypes) { - g_called = false; // Silence -Wunneeded-internal-declaration. + g_called = false; // Silence -Wunneeded-internal-declaration and set_but_not_used. + VERIFY(true || g_called); for (int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1(mixingtypes<3>()); CALL_SUBTEST_2(mixingtypes<4>()); diff --git a/test/packetmath.cpp b/test/packetmath.cpp index 6620096d7..38c27d709 100644 --- a/test/packetmath.cpp +++ b/test/packetmath.cpp @@ -298,7 +298,7 @@ struct test_cast_helper(data1[i]); + ref[i] = static_cast(data1[i]); } pcast_array::cast(data1, DataSize, data2);