From 61a5a6b016986cc56fe52c360654bbbd875efa4e Mon Sep 17 00:00:00 2001 From: Cherry Mui Date: Mon, 24 Nov 2025 11:24:00 -0500 Subject: [PATCH] [dev.simd] simd: add goexperiment tag to generate.go So the simd package does not exist, instead of existing as an empty package, if the goexperiment is not enabled. Unfortunately the simd package developers have to run GOEXPERIMENT=simd go generate, especially if one is not on an AMD64 machine. But that command is still simple enough, not too bad. Change-Id: I632ce92ecb72e208212e294d8b3448b43fd01eef Reviewed-on: https://go-review.googlesource.com/c/go/+/723802 Reviewed-by: Junyang Shao LUCI-TryBot-Result: Go LUCI --- src/go/doc/comment/std.go | 1 - src/simd/generate.go | 5 ++--- src/simd/internal/simd_test/{no_tag.go => generate.go} | 5 +++-- 3 files changed, 5 insertions(+), 6 deletions(-) rename src/simd/internal/simd_test/{no_tag.go => generate.go} (58%) diff --git a/src/go/doc/comment/std.go b/src/go/doc/comment/std.go index 73cf9627a0..191e1f1291 100644 --- a/src/go/doc/comment/std.go +++ b/src/go/doc/comment/std.go @@ -35,7 +35,6 @@ var stdPkgs = []string{ "reflect", "regexp", "runtime", - "simd", "slices", "sort", "strconv", diff --git a/src/simd/generate.go b/src/simd/generate.go index 95ae5d7851..5cd94e165e 100644 --- a/src/simd/generate.go +++ b/src/simd/generate.go @@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build goexperiment.simd + package simd // Invoke code generators. -// -// This file intentionally has no goexperiment.simd build tag, so that go -// generate can run without a GOEXPERIMENT set. //go:generate go run -C _gen . -tmplgen -simdgen diff --git a/src/simd/internal/simd_test/no_tag.go b/src/simd/internal/simd_test/generate.go similarity index 58% rename from src/simd/internal/simd_test/no_tag.go rename to src/simd/internal/simd_test/generate.go index 0cc6185b5a..e744a5299f 100644 --- a/src/simd/internal/simd_test/no_tag.go +++ b/src/simd/internal/simd_test/generate.go @@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build goexperiment.simd + package simd -// This file has no build tag, so that go generate can run without a build tag. -// It does the same thing as go generate in the grandparent directory. +// Invoke code generators. //go:generate go run -C ../.. genfiles.go -- 2.52.0