[sys] cpu: support darwin/arm64 CPU feature detection

428 views
Skip to first unread message

Gerrit Bot (Gerrit)

unread,
Jul 3, 2021, 1:51:36 PM7/3/21
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Gerrit Bot has uploaded this change for review.

View Change

cpu: support darwin/arm64 CPU feature detection

Support ARM64 features detection. The CPU features which are supported by
Apple Silicon M1 are assumed as the minimal set of features for Go programs
running on darwin/arm64.

Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
GitHub-Last-Rev: 107027e1baeeda7553675d751104c55ccf1ea097
GitHub-Pull-Request: golang/sys#114
---
A cpu/cpu_android_arm64.go
M cpu/cpu_arm64.go
M cpu/cpu_arm64.s
A cpu/cpu_darwin_arm64.go
A cpu/cpu_freebsd_arm64.go
M cpu/cpu_linux_arm64.go
M cpu/cpu_other_arm64.go
M cpu/cpu_test.go
8 files changed, 271 insertions(+), 26 deletions(-)

diff --git a/cpu/cpu_android_arm64.go b/cpu/cpu_android_arm64.go
new file mode 100644
index 0000000..1e9912c
--- /dev/null
+++ b/cpu/cpu_android_arm64.go
@@ -0,0 +1,98 @@
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build arm64
+// +build android
+
+package cpu
+
+// HWCAP/HWCAP2 bits. These are exposed by Linux.
+const (
+ hwcap_FP = 1 << 0
+ hwcap_ASIMD = 1 << 1
+ hwcap_EVTSTRM = 1 << 2
+ hwcap_AES = 1 << 3
+ hwcap_PMULL = 1 << 4
+ hwcap_SHA1 = 1 << 5
+ hwcap_SHA2 = 1 << 6
+ hwcap_CRC32 = 1 << 7
+ hwcap_ATOMICS = 1 << 8
+ hwcap_FPHP = 1 << 9
+ hwcap_ASIMDHP = 1 << 10
+ hwcap_CPUID = 1 << 11
+ hwcap_ASIMDRDM = 1 << 12
+ hwcap_JSCVT = 1 << 13
+ hwcap_FCMA = 1 << 14
+ hwcap_LRCPC = 1 << 15
+ hwcap_DCPOP = 1 << 16
+ hwcap_SHA3 = 1 << 17
+ hwcap_SM3 = 1 << 18
+ hwcap_SM4 = 1 << 19
+ hwcap_ASIMDDP = 1 << 20
+ hwcap_SHA512 = 1 << 21
+ hwcap_SVE = 1 << 22
+ hwcap_ASIMDFHM = 1 << 23
+)
+
+func osInit() {
+ if err := readHWCAP(); err != nil {
+ // failed to read /proc/self/auxv, try reading registers directly
+ readARM64Registers()
+ return
+ }
+
+ // HWCap was populated by the runtime from the auxiliary vector.
+ // Use HWCap information since reading aarch64 system registers
+ // is not supported in user space on older linux kernels.
+ ARM64.HasFP = isSet(hwCap, hwcap_FP)
+ ARM64.HasASIMD = isSet(hwCap, hwcap_ASIMD)
+ ARM64.HasEVTSTRM = isSet(hwCap, hwcap_EVTSTRM)
+ ARM64.HasAES = isSet(hwCap, hwcap_AES)
+ ARM64.HasPMULL = isSet(hwCap, hwcap_PMULL)
+ ARM64.HasSHA1 = isSet(hwCap, hwcap_SHA1)
+ ARM64.HasSHA2 = isSet(hwCap, hwcap_SHA2)
+ ARM64.HasCRC32 = isSet(hwCap, hwcap_CRC32)
+ ARM64.HasFPHP = isSet(hwCap, hwcap_FPHP)
+ ARM64.HasASIMDHP = isSet(hwCap, hwcap_ASIMDHP)
+ ARM64.HasASIMDRDM = isSet(hwCap, hwcap_ASIMDRDM)
+ ARM64.HasJSCVT = isSet(hwCap, hwcap_JSCVT)
+ ARM64.HasFCMA = isSet(hwCap, hwcap_FCMA)
+ ARM64.HasLRCPC = isSet(hwCap, hwcap_LRCPC)
+ ARM64.HasDCPOP = isSet(hwCap, hwcap_DCPOP)
+ ARM64.HasSHA3 = isSet(hwCap, hwcap_SHA3)
+ ARM64.HasSM3 = isSet(hwCap, hwcap_SM3)
+ ARM64.HasSM4 = isSet(hwCap, hwcap_SM4)
+ ARM64.HasASIMDDP = isSet(hwCap, hwcap_ASIMDDP)
+ ARM64.HasSHA512 = isSet(hwCap, hwcap_SHA512)
+ ARM64.HasSVE = isSet(hwCap, hwcap_SVE)
+ ARM64.HasASIMDFHM = isSet(hwCap, hwcap_ASIMDFHM)
+
+ // The Samsung S9+ kernel reports support for atomics, but not all cores
+ // actually support them, resulting in SIGILL. See issue #28431.
+ // TODO(elias.naur): Only disable the optimization on bad chipsets on android.
+ ARM64.HasATOMICS = false
+
+ // Check to see if executing on a NeoverseN1 and in order to do that,
+ // check the AUXV for the CPUID bit. The getMIDR function executes an
+ // instruction which would normally be an illegal instruction, but it's
+ // trapped by the kernel, the value sanitized and then returned. Without
+ // the CPUID bit the kernel will not trap the instruction and the process
+ // will be terminated with SIGILL.
+ if ARM64.HasCPUID {
+ midr := getMIDR()
+ part_num := uint16((midr >> 4) & 0xfff)
+ implementor := byte((midr >> 24) & 0xff)
+
+ if implementor == 'A' && part_num == 0xd0c {
+ ARM64.IsNeoverseN1 = true
+ }
+ if implementor == 'A' && part_num == 0xd40 {
+ ARM64.IsZeus = true
+ }
+ }
+}
+
+func isSet(hwc uint, value uint) bool {
+ return hwc&value != 0
+}
diff --git a/cpu/cpu_arm64.go b/cpu/cpu_arm64.go
index 87dd5e3..30282ba 100644
--- a/cpu/cpu_arm64.go
+++ b/cpu/cpu_arm64.go
@@ -4,8 +4,6 @@

package cpu

-import "runtime"
-
const cacheLineSize = 64

