1 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve -asm-verbose=0 < %s | FileCheck %s
5 define half @fadda_nxv2f16(half %init, <vscale x 2 x half> %a) {
6 ; CHECK-LABEL: fadda_nxv2f16:
8 ; CHECK-NEXT: fadda h0, p0, h0, z1.h
10 %res = call half @llvm.vector.reduce.fadd.nxv2f16(half %init, <vscale x 2 x half> %a)
14 define half @fadda_nxv4f16(half %init, <vscale x 4 x half> %a) {
15 ; CHECK-LABEL: fadda_nxv4f16:
17 ; CHECK-NEXT: fadda h0, p0, h0, z1.h
19 %res = call half @llvm.vector.reduce.fadd.nxv4f16(half %init, <vscale x 4 x half> %a)
23 define half @fadda_nxv8f16(half %init, <vscale x 8 x half> %a) {
24 ; CHECK-LABEL: fadda_nxv8f16:
26 ; CHECK-NEXT: fadda h0, p0, h0, z1.h
28 %res = call half @llvm.vector.reduce.fadd.nxv8f16(half %init, <vscale x 8 x half> %a)
32 define float @fadda_nxv2f32(float %init, <vscale x 2 x float> %a) {
33 ; CHECK-LABEL: fadda_nxv2f32:
35 ; CHECK-NEXT: fadda s0, p0, s0, z1.s
37 %res = call float @llvm.vector.reduce.fadd.nxv2f32(float %init, <vscale x 2 x float> %a)
41 define float @fadda_nxv4f32(float %init, <vscale x 4 x float> %a) {
42 ; CHECK-LABEL: fadda_nxv4f32:
44 ; CHECK-NEXT: fadda s0, p0, s0, z1.s
46 %res = call float @llvm.vector.reduce.fadd.nxv4f32(float %init, <vscale x 4 x float> %a)
50 define double @fadda_nxv2f64(double %init, <vscale x 2 x double> %a) {
51 ; CHECK-LABEL: fadda_nxv2f64:
53 ; CHECK-NEXT: fadda d0, p0, d0, z1.d
55 %res = call double @llvm.vector.reduce.fadd.nxv2f64(double %init, <vscale x 2 x double> %a)
61 define half @faddv_nxv2f16(half %init, <vscale x 2 x half> %a) {
62 ; CHECK-LABEL: faddv_nxv2f16:
64 ; CHECK-NEXT: faddv h1, p0, z1.h
65 ; CHECK-NEXT: fadd h0, h0, h1
67 %res = call fast half @llvm.vector.reduce.fadd.nxv2f16(half %init, <vscale x 2 x half> %a)
71 define half @faddv_nxv4f16(half %init, <vscale x 4 x half> %a) {
72 ; CHECK-LABEL: faddv_nxv4f16:
74 ; CHECK-NEXT: faddv h1, p0, z1.h
75 ; CHECK-NEXT: fadd h0, h0, h1
77 %res = call fast half @llvm.vector.reduce.fadd.nxv4f16(half %init, <vscale x 4 x half> %a)
81 define half @faddv_nxv8f16(half %init, <vscale x 8 x half> %a) {
82 ; CHECK-LABEL: faddv_nxv8f16:
84 ; CHECK-NEXT: faddv h1, p0, z1.h
85 ; CHECK-NEXT: fadd h0, h0, h1
87 %res = call fast half @llvm.vector.reduce.fadd.nxv8f16(half %init, <vscale x 8 x half> %a)
91 define float @faddv_nxv2f32(float %init, <vscale x 2 x float> %a) {
92 ; CHECK-LABEL: faddv_nxv2f32:
94 ; CHECK-NEXT: faddv s1, p0, z1.s
95 ; CHECK-NEXT: fadd s0, s0, s1
97 %res = call fast float @llvm.vector.reduce.fadd.nxv2f32(float %init, <vscale x 2 x float> %a)
101 define float @faddv_nxv4f32(float %init, <vscale x 4 x float> %a) {
102 ; CHECK-LABEL: faddv_nxv4f32:
104 ; CHECK-NEXT: faddv s1, p0, z1.s
105 ; CHECK-NEXT: fadd s0, s0, s1
107 %res = call fast float @llvm.vector.reduce.fadd.nxv4f32(float %init, <vscale x 4 x float> %a)
111 define double @faddv_nxv2f64(double %init, <vscale x 2 x double> %a) {
112 ; CHECK-LABEL: faddv_nxv2f64:
114 ; CHECK-NEXT: faddv d1, p0, z1.d
115 ; CHECK-NEXT: fadd d0, d0, d1
117 %res = call fast double @llvm.vector.reduce.fadd.nxv2f64(double %init, <vscale x 2 x double> %a)
123 define half @fmaxv_nxv2f16(<vscale x 2 x half> %a) {
124 ; CHECK-LABEL: fmaxv_nxv2f16:
126 ; CHECK-NEXT: fmaxnmv h0, p0, z0.h
128 %res = call half @llvm.vector.reduce.fmax.nxv2f16(<vscale x 2 x half> %a)
132 define half @fmaxv_nxv4f16(<vscale x 4 x half> %a) {
133 ; CHECK-LABEL: fmaxv_nxv4f16:
135 ; CHECK-NEXT: fmaxnmv h0, p0, z0.h
137 %res = call half @llvm.vector.reduce.fmax.nxv4f16(<vscale x 4 x half> %a)
141 define half @fmaxv_nxv8f16(<vscale x 8 x half> %a) {
142 ; CHECK-LABEL: fmaxv_nxv8f16:
144 ; CHECK-NEXT: fmaxnmv h0, p0, z0.h
146 %res = call half @llvm.vector.reduce.fmax.nxv8f16(<vscale x 8 x half> %a)
150 define float @fmaxv_nxv2f32(<vscale x 2 x float> %a) {
151 ; CHECK-LABEL: fmaxv_nxv2f32:
153 ; CHECK-NEXT: fmaxnmv s0, p0, z0.s
155 %res = call float @llvm.vector.reduce.fmax.nxv2f32(<vscale x 2 x float> %a)
159 define float @fmaxv_nxv4f32(<vscale x 4 x float> %a) {
160 ; CHECK-LABEL: fmaxv_nxv4f32:
162 ; CHECK-NEXT: fmaxnmv s0, p0, z0.s
164 %res = call float @llvm.vector.reduce.fmax.nxv4f32(<vscale x 4 x float> %a)
168 define double @fmaxv_nxv2f64(<vscale x 2 x double> %a) {
169 ; CHECK-LABEL: fmaxv_nxv2f64:
171 ; CHECK-NEXT: fmaxnmv d0, p0, z0.d
173 %res = call double @llvm.vector.reduce.fmax.nxv2f64(<vscale x 2 x double> %a)
179 define half @fminv_nxv2f16(<vscale x 2 x half> %a) {
180 ; CHECK-LABEL: fminv_nxv2f16:
182 ; CHECK-NEXT: fminnmv h0, p0, z0.h
184 %res = call half @llvm.vector.reduce.fmin.nxv2f16(<vscale x 2 x half> %a)
188 define half @fminv_nxv4f16(<vscale x 4 x half> %a) {
189 ; CHECK-LABEL: fminv_nxv4f16:
191 ; CHECK-NEXT: fminnmv h0, p0, z0.h
193 %res = call half @llvm.vector.reduce.fmin.nxv4f16(<vscale x 4 x half> %a)
197 define half @fminv_nxv8f16(<vscale x 8 x half> %a) {
198 ; CHECK-LABEL: fminv_nxv8f16:
200 ; CHECK-NEXT: fminnmv h0, p0, z0.h
202 %res = call half @llvm.vector.reduce.fmin.nxv8f16(<vscale x 8 x half> %a)
206 define float @fminv_nxv2f32(<vscale x 2 x float> %a) {
207 ; CHECK-LABEL: fminv_nxv2f32:
209 ; CHECK-NEXT: fminnmv s0, p0, z0.s
211 %res = call float @llvm.vector.reduce.fmin.nxv2f32(<vscale x 2 x float> %a)
215 define float @fminv_nxv4f32(<vscale x 4 x float> %a) {
216 ; CHECK-LABEL: fminv_nxv4f32:
218 ; CHECK-NEXT: fminnmv s0, p0, z0.s
220 %res = call float @llvm.vector.reduce.fmin.nxv4f32(<vscale x 4 x float> %a)
224 define double @fminv_nxv2f64(<vscale x 2 x double> %a) {
225 ; CHECK-LABEL: fminv_nxv2f64:
227 ; CHECK-NEXT: fminnmv d0, p0, z0.d
229 %res = call double @llvm.vector.reduce.fmin.nxv2f64(<vscale x 2 x double> %a)
233 declare half @llvm.vector.reduce.fadd.nxv2f16(half, <vscale x 2 x half>)
234 declare half @llvm.vector.reduce.fadd.nxv4f16(half, <vscale x 4 x half>)
235 declare half @llvm.vector.reduce.fadd.nxv8f16(half, <vscale x 8 x half>)
236 declare float @llvm.vector.reduce.fadd.nxv2f32(float, <vscale x 2 x float>)
237 declare float @llvm.vector.reduce.fadd.nxv4f32(float, <vscale x 4 x float>)
238 declare double @llvm.vector.reduce.fadd.nxv2f64(double, <vscale x 2 x double>)
240 declare half @llvm.vector.reduce.fmax.nxv2f16(<vscale x 2 x half>)
241 declare half @llvm.vector.reduce.fmax.nxv4f16(<vscale x 4 x half>)
242 declare half @llvm.vector.reduce.fmax.nxv8f16(<vscale x 8 x half>)
243 declare float @llvm.vector.reduce.fmax.nxv2f32(<vscale x 2 x float>)
244 declare float @llvm.vector.reduce.fmax.nxv4f32(<vscale x 4 x float>)
245 declare double @llvm.vector.reduce.fmax.nxv2f64(<vscale x 2 x double>)
247 declare half @llvm.vector.reduce.fmin.nxv2f16(<vscale x 2 x half>)
248 declare half @llvm.vector.reduce.fmin.nxv4f16(<vscale x 4 x half>)
249 declare half @llvm.vector.reduce.fmin.nxv8f16(<vscale x 8 x half>)
250 declare float @llvm.vector.reduce.fmin.nxv2f32(<vscale x 2 x float>)
251 declare float @llvm.vector.reduce.fmin.nxv4f32(<vscale x 4 x float>)
252 declare double @llvm.vector.reduce.fmin.nxv2f64(<vscale x 2 x double>)