]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/internal/cryptotest: use linux-amd64_avx512 builder for SHA-NI
authorFilippo Valsorda <filippo@golang.org>
Thu, 7 Aug 2025 22:16:27 +0000 (00:16 +0200)
committerGopher Robot <gobot@golang.org>
Tue, 16 Sep 2025 00:29:27 +0000 (17:29 -0700)
Updates #74772
Fixes #69592

Change-Id: I6a6a69647ab1785ed953f3ed2dfa04cd55576f2b
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64_avx512
Reviewed-on: https://go-review.googlesource.com/c/go/+/701315
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/crypto/internal/cryptotest/implementations.go

index f0ba665403e4e232dc614d823b327b2bee6af20d..2b6cf4b75fc6b75e23d18fb4fe9ac0c056ecaa95 100644 (file)
@@ -10,6 +10,7 @@ import (
        "internal/goarch"
        "internal/goos"
        "internal/testenv"
+       "strings"
        "testing"
 )
 
@@ -38,22 +39,33 @@ func TestAllImplementations(t *testing.T, pkg string, f func(t *testing.T)) {
                        t.Run(name, func(t *testing.T) {
                                // Report an error if we're on the most capable builder for the
                                // architecture and the builder can't test this implementation.
-                               flagship := goos.GOOS == "linux" && goarch.GOARCH != "arm64" ||
-                                       goos.GOOS == "darwin" && goarch.GOARCH == "arm64"
-                               if testenv.Builder() != "" && flagship {
-                                       if name == "SHA-NI" {
-                                               t.Skip("known issue, see golang.org/issue/69592")
-                                       }
+                               if flagshipBuilder() {
                                        t.Error("builder doesn't support CPU features needed to test this implementation")
                                } else {
                                        t.Skip("implementation not supported")
                                }
                        })
                }
-
        }
 
        // Test the generic implementation.
        impl.Select(pkg, "")
        t.Run("Base", f)
 }
+
+func flagshipBuilder() bool {
+       builder := testenv.Builder()
+       if builder == "" {
+               return false
+       }
+       switch goarch.GOARCH {
+       case "amd64":
+               return strings.Contains(builder, "_avx512")
+       case "arm64":
+               // Apple M chips support everything we use.
+               return goos.GOOS == "darwin"
+       default:
+               // Presumably the Linux builders are the most capable.
+               return goos.GOOS == "linux"
+       }
+}