mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
Revert "cmd/compile: don't allow NaNs in floating-point constant ops"
This reverts CL 213477. Reason for revert: tests are failing on linux-mips*-rtrk builders. Change-Id: I8168f7450890233f1bd7e53930b73693c26d4dc0 Reviewed-on: https://go-review.googlesource.com/c/go/+/220897 Run-TryBot: Bryan C. Mills <bcmills@google.com> Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
58ba0f9dcd
commit
a9f1ea4a83
11 changed files with 26 additions and 200 deletions
|
|
@ -487,17 +487,11 @@ func DivisionNeedsFixUp(v *Value) bool {
|
|||
|
||||
// auxFrom64F encodes a float64 value so it can be stored in an AuxInt.
|
||||
func auxFrom64F(f float64) int64 {
|
||||
if f != f {
|
||||
panic("can't encode a NaN in AuxInt field")
|
||||
}
|
||||
return int64(math.Float64bits(f))
|
||||
}
|
||||
|
||||
// auxFrom32F encodes a float32 value so it can be stored in an AuxInt.
|
||||
func auxFrom32F(f float32) int64 {
|
||||
if f != f {
|
||||
panic("can't encode a NaN in AuxInt field")
|
||||
}
|
||||
return int64(math.Float64bits(extend32Fto64F(f)))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue