cpu: support reading arm64 CPU feature registers

This allows to detect ARM64 CPU features on non-Linux systems. On Linux,
this is used in case /proc/self/auxv cannot be read.

Change-Id: I67d55e989f2beda0c05a97ca5e55781840a8e01c
Reviewed-on: https://go-review.googlesource.com/c/sys/+/209478
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Tobias Klauser
2019-12-04 07:21:56 +00:00
committed by Tobias Klauser
parent 6d18c012ae
commit 85b82a3add
11 changed files with 253 additions and 50 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ func TestAVX2hasAVX(t *testing.T) {
}
func TestARM64minimalFeatures(t *testing.T) {
if runtime.GOARCH != "arm64" || runtime.GOOS != "linux" {
if runtime.GOARCH != "arm64" || runtime.GOOS == "darwin" {
return
}
if !cpu.ARM64.HasASIMD {