mirror of
https://github.com/golang/go
synced 2024-11-12 01:10:21 -07:00
runtime/internal/sys: use boolean constants for sys.BigEndian
The BigEndian constant is only used in boolean context so assign it boolean constants. Change-Id: If19d61dd71cdfbffede1d98b401f11e6535fba59 Reviewed-on: https://go-review.googlesource.com/73270 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
bbafa21b37
commit
0c68b79e9c
@ -52,7 +52,7 @@ func TestXadduintptr(t *testing.T) {
|
||||
// Tests that xadduintptr correctly updates 64-bit values. The place where
|
||||
// we actually do so is mstats.go, functions mSysStat{Inc,Dec}.
|
||||
func TestXadduintptrOnUint64(t *testing.T) {
|
||||
if sys.BigEndian != 0 {
|
||||
if sys.BigEndian {
|
||||
// On big endian architectures, we never use xadduintptr to update
|
||||
// 64-bit values and hence we skip the test. (Note that functions
|
||||
// mSysStat{Inc,Dec} in mstats.go have explicit checks for
|
||||
|
@ -6,7 +6,7 @@ package sys
|
||||
|
||||
const (
|
||||
ArchFamily = I386
|
||||
BigEndian = 0
|
||||
BigEndian = false
|
||||
CacheLineSize = 64
|
||||
DefaultPhysPageSize = GoosNacl*65536 + (1-GoosNacl)*4096 // 4k normally; 64k on NaCl
|
||||
PCQuantum = 1
|
||||
|
@ -6,7 +6,7 @@ package sys
|
||||
|
||||
const (
|
||||
ArchFamily = AMD64
|
||||
BigEndian = 0
|
||||
BigEndian = false
|
||||
CacheLineSize = 64
|
||||
DefaultPhysPageSize = 4096
|
||||
PCQuantum = 1
|
||||
|
@ -6,7 +6,7 @@ package sys
|
||||
|
||||
const (
|
||||
ArchFamily = AMD64
|
||||
BigEndian = 0
|
||||
BigEndian = false
|
||||
CacheLineSize = 64
|
||||
DefaultPhysPageSize = 65536*GoosNacl + 4096*(1-GoosNacl)
|
||||
PCQuantum = 1
|
||||
|
@ -6,7 +6,7 @@ package sys
|
||||
|
||||
const (
|
||||
ArchFamily = ARM
|
||||
BigEndian = 0
|
||||
BigEndian = false
|
||||
CacheLineSize = 32
|
||||
DefaultPhysPageSize = 65536
|
||||
PCQuantum = 4
|
||||
|
@ -6,7 +6,7 @@ package sys
|
||||
|
||||
const (
|
||||
ArchFamily = ARM64
|
||||
BigEndian = 0
|
||||
BigEndian = false
|
||||
CacheLineSize = 64
|
||||
DefaultPhysPageSize = 65536
|
||||
PCQuantum = 4
|
||||
|
@ -6,7 +6,7 @@ package sys
|
||||
|
||||
const (
|
||||
ArchFamily = MIPS
|
||||
BigEndian = 1
|
||||
BigEndian = true
|
||||
CacheLineSize = 32
|
||||
DefaultPhysPageSize = 65536
|
||||
PCQuantum = 4
|
||||
|
@ -6,7 +6,7 @@ package sys
|
||||
|
||||
const (
|
||||
ArchFamily = MIPS64
|
||||
BigEndian = 1
|
||||
BigEndian = true
|
||||
CacheLineSize = 32
|
||||
DefaultPhysPageSize = 16384
|
||||
PCQuantum = 4
|
||||
|
@ -6,7 +6,7 @@ package sys
|
||||
|
||||
const (
|
||||
ArchFamily = MIPS64
|
||||
BigEndian = 0
|
||||
BigEndian = false
|
||||
CacheLineSize = 32
|
||||
DefaultPhysPageSize = 16384
|
||||
PCQuantum = 4
|
||||
|
@ -6,7 +6,7 @@ package sys
|
||||
|
||||
const (
|
||||
ArchFamily = MIPS
|
||||
BigEndian = 0
|
||||
BigEndian = false
|
||||
CacheLineSize = 32
|
||||
DefaultPhysPageSize = 65536
|
||||
PCQuantum = 4
|
||||
|
@ -6,7 +6,7 @@ package sys
|
||||
|
||||
const (
|
||||
ArchFamily = PPC64
|
||||
BigEndian = 1
|
||||
BigEndian = true
|
||||
CacheLineSize = 128
|
||||
DefaultPhysPageSize = 65536
|
||||
PCQuantum = 4
|
||||
|
@ -6,7 +6,7 @@ package sys
|
||||
|
||||
const (
|
||||
ArchFamily = PPC64
|
||||
BigEndian = 0
|
||||
BigEndian = false
|
||||
CacheLineSize = 128
|
||||
DefaultPhysPageSize = 65536
|
||||
PCQuantum = 4
|
||||
|
@ -6,7 +6,7 @@ package sys
|
||||
|
||||
const (
|
||||
ArchFamily = S390X
|
||||
BigEndian = 1
|
||||
BigEndian = true
|
||||
CacheLineSize = 256
|
||||
DefaultPhysPageSize = 4096
|
||||
PCQuantum = 2
|
||||
|
@ -664,7 +664,7 @@ func purgecachedstats(c *mcache) {
|
||||
// overflow errors.
|
||||
//go:nosplit
|
||||
func mSysStatInc(sysStat *uint64, n uintptr) {
|
||||
if sys.BigEndian != 0 {
|
||||
if sys.BigEndian {
|
||||
atomic.Xadd64(sysStat, int64(n))
|
||||
return
|
||||
}
|
||||
@ -678,7 +678,7 @@ func mSysStatInc(sysStat *uint64, n uintptr) {
|
||||
// mSysStatInc apply.
|
||||
//go:nosplit
|
||||
func mSysStatDec(sysStat *uint64, n uintptr) {
|
||||
if sys.BigEndian != 0 {
|
||||
if sys.BigEndian {
|
||||
atomic.Xadd64(sysStat, -int64(n))
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user