aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/softfloat.go
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/softfloat.go
parent859cf7fc0f4535ab3cdec15c81860f5fd2ae5b01 (diff)
downloadgo-2db1a7f929892695696eebf685fc484841c08cb4.tar.gz
go-2db1a7f929892695696eebf685fc484841c08cb4.zip
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/softfloat.go')
-rw-r--r--src/cmd/compile/internal/ssa/softfloat.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/ssa/softfloat.go b/src/cmd/compile/internal/ssa/softfloat.go
index 39829b046c..b41819c6ad 100644
--- a/src/cmd/compile/internal/ssa/softfloat.go
+++ b/src/cmd/compile/internal/ssa/softfloat.go
@@ -25,7 +25,7 @@ func softfloat(f *Func) {
case OpConst32F:
v.Op = OpConst32
v.Type = f.Config.Types.UInt32
- v.AuxInt = int64(int32(math.Float32bits(i2f32(v.AuxInt))))
+ v.AuxInt = int64(int32(math.Float32bits(auxTo32F(v.AuxInt))))
case OpConst64F:
v.Op = OpConst64
v.Type = f.Config.Types.UInt64