1 !sum
2 # ReduceSum — floating-point add across all lanes (ZFADDV). The sum is a float
3 # in a floating-point scalar register.
4 # Predicated-only: the governing predicate is implicit-all-true.
5 - go: ReduceSum
6 asm: "ZFADDV[SD]"
7 in:
8 - go: $t
9 base: float
10 - class: mask # governing predicate
11 out:
12 - &floatScalar
13 class: fpreg
14 base: float
15
16 # ReduceMax — floating-point maximum across all lanes (ZFMAXV), the same shape
17 # as ReduceSum. FMAXV propagates NaN, as Go's max does.
18 - go: ReduceMax
19 asm: "ZFMAXV[SD]"
20 in:
21 - go: $t
22 base: float
23 - class: mask # governing predicate
24 out:
25 - *floatScalar
26
27 # ReduceMin -- floating-point minimum across all lanes (ZFMINV), the same shape
28 # as ReduceMax. FMINV propagates NaN and orders -0 below +0, as Go's min does.
29 - go: ReduceMin
30 asm: "ZFMINV[SD]"
31 in:
32 - go: $t
33 base: float
34 - class: mask # governing predicate
35 out:
36 - *floatScalar
37
38 # ReduceSum (integers) -- add across all lanes (ZUADDVD). UADDV leaves a 64-bit
39 # sum in a SIMD&FP register, whose low bits are the wrapped sum of the element
40 # type, signed or not, so the result takes the element's width
41 # (overwriteElementBits). The lowering moves it to a general register, where Go
42 # keeps integers.
43 - go: ReduceSum
44 asm: "ZUADDVD"
45 in:
46 - go: $t
47 base: $b
48 elemBits: $e
49 - class: mask # governing predicate
50 out:
51 - class: fpreg
52 base: $b
53 overwriteElementBits: $e
54
55 # ReduceMax (integers) -- maximum across all lanes (SMAXV, UMAXV), the same
56 # shape as the integer ReduceSum, with a result one element wide.
57 - go: ReduceMax
58 asm: "Z[SU]MAXV[BHSD]"
59 in:
60 - go: $t
61 base: int|uint
62 - class: mask # governing predicate
63 out:
64 - class: fpreg
65 base: int|uint
66
67 # ReduceMin (integers) -- minimum across all lanes (SMINV, UMINV), the same
68 # shape as the integer ReduceMax.
69 - go: ReduceMin
70 asm: "Z[SU]MINV[BHSD]"
71 in:
72 - go: $t
73 base: int|uint
74 - class: mask # governing predicate
75 out:
76 - class: fpreg
77 base: int|uint
78
View as plain text