From fc87e2cbaa65e7e93a2c695ce5a9dc048a64a985 Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen Date: Thu, 10 Jun 2021 19:18:50 -0700 Subject: Use bit_cast to create -0.0 for floating point types to avoid compiler optimization changing sign with --ffast-math enabled. --- Eigen/src/Core/arch/AltiVec/PacketMath.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Eigen/src/Core/arch/AltiVec/PacketMath.h') diff --git a/Eigen/src/Core/arch/AltiVec/PacketMath.h b/Eigen/src/Core/arch/AltiVec/PacketMath.h index 7c70c07b1..d4aee3e21 100755 --- a/Eigen/src/Core/arch/AltiVec/PacketMath.h +++ b/Eigen/src/Core/arch/AltiVec/PacketMath.h @@ -2260,7 +2260,8 @@ static Packet2ul p2ul_SIGN = { 0x8000000000000000ull, 0x8000000000000000ull }; static Packet2ul p2ul_PREV0DOT5 = { 0x3FDFFFFFFFFFFFFFull, 0x3FDFFFFFFFFFFFFFull }; static Packet2d p2d_ONE = { 1.0, 1.0 }; static Packet2d p2d_ZERO = reinterpret_cast(p4f_ZERO); -static Packet2d p2d_MZERO = { -0.0, -0.0 }; +static Packet2d p2d_MZERO = { numext::bit_cast(0x8000000000000000ull), + numext::bit_cast(0x8000000000000000ull) }; #ifdef _BIG_ENDIAN static Packet2d p2d_COUNTDOWN = reinterpret_cast(vec_sld(reinterpret_cast(p2d_ZERO), reinterpret_cast(p2d_ONE), 8)); -- cgit v1.2.3