aboutsummaryrefslogtreecommitdiff
path: root/src/internal/cpu/cpu.go
diff options
context:
space:
mode:
authorfanzha02 <fannie.zhang@arm.com>2023-04-20 07:28:50 +0000
committerJoel Sing <joel@sing.id.au>2023-04-25 14:08:20 +0000
commite4b03f9425a70f53acb9526dc9cd9c21373308e5 (patch)
treea3fef565f623dd6d3e0e0db8157e3b74b9838662 /src/internal/cpu/cpu.go
parenta1284d0185110b82b34200a13700fecacfa200fa (diff)
downloadgo-e4b03f9425a70f53acb9526dc9cd9c21373308e5.tar.xz
internal/cpu: add a detection for Neoverse(N2, V2) cores
The memmove implementation relies on the variable runtime.arm64UseAlignedLoads to select fastest code path. Considering Neoverse N2 and V2 cores prefer aligned loads, this patch adds code to detect them for memmove performance. And this patch uses a new variable ARM64.IsNeoverse to represent all Neoverse cores, removing the more specific versions. Change-Id: I9e06eae01a0325a0b604ac6af1e55711dd6133f7 Reviewed-on: https://go-review.googlesource.com/c/go/+/487815 Reviewed-by: Joel Sing <joel@sing.id.au> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Run-TryBot: Fannie Zhang <Fannie.Zhang@arm.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/internal/cpu/cpu.go')
-rw-r--r--src/internal/cpu/cpu.go23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/internal/cpu/cpu.go b/src/internal/cpu/cpu.go
index aef9fb3be7..1352810f42 100644
--- a/src/internal/cpu/cpu.go
+++ b/src/internal/cpu/cpu.go
@@ -57,18 +57,17 @@ var ARM struct {
// The booleans in ARM64 contain the correspondingly named cpu feature bit.
// The struct is padded to avoid false sharing.
var ARM64 struct {
- _ CacheLinePad
- HasAES bool
- HasPMULL bool
- HasSHA1 bool
- HasSHA2 bool
- HasSHA512 bool
- HasCRC32 bool
- HasATOMICS bool
- HasCPUID bool
- IsNeoverseN1 bool
- IsNeoverseV1 bool
- _ CacheLinePad
+ _ CacheLinePad
+ HasAES bool
+ HasPMULL bool
+ HasSHA1 bool
+ HasSHA2 bool
+ HasSHA512 bool
+ HasCRC32 bool
+ HasATOMICS bool
+ HasCPUID bool
+ IsNeoverse bool
+ _ CacheLinePad
}
var MIPS64X struct {