1 // Copyright 2026 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 //go:build goexperiment.simd
6
7 #include "textflag.h"
8
9 // func sgemmKernelSVE(c, a, b *float32, k, bstride int64)
10 //
11 // The same instruction sequence in the sgemmSIMD
12 // innermost loop.
13 TEXT ·sgemmKernelSVE(SB), NOSPLIT, $0-40
14 MOVD cioff+0(FP), R0
15 MOVD ai+8(FP), R1
16 MOVD boff+16(FP), R2
17 MOVD k+24(FP), R3
18 MOVD vlx4+32(FP), R4
19
20 // Construct the all-true predicate
21 MOVD $8, R5
22 MOVD ZR, R6
23 PWHILELT R5, R6, P0.S
24
25 ZDUP $0, Z0.S // the C strip accumulator
26
27 loop:
28 FMOVS (R1), F1 // a[i][p]
29 ZDUP Z1.S[0], Z1.S
30 ZLDR (VL*0)(R2), Z2 // B[p][off:off+vl]
31 ZFMLA Z2.S, Z1.S, P0.M, Z0.S
32 ADD $4, R1
33 ADD R4, R2
34 SUBS $1, R3
35 BNE loop
36
37 ZSTR Z0, (VL*0)(R0)
38 RET
39
View as plain text