Commit 0c68b79e authored by Tobias Klauser's avatar Tobias Klauser Committed by Tobias Klauser

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: 's avatarIan Lance Taylor <iant@golang.org>
parent bbafa21b
......@@ -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
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment