From 2db1a7f929892695696eebf685fc484841c08cb4 Mon Sep 17 00:00:00 2001 From: Michael Munday Date: Wed, 12 Sep 2018 12:16:50 +0100 Subject: cmd/compile: avoid more float32 <-> float64 conversions in compiler Use the new custom truncate/extension code when storing or extracting float32 values from AuxInts to avoid the value being changed by the host platform's floating point conversion instructions (e.g. sNaN -> qNaN). Updates #27516. Change-Id: Id39650f1431ef74af088c895cf4738ea5fa87974 Reviewed-on: https://go-review.googlesource.com/134855 Run-TryBot: Michael Munday TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- src/cmd/compile/internal/ssa/gen/386.rules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/cmd/compile/internal/ssa/gen/386.rules') diff --git a/src/cmd/compile/internal/ssa/gen/386.rules b/src/cmd/compile/internal/ssa/gen/386.rules index 2a05732c98..f6aa37e884 100644 --- a/src/cmd/compile/internal/ssa/gen/386.rules +++ b/src/cmd/compile/internal/ssa/gen/386.rules @@ -44,8 +44,8 @@ (Xor(32|16|8) x y) -> (XORL x y) (Neg(32|16|8) x) -> (NEGL x) -(Neg32F x) && !config.use387 -> (PXOR x (MOVSSconst [f2i(math.Copysign(0, -1))])) -(Neg64F x) && !config.use387 -> (PXOR x (MOVSDconst [f2i(math.Copysign(0, -1))])) +(Neg32F x) && !config.use387 -> (PXOR x (MOVSSconst [auxFrom32F(float32(math.Copysign(0, -1)))])) +(Neg64F x) && !config.use387 -> (PXOR x (MOVSDconst [auxFrom64F(math.Copysign(0, -1))])) (Neg32F x) && config.use387 -> (FCHS x) (Neg64F x) && config.use387 -> (FCHS x) -- cgit v1.2.1