func initOptions() {
@@ -38,25 +36,8 @@
}

func archInit() {
- switch runtime.GOOS {
- case "freebsd":
- readARM64Registers()
- case "linux", "netbsd":
- doinit()
- default:
- // Most platforms don't seem to allow reading these registers.
- //
- // OpenBSD:
- // See https://golang.org/issue/31746
- setMinimalFeatures()
- }
-}
-
-// setMinimalFeatures fakes the minimal ARM64 features expected by
-// TestARM64minimalFeatures.
-func setMinimalFeatures() {
- ARM64.HasASIMD = true
- ARM64.HasFP = true
+ setMinimalFeatures()
+ osInit()
}

func readARM64Registers() {
@@ -170,3 +151,12 @@
func extractBits(data uint64, start, end uint) uint {
return (uint)(data>>start) & ((1 << (end - start + 1)) - 1)
}
+
+// setMinimalFeatures fakes the minimal ARM64 features expected by
+// TestARM64minimalFeatures.
+func setMinimalFeatures() {
+ ARM64.HasASIMD = true
+ ARM64.HasFP = true
+}
+
+func getMIDR() uint64
diff --git a/cpu/cpu_arm64.s b/cpu/cpu_arm64.s
index c61f95a..07894c8 100644
--- a/cpu/cpu_arm64.s
+++ b/cpu/cpu_arm64.s
@@ -30,3 +30,9 @@
WORD $0xd5380400
MOVD R0, ret+0(FP)
RET
+
+// func getMIDR() uint64
+TEXT ·getMIDR(SB), NOSPLIT, $0-8
+ MRS MIDR_EL1, R0
+ MOVD R0, ret+0(FP)
+ RET
diff --git a/cpu/cpu_darwin_arm64.go b/cpu/cpu_darwin_arm64.go
new file mode 100644
index 0000000..963b7a0
--- /dev/null
+++ b/cpu/cpu_darwin_arm64.go
@@ -0,0 +1,133 @@
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build arm64
+// +build darwin
+// +build !ios
+
+package cpu
+
+import (
+ "fmt"
+ "strings"
+ "syscall"
+ "unsafe"
+)
+
+func osInit() {
+ ARM64.HasFP = sysctlEnabled("hw.optional.floatingpoint")
+ ARM64.HasASIMD = sysctlEnabled("hw.optional.neon")
+ ARM64.HasCRC32 = sysctlEnabled("hw.optional.armv8_crc32")
+ ARM64.HasATOMICS = sysctlEnabled("hw.optional.armv8_1_atomics")
+ ARM64.HasFPHP = sysctlEnabled("hw.optional.neon_hpfp")
+ ARM64.HasASIMDHP = sysctlEnabled("hw.optional.floatingpoint")
+ ARM64.HasSHA3 = sysctlEnabled("hw.optional.armv8_2_sha3")
+ ARM64.HasSHA512 = sysctlEnabled("hw.optional.armv8_2_sha512")
+ ARM64.HasASIMDFHM = sysctlEnabled("hw.optional.armv8_2_fhm")
+
+ // There are no hw.optional sysctl values for the below features on Mac OS 11.0
+ // to detect their supported state dynamically. Assume the CPU features that
+ // Apple Silicon M1 supports to be available as a minimal set of features
+ // to all Go programs running on darwin/arm64.
+ ARM64.HasEVTSTRM = true
+ ARM64.HasAES = true
+ ARM64.HasPMULL = true
+ ARM64.HasSHA1 = true
+ ARM64.HasSHA2 = true
+ ARM64.HasCPUID = true
+ ARM64.HasASIMDRDM = true
+ ARM64.HasJSCVT = true
+ ARM64.HasFCMA = true
+ ARM64.HasLRCPC = true
+ ARM64.HasDCPOP = true
+ ARM64.HasSM3 = true
+ ARM64.HasSM4 = true
+ ARM64.HasASIMDDP = true
+ ARM64.HasSVE = true
+}
+
+// The following is minimal copy of functionality from x/sys/unix so the cpu package can call
+// sysctl without depending on x/sys/unix.
+
+func sysctlEnabled(name string, args ...int) bool {
+ mib, err := nametomib(name)
+ if err != nil {
+ return false
+ }
+
+ for _, a := range args {
+ mib = append(mib, _C_int(a))
+ }
+
+ // Find size.
+ n := uintptr(0)
+ if err := sysctl(mib, nil, &n, nil, 0); err != nil {
+ return false
+ }
+
+ return true
+}
+
+type _C_int int32
+
+func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
+ var _zero uintptr
+ var _p0 unsafe.Pointer
+ if len(mib) > 0 {
+ _p0 = unsafe.Pointer(&mib[0])
+ } else {
+ _p0 = unsafe.Pointer(&_zero)
+ }
+ _, _, errno := syscall.Syscall6(
+ syscall.SYS___SYSCTL,
+ uintptr(_p0),
+ uintptr(len(mib)),
+ uintptr(unsafe.Pointer(old)),
+ uintptr(unsafe.Pointer(oldlen)),
+ uintptr(unsafe.Pointer(new)),
+ uintptr(newlen))
+ if errno != 0 {
+ return errno
+ }
+ return nil
+}
+
+// nametomib is a copy from "unix.nametomib()" in "unix/syscall_darwin.go".
+func nametomib(name string) (mib []_C_int, err error) {
+ const CTL_MAXNAME = 0xc
+ const siz = unsafe.Sizeof(mib[0])
+
+ // NOTE(rsc): It seems strange to set the buffer to have
+ // size CTL_MAXNAME+2 but use only CTL_MAXNAME
+ // as the size. I don't know why the +2 is here, but the
+ // kernel uses +2 for its own implementation of this function.
+ // I am scared that if we don't include the +2 here, the kernel
+ // will silently write 2 words farther than we specify
+ // and we'll get memory corruption.
+ var buf [CTL_MAXNAME + 2]_C_int
+ n := uintptr(CTL_MAXNAME) * siz
+
+ p := (*byte)(unsafe.Pointer(&buf[0]))
+ bytes, err := byteSliceFromString(name)
+ if err != nil {
+ return nil, err
+ }
+
+ // Magic sysctl: "setting" 0.3 to a string name
+ // lets you read back the array of integers form.
+ if err = sysctl([]_C_int{0, 3}, p, &n, &bytes[0], uintptr(len(name))); err != nil {
+ return nil, err
+ }
+ return buf[0 : n/siz], nil
+}
+
+// byteSliceFromString is a simple copy of "unix.ByteSliceFromString()"
+func byteSliceFromString(s string) ([]byte, error) {
+ if strings.IndexByte(s, 0) != -1 {
+ return nil, fmt.Errorf("invalid argument in cpu.byteSliceFromString()")
+ }
+ a := make([]byte, len(s)+1)
+ copy(a, s)
+ return a, nil
+}
diff --git a/cpu/cpu_freebsd_arm64.go b/cpu/cpu_freebsd_arm64.go
new file mode 100644
index 0000000..66fe871
--- /dev/null
+++ b/cpu/cpu_freebsd_arm64.go
@@ -0,0 +1,12 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build arm64
+// +build freebsd
+
+package cpu
+
+func osInit() {
+ readARM64Registers()
+}
diff --git a/cpu/cpu_linux_arm64.go b/cpu/cpu_linux_arm64.go
index 79a38a0..7f55a6e 100644
--- a/cpu/cpu_linux_arm64.go
+++ b/cpu/cpu_linux_arm64.go
@@ -2,6 +2,10 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

