summaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/gen/386.rules
diff options
context:
space:
mode:
authorMichael Munday <mike.munday@ibm.com>2018-09-12 12:16:50 +0100
committerMichael Munday <mike.munday@ibm.com>2018-09-17 14:37:45 +0000
commit2db1a7f929892695696eebf685fc484841c08cb4 (patch)
tree36799ecb58734b34a8aafcbecd91f44bde676ceb /src/cmd/compile/internal/ssa/gen/386.rules
parent859cf7fc0f4535ab3cdec15c81860f5fd2ae5b01 (diff)
downloadgo-git-2db1a7f929892695696eebf685fc484841c08cb4.tar.gz
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 <mike.munday@ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ssa/gen/386.rules')
-rw-r--r--src/cmd/compile/internal/ssa/gen/386.rules4
1 files changed, 2 insertions, 2 deletions
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 <typ.Float32> [f2i(math.Copysign(0, -1))]))
-(Neg64F x) && !config.use387 -> (PXOR x (MOVSDconst <typ.Float64> [f2i(math.Copysign(0, -1))]))
+(Neg32F x) && !config.use387 -> (PXOR x (MOVSSconst <typ.Float32> [auxFrom32F(float32(math.Copysign(0, -1)))]))
+(Neg64F x) && !config.use387 -> (PXOR x (MOVSDconst <typ.Float64> [auxFrom64F(math.Copysign(0, -1))]))
(Neg32F x) && config.use387 -> (FCHS x)
(Neg64F x) && config.use387 -> (FCHS x)