diff options
| author | Katie Hockman <katie@golang.org> | 2020-12-14 10:03:05 -0500 |
|---|---|---|
| committer | Katie Hockman <katie@golang.org> | 2020-12-14 10:06:13 -0500 |
| commit | 0345ede87ee12698988973884cfc0fd3d499dffd (patch) | |
| tree | 7123cff141ee5661208d2f5f437b8f5252ac7f6a /src/internal/cpu/cpu_ppc64x.go | |
| parent | 4651d6b267818b0e0d128a5443289717c4bb8cbc (diff) | |
| parent | 0a02371b0576964e81c3b40d328db9a3ef3b031b (diff) | |
| download | go-0345ede87ee12698988973884cfc0fd3d499dffd.tar.xz | |
[dev.fuzz] all: merge master into dev.fuzz
Change-Id: I5d8c8329ccc9d747bd81ade6b1cb7cb8ae2e94b2
Diffstat (limited to 'src/internal/cpu/cpu_ppc64x.go')
| -rw-r--r-- | src/internal/cpu/cpu_ppc64x.go | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/src/internal/cpu/cpu_ppc64x.go b/src/internal/cpu/cpu_ppc64x.go index 2487879c46..beb1765427 100644 --- a/src/internal/cpu/cpu_ppc64x.go +++ b/src/internal/cpu/cpu_ppc64x.go @@ -8,39 +8,14 @@ package cpu const CacheLinePadSize = 128 -// ppc64x doesn't have a 'cpuid' equivalent, so we rely on HWCAP/HWCAP2. -// These are initialized by archauxv and should not be changed after they are -// initialized. -// On aix/ppc64, these values are initialized early in the runtime in runtime/os_aix.go. -var HWCap uint -var HWCap2 uint - -// HWCAP/HWCAP2 bits. These are exposed by the kernel. -const ( - // ISA Level - PPC_FEATURE2_ARCH_2_07 = 0x80000000 - PPC_FEATURE2_ARCH_3_00 = 0x00800000 - - // CPU features - PPC_FEATURE2_DARN = 0x00200000 - PPC_FEATURE2_SCV = 0x00100000 -) - func doinit() { options = []option{ {Name: "darn", Feature: &PPC64.HasDARN}, {Name: "scv", Feature: &PPC64.HasSCV}, {Name: "power9", Feature: &PPC64.IsPOWER9}, - - // These capabilities should always be enabled on ppc64 and ppc64le: - {Name: "power8", Feature: &PPC64.IsPOWER8, Required: true}, } - // HWCAP2 feature bits - PPC64.IsPOWER8 = isSet(HWCap2, PPC_FEATURE2_ARCH_2_07) - PPC64.IsPOWER9 = isSet(HWCap2, PPC_FEATURE2_ARCH_3_00) - PPC64.HasDARN = isSet(HWCap2, PPC_FEATURE2_DARN) - PPC64.HasSCV = isSet(HWCap2, PPC_FEATURE2_SCV) + osinit() } func isSet(hwc uint, value uint) bool { |
