]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.simd] internal/goexperiment: add SIMD goexperiment
authorCherry Mui <cherryyz@google.com>
Thu, 22 May 2025 19:08:05 +0000 (15:08 -0400)
committerCherry Mui <cherryyz@google.com>
Thu, 22 May 2025 20:37:21 +0000 (13:37 -0700)
We'll use it to guard the simd package, and the compiler's
handling of SIMD types and intrinsics.

Change-Id: I0356368eea0a98a5016baaaf7acb7da8b6305429
Reviewed-on: https://go-review.googlesource.com/c/go/+/675536
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/internal/goexperiment/exp_simd_off.go [new file with mode: 0644]
src/internal/goexperiment/exp_simd_on.go [new file with mode: 0644]
src/internal/goexperiment/flags.go

diff --git a/src/internal/goexperiment/exp_simd_off.go b/src/internal/goexperiment/exp_simd_off.go
new file mode 100644 (file)
index 0000000..ebc40b3
--- /dev/null
@@ -0,0 +1,8 @@
+// Code generated by mkconsts.go. DO NOT EDIT.
+
+//go:build !goexperiment.simd
+
+package goexperiment
+
+const SIMD = false
+const SIMDInt = 0
diff --git a/src/internal/goexperiment/exp_simd_on.go b/src/internal/goexperiment/exp_simd_on.go
new file mode 100644 (file)
index 0000000..137d1dd
--- /dev/null
@@ -0,0 +1,8 @@
+// Code generated by mkconsts.go. DO NOT EDIT.
+
+//go:build goexperiment.simd
+
+package goexperiment
+
+const SIMD = true
+const SIMDInt = 1
index ceff24193d89a59bfac804faf80871bc83a4d8d6..b693ed883a51d3d0b9f2bf210ac072af8eb20535 100644 (file)
@@ -129,4 +129,8 @@ type Flags struct {
 
        // GreenTeaGC enables the Green Tea GC implementation.
        GreenTeaGC bool
+
+       // SIMD enables the simd package and the compiler's handling
+       // of SIMD intrinsics.
+       SIMD bool
 }