From 0c18c88c715857ea966c4fcc1a5d23841443feb2 Mon Sep 17 00:00:00 2001 From: Roland Shoemaker Date: Tue, 16 Jul 2024 16:38:00 -0700 Subject: [PATCH] cpu: add DIT option and hwcap DIT support Follow-up to https://go.dev/cl/597377, add a option for DIT so it can be set via GODEBUG, and add hwcap support for Linux. Change-Id: Ib094b520edea9c099d37f121b09d02b31644a433 Reviewed-on: https://go-review.googlesource.com/c/sys/+/598719 LUCI-TryBot-Result: Go LUCI Reviewed-by: Ian Lance Taylor --- cpu/cpu_arm64.go | 1 + cpu/cpu_linux_arm64.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/cpu/cpu_arm64.go b/cpu/cpu_arm64.go index 98956a5b5..8bde6f1b9 100644 --- a/cpu/cpu_arm64.go +++ b/cpu/cpu_arm64.go @@ -38,6 +38,7 @@ func initOptions() { {Name: "dcpop", Feature: &ARM64.HasDCPOP}, {Name: "asimddp", Feature: &ARM64.HasASIMDDP}, {Name: "asimdfhm", Feature: &ARM64.HasASIMDFHM}, + {Name: "dit", Feature: &ARM64.HasDIT}, } } diff --git a/cpu/cpu_linux_arm64.go b/cpu/cpu_linux_arm64.go index 3d386d0fc..bc61b1909 100644 --- a/cpu/cpu_linux_arm64.go +++ b/cpu/cpu_linux_arm64.go @@ -35,6 +35,7 @@ const ( hwcap_SHA512 = 1 << 21 hwcap_SVE = 1 << 22 hwcap_ASIMDFHM = 1 << 23 + hwcap_DIT = 1 << 24 hwcap2_SVE2 = 1 << 1 ) @@ -106,6 +107,8 @@ func doinit() { ARM64.HasSHA512 = isSet(hwCap, hwcap_SHA512) ARM64.HasSVE = isSet(hwCap, hwcap_SVE) ARM64.HasASIMDFHM = isSet(hwCap, hwcap_ASIMDFHM) + ARM64.HasDIT = isSet(hwCap, hwcap_DIT) + // HWCAP2 feature bits ARM64.HasSVE2 = isSet(hwCap2, hwcap2_SVE2)