Commit e6d9ab1584 for golang

commit e6d9ab1584801cbea20ac14706134f8fbae01943
Author: Michael Haddon <michael@politepixels.io>
Date:   Thu Nov 26 01:36:31 2026 +0000

    cmd/compile: drop the memory argument of wasm SIMD broadcasts

    simdBroadcast builds the generic Broadcast ops with the current memory
    as a second argument, but those ops take only the scalar. The wasm
    lowering rules copy both arguments to the Splat ops, and code
    generation reads only the first, so the results are correct, but
    -d=ssa/check/on rejects every broadcast on wasm, including those in
    simd/archsimd. The extra argument also keeps CSE from combining two
    broadcasts of the same value on either side of a store.

    Build the value with the scalar argument only.

    Add a test.

    Fixes #83400

    Change-Id: I5b193927cd12db9d896a72a2bfff3ed81efdc1a4
    GitHub-Last-Rev: 3f446d17986f182096818aa5779ba2b8adc492ca
    GitHub-Pull-Request: golang/go#83401
    Reviewed-on: https://go-review.googlesource.com/c/go/+/867364
    Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
    Reviewed-by: David Chase <drchase@google.com>
    LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
    Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>

diff --git a/src/cmd/compile/internal/ssagen/intrinsics.go b/src/cmd/compile/internal/ssagen/intrinsics.go
index c145696551..d37d5afd3e 100644
--- a/src/cmd/compile/internal/ssagen/intrinsics.go
+++ b/src/cmd/compile/internal/ssagen/intrinsics.go
@@ -2569,7 +2569,7 @@ func opLen4Imm8(op ssaop.Op, t *types.Type, offset int) func(s *state, n *ir.Cal
 //go:noinline
 func simdBroadcast(op ssaop.Op) func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value {
 	return func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value {
-		return s.newValue2(op, n.Type(), args[0], s.mem())
+		return s.newValue1(op, n.Type(), args[0])
 	}
 }

diff --git a/test/fixedbugs/issue83400.go b/test/fixedbugs/issue83400.go
new file mode 100644
index 0000000000..22f1abd211
--- /dev/null
+++ b/test/fixedbugs/issue83400.go
@@ -0,0 +1,22 @@
+// compile -d=ssa/check/on
+
+// Copyright 2026 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build goexperiment.simdstable && wasm
+
+// The Broadcast intrinsics on wasm built their SSA value with a
+// memory argument that the op does not take.
+
+package p
+
+import "simd/archsimd"
+
+func f(a int8, b int16, c int32, d int64, e float32, g float64) (archsimd.Int8x16, archsimd.Int16x8, archsimd.Int32x4, archsimd.Int64x2, archsimd.Float32x4, archsimd.Float64x2) {
+	return archsimd.BroadcastInt8x16(a), archsimd.BroadcastInt16x8(b), archsimd.BroadcastInt32x4(c), archsimd.BroadcastInt64x2(d), archsimd.BroadcastFloat32x4(e), archsimd.BroadcastFloat64x2(g)
+}
+
+func h(x archsimd.Int64x2) archsimd.Int32x4 {
+	return x.SaturateToInt32()
+}