]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: use quiet NaNs in softfloat implementation
authorKeith Randall <khr@golang.org>
Fri, 28 Feb 2020 23:42:03 +0000 (15:42 -0800)
committerKeith Randall <khr@golang.org>
Mon, 2 Mar 2020 17:17:18 +0000 (17:17 +0000)
Update #37455

Change-Id: Ieac0823aa398d73187c009037be15ba34c84f3d9
Reviewed-on: https://go-review.googlesource.com/c/go/+/221433
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/runtime/softfloat64.go

index 8fde0feddc26173a7164153ded1c72f5467c234e..13bee6c1d7a06499d838ef6cf2356f1dd3db9774 100644 (file)
@@ -13,7 +13,7 @@ const (
        expbits64  uint = 11
        bias64          = -1<<(expbits64-1) + 1
 
-       nan64 uint64 = (1<<expbits64-1)<<mantbits64 + 1
+       nan64 uint64 = (1<<expbits64-1)<<mantbits64 + 1<<(mantbits64-1) // quiet NaN, 0 payload
        inf64 uint64 = (1<<expbits64 - 1) << mantbits64
        neg64 uint64 = 1 << (expbits64 + mantbits64)
 
@@ -21,7 +21,7 @@ const (
        expbits32  uint = 8
        bias32          = -1<<(expbits32-1) + 1
 
-       nan32 uint32 = (1<<expbits32-1)<<mantbits32 + 1
+       nan32 uint32 = (1<<expbits32-1)<<mantbits32 + 1<<(mantbits32-1) // quiet NaN, 0 payload
        inf32 uint32 = (1<<expbits32 - 1) << mantbits32
        neg32 uint32 = 1 << (expbits32 + mantbits32)
 )