From 4d2c71ebf9b05c50d4078fe1735fb4d0d1d26572 Mon Sep 17 00:00:00 2001 From: Cherry Mui Date: Thu, 22 May 2025 15:08:05 -0400 Subject: [PATCH] [dev.simd] internal/goexperiment: add SIMD goexperiment 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 LUCI-TryBot-Result: Go LUCI --- src/internal/goexperiment/exp_simd_off.go | 8 ++++++++ src/internal/goexperiment/exp_simd_on.go | 8 ++++++++ src/internal/goexperiment/flags.go | 4 ++++ 3 files changed, 20 insertions(+) create mode 100644 src/internal/goexperiment/exp_simd_off.go create mode 100644 src/internal/goexperiment/exp_simd_on.go diff --git a/src/internal/goexperiment/exp_simd_off.go b/src/internal/goexperiment/exp_simd_off.go new file mode 100644 index 0000000000..ebc40b308e --- /dev/null +++ b/src/internal/goexperiment/exp_simd_off.go @@ -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 index 0000000000..137d1dd1ba --- /dev/null +++ b/src/internal/goexperiment/exp_simd_on.go @@ -0,0 +1,8 @@ +// Code generated by mkconsts.go. DO NOT EDIT. + +//go:build goexperiment.simd + +package goexperiment + +const SIMD = true +const SIMDInt = 1 diff --git a/src/internal/goexperiment/flags.go b/src/internal/goexperiment/flags.go index ceff24193d..b693ed883a 100644 --- a/src/internal/goexperiment/flags.go +++ b/src/internal/goexperiment/flags.go @@ -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 } -- 2.52.0