Skip to content

Commit

Permalink
read sve2 from hwcap2
Browse files Browse the repository at this point in the history
  • Loading branch information
mhr3 committed Apr 21, 2024
1 parent b80f091 commit 224806d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cpu/cpu_linux_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ const (
hwcap_SHA512 = 1 << 21
hwcap_SVE = 1 << 22
hwcap_ASIMDFHM = 1 << 23

hwcap2_SVE2 = 1 << 1
)

// linuxKernelCanEmulateCPUID reports whether we're running
Expand Down Expand Up @@ -104,6 +106,9 @@ func doinit() {
ARM64.HasSHA512 = isSet(hwCap, hwcap_SHA512)
ARM64.HasSVE = isSet(hwCap, hwcap_SVE)
ARM64.HasASIMDFHM = isSet(hwCap, hwcap_ASIMDFHM)

// HWCAP2 feature bits
ARM64.HasSVE2 = isSet(hwCap2, hwcap2_SVE2)
}

func isSet(hwc uint, value uint) bool {
Expand Down

0 comments on commit 224806d

Please sign in to comment.