]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.simd] cmd/compile: fix opLen(2|3)Imm8_2I intrinsic function
authorJunyang Shao <shaojunyang@google.com>
Thu, 17 Jul 2025 22:23:15 +0000 (22:23 +0000)
committerDavid Chase <drchase@google.com>
Mon, 21 Jul 2025 17:27:18 +0000 (10:27 -0700)
This function reads the const from the wrong arg, this CL fixes it.

Change-Id: Icd38977a35f0df9064efb290fa6390453d6b9e5b
Reviewed-on: https://go-review.googlesource.com/c/go/+/688595
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/cmd/compile/internal/ssagen/intrinsics.go

index 337f0b86e61136fc8905d4d08960c76b23b8995f..5415143ec3199c7402adec63c5714620cea6be35 100644 (file)
@@ -1722,7 +1722,7 @@ func opLen3Imm8(op ssa.Op, t *types.Type, offset int) func(s *state, n *ir.CallE
 
 func opLen2Imm8_2I(op ssa.Op, t *types.Type, offset int) func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value {
        return func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value {
-               if args[1].Op == ssa.OpConst8 {
+               if args[2].Op == ssa.OpConst8 {
                        return s.newValue2I(op, t, args[2].AuxInt<<int64(offset), args[0], args[1])
                }
                plainPanicSimdImm(s)
@@ -1736,7 +1736,7 @@ func opLen2Imm8_2I(op ssa.Op, t *types.Type, offset int) func(s *state, n *ir.Ca
 
 func opLen3Imm8_2I(op ssa.Op, t *types.Type, offset int) func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value {
        return func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value {
-               if args[1].Op == ssa.OpConst8 {
+               if args[2].Op == ssa.OpConst8 {
                        return s.newValue3I(op, t, args[2].AuxInt<<int64(offset), args[0], args[1], args[3])
                }
                plainPanicSimdImm(s)