Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
fb86164
runtime: fix randomized heap base prefix mask misalignment
derekparker Aug 27, 2026
5b7fced
cmd/compile, simd/archsimd: add SVE Sub and its merging peephole
JunyangShao Aug 24, 2026
9de2d19
cmd/compile, simd/archsimd: add SVE Abs and fold selects into its pre…
JunyangShao Aug 25, 2026
216cbea
simd/archsimd: add SVE SubSaturated
JunyangShao Aug 27, 2026
3e5d652
simd/archsimd: add SVE Neg
JunyangShao Aug 27, 2026
f0b5a85
simd/archsimd: extend SVE Abs to float types
JunyangShao Aug 27, 2026
978a95f
simd/archsimd: add SVE Sqrt
JunyangShao Aug 27, 2026
71d1fb5
simd/archsimd: add SVE Ceil
JunyangShao Aug 27, 2026
d162d69
simd/archsimd: add SVE Floor
JunyangShao Aug 27, 2026
8d6fbb0
simd/archsimd: add SVE Trunc
JunyangShao Aug 27, 2026
5bcfe1b
simd/archsimd: add SVE Round
JunyangShao Aug 27, 2026
e585179
simd/archsimd: extend SVE Greater to unsigned and float types
JunyangShao Aug 27, 2026
1dcfdf6
simd/archsimd: add SVE Equal
JunyangShao Aug 27, 2026
1da1ff7
simd/archsimd: add SVE NotEqual
JunyangShao Aug 27, 2026
2ba3d5f
simd/archsimd: add SVE GreaterEqual
JunyangShao Aug 27, 2026
a9aed73
simd/archsimd: add SVE And and width-agnostic bitwise machinery
JunyangShao Aug 27, 2026
61b3e65
cmd/compile: qualify shared wrapper receiver types
jakebailey Sep 1, 2026
1afe831
simd/archsimd: add SVE Or
JunyangShao Aug 27, 2026
336f6cf
simd/archsimd: add SVE Xor
JunyangShao Aug 27, 2026
85ec058
cmd/compile: simplify bounded shift on mips64x
HeliC829 Jul 27, 2026
0a63827
cmd/compile/internal/amd64: fix typo in SIMD comments
0xff-dev Aug 20, 2026
ebe55c0
time: test that After queues by deadline, not that the scheduler is p…
rsc Aug 27, 2026
6ba30ec
cmd/go: fix tool_build_as_needed for cross-built testgo
qmuntal Sep 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/cmd/compile/internal/amd64/ssa.go
Original file line number Diff line number Diff line change
Expand Up @@ -2165,7 +2165,7 @@ func simdVgpvImm8(s *ssagen.State, v *ssa.Value) *obj.Prog {
}
func simdVgpvImm(s *ssagen.State, v *ssa.Value) *obj.Prog {
// within simdgen, the choice of intrinsic shape and the output
// intruction format are linked. In the case of VgpImm, there is
// instruction format are linked. In the case of VgpImm, there is
// a difference in the intrinsic, but no difference in the
// instruction, it is just like VgpvImm8.
//
Expand Down Expand Up @@ -2276,7 +2276,7 @@ func simdVgpImm8(s *ssagen.State, v *ssa.Value) *obj.Prog {

func simdVgpImm(s *ssagen.State, v *ssa.Value) *obj.Prog {
// within simdgen, the choice of intrinsic shape and the output
// intruction format are linked. In the case of VgpImm, there is
// instruction format are linked. In the case of VgpImm, there is
// a difference in the intrinsic, but no difference in the
// instruction, it is just like VgpImm8.
return simdVgpImm8(s, v)
Expand Down
167 changes: 151 additions & 16 deletions src/cmd/compile/internal/arm64/simdssa_sve.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions src/cmd/compile/internal/arm64/ssa.go
Original file line number Diff line number Diff line change
Expand Up @@ -2163,6 +2163,12 @@ func simdZ2kvPred(s *ssagen.State, v *ssa.Value, arng int16) *obj.Prog {
switch d {
case x:
case y:
// Only reachable for a commutative operation: a non-commutative one is
// marked resultInArg0, which pins the destination to arg0. Swapping the
// sources of one would compute y-x where x-y was asked for.
if v.Op.ResultInArg0() {
v.Fatalf("destination is arg1 of resultInArg0 op %v", v.Op)
}
x, y = y, x
default:
mp := s.Prog(arm64.AZMOVPRFX)
Expand All @@ -2181,6 +2187,35 @@ func simdZ2kvPred(s *ssagen.State, v *ssa.Value, arng int16) *obj.Prog {
return p
}

// simdZkv emits a predicated-only SVE unary operation standing in for an
// unpredicated one, e.g. ZABS Z0.B, P0.M, Z1.B. SSA provides arg0=x and
// arg1=the governing predicate, which the lowering rule synthesized as
// all-true. With every lane active, merging predication leaves nothing of the
// destination behind, so the operation is unpredicated in effect.
func simdZkv(s *ssagen.State, v *ssa.Value, arng int16) *obj.Prog {
return sveUnaryPred(s, v, arng, v.Args[0].Reg(), v.Args[1].Reg(), arm64.PRED_M)
}

// simdZ2kvPredResultInArg0 emits the merging form of a predicated SVE unary
// operation, e.g. ZABS Z1.B, P0.M, Z0.B. SSA provides arg0=the value the
// inactive lanes keep, arg1=x, arg2=mask, and resultInArg0 puts that value in
// the destination. The instruction is constructive -- it names its destination
// apart from its source -- so merging into that destination needs no MOVPRFX.
func simdZ2kvPredResultInArg0(s *ssagen.State, v *ssa.Value, arng int16) *obj.Prog {
return sveUnaryPred(s, v, arng, v.Args[1].Reg(), v.Args[2].Reg(), arm64.PRED_M)
}

// sveUnaryPred emits a predicated SVE unary operation: OP Zn.T, Pg/<qual>, Zd.T.
func sveUnaryPred(s *ssagen.State, v *ssa.Value, arng int16, zn, pg int16, qual int16) *obj.Prog {
p := s.Prog(v.Op.Asm())
p.From.Type = obj.TYPE_REG
p.From.Reg = zregArng(zn, arng) // Zn
p.AddRestSourceReg(pregMask(pg, qual)) // Pg/M or Pg/Z
p.To.Type = obj.TYPE_REG
p.To.Reg = zregArng(v.Reg(), arng) // Zd
return p
}

// simdZ3kvPredResultInArg0 emits an SVE merging-predicated binary operation
// whose inactive lanes come from a value that is neither of its sources, e.g.
// x.Add(y).IfElse(mask, z). SSA provides arg0=z, arg1=x, arg2=y, arg3=mask, and
Expand Down
25 changes: 6 additions & 19 deletions src/cmd/compile/internal/ir/expr.go
Original file line number Diff line number Diff line change
Expand Up @@ -1212,28 +1212,15 @@ func promotedWrapperSym(wrapper, wrappee *types.Type, msym *types.Sym, offset in
recvMode = "n"
}

rsym := wrapper.Sym()
if wrapper.IsPtr() {
if rsym != nil {
base.Fatalf("declared pointer receiver type: %v", wrapper)
}
rsym = wrapper.Elem().Sym()
}
rpkg := Pkgs.Go
if rsym != nil {
rpkg = rsym.Pkg
}
wrappeeMethod := ReceiverMethodSym(wrappee, msym)

var b bytes.Buffer
fmt.Fprintf(&b, ".embed.%-S.", wrappee)
if !types.IsExported(msym.Name) {
b.WriteString(msym.Pkg.Prefix)
b.WriteString(".")
}
b.WriteString(msym.Name)
fmt.Fprintf(&b, ".%d%s.%d", derefs, recvMode, offset)
fmt.Fprintf(&b, ".embed.%d%s.%d.", derefs, recvMode, offset)
b.WriteString(wrappeeMethod.Pkg.Prefix)
b.WriteString(".")
b.WriteString(wrappeeMethod.Name)

sym := rpkg.LookupBytes(b.Bytes())
sym := wrappeeMethod.Pkg.LookupBytes(b.Bytes())
sym.SetFunc(true)
return sym
}
Expand Down
3 changes: 2 additions & 1 deletion src/cmd/compile/internal/ssa/_gen/ARM64Ops.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ func init() {
fp31 = regInfo{inputs: []regMask{fp, fp, fp}, outputs: []regMask{fp}}
fp2flags = regInfo{inputs: []regMask{fp, fp}}
fp1flags = regInfo{inputs: []regMask{fp}}
fp1predfp = regInfo{inputs: []regMask{fp, pred}, outputs: []regMask{fp}}
fp2predpred = regInfo{inputs: []regMask{fp, fp, pred}, outputs: []regMask{pred}}
fp2predfp = regInfo{inputs: []regMask{fp, fp, pred}, outputs: []regMask{fp}}
fp3predfp = regInfo{inputs: []regMask{fp, fp, fp, pred}, outputs: []regMask{fp}}
Expand Down Expand Up @@ -902,7 +903,7 @@ func init() {
pkg: "cmd/internal/obj/arm64",
genfile: "../../arm64/ssa.go",
genSIMDfile: "../../arm64/simdssa.go ../../arm64/simdssa_sve.go",
ops: append(append(ops, simdARM64Ops(fp11, fp21, fp31, fpgp, fpgpfp, fp21)...), simdARM64SVEOps(fp11, fp21, fp2predpred, fp2predfp, fp2predfp, fp3predfp)...),
ops: append(append(ops, simdARM64Ops(fp11, fp21, fp31, fpgp, fpgpfp, fp21)...), simdARM64SVEOps(fp11, fp21, fp1predfp, fp2predpred, fp2predfp, fp2predfp, fp3predfp)...),
blocks: blocks,
regnames: regNamesARM64,
ParamIntRegNames: "R0 R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13 R14 R15",
Expand Down
Loading
Loading