aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJunyang Shao <shaojunyang@google.com>2025-09-16 03:27:41 +0000
committerJunyang Shao <shaojunyang@google.com>2025-09-18 11:06:57 -0700
commitd9751166a6872e05afee5087cee2f360344bd2f9 (patch)
tree7f8eb655b8817e05d8818ddd38d84e83b127c3d8 /test
parent4eb5c6e07b56b75033d98941c8fadd3304ee4965 (diff)
downloadgo-d9751166a6872e05afee5087cee2f360344bd2f9.tar.xz
[dev.simd] cmd/compile: handle rematerialized op for incompatible reg constraint
This CL fixes an issue raised by contributor dominikh@. Change-Id: I941b330a6ba6f6c120c69951ddd24933f2f0b3ec Reviewed-on: https://go-review.googlesource.com/c/go/+/704056 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'test')
-rw-r--r--test/simd/bug2.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/simd/bug2.go b/test/simd/bug2.go
new file mode 100644
index 0000000000..2d2094b5a4
--- /dev/null
+++ b/test/simd/bug2.go
@@ -0,0 +1,26 @@
+// compile
+
+//go:build amd64 && goexperiment.simd
+
+// Copyright 2025 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.
+
+// Test case for rematerialization ignoring the register constraint
+// during regalloc's shuffle phase.
+
+package p
+
+import (
+ "simd"
+)
+
+func PackComplex(b bool) {
+ for {
+ if b {
+ var indices [4]uint32
+ simd.Uint32x4{}.ShiftAllRight(20).Store(&indices)
+ _ = indices[indices[0]]
+ }
+ }
+}