]> Cypherpunks repositories - gostls13.git/commitdiff
bits: use same expression with system bit size
authoryangwenmai <yangwen.yw@gmail.com>
Tue, 27 Apr 2021 00:30:25 +0000 (08:30 +0800)
committerKeith Randall <khr@golang.org>
Tue, 27 Apr 2021 16:25:40 +0000 (16:25 +0000)
Change-Id: Ibce07f8f36f7c64f7022ce656f8efbec5dff3f82
Reviewed-on: https://go-review.googlesource.com/c/go/+/313829
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>

src/cmd/compile/internal/ssa/poset.go
src/math/bits/bits.go

index 1e04b48ba4612ed29d4e22ebe03552abf69595e3..d2719eb8a1d9d4f9b4cbda90e1a1a6b4ef1c0ab2 100644 (file)
@@ -12,7 +12,7 @@ import (
 // If true, check poset integrity after every mutation
 var debugPoset = false
 
-const uintSize = 32 << (^uint(0) >> 32 & 1) // 32 or 64
+const uintSize = 32 << (^uint(0) >> 63) // 32 or 64
 
 // bitset is a bit array for dense indexes.
 type bitset []uint
index 879ef2da5414f5ac2f6c2d22f07efeadb6a9d4b0..65452feda2ce4601caa75ae5a95fee2af5e2103d 100644 (file)
@@ -8,7 +8,7 @@
 // functions for the predeclared unsigned integer types.
 package bits
 
-const uintSize = 32 << (^uint(0) >> 32 & 1) // 32 or 64
+const uintSize = 32 << (^uint(0) >> 63) // 32 or 64
 
 // UintSize is the size of a uint in bits.
 const UintSize = uintSize