go/test/simd/bug2.go
Junyang Shao d9751166a6 [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>
2025-09-18 11:06:57 -07:00

26 lines
504 B
Go

// 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]]
}
}
}