[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 <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
Cherry Mui 2025-11-24 11:24:00 -05:00
parent f045ed4110
commit 61a5a6b016
3 changed files with 5 additions and 6 deletions

View file

@ -35,7 +35,6 @@ var stdPkgs = []string{
"reflect", "reflect",
"regexp", "regexp",
"runtime", "runtime",
"simd",
"slices", "slices",
"sort", "sort",
"strconv", "strconv",

View file

@ -2,11 +2,10 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
//go:build goexperiment.simd
package simd package simd
// Invoke code generators. // 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 //go:generate go run -C _gen . -tmplgen -simdgen

View file

@ -2,9 +2,10 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
//go:build goexperiment.simd
package simd package simd
// This file has no build tag, so that go generate can run without a build tag. // Invoke code generators.
// It does the same thing as go generate in the grandparent directory.
//go:generate go run -C ../.. genfiles.go //go:generate go run -C ../.. genfiles.go