Skip to content

Commit

Permalink
internal/cpu: set PPC64.IsPOWER8
Browse files Browse the repository at this point in the history
This should always be true, but use the HWCAP2 bit anyways.

Change-Id: Ib164cf05b4c9f0c509f41b7eb339ef32fb63e384
Reviewed-on: https://go-review.googlesource.com/c/go/+/389894
Trust: Paul Murphy <murp@ibm.com>
Run-TryBot: Paul Murphy <murp@ibm.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
  • Loading branch information
pmur committed Mar 7, 2022
1 parent 079a027 commit d9d5572
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/internal/cpu/cpu_ppc64x_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ var HWCap2 uint
// HWCAP bits. These are exposed by Linux.
const (
// ISA Level
hwcap2_ARCH_2_07 = 0x80000000
hwcap2_ARCH_3_00 = 0x00800000

// CPU features
Expand All @@ -23,6 +24,7 @@ const (
)

func osinit() {
PPC64.IsPOWER8 = isSet(HWCap2, hwcap2_ARCH_2_07)
PPC64.IsPOWER9 = isSet(HWCap2, hwcap2_ARCH_3_00)
PPC64.HasDARN = isSet(HWCap2, hwcap2_DARN)
PPC64.HasSCV = isSet(HWCap2, hwcap2_SCV)
Expand Down

0 comments on commit d9d5572

Please sign in to comment.