From adf21a9b56f3498385152d701ddd0e8679fe57ed Mon Sep 17 00:00:00 2001 From: fanzha02 Date: Mon, 7 Apr 2025 10:12:06 +0000 Subject: [PATCH] internal/cpu: add a detection for Neoverse(N3, V3, V3ae) cores The memmove implementation relies on the variable runtime.arm64UseAlignedLoads to select fastest code path. Considering Neoverse N3, V3 and V3ae cores prefer aligned loads, this patch adds code to detect them for memmove performance. Change-Id: I7266fc35d8b2c15ff516c592b987bafacb82b620 Reviewed-on: https://go-review.googlesource.com/c/go/+/664038 Reviewed-by: Cherry Mui LUCI-TryBot-Result: Go LUCI Reviewed-by: Keith Randall --- src/internal/cpu/cpu_arm64_hwcap.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/internal/cpu/cpu_arm64_hwcap.go b/src/internal/cpu/cpu_arm64_hwcap.go index cdc1d89c9e..e6711ae275 100644 --- a/src/internal/cpu/cpu_arm64_hwcap.go +++ b/src/internal/cpu/cpu_arm64_hwcap.go @@ -67,9 +67,14 @@ func hwcapInit(os string) { // d40 - NeoverseV1 // d49 - NeoverseN2 // d4f - NeoverseV2 - if implementer == 'A' && (part_num == 0xd0c || part_num == 0xd40 || - part_num == 0xd49 || part_num == 0xd4f) { - ARM64.IsNeoverse = true + // d8e - NeoverseN3 + // d84 - NeoverseV3 + // d83 - NeoverseV3ae + if implementer == 'A' { + switch part_num { + case 0xd0c, 0xd40, 0xd49, 0xd4f, 0xd8e, 0xd84, 0xd83: + ARM64.IsNeoverse = true + } } } }