diff --git a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h index 137daa815..04b56b32c 100644 --- a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +++ b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h @@ -171,8 +171,8 @@ EIGEN_UNUSED Packet plog_impl_float(const Packet _x) { const Packet cst_1 = pset1(1.0f); - const Packet cst_minus_inf = pset1frombits( 0xff800000u); - const Packet cst_pos_inf = pset1frombits( 0x7f800000u); + const Packet cst_minus_inf = pset1frombits(static_cast(0xff800000u)); + const Packet cst_pos_inf = pset1frombits(static_cast(0x7f800000u)); const Packet cst_cephes_SQRTHF = pset1(0.707106781186547524f); Packet e, x; @@ -538,7 +538,7 @@ Packet pexp_double(const Packet _x) // aligned on 8-bits, and (2) replicating the storage of the bits of 2/pi. // - Avoid a branch in rounding and extraction of the remaining fractional part. // Overall, I measured a speed up higher than x2 on x86-64. -inline float trig_reduce_huge (float xf, int *quadrant) +inline float trig_reduce_huge (float xf, Eigen::numext::int32_t *quadrant) { using Eigen::numext::int32_t; using Eigen::numext::uint32_t; @@ -605,7 +605,7 @@ Packet psincos_float(const Packet& _x) const Packet cst_2oPI = pset1(0.636619746685028076171875f); // 2/PI const Packet cst_rounding_magic = pset1(12582912); // 2^23 for rounding const PacketI csti_1 = pset1(1); - const Packet cst_sign_mask = pset1frombits(0x80000000u); + const Packet cst_sign_mask = pset1frombits(static_cast(0x80000000u)); Packet x = pabs(_x); @@ -661,7 +661,7 @@ Packet psincos_float(const Packet& _x) const int PacketSize = unpacket_traits::size; EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) float vals[PacketSize]; EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) float x_cpy[PacketSize]; - EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) int y_int2[PacketSize]; + EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) Eigen::numext::int32_t y_int2[PacketSize]; pstoreu(vals, pabs(_x)); pstoreu(x_cpy, x); pstoreu(y_int2, y_int); diff --git a/Eigen/src/Core/arch/NEON/PacketMath.h b/Eigen/src/Core/arch/NEON/PacketMath.h index dda0a1efb..e073535bb 100644 --- a/Eigen/src/Core/arch/NEON/PacketMath.h +++ b/Eigen/src/Core/arch/NEON/PacketMath.h @@ -707,9 +707,9 @@ template<> EIGEN_STRONG_INLINE Packet4ui pset1(const uint32_t& from) template<> EIGEN_STRONG_INLINE Packet2l pset1(const int64_t& from) { return vdupq_n_s64(from); } template<> EIGEN_STRONG_INLINE Packet2ul pset1(const uint64_t& from) { return vdupq_n_u64(from); } -template<> EIGEN_STRONG_INLINE Packet2f pset1frombits(unsigned int from) +template<> EIGEN_STRONG_INLINE Packet2f pset1frombits(uint32_t from) { return vreinterpret_f32_u32(vdup_n_u32(from)); } -template<> EIGEN_STRONG_INLINE Packet4f pset1frombits(unsigned int from) +template<> EIGEN_STRONG_INLINE Packet4f pset1frombits(uint32_t from) { return vreinterpretq_f32_u32(vdupq_n_u32(from)); } template<> EIGEN_STRONG_INLINE Packet2f plset(const float& a)