+// +build arm64
+// +build linux
+// +build !android
+
package cpu

// HWCAP/HWCAP2 bits. These are exposed by Linux.
@@ -32,7 +36,7 @@
hwcap_ASIMDFHM = 1 << 23
)

-func doinit() {
+func osInit() {
if err := readHWCAP(); err != nil {
// failed to read /proc/self/auxv, try reading registers directly
readARM64Registers()
diff --git a/cpu/cpu_other_arm64.go b/cpu/cpu_other_arm64.go
index f8c484f..e5a23d1 100644
--- a/cpu/cpu_other_arm64.go
+++ b/cpu/cpu_other_arm64.go
@@ -2,9 +2,11 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

-//go:build !linux && !netbsd && arm64
-// +build !linux,!netbsd,arm64
+//go:build !linux && !netbsd && !darwin && arm64
+// +build !linux,!netbsd,!darwin,arm64

package cpu

-func doinit() {}
+func osInit() {
+ setMinimalFeatures()
+}
diff --git a/cpu/cpu_test.go b/cpu/cpu_test.go
index 5f7f843..ba25551 100644
--- a/cpu/cpu_test.go
+++ b/cpu/cpu_test.go
@@ -42,7 +42,7 @@
}

func TestARM64minimalFeatures(t *testing.T) {
- if runtime.GOARCH != "arm64" || (runtime.GOOS == "darwin" || runtime.GOOS == "ios") {
+ if runtime.GOARCH != "arm64" || runtime.GOOS == "ios" {
return
}
if !cpu.ARM64.HasASIMD {

To view, visit change 332729. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: sys
Gerrit-Branch: master
Gerrit-Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
Gerrit-Change-Number: 332729
Gerrit-PatchSet: 1
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-MessageType: newchange

Gerrit Bot (Gerrit)

unread,
Jul 3, 2021, 1:53:49 PM7/3/21
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Gerrit Bot uploaded patch set #2 to this change.

View Change

cpu: support darwin/arm64 CPU feature detection

Support ARM64 features detection. The CPU features which are supported by
Apple Silicon M1 are assumed as the minimal set of features for Go programs
running on darwin/arm64.

close https://github.com/golang/go/issues/42747


Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
GitHub-Last-Rev: 107027e1baeeda7553675d751104c55ccf1ea097
GitHub-Pull-Request: golang/sys#114
---
A cpu/cpu_android_arm64.go
M cpu/cpu_arm64.go
M cpu/cpu_arm64.s
A cpu/cpu_darwin_arm64.go
A cpu/cpu_freebsd_arm64.go
M cpu/cpu_linux_arm64.go
M cpu/cpu_other_arm64.go
M cpu/cpu_test.go
8 files changed, 271 insertions(+), 26 deletions(-)

To view, visit change 332729. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: sys
Gerrit-Branch: master
Gerrit-Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
Gerrit-Change-Number: 332729
Gerrit-PatchSet: 2
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-MessageType: newpatchset

Gerrit Bot (Gerrit)

unread,
Jul 3, 2021, 2:00:00 PM7/3/21
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Gerrit Bot uploaded patch set #3 to this change.

View Change

cpu: support darwin/arm64 CPU feature detection

Support ARM64 features detection. The CPU features which are supported by
Apple Silicon M1 are assumed as the minimal set of features for Go programs
running on darwin/arm64.

close https://github.com/golang/go/issues/42747

Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
GitHub-Last-Rev: 1ba468781a51bfd0c0db2fa2038c114e41853403

GitHub-Pull-Request: golang/sys#114
---
A cpu/cpu_android_arm64.go
M cpu/cpu_arm64.go
M cpu/cpu_arm64.s
A cpu/cpu_darwin_arm64.go
A cpu/cpu_freebsd_arm64.go
M cpu/cpu_linux_arm64.go
M cpu/cpu_other_arm64.go
M cpu/cpu_test.go
8 files changed, 271 insertions(+), 26 deletions(-)

To view, visit change 332729. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: sys
Gerrit-Branch: master
Gerrit-Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
Gerrit-Change-Number: 332729
Gerrit-PatchSet: 3

Gerrit Bot (Gerrit)

unread,
Jul 3, 2021, 2:22:11 PM7/3/21
to Hau Yang, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Gerrit Bot uploaded patch set #4 to this change.

View Change

cpu: support darwin/arm64 CPU feature detection

Support ARM64 features detection. The CPU features which are supported by
Apple Silicon M1 are assumed as the minimal set of features for Go programs
running on darwin/arm64.

The ARM64 supporting features are referred to
https://en.wikichip.org/wiki/arm/armv8#ARMv8_Extensions_and_Processor_Features


close https://github.com/golang/go/issues/42747

Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
GitHub-Last-Rev: 1ba468781a51bfd0c0db2fa2038c114e41853403
GitHub-Pull-Request: golang/sys#114
---
A cpu/cpu_android_arm64.go
M cpu/cpu_arm64.go
M cpu/cpu_arm64.s
A cpu/cpu_darwin_arm64.go
A cpu/cpu_freebsd_arm64.go
M cpu/cpu_linux_arm64.go
M cpu/cpu_other_arm64.go
M cpu/cpu_test.go
8 files changed, 271 insertions(+), 26 deletions(-)

To view, visit change 332729. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: sys
Gerrit-Branch: master
Gerrit-Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
Gerrit-Change-Number: 332729
Gerrit-PatchSet: 4
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-CC: Hau Yang <yuany...@gmail.com>
Gerrit-MessageType: newpatchset

Martin Möhrmann (Gerrit)

unread,
Jul 5, 2021, 1:52:33 PM7/5/21
to Gerrit Bot, Hau Yang, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

View Change

7 comments:

    • // Check to see if executing on a NeoverseN1 and in order to do that,

    • 	// check the AUXV for the CPUID bit. The getMIDR function executes an

    • 	// instruction which would normally be an illegal instruction, but it's

    • 	// trapped by the kernel, the value sanitized and then returned. Without

    • 	// the CPUID bit the kernel will not trap the instruction and the process

    • 	// will be terminated with SIGILL.

    • 	if ARM64.HasCPUID {
      midr := getMIDR()


    • part_num := uint16((midr >> 4) & 0xfff)

    • 		implementor := byte((midr >> 24) & 0xff)

    • 		if implementor == 'A' && part_num == 0xd0c {

    • 			ARM64.IsNeoverseN1 = true


    • }
      if implementor == 'A' && part_num == 0xd40 {

    • 			ARM64.IsZeus = true
      }
      }

      This is used for runtime internal implementation selection and IsZeus and IsNeoverseN1 doesn need to be exposed in sys/cpu.

  • File cpu/cpu_arm64.go:


    • // Most platforms don't seem to allow reading these registers.

To view, visit change 332729. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: sys
Gerrit-Branch: master
Gerrit-Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
Gerrit-Change-Number: 332729
Gerrit-PatchSet: 4
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-CC: Hau Yang <yuany...@gmail.com>
Gerrit-CC: Martin Möhrmann <moeh...@google.com>
Gerrit-Comment-Date: Mon, 05 Jul 2021 17:52:28 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Gerrit Bot (Gerrit)

unread,
Jul 6, 2021, 9:30:24 PM7/6/21
to Hau Yang, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Gerrit Bot uploaded patch set #5 to this change.

View Change

cpu: support darwin/arm64 CPU feature detection

Support ARM64 features detection. The CPU features which are supported by
Apple Silicon M1 are assumed as the minimal set of features for Go programs
running on darwin/arm64.

The ARM64 supporting features are referred to
https://en.wikichip.org/wiki/arm/armv8#ARMv8_Extensions_and_Processor_Features

close https://github.com/golang/go/issues/42747

Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
GitHub-Last-Rev: c3be48e5eec55f62e22b099ce8ecd63e93bb2a3c
GitHub-Pull-Request: golang/sys#114
---
M cpu/cpu.go

A cpu/cpu_android_arm64.go
M cpu/cpu_arm64.go
M cpu/cpu_arm64.s
A cpu/cpu_darwin_arm64.go
A cpu/cpu_darwin_arm64.s

A cpu/cpu_freebsd_arm64.go
M cpu/cpu_linux_arm64.go
M cpu/cpu_other_arm64.go
M cpu/cpu_test.go
10 files changed, 202 insertions(+), 14 deletions(-)

To view, visit change 332729. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: sys
Gerrit-Branch: master
Gerrit-Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
Gerrit-Change-Number: 332729
Gerrit-PatchSet: 5
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-CC: Hau Yang <yuany...@gmail.com>
Gerrit-CC: Martin Möhrmann <moeh...@google.com>
Gerrit-MessageType: newpatchset

Gerrit Bot (Gerrit)

unread,
Jul 6, 2021, 9:32:49 PM7/6/21
to Hau Yang, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Gerrit Bot uploaded patch set #6 to this change.

View Change

cpu: support darwin/arm64 CPU feature detection

Support ARM64 features detection. The CPU features which are supported by
Apple Silicon M1 are assumed as the minimal set of features for Go programs
running on darwin/arm64.

The ARM64 supporting features are referred to
https://en.wikichip.org/wiki/arm/armv8#ARMv8_Extensions_and_Processor_Features

close https://github.com/golang/go/issues/42747

Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
GitHub-Last-Rev: cfc9f86baec1173a7ff11060c309e69e08731e3e

GitHub-Pull-Request: golang/sys#114
---
M cpu/cpu.go
A cpu/cpu_android_arm64.go
M cpu/cpu_arm64.go
A cpu/cpu_darwin_arm64.go
A cpu/cpu_darwin_arm64.s
A cpu/cpu_freebsd_arm64.go
M cpu/cpu_linux_arm64.go
M cpu/cpu_other_arm64.go
M cpu/cpu_test.go
9 files changed, 194 insertions(+), 14 deletions(-)

To view, visit change 332729. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: sys
Gerrit-Branch: master
Gerrit-Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
Gerrit-Change-Number: 332729
Gerrit-PatchSet: 6

Gerrit Bot (Gerrit)

unread,
Jul 6, 2021, 9:35:15 PM7/6/21
to Hau Yang, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Gerrit Bot uploaded patch set #7 to this change.

View Change

cpu: support darwin/arm64 CPU feature detection

Support ARM64 features detection. The CPU features which are supported by
Apple Silicon M1 are assumed as the minimal set of features for Go programs
running on darwin/arm64.

The ARM64 supporting features are referred to
https://en.wikichip.org/wiki/arm/armv8#ARMv8_Extensions_and_Processor_Features

close https://github.com/golang/go/issues/42747

Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
GitHub-Last-Rev: e57cd244006d560233888dd3caf5cce07c3e09f4

GitHub-Pull-Request: golang/sys#114
---
M cpu/cpu.go
A cpu/cpu_android_arm64.go
M cpu/cpu_arm64.go
A cpu/cpu_darwin_arm64.go
A cpu/cpu_darwin_arm64.s
A cpu/cpu_freebsd_arm64.go
M cpu/cpu_linux_arm64.go
M cpu/cpu_other_arm64.go
M cpu/cpu_test.go
9 files changed, 196 insertions(+), 14 deletions(-)

To view, visit change 332729. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: sys
Gerrit-Branch: master
Gerrit-Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
Gerrit-Change-Number: 332729
Gerrit-PatchSet: 7

Gerrit Bot (Gerrit)

unread,
Jul 6, 2021, 9:37:36 PM7/6/21
to Hau Yang, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Gerrit Bot uploaded patch set #8 to this change.

View Change

cpu: support darwin/arm64 CPU feature detection

Support ARM64 features detection. The CPU features which are supported by
Apple Silicon M1 are assumed as the minimal set of features for Go programs
running on darwin/arm64.

The ARM64 supporting features are referred to
https://en.wikichip.org/wiki/arm/armv8#ARMv8_Extensions_and_Processor_Features

close https://github.com/golang/go/issues/42747

Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
GitHub-Last-Rev: dbeb49166d3204a525ba0a3acf39eceec03ac221

GitHub-Pull-Request: golang/sys#114
---
M cpu/cpu.go
A cpu/cpu_android_arm64.go
M cpu/cpu_arm64.go
A cpu/cpu_darwin_arm64.go
A cpu/cpu_darwin_arm64.s
M cpu/cpu_linux_arm64.go
M cpu/cpu_other_arm64.go
M cpu/cpu_test.go
8 files changed, 184 insertions(+), 14 deletions(-)

To view, visit change 332729. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: sys
Gerrit-Branch: master
Gerrit-Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
Gerrit-Change-Number: 332729
Gerrit-PatchSet: 8

Gerrit Bot (Gerrit)

unread,
Jul 6, 2021, 11:01:03 PM7/6/21
to Hau Yang, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Gerrit Bot uploaded patch set #9 to this change.

View Change

cpu: support darwin/arm64 CPU feature detection

Support ARM64 features detection. The CPU features which are supported by
Apple Silicon M1 are assumed as the minimal set of features for Go programs
running on darwin/arm64.

The ARM64 supporting features are referred to
https://en.wikichip.org/wiki/arm/armv8#ARMv8_Extensions_and_Processor_Features

close https://github.com/golang/go/issues/42747

Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
GitHub-Last-Rev: 76cf32cd7c9dbce97b3a68ccc100a0910ff89db6

GitHub-Pull-Request: golang/sys#114
---
M cpu/cpu.go
A cpu/cpu_android_arm64.go
M cpu/cpu_arm64.go
A cpu/cpu_darwin_arm64.go
M cpu/cpu_linux_arm64.go
M cpu/cpu_other_arm64.go
M cpu/cpu_test.go
7 files changed, 173 insertions(+), 14 deletions(-)

To view, visit change 332729. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: sys
Gerrit-Branch: master
Gerrit-Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
Gerrit-Change-Number: 332729
Gerrit-PatchSet: 9

Hau Yang (Gerrit)

unread,
Jul 6, 2021, 11:01:23 PM7/6/21
to Gerrit Bot, goph...@pubsubhelper.golang.org, Martin Möhrmann, golang-co...@googlegroups.com

Attention is currently required from: Martin Möhrmann.

View Change

5 comments:

  • File cpu/cpu_android_arm64.go:

    • This just seems copied from internal/cpu? should then have comments adjusted and be reflected in the […]

      Could I keep this file with amending the git commit message?

    • Patch Set #4, Line 45: // HWCap was populated by the runtime from the auxiliary vector.

      this is not true for sys/cpu

    • removed

    • Patch Set #4, Line 76:

      // Check to see if executing on a NeoverseN1 and in order to do that,
      // check the AUXV for the CPUID bit. The getMIDR function executes an
      // instruction which would normally be an illegal instruction, but it's
      // trapped by the kernel, the value sanitized and then returned. Without
      // the CPUID bit the kernel will not trap the instruction and the process
      // will be terminated with SIGILL.
      if ARM64.HasCPUID {
      midr := getMIDR()
      part_num := uint16((midr >> 4) & 0xfff)
      implementor := byte((midr >> 24) & 0xff)

      if implementor == 'A' && part_num == 0xd0c {
      ARM64.IsNeoverseN1 = true
      }
      if implementor == 'A' && part_num == 0xd40 {
      ARM64.IsZeus = true
      }
      }

    • This is used for runtime internal implementation selection and IsZeus and IsNeoverseN1 doesn need to […]

      removed

  • File cpu/cpu_arm64.go:

    • Patch Set #4, Line 42:

      	case "freebsd":
      readARM64Registers()
      case "linux", "netbsd":
      doinit()
      default:
      // Most platforms don't seem to allow reading these registers.
      //
      // OpenBSD:
      // See https://golang.org/issue/31746
      setMinimalFeatures()
      }

      Can we keep this and just extend it?

    • done

    • Patch Set #4, Line 39: setMinimalFeatures

      these should only be set on OSes with no feature detection not generally.

    • fixed with the following request

To view, visit change 332729. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: sys
Gerrit-Branch: master
Gerrit-Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
Gerrit-Change-Number: 332729
Gerrit-PatchSet: 4
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-CC: Hau Yang <yuany...@gmail.com>
Gerrit-CC: Martin Möhrmann <moeh...@google.com>
Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
Gerrit-Comment-Date: Wed, 07 Jul 2021 03:01:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Martin Möhrmann <moeh...@google.com>
Gerrit-MessageType: comment

Hau Yang (Gerrit)

unread,
Jul 6, 2021, 11:06:09 PM7/6/21
to Gerrit Bot, goph...@pubsubhelper.golang.org, Martin Möhrmann, golang-co...@googlegroups.com

Attention is currently required from: Martin Möhrmann.

View Change

1 comment:

  • File cpu/cpu_darwin_arm64.go:

    • instead of sysctl we can use the approach as for detecting avx512 amd64 on darwin: […]

      I am working on the assembly version of this part, but the current `unsafe.Pointer` works on my M1 machine

To view, visit change 332729. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: sys
Gerrit-Branch: master
Gerrit-Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
Gerrit-Change-Number: 332729
Gerrit-PatchSet: 9
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-CC: Hau Yang <yuany...@gmail.com>
Gerrit-CC: Martin Möhrmann <moeh...@google.com>
Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
Gerrit-Comment-Date: Wed, 07 Jul 2021 03:06:04 +0000

Gerrit Bot (Gerrit)

unread,
Jul 6, 2021, 11:49:18 PM7/6/21
to Hau Yang, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Martin Möhrmann.

Gerrit Bot uploaded patch set #10 to this change.

View Change

cpu: extend arm64 support on CPU feature detection

Extend the support of ARM64 features detection, including `darwin` and `android`.

The CPU features which are supported by Apple Silicon M1 are assumed as the
minimal set of features for Go programs running on darwin/arm64.

The ARM64 supporting features are referred to
https://en.wikichip.org/wiki/arm/armv8#ARMv8_Extensions_and_Processor_Features

close https://github.com/golang/go/issues/42747

Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
GitHub-Last-Rev: 76cf32cd7c9dbce97b3a68ccc100a0910ff89db6
GitHub-Pull-Request: golang/sys#114
---
M cpu/cpu.go
A cpu/cpu_android_arm64.go
M cpu/cpu_arm64.go
A cpu/cpu_darwin_arm64.go
M cpu/cpu_linux_arm64.go
M cpu/cpu_other_arm64.go
M cpu/cpu_test.go
7 files changed, 173 insertions(+), 14 deletions(-)

To view, visit change 332729. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: sys
Gerrit-Branch: master
Gerrit-Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
Gerrit-Change-Number: 332729
Gerrit-PatchSet: 10
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-CC: Hau Yang <yuany...@gmail.com>
Gerrit-CC: Martin Möhrmann <moeh...@google.com>
Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
Gerrit-MessageType: newpatchset

Martin Möhrmann (Gerrit)

unread,
Jul 7, 2021, 1:27:30 AM7/7/21
to Gerrit Bot, Hau Yang, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Hau Yang.

View Change

8 comments:

  • File cpu/cpu.go:

    • Patch Set #10, Line 103: HasFMA bool // Fused Multiply Add

      please leave this out for now until we know how this corresponds to the arm architecture feature bits and other oses

  • File cpu/cpu_android_arm64.go:

    • Could I keep this file with amending the git commit message?

      preference is into splitting cls:

      • android support (with minimal change and potentially rename to the linux file)
      • darwin support

      That makes it easier to debug, test and later rollback if there is an issue.

  • File cpu/cpu_android_arm64.go:

    • Patch Set #10, Line 73: ARM64.HasATOMICS = false

      We dont need an entire copy of cpu_linux_arm64.go for android. They can just share the same code (potentially with some Ifs for differences). For a first version of android support the special casing of "The Samsung S9+" can for now can be left out of x/sys/cpu. It cannot be worked around in internal/cpu so it should for now stay there.

  • File cpu/cpu_arm64.go:

    • // setMinimalFeatures fakes the minimal ARM64 features expected by

    • // TestARM64minimalFeatures.
      func setMinimalFeatures() {
      ARM64.HasASIMD = true
      ARM64.HasFP = true
      }

      move this function back to keep the diff minimal

  • File cpu/cpu_darwin_arm64.go:

    • Patch Set #10, Line 16: uint64

      Do these work without specifying uint64? If so please remove the types.

    • Patch Set #10, Line 31: darwinCheckFeatureEnabled

      Restructuring so that there is one function that returns the whole commpage64_cpu_capabilities64 would be easier IMO. Then we can check the bits in go code similar how we do for other architectures.

    • Patch Set #10, Line 43:

    • // There are no hw.optional sysctl values for the below features on Mac OS 11.0

    • 	// to detect their supported state dynamically. Assume the CPU features that

    • 	// Apple Silicon M1 supports to be available as a minimal set of features

    • 	// to all Go programs running on darwin/arm64.

      Did we check they are all available?

  • File cpu/cpu_other_arm64.go:

To view, visit change 332729. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: sys
Gerrit-Branch: master
Gerrit-Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
Gerrit-Change-Number: 332729
Gerrit-PatchSet: 10
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-CC: Hau Yang <yuany...@gmail.com>
Gerrit-CC: Martin Möhrmann <moeh...@google.com>
Gerrit-Attention: Hau Yang <yuany...@gmail.com>
Gerrit-Comment-Date: Wed, 07 Jul 2021 05:27:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Hau Yang <yuany...@gmail.com>

Gerrit Bot (Gerrit)

unread,
Jul 7, 2021, 12:04:42 PM7/7/21
to Hau Yang, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Hau Yang.

Gerrit Bot uploaded patch set #11 to this change.

View Change

cpu: support darwin/arm64 CPU feature detection

Support ARM64 features detection. The CPU features which are supported by
Apple Silicon M1 are assumed as the minimal set of features for Go programs
running on darwin/arm64.

The ARM64 supporting features are referred to
https://en.wikichip.org/wiki/arm/armv8#ARMv8_Extensions_and_Processor_Features

close https://github.com/golang/go/issues/42747

Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
GitHub-Last-Rev: a305a6c88a9cbda058004a1f89138d0e18ae145b
GitHub-Pull-Request: golang/sys#114
---

M cpu/cpu_arm64.go
A cpu/cpu_darwin_arm64.go
A cpu/cpu_darwin_arm64.s
M cpu/cpu_other_arm64.go
M cpu/cpu_test.go
5 files changed, 90 insertions(+), 4 deletions(-)

To view, visit change 332729. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: sys
Gerrit-Branch: master
Gerrit-Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
Gerrit-Change-Number: 332729
Gerrit-PatchSet: 11
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-CC: Hau Yang <yuany...@gmail.com>
Gerrit-CC: Martin Möhrmann <moeh...@google.com>
Gerrit-Attention: Hau Yang <yuany...@gmail.com>
Gerrit-MessageType: newpatchset

Gerrit Bot (Gerrit)

unread,
Jul 7, 2021, 12:25:18 PM7/7/21
to Hau Yang, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Hau Yang.

Gerrit Bot uploaded patch set #12 to this change.

View Change

cpu: support darwin/arm64 CPU feature detection

Support ARM64 features detection. The CPU features which are supported by
Apple Silicon M1 are assumed as the minimal set of features for Go programs
running on darwin/arm64.

The ARM64 supporting features are referred to
https://en.wikichip.org/wiki/arm/armv8#ARMv8_Extensions_and_Processor_Features

close https://github.com/golang/go/issues/42747

Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
GitHub-Last-Rev: 72441605819ca2037507a1019c79fd176b2543ac

GitHub-Pull-Request: golang/sys#114
---
M cpu/cpu_arm64.go
A cpu/cpu_darwin_arm64.go
A cpu/cpu_darwin_arm64.s
M cpu/cpu_other_arm64.go
M cpu/cpu_test.go
5 files changed, 89 insertions(+), 4 deletions(-)

To view, visit change 332729. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: sys
Gerrit-Branch: master
Gerrit-Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
Gerrit-Change-Number: 332729
Gerrit-PatchSet: 12

Hau Yang (Gerrit)

unread,
Jul 7, 2021, 12:29:17 PM7/7/21
to Gerrit Bot, goph...@pubsubhelper.golang.org, Martin Möhrmann, golang-co...@googlegroups.com

Attention is currently required from: Martin Möhrmann.

View Change

8 comments:

  • File cpu/cpu.go:

    • please leave this out for now until we know how this corresponds to the arm architecture feature bit […]

      Done

  • File cpu/cpu_android_arm64.go:

    • preference is into splitting cls: […]

      Let me open another PR for android

  • File cpu/cpu_android_arm64.go:

    • We dont need an entire copy of cpu_linux_arm64.go for android. […]

      Done

  • File cpu/cpu_arm64.go:

    • Patch Set #10, Line 167:

      // setMinimalFeatures fakes the minimal ARM64 features expected by
      // TestARM64minimalFeatures.
      func setMinimalFeatures() {
      ARM64.HasASIMD = true
      ARM64.HasFP = true
      }

      move this function back to keep the diff minimal

    • Done

  • File cpu/cpu_darwin_arm64.go:

    • Done

    • Restructuring so that there is one function that returns the whole commpage64_cpu_capabilities64 wou […]

      I have implemented one as `darwinSupportsAVX512` in assembly now

    • Patch Set #10, Line 43:

      // There are no hw.optional sysctl values for the below features on Mac OS 11.0
      // to detect their supported state dynamically. Assume the CPU features that
      // Apple Silicon M1 supports to be available as a minimal set of features
      // to all Go programs running on darwin/arm64.

      Did we check they are all available?

    • Done

To view, visit change 332729. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: sys
Gerrit-Branch: master
Gerrit-Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
Gerrit-Change-Number: 332729
Gerrit-PatchSet: 12
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-CC: Hau Yang <yuany...@gmail.com>
Gerrit-CC: Martin Möhrmann <moeh...@google.com>
Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
Gerrit-Comment-Date: Wed, 07 Jul 2021 16:29:13 +0000

Gerrit Bot (Gerrit)

unread,
Jul 10, 2021, 5:17:01 AM7/10/21
to Hau Yang, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Martin Möhrmann.

Gerrit Bot uploaded patch set #13 to this change.

View Change

cpu: support darwin/arm64 CPU feature detection

Support ARM64 features detection. The CPU features which are supported by
Apple Silicon M1 are assumed as the minimal set of features for Go programs
running on darwin/arm64.

The ARM64 supporting features are referred to
https://en.wikichip.org/wiki/arm/armv8#ARMv8_Extensions_and_Processor_Features

close https://github.com/golang/go/issues/42747

Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
GitHub-Last-Rev: 54c2df71cfc6a81e617bce95b48e924e5e6e0d60

GitHub-Pull-Request: golang/sys#114
---
M cpu/cpu_arm64.go
A cpu/cpu_darwin_arm64.go
A cpu/cpu_darwin_arm64.s
M cpu/cpu_other_arm64.go
M cpu/cpu_test.go
5 files changed, 89 insertions(+), 4 deletions(-)

To view, visit change 332729. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: sys
Gerrit-Branch: master
Gerrit-Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
Gerrit-Change-Number: 332729
Gerrit-PatchSet: 13
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-CC: Hau Yang <yuany...@gmail.com>
Gerrit-CC: Martin Möhrmann <moeh...@google.com>
Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
Gerrit-MessageType: newpatchset

Gerrit Bot (Gerrit)

unread,
Jul 10, 2021, 5:48:59 AM7/10/21
to Hau Yang, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Martin Möhrmann.

Gerrit Bot uploaded patch set #14 to this change.

View Change

cpu: support darwin/arm64 CPU feature detection

Support ARM64 features detection. The CPU features which are supported by
Apple Silicon M1 are assumed as the minimal set of features for Go programs
running on darwin/arm64.

The ARM64 supporting features are referred to
https://en.wikichip.org/wiki/arm/armv8#ARMv8_Extensions_and_Processor_Features

close https://github.com/golang/go/issues/42747

Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
GitHub-Last-Rev: 794279327c85d1c2d2b202e56f9644b5147fe9b3

GitHub-Pull-Request: golang/sys#114
---
M cpu/cpu_arm64.go
A cpu/cpu_darwin_arm64.go
A cpu/cpu_darwin_arm64.s
M cpu/cpu_other_arm64.go
M cpu/cpu_test.go
5 files changed, 89 insertions(+), 4 deletions(-)

To view, visit change 332729. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: sys
Gerrit-Branch: master
Gerrit-Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
Gerrit-Change-Number: 332729
Gerrit-PatchSet: 14

Eric Lagergren (Gerrit)

unread,
Apr 2, 2022, 3:50:15 PM4/2/22
to Gerrit Bot, Hau Yang, goph...@pubsubhelper.golang.org, Martin Möhrmann, golang-co...@googlegroups.com

Attention is currently required from: Martin Möhrmann.

View Change

1 comment:

  • Patchset:

    • Patch Set #14:

      What's the status of this CL? If it's been abandoned I'd like to pick it up.

To view, visit change 332729. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: sys
Gerrit-Branch: master
Gerrit-Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
Gerrit-Change-Number: 332729
Gerrit-PatchSet: 14
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-CC: Eric Lagergren <ericscott...@gmail.com>
Gerrit-CC: Hau Yang <yuany...@gmail.com>
Gerrit-CC: Martin Möhrmann <moeh...@google.com>
Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
Gerrit-Comment-Date: Sat, 02 Apr 2022 19:50:12 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Daniel Martí (Gerrit)

unread,
Jun 13, 2022, 4:35:39 PM6/13/22
to Gerrit Bot, Hau Yang, goph...@pubsubhelper.golang.org, Eric Lagergren, Martin Möhrmann, golang-co...@googlegroups.com

Attention is currently required from: Martin Möhrmann.

View Change

2 comments:

To view, visit change 332729. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: sys
Gerrit-Branch: master
Gerrit-Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
Gerrit-Change-Number: 332729
Gerrit-PatchSet: 14
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-CC: Daniel Martí <mv...@mvdan.cc>
Gerrit-CC: Eric Lagergren <er...@ericlagergren.com>
Gerrit-CC: Hau Yang <yuany...@gmail.com>
Gerrit-CC: Martin Möhrmann <moeh...@google.com>
Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
Gerrit-Comment-Date: Mon, 13 Jun 2022 20:35:33 +0000

Eric Lagergren (Gerrit)

unread,
Jun 13, 2022, 5:32:24 PM6/13/22
to Gerrit Bot, Hau Yang, goph...@pubsubhelper.golang.org, Daniel Martí, Martin Möhrmann, golang-co...@googlegroups.com

Attention is currently required from: Martin Möhrmann.

View Change

1 comment:

  • Patchset:

To view, visit change 332729. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: sys
Gerrit-Branch: master
Gerrit-Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
Gerrit-Change-Number: 332729
Gerrit-PatchSet: 14
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-CC: Daniel Martí <mv...@mvdan.cc>
Gerrit-CC: Eric Lagergren <er...@ericlagergren.com>
Gerrit-CC: Hau Yang <yuany...@gmail.com>
Gerrit-CC: Martin Möhrmann <moeh...@google.com>
Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
Gerrit-Comment-Date: Mon, 13 Jun 2022 21:32:21 +0000

Daniel Martí (Gerrit)

unread,
Jun 13, 2022, 5:35:20 PM6/13/22
to Gerrit Bot, Hau Yang, goph...@pubsubhelper.golang.org, Eric Lagergren, Martin Möhrmann, golang-co...@googlegroups.com

Attention is currently required from: Martin Möhrmann.

View Change

2 comments:

  • Commit Message:

    • The issue you link to is for internal/cpu and already fixed; you want https://github. […]

      Done

  • Patchset:

    • Patch Set #14:

      Friendly ping, Martin, when you have ten minutes to review this again :)

    • Ignore me - I had not noticed Eric's new CL.

To view, visit change 332729. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: sys
Gerrit-Branch: master
Gerrit-Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
Gerrit-Change-Number: 332729
Gerrit-PatchSet: 14
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-CC: Daniel Martí <mv...@mvdan.cc>
Gerrit-CC: Eric Lagergren <er...@ericlagergren.com>
Gerrit-CC: Hau Yang <yuany...@gmail.com>
Gerrit-CC: Martin Möhrmann <moeh...@google.com>
Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
Gerrit-Comment-Date: Mon, 13 Jun 2022 21:35:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Daniel Martí <mv...@mvdan.cc>
Gerrit-MessageType: comment

Koichi Shiraishi (Gerrit)

unread,
Jun 13, 2022, 6:18:20 PM6/13/22
to Gerrit Bot, Hau Yang, goph...@pubsubhelper.golang.org, Daniel Martí, Eric Lagergren, Martin Möhrmann, golang-co...@googlegroups.com

Attention is currently required from: Martin Möhrmann.

View Change

1 comment:

  • File cpu/cpu_darwin_arm64.go:

    • Patch Set #14, Line 5: // +build arm64

      Why not use the new "go:build" pragma? Also, IINM Go's core library seems to have GOOS first in general.

      `//go:build darwin && arm64 && !ios`

To view, visit change 332729. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: sys
Gerrit-Branch: master
Gerrit-Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
Gerrit-Change-Number: 332729
Gerrit-PatchSet: 14
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-CC: Daniel Martí <mv...@mvdan.cc>
Gerrit-CC: Eric Lagergren <er...@ericlagergren.com>
Gerrit-CC: Hau Yang <yuany...@gmail.com>
Gerrit-CC: Koichi Shiraishi <zche...@gmail.com>
Gerrit-CC: Martin Möhrmann <moeh...@google.com>
Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
Gerrit-Comment-Date: Mon, 13 Jun 2022 22:18:14 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Hau Yang (Gerrit)

unread,
Sep 4, 2022, 8:35:18 AM9/4/22
to Gerrit Bot, goph...@pubsubhelper.golang.org, Koichi Shiraishi, Daniel Martí, Eric Lagergren, Martin Möhrmann, golang-co...@googlegroups.com

Attention is currently required from: Koichi Shiraishi, Martin Möhrmann.

View Change

1 comment:

  • File cpu/cpu_darwin_arm64.go:

    • Why not use the new "go:build" pragma? Also, IINM Go's core library seems to have GOOS first in gene […]

      Done

To view, visit change 332729. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: sys
Gerrit-Branch: master
Gerrit-Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
Gerrit-Change-Number: 332729
Gerrit-PatchSet: 14
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-CC: Daniel Martí <mv...@mvdan.cc>
Gerrit-CC: Eric Lagergren <er...@ericlagergren.com>
Gerrit-CC: Hau Yang <yuany...@gmail.com>
Gerrit-CC: Koichi Shiraishi <zche...@gmail.com>
Gerrit-CC: Martin Möhrmann <moeh...@google.com>
Gerrit-Attention: Koichi Shiraishi <zche...@gmail.com>
Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
Gerrit-Comment-Date: Sun, 04 Sep 2022 12:35:11 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Koichi Shiraishi <zche...@gmail.com>
Gerrit-MessageType: comment

Gerrit Bot (Gerrit)

unread,
Sep 4, 2022, 8:35:19 AM9/4/22
to Hau Yang, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Koichi Shiraishi, Martin Möhrmann.

Gerrit Bot uploaded patch set #15 to this change.

View Change

cpu: support darwin/arm64 CPU feature detection

Support ARM64 features detection. The CPU features which are supported by
Apple Silicon M1 are assumed as the minimal set of features for Go programs
running on darwin/arm64.

The ARM64 supporting features are referred to
https://en.wikichip.org/wiki/arm/armv8#ARMv8_Extensions_and_Processor_Features

close https://github.com/golang/go/issues/42747

Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
GitHub-Last-Rev: 44d7b393fd1edd43580d19a38f4dec1bd3be942b

GitHub-Pull-Request: golang/sys#114
---
M cpu/cpu_arm64.go
A cpu/cpu_darwin_arm64.go
A cpu/cpu_darwin_arm64.s
M cpu/cpu_other_arm64.go
4 files changed, 107 insertions(+), 3 deletions(-)

To view, visit change 332729. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: sys
Gerrit-Branch: master
Gerrit-Change-Id: Id7d69763021773ccc469ff069b02ecb9c7473ac9
Gerrit-Change-Number: 332729
Gerrit-PatchSet: 15
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-CC: Daniel Martí <mv...@mvdan.cc>
Gerrit-CC: Eric Lagergren <er...@ericlagergren.com>
Gerrit-CC: Hau Yang <yuany...@gmail.com>
Gerrit-CC: Koichi Shiraishi <zche...@gmail.com>
Gerrit-CC: Martin Möhrmann <moeh...@google.com>
Gerrit-Attention: Koichi Shiraishi <zche...@gmail.com>
Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
Gerrit-MessageType: newpatchset
Reply all
Reply to author
Forward
0 new messages