diff options
| author | Cuong Manh Le <cuong.manhle.vn@gmail.com> | 2026-02-05 21:16:55 +0700 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2026-02-06 09:36:03 -0800 |
| commit | 38ed6147485232f9562e87970c56f4491c082998 (patch) | |
| tree | b579e6e0cbd4f270dcfd8be6b8f8224beb4b8966 /src/cmd | |
| parent | ae842f71461ad178eff7283bc36e150fe284b9aa (diff) | |
| download | go-38ed6147485232f9562e87970c56f4491c082998.tar.xz | |
cmd/compile: fix SIMD type parameter instantiation
When a SIMD type is used to instantiate a type parameter, the SIMD's
underlying type is its shape. This shape type must be marked as a SIMD
type, otherwise, the backend will confuse and does not know how to put
this SIMD type to proper registers.
Fixing this by marking a type as SIMD type if its underlying is already
a SIMD one.
Fixes #77444
Change-Id: I745c474469889c94bc68435472ba4820e9f752a1
Reviewed-on: https://go-review.googlesource.com/c/go/+/742320
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'src/cmd')
| -rw-r--r-- | src/cmd/compile/internal/types/type.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/types/type.go b/src/cmd/compile/internal/types/type.go index 6663c49dd8..3fa0b90e12 100644 --- a/src/cmd/compile/internal/types/type.go +++ b/src/cmd/compile/internal/types/type.go @@ -1683,6 +1683,9 @@ func (t *Type) SetUnderlying(underlying *Type) { if underlying.HasShape() { t.SetHasShape(true) } + if underlying.isSIMD { + simdify(t, underlying.isSIMDTag) + } // spec: "The declared type does not inherit any methods bound // to the existing type, but the method set of an interface |
