aboutsummaryrefslogtreecommitdiff
path: root/src/internal
diff options
context:
space:
mode:
authorJoel Sing <joel@sing.id.au>2022-08-09 18:06:25 +1000
committerJoel Sing <joel@sing.id.au>2022-09-26 16:42:07 +0000
commit95a5e20d8f7a6f7863eb3281e3a198a577e773fe (patch)
tree77a3174d789b67957f05d7b216a9908b77526ea6 /src/internal
parentc3728b75024667927f690373cea324dd26777414 (diff)
downloadgo-95a5e20d8f7a6f7863eb3281e3a198a577e773fe.tar.xz
internal/cpu: enable arm64 SHA512 detection for freebsd/openbsd
Change-Id: I1f21654b50d7b0cd8e1f854efe2724b72f067449 Reviewed-on: https://go-review.googlesource.com/c/go/+/422216 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Joel Sing <joel@sing.id.au> Reviewed-by: Meng Zhuo <mzh@golangcn.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Yuval Pavel Zholkover <paulzhol@gmail.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/internal')
-rw-r--r--src/internal/cpu/cpu_arm64_freebsd.go5
-rw-r--r--src/internal/cpu/cpu_arm64_openbsd.go5
2 files changed, 8 insertions, 2 deletions
diff --git a/src/internal/cpu/cpu_arm64_freebsd.go b/src/internal/cpu/cpu_arm64_freebsd.go
index c25e021c68..40ebfaf6ff 100644
--- a/src/internal/cpu/cpu_arm64_freebsd.go
+++ b/src/internal/cpu/cpu_arm64_freebsd.go
@@ -25,8 +25,11 @@ func osInit() {
}
switch extractBits(isar0, 12, 15) {
- case 1, 2:
+ case 1:
+ ARM64.HasSHA2 = true
+ case 2:
ARM64.HasSHA2 = true
+ ARM64.HasSHA512 = true
}
switch extractBits(isar0, 16, 19) {
diff --git a/src/internal/cpu/cpu_arm64_openbsd.go b/src/internal/cpu/cpu_arm64_openbsd.go
index 2b284ebd03..54e1f4b931 100644
--- a/src/internal/cpu/cpu_arm64_openbsd.go
+++ b/src/internal/cpu/cpu_arm64_openbsd.go
@@ -44,8 +44,11 @@ func osInit() {
}
switch extractBits(isar0, 12, 15) {
- case 1, 2:
+ case 1:
+ ARM64.HasSHA2 = true
+ case 2:
ARM64.HasSHA2 = true
+ ARM64.HasSHA512 = true
}
switch extractBits(isar0, 16, 19) {