From 3510a1e32cbc86b73db143aefcc00aadc44c27bd Mon Sep 17 00:00:00 2001 From: Martin Möhrmann Date: Thu, 5 Nov 2020 05:59:34 +0100 Subject: internal/cpu: fix and cleanup ARM64 cpu feature fields and options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove all cpu features from the ARM64 struct that are not initialized to reduce cache lines used and to avoid those features being accidentially used without actual detection if they are present. Add missing option to mask the CPUID feature. Change-Id: I94bf90c0655de1af2218ac72117ac6c52adfc289 Reviewed-on: https://go-review.googlesource.com/c/go/+/267658 Run-TryBot: Martin Möhrmann TryBot-Result: Go Bot Reviewed-by: Tobias Klauser Trust: Martin Möhrmann --- src/internal/cpu/cpu_arm64.go | 1 + 1 file changed, 1 insertion(+) (limited to 'src/internal/cpu/cpu_arm64.go') diff --git a/src/internal/cpu/cpu_arm64.go b/src/internal/cpu/cpu_arm64.go index 8fde39f03e..4e9ea8ca96 100644 --- a/src/internal/cpu/cpu_arm64.go +++ b/src/internal/cpu/cpu_arm64.go @@ -29,6 +29,7 @@ func doinit() { {Name: "sha2", Feature: &ARM64.HasSHA2}, {Name: "crc32", Feature: &ARM64.HasCRC32}, {Name: "atomics", Feature: &ARM64.HasATOMICS}, + {Name: "cpuid", Feature: &ARM64.HasCPUID}, {Name: "isNeoverseN1", Feature: &ARM64.IsNeoverseN1}, {Name: "isZeus", Feature: &ARM64.IsZeus}, } -- cgit v1.3-5-g9baa