1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s | FileCheck %s
4 target triple = "aarch64-unknown-linux-gnu"
10 define <vscale x 8 x half> @fadd_h_immhalf(<vscale x 8 x half> %a) #0 {
11 ; CHECK-LABEL: fadd_h_immhalf:
13 ; CHECK-NEXT: ptrue p0.h
14 ; CHECK-NEXT: fadd z0.h, p0/m, z0.h, #0.5
16 %elt = insertelement <vscale x 8 x half> undef, half 0.500000e+00, i32 0
17 %splat = shufflevector <vscale x 8 x half> %elt, <vscale x 8 x half> undef, <vscale x 8 x i32> zeroinitializer
18 %out = fadd <vscale x 8 x half> %a, %splat
19 ret <vscale x 8 x half> %out
22 define <vscale x 8 x half> @fadd_h_immone(<vscale x 8 x half> %a) #0 {
23 ; CHECK-LABEL: fadd_h_immone:
25 ; CHECK-NEXT: ptrue p0.h
26 ; CHECK-NEXT: fadd z0.h, p0/m, z0.h, #1.0
28 %elt = insertelement <vscale x 8 x half> undef, half 1.000000e+00, i32 0
29 %splat = shufflevector <vscale x 8 x half> %elt, <vscale x 8 x half> undef, <vscale x 8 x i32> zeroinitializer
30 %out = fadd <vscale x 8 x half> %a, %splat
31 ret <vscale x 8 x half> %out
34 define <vscale x 4 x half> @fadd_4h_immhalf(<vscale x 4 x half> %a) #0 {
35 ; CHECK-LABEL: fadd_4h_immhalf:
37 ; CHECK-NEXT: ptrue p0.s
38 ; CHECK-NEXT: fadd z0.h, p0/m, z0.h, #0.5
40 %elt = insertelement <vscale x 4 x half> undef, half 0.500000e+00, i32 0
41 %splat = shufflevector <vscale x 4 x half> %elt, <vscale x 4 x half> undef, <vscale x 4 x i32> zeroinitializer
42 %out = fadd <vscale x 4 x half> %a, %splat
43 ret <vscale x 4 x half> %out
46 define <vscale x 4 x half> @fadd_4h_immone(<vscale x 4 x half> %a) #0 {
47 ; CHECK-LABEL: fadd_4h_immone:
49 ; CHECK-NEXT: ptrue p0.s
50 ; CHECK-NEXT: fadd z0.h, p0/m, z0.h, #1.0
52 %elt = insertelement <vscale x 4 x half> undef, half 1.000000e+00, i32 0
53 %splat = shufflevector <vscale x 4 x half> %elt, <vscale x 4 x half> undef, <vscale x 4 x i32> zeroinitializer
54 %out = fadd <vscale x 4 x half> %a, %splat
55 ret <vscale x 4 x half> %out
58 define <vscale x 2 x half> @fadd_2h_immhalf(<vscale x 2 x half> %a) #0 {
59 ; CHECK-LABEL: fadd_2h_immhalf:
61 ; CHECK-NEXT: ptrue p0.d
62 ; CHECK-NEXT: fadd z0.h, p0/m, z0.h, #0.5
64 %elt = insertelement <vscale x 2 x half> undef, half 0.500000e+00, i32 0
65 %splat = shufflevector <vscale x 2 x half> %elt, <vscale x 2 x half> undef, <vscale x 2 x i32> zeroinitializer
66 %out = fadd <vscale x 2 x half> %a, %splat
67 ret <vscale x 2 x half> %out
70 define <vscale x 2 x half> @fadd_2h_immone(<vscale x 2 x half> %a) #0 {
71 ; CHECK-LABEL: fadd_2h_immone:
73 ; CHECK-NEXT: ptrue p0.d
74 ; CHECK-NEXT: fadd z0.h, p0/m, z0.h, #1.0
76 %elt = insertelement <vscale x 2 x half> undef, half 1.000000e+00, i32 0
77 %splat = shufflevector <vscale x 2 x half> %elt, <vscale x 2 x half> undef, <vscale x 2 x i32> zeroinitializer
78 %out = fadd <vscale x 2 x half> %a, %splat
79 ret <vscale x 2 x half> %out
82 define <vscale x 4 x float> @fadd_s_immhalf(<vscale x 4 x float> %a) #0 {
83 ; CHECK-LABEL: fadd_s_immhalf:
85 ; CHECK-NEXT: ptrue p0.s
86 ; CHECK-NEXT: fadd z0.s, p0/m, z0.s, #0.5
88 %elt = insertelement <vscale x 4 x float> undef, float 0.500000e+00, i32 0
89 %splat = shufflevector <vscale x 4 x float> %elt, <vscale x 4 x float> undef, <vscale x 4 x i32> zeroinitializer
90 %out = fadd <vscale x 4 x float> %a, %splat
91 ret <vscale x 4 x float> %out
94 define <vscale x 4 x float> @fadd_s_immone(<vscale x 4 x float> %a) #0 {
95 ; CHECK-LABEL: fadd_s_immone:
97 ; CHECK-NEXT: ptrue p0.s
98 ; CHECK-NEXT: fadd z0.s, p0/m, z0.s, #1.0
100 %elt = insertelement <vscale x 4 x float> undef, float 1.000000e+00, i32 0
101 %splat = shufflevector <vscale x 4 x float> %elt, <vscale x 4 x float> undef, <vscale x 4 x i32> zeroinitializer
102 %out = fadd <vscale x 4 x float> %a, %splat
103 ret <vscale x 4 x float> %out
106 define <vscale x 2 x float> @fadd_2s_immhalf(<vscale x 2 x float> %a) #0 {
107 ; CHECK-LABEL: fadd_2s_immhalf:
109 ; CHECK-NEXT: ptrue p0.d
110 ; CHECK-NEXT: fadd z0.s, p0/m, z0.s, #0.5
112 %elt = insertelement <vscale x 2 x float> undef, float 0.500000e+00, i32 0
113 %splat = shufflevector <vscale x 2 x float> %elt, <vscale x 2 x float> undef, <vscale x 2 x i32> zeroinitializer
114 %out = fadd <vscale x 2 x float> %a, %splat
115 ret <vscale x 2 x float> %out
118 define <vscale x 2 x float> @fadd_2s_immone(<vscale x 2 x float> %a) #0 {
119 ; CHECK-LABEL: fadd_2s_immone:
121 ; CHECK-NEXT: ptrue p0.d
122 ; CHECK-NEXT: fadd z0.s, p0/m, z0.s, #1.0
124 %elt = insertelement <vscale x 2 x float> undef, float 1.000000e+00, i32 0
125 %splat = shufflevector <vscale x 2 x float> %elt, <vscale x 2 x float> undef, <vscale x 2 x i32> zeroinitializer
126 %out = fadd <vscale x 2 x float> %a, %splat
127 ret <vscale x 2 x float> %out
131 define <vscale x 2 x double> @fadd_d_immhalf(<vscale x 2 x double> %a) #0 {
132 ; CHECK-LABEL: fadd_d_immhalf:
134 ; CHECK-NEXT: ptrue p0.d
135 ; CHECK-NEXT: fadd z0.d, p0/m, z0.d, #0.5
137 %elt = insertelement <vscale x 2 x double> undef, double 0.500000e+00, i32 0
138 %splat = shufflevector <vscale x 2 x double> %elt, <vscale x 2 x double> undef, <vscale x 2 x i32> zeroinitializer
139 %out = fadd <vscale x 2 x double> %a, %splat
140 ret <vscale x 2 x double> %out
143 define <vscale x 2 x double> @fadd_d_immone(<vscale x 2 x double> %a) #0 {
144 ; CHECK-LABEL: fadd_d_immone:
146 ; CHECK-NEXT: ptrue p0.d
147 ; CHECK-NEXT: fadd z0.d, p0/m, z0.d, #1.0
149 %elt = insertelement <vscale x 2 x double> undef, double 1.000000e+00, i32 0
150 %splat = shufflevector <vscale x 2 x double> %elt, <vscale x 2 x double> undef, <vscale x 2 x i32> zeroinitializer
151 %out = fadd <vscale x 2 x double> %a, %splat
152 ret <vscale x 2 x double> %out
159 define <vscale x 8 x half> @fmax_h_immzero(<vscale x 8 x half> %a) #0 {
160 ; CHECK-LABEL: fmax_h_immzero:
162 ; CHECK-NEXT: ptrue p0.h
163 ; CHECK-NEXT: fmax z0.h, p0/m, z0.h, #0.0
165 %elt = insertelement <vscale x 8 x half> undef, half 0.000000e+00, i32 0
166 %splat = shufflevector <vscale x 8 x half> %elt, <vscale x 8 x half> undef, <vscale x 8 x i32> zeroinitializer
167 %out = call <vscale x 8 x half> @llvm.maximum.nxv8f16(<vscale x 8 x half> %a, <vscale x 8 x half> %splat)
168 ret <vscale x 8 x half> %out
171 define <vscale x 8 x half> @fmax_h_immone(<vscale x 8 x half> %a) #0 {
172 ; CHECK-LABEL: fmax_h_immone:
174 ; CHECK-NEXT: ptrue p0.h
175 ; CHECK-NEXT: fmax z0.h, p0/m, z0.h, #1.0
177 %elt = insertelement <vscale x 8 x half> undef, half 1.000000e+00, i32 0
178 %splat = shufflevector <vscale x 8 x half> %elt, <vscale x 8 x half> undef, <vscale x 8 x i32> zeroinitializer
179 %out = call <vscale x 8 x half> @llvm.maximum.nxv8f16(<vscale x 8 x half> %a, <vscale x 8 x half> %splat)
180 ret <vscale x 8 x half> %out
183 define <vscale x 4 x half> @fmax_4h_immzero(<vscale x 4 x half> %a) #0 {
184 ; CHECK-LABEL: fmax_4h_immzero:
186 ; CHECK-NEXT: ptrue p0.s
187 ; CHECK-NEXT: fmax z0.h, p0/m, z0.h, #0.0
189 %elt = insertelement <vscale x 4 x half> undef, half 0.000000e+00, i32 0
190 %splat = shufflevector <vscale x 4 x half> %elt, <vscale x 4 x half> undef, <vscale x 4 x i32> zeroinitializer
191 %out = call <vscale x 4 x half> @llvm.maximum.nxv4f16(<vscale x 4 x half> %a, <vscale x 4 x half> %splat)
192 ret <vscale x 4 x half> %out
195 define <vscale x 4 x half> @fmax_4h_immone(<vscale x 4 x half> %a) #0 {
196 ; CHECK-LABEL: fmax_4h_immone:
198 ; CHECK-NEXT: ptrue p0.s
199 ; CHECK-NEXT: fmax z0.h, p0/m, z0.h, #1.0
201 %elt = insertelement <vscale x 4 x half> undef, half 1.000000e+00, i32 0
202 %splat = shufflevector <vscale x 4 x half> %elt, <vscale x 4 x half> undef, <vscale x 4 x i32> zeroinitializer
203 %out = call <vscale x 4 x half> @llvm.maximum.nxv4f16(<vscale x 4 x half> %a, <vscale x 4 x half> %splat)
204 ret <vscale x 4 x half> %out
207 define <vscale x 2 x half> @fmax_2h_immzero(<vscale x 2 x half> %a) #0 {
208 ; CHECK-LABEL: fmax_2h_immzero:
210 ; CHECK-NEXT: ptrue p0.d
211 ; CHECK-NEXT: fmax z0.h, p0/m, z0.h, #0.0
213 %elt = insertelement <vscale x 2 x half> undef, half 0.000000e+00, i32 0
214 %splat = shufflevector <vscale x 2 x half> %elt, <vscale x 2 x half> undef, <vscale x 2 x i32> zeroinitializer
215 %out = call <vscale x 2 x half> @llvm.maximum.nxv2f16(<vscale x 2 x half> %a, <vscale x 2 x half> %splat)
216 ret <vscale x 2 x half> %out
219 define <vscale x 2 x half> @fmax_2h_immone(<vscale x 2 x half> %a) #0 {
220 ; CHECK-LABEL: fmax_2h_immone:
222 ; CHECK-NEXT: ptrue p0.d
223 ; CHECK-NEXT: fmax z0.h, p0/m, z0.h, #1.0
225 %elt = insertelement <vscale x 2 x half> undef, half 1.000000e+00, i32 0
226 %splat = shufflevector <vscale x 2 x half> %elt, <vscale x 2 x half> undef, <vscale x 2 x i32> zeroinitializer
227 %out = call <vscale x 2 x half> @llvm.maximum.nxv2f16(<vscale x 2 x half> %a, <vscale x 2 x half> %splat)
228 ret <vscale x 2 x half> %out
231 define <vscale x 4 x float> @fmax_s_immzero(<vscale x 4 x float> %a) #0 {
232 ; CHECK-LABEL: fmax_s_immzero:
234 ; CHECK-NEXT: ptrue p0.s
235 ; CHECK-NEXT: fmax z0.s, p0/m, z0.s, #0.0
237 %elt = insertelement <vscale x 4 x float> undef, float 0.000000e+00, i32 0
238 %splat = shufflevector <vscale x 4 x float> %elt, <vscale x 4 x float> undef, <vscale x 4 x i32> zeroinitializer
239 %out = call <vscale x 4 x float> @llvm.maximum.nxv4f32(<vscale x 4 x float> %a, <vscale x 4 x float> %splat)
240 ret <vscale x 4 x float> %out
243 define <vscale x 4 x float> @fmax_s_immone(<vscale x 4 x float> %a) #0 {
244 ; CHECK-LABEL: fmax_s_immone:
246 ; CHECK-NEXT: ptrue p0.s
247 ; CHECK-NEXT: fmax z0.s, p0/m, z0.s, #1.0
249 %elt = insertelement <vscale x 4 x float> undef, float 1.000000e+00, i32 0
250 %splat = shufflevector <vscale x 4 x float> %elt, <vscale x 4 x float> undef, <vscale x 4 x i32> zeroinitializer
251 %out = call <vscale x 4 x float> @llvm.maximum.nxv4f32(<vscale x 4 x float> %a, <vscale x 4 x float> %splat)
252 ret <vscale x 4 x float> %out
255 define <vscale x 2 x float> @fmax_2s_immzero(<vscale x 2 x float> %a) #0 {
256 ; CHECK-LABEL: fmax_2s_immzero:
258 ; CHECK-NEXT: ptrue p0.d
259 ; CHECK-NEXT: fmax z0.s, p0/m, z0.s, #0.0
261 %elt = insertelement <vscale x 2 x float> undef, float 0.000000e+00, i32 0
262 %splat = shufflevector <vscale x 2 x float> %elt, <vscale x 2 x float> undef, <vscale x 2 x i32> zeroinitializer
263 %out = call <vscale x 2 x float> @llvm.maximum.nxv2f32(<vscale x 2 x float> %a, <vscale x 2 x float> %splat)
264 ret <vscale x 2 x float> %out
267 define <vscale x 2 x float> @fmax_2s_immone(<vscale x 2 x float> %a) #0 {
268 ; CHECK-LABEL: fmax_2s_immone:
270 ; CHECK-NEXT: ptrue p0.d
271 ; CHECK-NEXT: fmax z0.s, p0/m, z0.s, #1.0
273 %elt = insertelement <vscale x 2 x float> undef, float 1.000000e+00, i32 0
274 %splat = shufflevector <vscale x 2 x float> %elt, <vscale x 2 x float> undef, <vscale x 2 x i32> zeroinitializer
275 %out = call <vscale x 2 x float> @llvm.maximum.nxv2f32(<vscale x 2 x float> %a, <vscale x 2 x float> %splat)
276 ret <vscale x 2 x float> %out
279 define <vscale x 2 x double> @fmax_d_immzero(<vscale x 2 x double> %a) #0 {
280 ; CHECK-LABEL: fmax_d_immzero:
282 ; CHECK-NEXT: ptrue p0.d
283 ; CHECK-NEXT: fmax z0.d, p0/m, z0.d, #0.0
285 %elt = insertelement <vscale x 2 x double> undef, double 0.000000e+00, i32 0
286 %splat = shufflevector <vscale x 2 x double> %elt, <vscale x 2 x double> undef, <vscale x 2 x i32> zeroinitializer
287 %out = call <vscale x 2 x double> @llvm.maximum.nxv2f64(<vscale x 2 x double> %a, <vscale x 2 x double> %splat)
288 ret <vscale x 2 x double> %out
291 define <vscale x 2 x double> @fmax_d_immone(<vscale x 2 x double> %a) #0 {
292 ; CHECK-LABEL: fmax_d_immone:
294 ; CHECK-NEXT: ptrue p0.d
295 ; CHECK-NEXT: fmax z0.d, p0/m, z0.d, #1.0
297 %elt = insertelement <vscale x 2 x double> undef, double 1.000000e+00, i32 0
298 %splat = shufflevector <vscale x 2 x double> %elt, <vscale x 2 x double> undef, <vscale x 2 x i32> zeroinitializer
299 %out = call <vscale x 2 x double> @llvm.maximum.nxv2f64(<vscale x 2 x double> %a, <vscale x 2 x double> %splat)
300 ret <vscale x 2 x double> %out
307 define <vscale x 8 x half> @fmaxnm_h_immzero(<vscale x 8 x half> %a) #0 {
308 ; CHECK-LABEL: fmaxnm_h_immzero:
310 ; CHECK-NEXT: ptrue p0.h
311 ; CHECK-NEXT: fmaxnm z0.h, p0/m, z0.h, #0.0
313 %elt = insertelement <vscale x 8 x half> undef, half 0.000000e+00, i32 0
314 %splat = shufflevector <vscale x 8 x half> %elt, <vscale x 8 x half> undef, <vscale x 8 x i32> zeroinitializer
315 %out = call <vscale x 8 x half> @llvm.maxnum.nxv8f16(<vscale x 8 x half> %a, <vscale x 8 x half> %splat)
316 ret <vscale x 8 x half> %out
319 define <vscale x 8 x half> @fmaxnm_h_immone(<vscale x 8 x half> %a) #0 {
320 ; CHECK-LABEL: fmaxnm_h_immone:
322 ; CHECK-NEXT: ptrue p0.h
323 ; CHECK-NEXT: fmaxnm z0.h, p0/m, z0.h, #1.0
325 %elt = insertelement <vscale x 8 x half> undef, half 1.000000e+00, i32 0
326 %splat = shufflevector <vscale x 8 x half> %elt, <vscale x 8 x half> undef, <vscale x 8 x i32> zeroinitializer
327 %out = call <vscale x 8 x half> @llvm.maxnum.nxv8f16(<vscale x 8 x half> %a, <vscale x 8 x half> %splat)
328 ret <vscale x 8 x half> %out
331 define <vscale x 4 x half> @fmaxnm_4h_immzero(<vscale x 4 x half> %a) #0 {
332 ; CHECK-LABEL: fmaxnm_4h_immzero:
334 ; CHECK-NEXT: ptrue p0.s
335 ; CHECK-NEXT: fmaxnm z0.h, p0/m, z0.h, #0.0
337 %elt = insertelement <vscale x 4 x half> undef, half 0.000000e+00, i32 0
338 %splat = shufflevector <vscale x 4 x half> %elt, <vscale x 4 x half> undef, <vscale x 4 x i32> zeroinitializer
339 %out = call <vscale x 4 x half> @llvm.maxnum.nxv4f16(<vscale x 4 x half> %a, <vscale x 4 x half> %splat)
340 ret <vscale x 4 x half> %out
343 define <vscale x 4 x half> @fmaxnm_4h_immone(<vscale x 4 x half> %a) #0 {
344 ; CHECK-LABEL: fmaxnm_4h_immone:
346 ; CHECK-NEXT: ptrue p0.s
347 ; CHECK-NEXT: fmaxnm z0.h, p0/m, z0.h, #1.0
349 %elt = insertelement <vscale x 4 x half> undef, half 1.000000e+00, i32 0
350 %splat = shufflevector <vscale x 4 x half> %elt, <vscale x 4 x half> undef, <vscale x 4 x i32> zeroinitializer
351 %out = call <vscale x 4 x half> @llvm.maxnum.nxv4f16(<vscale x 4 x half> %a, <vscale x 4 x half> %splat)
352 ret <vscale x 4 x half> %out
355 define <vscale x 2 x half> @fmaxnm_2h_immzero(<vscale x 2 x half> %a) #0 {
356 ; CHECK-LABEL: fmaxnm_2h_immzero:
358 ; CHECK-NEXT: ptrue p0.d
359 ; CHECK-NEXT: fmaxnm z0.h, p0/m, z0.h, #0.0
361 %elt = insertelement <vscale x 2 x half> undef, half 0.000000e+00, i32 0
362 %splat = shufflevector <vscale x 2 x half> %elt, <vscale x 2 x half> undef, <vscale x 2 x i32> zeroinitializer
363 %out = call <vscale x 2 x half> @llvm.maxnum.nxv2f16(<vscale x 2 x half> %a, <vscale x 2 x half> %splat)
364 ret <vscale x 2 x half> %out
367 define <vscale x 2 x half> @fmaxnm_2h_immone(<vscale x 2 x half> %a) #0 {
368 ; CHECK-LABEL: fmaxnm_2h_immone:
370 ; CHECK-NEXT: ptrue p0.d
371 ; CHECK-NEXT: fmaxnm z0.h, p0/m, z0.h, #1.0
373 %elt = insertelement <vscale x 2 x half> undef, half 1.000000e+00, i32 0
374 %splat = shufflevector <vscale x 2 x half> %elt, <vscale x 2 x half> undef, <vscale x 2 x i32> zeroinitializer
375 %out = call <vscale x 2 x half> @llvm.maxnum.nxv2f16(<vscale x 2 x half> %a, <vscale x 2 x half> %splat)
376 ret <vscale x 2 x half> %out
379 define <vscale x 4 x float> @fmaxnm_s_immzero(<vscale x 4 x float> %a) #0 {
380 ; CHECK-LABEL: fmaxnm_s_immzero:
382 ; CHECK-NEXT: ptrue p0.s
383 ; CHECK-NEXT: fmaxnm z0.s, p0/m, z0.s, #0.0
385 %elt = insertelement <vscale x 4 x float> undef, float 0.000000e+00, i32 0
386 %splat = shufflevector <vscale x 4 x float> %elt, <vscale x 4 x float> undef, <vscale x 4 x i32> zeroinitializer
387 %out = call <vscale x 4 x float> @llvm.maxnum.nxv4f32(<vscale x 4 x float> %a, <vscale x 4 x float> %splat)
388 ret <vscale x 4 x float> %out
391 define <vscale x 4 x float> @fmaxnm_s_immone(<vscale x 4 x float> %a) #0 {
392 ; CHECK-LABEL: fmaxnm_s_immone:
394 ; CHECK-NEXT: ptrue p0.s
395 ; CHECK-NEXT: fmaxnm z0.s, p0/m, z0.s, #1.0
397 %elt = insertelement <vscale x 4 x float> undef, float 1.000000e+00, i32 0
398 %splat = shufflevector <vscale x 4 x float> %elt, <vscale x 4 x float> undef, <vscale x 4 x i32> zeroinitializer
399 %out = call <vscale x 4 x float> @llvm.maxnum.nxv4f32(<vscale x 4 x float> %a, <vscale x 4 x float> %splat)
400 ret <vscale x 4 x float> %out
403 define <vscale x 2 x float> @fmaxnm_2s_immzero(<vscale x 2 x float> %a) #0 {
404 ; CHECK-LABEL: fmaxnm_2s_immzero:
406 ; CHECK-NEXT: ptrue p0.d
407 ; CHECK-NEXT: fmaxnm z0.s, p0/m, z0.s, #0.0
409 %elt = insertelement <vscale x 2 x float> undef, float 0.000000e+00, i32 0
410 %splat = shufflevector <vscale x 2 x float> %elt, <vscale x 2 x float> undef, <vscale x 2 x i32> zeroinitializer
411 %out = call <vscale x 2 x float> @llvm.maxnum.nxv2f32(<vscale x 2 x float> %a, <vscale x 2 x float> %splat)
412 ret <vscale x 2 x float> %out
415 define <vscale x 2 x float> @fmaxnm_2s_immone(<vscale x 2 x float> %a) #0 {
416 ; CHECK-LABEL: fmaxnm_2s_immone:
418 ; CHECK-NEXT: ptrue p0.d
419 ; CHECK-NEXT: fmaxnm z0.s, p0/m, z0.s, #1.0
421 %elt = insertelement <vscale x 2 x float> undef, float 1.000000e+00, i32 0
422 %splat = shufflevector <vscale x 2 x float> %elt, <vscale x 2 x float> undef, <vscale x 2 x i32> zeroinitializer
423 %out = call <vscale x 2 x float> @llvm.maxnum.nxv2f32(<vscale x 2 x float> %a, <vscale x 2 x float> %splat)
424 ret <vscale x 2 x float> %out
427 define <vscale x 2 x double> @fmaxnm_d_immzero(<vscale x 2 x double> %a) #0 {
428 ; CHECK-LABEL: fmaxnm_d_immzero:
430 ; CHECK-NEXT: ptrue p0.d
431 ; CHECK-NEXT: fmaxnm z0.d, p0/m, z0.d, #0.0
433 %elt = insertelement <vscale x 2 x double> undef, double 0.000000e+00, i32 0
434 %splat = shufflevector <vscale x 2 x double> %elt, <vscale x 2 x double> undef, <vscale x 2 x i32> zeroinitializer
435 %out = call <vscale x 2 x double> @llvm.maxnum.nxv2f64(<vscale x 2 x double> %a, <vscale x 2 x double> %splat)
436 ret <vscale x 2 x double> %out
439 define <vscale x 2 x double> @fmaxnm_d_immone(<vscale x 2 x double> %a) #0 {
440 ; CHECK-LABEL: fmaxnm_d_immone:
442 ; CHECK-NEXT: ptrue p0.d
443 ; CHECK-NEXT: fmaxnm z0.d, p0/m, z0.d, #1.0
445 %elt = insertelement <vscale x 2 x double> undef, double 1.000000e+00, i32 0
446 %splat = shufflevector <vscale x 2 x double> %elt, <vscale x 2 x double> undef, <vscale x 2 x i32> zeroinitializer
447 %out = call <vscale x 2 x double> @llvm.maxnum.nxv2f64(<vscale x 2 x double> %a, <vscale x 2 x double> %splat)
448 ret <vscale x 2 x double> %out
455 define <vscale x 8 x half> @fmin_h_immzero(<vscale x 8 x half> %a) #0 {
456 ; CHECK-LABEL: fmin_h_immzero:
458 ; CHECK-NEXT: ptrue p0.h
459 ; CHECK-NEXT: fmin z0.h, p0/m, z0.h, #0.0
461 %elt = insertelement <vscale x 8 x half> undef, half 0.000000e+00, i32 0
462 %splat = shufflevector <vscale x 8 x half> %elt, <vscale x 8 x half> undef, <vscale x 8 x i32> zeroinitializer
463 %out = call <vscale x 8 x half> @llvm.minimum.nxv8f16(<vscale x 8 x half> %a, <vscale x 8 x half> %splat)
464 ret <vscale x 8 x half> %out
467 define <vscale x 8 x half> @fmin_h_immone(<vscale x 8 x half> %a) #0 {
468 ; CHECK-LABEL: fmin_h_immone:
470 ; CHECK-NEXT: ptrue p0.h
471 ; CHECK-NEXT: fmin z0.h, p0/m, z0.h, #1.0
473 %elt = insertelement <vscale x 8 x half> undef, half 1.000000e+00, i32 0
474 %splat = shufflevector <vscale x 8 x half> %elt, <vscale x 8 x half> undef, <vscale x 8 x i32> zeroinitializer
475 %out = call <vscale x 8 x half> @llvm.minimum.nxv8f16(<vscale x 8 x half> %a, <vscale x 8 x half> %splat)
476 ret <vscale x 8 x half> %out
479 define <vscale x 4 x half> @fmin_4h_immzero(<vscale x 4 x half> %a) #0 {
480 ; CHECK-LABEL: fmin_4h_immzero:
482 ; CHECK-NEXT: ptrue p0.s
483 ; CHECK-NEXT: fmin z0.h, p0/m, z0.h, #0.0
485 %elt = insertelement <vscale x 4 x half> undef, half 0.000000e+00, i32 0
486 %splat = shufflevector <vscale x 4 x half> %elt, <vscale x 4 x half> undef, <vscale x 4 x i32> zeroinitializer
487 %out = call <vscale x 4 x half> @llvm.minimum.nxv4f16(<vscale x 4 x half> %a, <vscale x 4 x half> %splat)
488 ret <vscale x 4 x half> %out
491 define <vscale x 4 x half> @fmin_4h_immone(<vscale x 4 x half> %a) #0 {
492 ; CHECK-LABEL: fmin_4h_immone:
494 ; CHECK-NEXT: ptrue p0.s
495 ; CHECK-NEXT: fmin z0.h, p0/m, z0.h, #1.0
497 %elt = insertelement <vscale x 4 x half> undef, half 1.000000e+00, i32 0
498 %splat = shufflevector <vscale x 4 x half> %elt, <vscale x 4 x half> undef, <vscale x 4 x i32> zeroinitializer
499 %out = call <vscale x 4 x half> @llvm.minimum.nxv4f16(<vscale x 4 x half> %a, <vscale x 4 x half> %splat)
500 ret <vscale x 4 x half> %out
503 define <vscale x 2 x half> @fmin_2h_immzero(<vscale x 2 x half> %a) #0 {
504 ; CHECK-LABEL: fmin_2h_immzero:
506 ; CHECK-NEXT: ptrue p0.d
507 ; CHECK-NEXT: fmin z0.h, p0/m, z0.h, #0.0
509 %elt = insertelement <vscale x 2 x half> undef, half 0.000000e+00, i32 0
510 %splat = shufflevector <vscale x 2 x half> %elt, <vscale x 2 x half> undef, <vscale x 2 x i32> zeroinitializer
511 %out = call <vscale x 2 x half> @llvm.minimum.nxv2f16(<vscale x 2 x half> %a, <vscale x 2 x half> %splat)
512 ret <vscale x 2 x half> %out
515 define <vscale x 2 x half> @fmin_2h_immone(<vscale x 2 x half> %a) #0 {
516 ; CHECK-LABEL: fmin_2h_immone:
518 ; CHECK-NEXT: ptrue p0.d
519 ; CHECK-NEXT: fmin z0.h, p0/m, z0.h, #1.0
521 %elt = insertelement <vscale x 2 x half> undef, half 1.000000e+00, i32 0
522 %splat = shufflevector <vscale x 2 x half> %elt, <vscale x 2 x half> undef, <vscale x 2 x i32> zeroinitializer
523 %out = call <vscale x 2 x half> @llvm.minimum.nxv2f16(<vscale x 2 x half> %a, <vscale x 2 x half> %splat)
524 ret <vscale x 2 x half> %out
527 define <vscale x 4 x float> @fmin_s_immzero(<vscale x 4 x float> %a) #0 {
528 ; CHECK-LABEL: fmin_s_immzero:
530 ; CHECK-NEXT: ptrue p0.s
531 ; CHECK-NEXT: fmin z0.s, p0/m, z0.s, #0.0
533 %elt = insertelement <vscale x 4 x float> undef, float 0.000000e+00, i32 0
534 %splat = shufflevector <vscale x 4 x float> %elt, <vscale x 4 x float> undef, <vscale x 4 x i32> zeroinitializer
535 %out = call <vscale x 4 x float> @llvm.minimum.nxv4f32(<vscale x 4 x float> %a, <vscale x 4 x float> %splat)
536 ret <vscale x 4 x float> %out
539 define <vscale x 4 x float> @fmin_s_immone(<vscale x 4 x float> %a) #0 {
540 ; CHECK-LABEL: fmin_s_immone:
542 ; CHECK-NEXT: ptrue p0.s
543 ; CHECK-NEXT: fmin z0.s, p0/m, z0.s, #1.0
545 %elt = insertelement <vscale x 4 x float> undef, float 1.000000e+00, i32 0
546 %splat = shufflevector <vscale x 4 x float> %elt, <vscale x 4 x float> undef, <vscale x 4 x i32> zeroinitializer
547 %out = call <vscale x 4 x float> @llvm.minimum.nxv4f32(<vscale x 4 x float> %a, <vscale x 4 x float> %splat)
548 ret <vscale x 4 x float> %out
551 define <vscale x 2 x float> @fmin_2s_immzero(<vscale x 2 x float> %a) #0 {
552 ; CHECK-LABEL: fmin_2s_immzero:
554 ; CHECK-NEXT: ptrue p0.d
555 ; CHECK-NEXT: fmin z0.s, p0/m, z0.s, #0.0
557 %elt = insertelement <vscale x 2 x float> undef, float 0.000000e+00, i32 0
558 %splat = shufflevector <vscale x 2 x float> %elt, <vscale x 2 x float> undef, <vscale x 2 x i32> zeroinitializer
559 %out = call <vscale x 2 x float> @llvm.minimum.nxv2f32(<vscale x 2 x float> %a, <vscale x 2 x float> %splat)
560 ret <vscale x 2 x float> %out
563 define <vscale x 2 x float> @fmin_2s_immone(<vscale x 2 x float> %a) #0 {
564 ; CHECK-LABEL: fmin_2s_immone:
566 ; CHECK-NEXT: ptrue p0.d
567 ; CHECK-NEXT: fmin z0.s, p0/m, z0.s, #1.0
569 %elt = insertelement <vscale x 2 x float> undef, float 1.000000e+00, i32 0
570 %splat = shufflevector <vscale x 2 x float> %elt, <vscale x 2 x float> undef, <vscale x 2 x i32> zeroinitializer
571 %out = call <vscale x 2 x float> @llvm.minimum.nxv2f32(<vscale x 2 x float> %a, <vscale x 2 x float> %splat)
572 ret <vscale x 2 x float> %out
575 define <vscale x 2 x double> @fmin_d_immzero(<vscale x 2 x double> %a) #0 {
576 ; CHECK-LABEL: fmin_d_immzero:
578 ; CHECK-NEXT: ptrue p0.d
579 ; CHECK-NEXT: fmin z0.d, p0/m, z0.d, #0.0
581 %elt = insertelement <vscale x 2 x double> undef, double 0.000000e+00, i32 0
582 %splat = shufflevector <vscale x 2 x double> %elt, <vscale x 2 x double> undef, <vscale x 2 x i32> zeroinitializer
583 %out = call <vscale x 2 x double> @llvm.minimum.nxv2f64(<vscale x 2 x double> %a, <vscale x 2 x double> %splat)
584 ret <vscale x 2 x double> %out
587 define <vscale x 2 x double> @fmin_d_immone(<vscale x 2 x double> %a) #0 {
588 ; CHECK-LABEL: fmin_d_immone:
590 ; CHECK-NEXT: ptrue p0.d
591 ; CHECK-NEXT: fmin z0.d, p0/m, z0.d, #1.0
593 %elt = insertelement <vscale x 2 x double> undef, double 1.000000e+00, i32 0
594 %splat = shufflevector <vscale x 2 x double> %elt, <vscale x 2 x double> undef, <vscale x 2 x i32> zeroinitializer
595 %out = call <vscale x 2 x double> @llvm.minimum.nxv2f64(<vscale x 2 x double> %a, <vscale x 2 x double> %splat)
596 ret <vscale x 2 x double> %out
603 define <vscale x 8 x half> @fminnm_h_immzero(<vscale x 8 x half> %a) #0 {
604 ; CHECK-LABEL: fminnm_h_immzero:
606 ; CHECK-NEXT: ptrue p0.h
607 ; CHECK-NEXT: fminnm z0.h, p0/m, z0.h, #0.0
609 %elt = insertelement <vscale x 8 x half> undef, half 0.000000e+00, i32 0
610 %splat = shufflevector <vscale x 8 x half> %elt, <vscale x 8 x half> undef, <vscale x 8 x i32> zeroinitializer
611 %out = call <vscale x 8 x half> @llvm.minnum.nxv8f16(<vscale x 8 x half> %a, <vscale x 8 x half> %splat)
612 ret <vscale x 8 x half> %out
615 define <vscale x 8 x half> @fminnm_h_immone(<vscale x 8 x half> %a) #0 {
616 ; CHECK-LABEL: fminnm_h_immone:
618 ; CHECK-NEXT: ptrue p0.h
619 ; CHECK-NEXT: fminnm z0.h, p0/m, z0.h, #1.0
621 %elt = insertelement <vscale x 8 x half> undef, half 1.000000e+00, i32 0
622 %splat = shufflevector <vscale x 8 x half> %elt, <vscale x 8 x half> undef, <vscale x 8 x i32> zeroinitializer
623 %out = call <vscale x 8 x half> @llvm.minnum.nxv8f16(<vscale x 8 x half> %a, <vscale x 8 x half> %splat)
624 ret <vscale x 8 x half> %out
627 define <vscale x 4 x half> @fminnm_4h_immzero(<vscale x 4 x half> %a) #0 {
628 ; CHECK-LABEL: fminnm_4h_immzero:
630 ; CHECK-NEXT: ptrue p0.s
631 ; CHECK-NEXT: fminnm z0.h, p0/m, z0.h, #0.0
633 %elt = insertelement <vscale x 4 x half> undef, half 0.000000e+00, i32 0
634 %splat = shufflevector <vscale x 4 x half> %elt, <vscale x 4 x half> undef, <vscale x 4 x i32> zeroinitializer
635 %out = call <vscale x 4 x half> @llvm.minnum.nxv4f16(<vscale x 4 x half> %a, <vscale x 4 x half> %splat)
636 ret <vscale x 4 x half> %out
639 define <vscale x 4 x half> @fminnm_4h_immone(<vscale x 4 x half> %a) #0 {
640 ; CHECK-LABEL: fminnm_4h_immone:
642 ; CHECK-NEXT: ptrue p0.s
643 ; CHECK-NEXT: fminnm z0.h, p0/m, z0.h, #1.0
645 %elt = insertelement <vscale x 4 x half> undef, half 1.000000e+00, i32 0
646 %splat = shufflevector <vscale x 4 x half> %elt, <vscale x 4 x half> undef, <vscale x 4 x i32> zeroinitializer
647 %out = call <vscale x 4 x half> @llvm.minnum.nxv4f16(<vscale x 4 x half> %a, <vscale x 4 x half> %splat)
648 ret <vscale x 4 x half> %out
651 define <vscale x 2 x half> @fminnm_2h_immzero(<vscale x 2 x half> %a) #0 {
652 ; CHECK-LABEL: fminnm_2h_immzero:
654 ; CHECK-NEXT: ptrue p0.d
655 ; CHECK-NEXT: fminnm z0.h, p0/m, z0.h, #0.0
657 %elt = insertelement <vscale x 2 x half> undef, half 0.000000e+00, i32 0
658 %splat = shufflevector <vscale x 2 x half> %elt, <vscale x 2 x half> undef, <vscale x 2 x i32> zeroinitializer
659 %out = call <vscale x 2 x half> @llvm.minnum.nxv2f16(<vscale x 2 x half> %a, <vscale x 2 x half> %splat)
660 ret <vscale x 2 x half> %out
663 define <vscale x 2 x half> @fminnm_2h_immone(<vscale x 2 x half> %a) #0 {
664 ; CHECK-LABEL: fminnm_2h_immone:
666 ; CHECK-NEXT: ptrue p0.d
667 ; CHECK-NEXT: fminnm z0.h, p0/m, z0.h, #1.0
669 %elt = insertelement <vscale x 2 x half> undef, half 1.000000e+00, i32 0
670 %splat = shufflevector <vscale x 2 x half> %elt, <vscale x 2 x half> undef, <vscale x 2 x i32> zeroinitializer
671 %out = call <vscale x 2 x half> @llvm.minnum.nxv2f16(<vscale x 2 x half> %a, <vscale x 2 x half> %splat)
672 ret <vscale x 2 x half> %out
675 define <vscale x 4 x float> @fminnm_s_immzero(<vscale x 4 x float> %a) #0 {
676 ; CHECK-LABEL: fminnm_s_immzero:
678 ; CHECK-NEXT: ptrue p0.s
679 ; CHECK-NEXT: fminnm z0.s, p0/m, z0.s, #0.0
681 %elt = insertelement <vscale x 4 x float> undef, float 0.000000e+00, i32 0
682 %splat = shufflevector <vscale x 4 x float> %elt, <vscale x 4 x float> undef, <vscale x 4 x i32> zeroinitializer
683 %out = call <vscale x 4 x float> @llvm.minnum.nxv4f32(<vscale x 4 x float> %a, <vscale x 4 x float> %splat)
684 ret <vscale x 4 x float> %out
687 define <vscale x 4 x float> @fminnm_s_immone(<vscale x 4 x float> %a) #0 {
688 ; CHECK-LABEL: fminnm_s_immone:
690 ; CHECK-NEXT: ptrue p0.s
691 ; CHECK-NEXT: fminnm z0.s, p0/m, z0.s, #1.0
693 %elt = insertelement <vscale x 4 x float> undef, float 1.000000e+00, i32 0
694 %splat = shufflevector <vscale x 4 x float> %elt, <vscale x 4 x float> undef, <vscale x 4 x i32> zeroinitializer
695 %out = call <vscale x 4 x float> @llvm.minnum.nxv4f32(<vscale x 4 x float> %a, <vscale x 4 x float> %splat)
696 ret <vscale x 4 x float> %out
699 define <vscale x 2 x float> @fminnm_2s_immzero(<vscale x 2 x float> %a) #0 {
700 ; CHECK-LABEL: fminnm_2s_immzero:
702 ; CHECK-NEXT: ptrue p0.d
703 ; CHECK-NEXT: fminnm z0.s, p0/m, z0.s, #0.0
705 %elt = insertelement <vscale x 2 x float> undef, float 0.000000e+00, i32 0
706 %splat = shufflevector <vscale x 2 x float> %elt, <vscale x 2 x float> undef, <vscale x 2 x i32> zeroinitializer
707 %out = call <vscale x 2 x float> @llvm.minnum.nxv2f32(<vscale x 2 x float> %a, <vscale x 2 x float> %splat)
708 ret <vscale x 2 x float> %out
711 define <vscale x 2 x float> @fminnm_2s_immone(<vscale x 2 x float> %a) #0 {
712 ; CHECK-LABEL: fminnm_2s_immone:
714 ; CHECK-NEXT: ptrue p0.d
715 ; CHECK-NEXT: fminnm z0.s, p0/m, z0.s, #1.0
717 %elt = insertelement <vscale x 2 x float> undef, float 1.000000e+00, i32 0
718 %splat = shufflevector <vscale x 2 x float> %elt, <vscale x 2 x float> undef, <vscale x 2 x i32> zeroinitializer
719 %out = call <vscale x 2 x float> @llvm.minnum.nxv2f32(<vscale x 2 x float> %a, <vscale x 2 x float> %splat)
720 ret <vscale x 2 x float> %out
723 define <vscale x 2 x double> @fminnm_d_immzero(<vscale x 2 x double> %a) #0 {
724 ; CHECK-LABEL: fminnm_d_immzero:
726 ; CHECK-NEXT: ptrue p0.d
727 ; CHECK-NEXT: fminnm z0.d, p0/m, z0.d, #0.0
729 %elt = insertelement <vscale x 2 x double> undef, double 0.000000e+00, i32 0
730 %splat = shufflevector <vscale x 2 x double> %elt, <vscale x 2 x double> undef, <vscale x 2 x i32> zeroinitializer
731 %out = call <vscale x 2 x double> @llvm.minnum.nxv2f64(<vscale x 2 x double> %a, <vscale x 2 x double> %splat)
732 ret <vscale x 2 x double> %out
735 define <vscale x 2 x double> @fminnm_d_immone(<vscale x 2 x double> %a) #0 {
736 ; CHECK-LABEL: fminnm_d_immone:
738 ; CHECK-NEXT: ptrue p0.d
739 ; CHECK-NEXT: fminnm z0.d, p0/m, z0.d, #1.0
741 %elt = insertelement <vscale x 2 x double> undef, double 1.000000e+00, i32 0
742 %splat = shufflevector <vscale x 2 x double> %elt, <vscale x 2 x double> undef, <vscale x 2 x i32> zeroinitializer
743 %out = call <vscale x 2 x double> @llvm.minnum.nxv2f64(<vscale x 2 x double> %a, <vscale x 2 x double> %splat)
744 ret <vscale x 2 x double> %out
751 define <vscale x 8 x half> @fmul_h_immhalf(<vscale x 8 x half> %a) #0 {
752 ; CHECK-LABEL: fmul_h_immhalf:
754 ; CHECK-NEXT: ptrue p0.h
755 ; CHECK-NEXT: fmul z0.h, p0/m, z0.h, #0.5
757 %elt = insertelement <vscale x 8 x half> undef, half 0.500000e+00, i32 0
758 %splat = shufflevector <vscale x 8 x half> %elt, <vscale x 8 x half> undef, <vscale x 8 x i32> zeroinitializer
759 %out = fmul <vscale x 8 x half> %a, %splat
760 ret <vscale x 8 x half> %out
763 define <vscale x 8 x half> @fmul_h_immtwo(<vscale x 8 x half> %a) #0 {
764 ; CHECK-LABEL: fmul_h_immtwo:
766 ; CHECK-NEXT: fadd z0.h, z0.h, z0.h
768 %elt = insertelement <vscale x 8 x half> undef, half 2.000000e+00, i32 0
769 %splat = shufflevector <vscale x 8 x half> %elt, <vscale x 8 x half> undef, <vscale x 8 x i32> zeroinitializer
770 %out = fmul <vscale x 8 x half> %a, %splat
771 ret <vscale x 8 x half> %out
774 define <vscale x 4 x half> @fmul_4h_immhalf(<vscale x 4 x half> %a) #0 {
775 ; CHECK-LABEL: fmul_4h_immhalf:
777 ; CHECK-NEXT: ptrue p0.s
778 ; CHECK-NEXT: fmul z0.h, p0/m, z0.h, #0.5
780 %elt = insertelement <vscale x 4 x half> undef, half 0.500000e+00, i32 0
781 %splat = shufflevector <vscale x 4 x half> %elt, <vscale x 4 x half> undef, <vscale x 4 x i32> zeroinitializer
782 %out = fmul <vscale x 4 x half> %a, %splat
783 ret <vscale x 4 x half> %out
786 define <vscale x 4 x half> @fmul_4h_immtwo(<vscale x 4 x half> %a) #0 {
787 ; CHECK-LABEL: fmul_4h_immtwo:
789 ; CHECK-NEXT: ptrue p0.s
790 ; CHECK-NEXT: fadd z0.h, p0/m, z0.h, z0.h
792 %elt = insertelement <vscale x 4 x half> undef, half 2.000000e+00, i32 0
793 %splat = shufflevector <vscale x 4 x half> %elt, <vscale x 4 x half> undef, <vscale x 4 x i32> zeroinitializer
794 %out = fmul <vscale x 4 x half> %a, %splat
795 ret <vscale x 4 x half> %out
798 define <vscale x 2 x half> @fmul_2h_immhalf(<vscale x 2 x half> %a) #0 {
799 ; CHECK-LABEL: fmul_2h_immhalf:
801 ; CHECK-NEXT: ptrue p0.d
802 ; CHECK-NEXT: fmul z0.h, p0/m, z0.h, #0.5
804 %elt = insertelement <vscale x 2 x half> undef, half 0.500000e+00, i32 0
805 %splat = shufflevector <vscale x 2 x half> %elt, <vscale x 2 x half> undef, <vscale x 2 x i32> zeroinitializer
806 %out = fmul <vscale x 2 x half> %a, %splat
807 ret <vscale x 2 x half> %out
810 define <vscale x 2 x half> @fmul_2h_immtwo(<vscale x 2 x half> %a) #0 {
811 ; CHECK-LABEL: fmul_2h_immtwo:
813 ; CHECK-NEXT: ptrue p0.d
814 ; CHECK-NEXT: fadd z0.h, p0/m, z0.h, z0.h
816 %elt = insertelement <vscale x 2 x half> undef, half 2.000000e+00, i32 0
817 %splat = shufflevector <vscale x 2 x half> %elt, <vscale x 2 x half> undef, <vscale x 2 x i32> zeroinitializer
818 %out = fmul <vscale x 2 x half> %a, %splat
819 ret <vscale x 2 x half> %out
822 define <vscale x 4 x float> @fmul_s_immhalf(<vscale x 4 x float> %a) #0 {
823 ; CHECK-LABEL: fmul_s_immhalf:
825 ; CHECK-NEXT: ptrue p0.s
826 ; CHECK-NEXT: fmul z0.s, p0/m, z0.s, #0.5
828 %elt = insertelement <vscale x 4 x float> undef, float 0.500000e+00, i32 0
829 %splat = shufflevector <vscale x 4 x float> %elt, <vscale x 4 x float> undef, <vscale x 4 x i32> zeroinitializer
830 %out = fmul <vscale x 4 x float> %a, %splat
831 ret <vscale x 4 x float> %out
834 define <vscale x 4 x float> @fmul_s_immtwo(<vscale x 4 x float> %a) #0 {
835 ; CHECK-LABEL: fmul_s_immtwo:
837 ; CHECK-NEXT: fadd z0.s, z0.s, z0.s
839 %elt = insertelement <vscale x 4 x float> undef, float 2.000000e+00, i32 0
840 %splat = shufflevector <vscale x 4 x float> %elt, <vscale x 4 x float> undef, <vscale x 4 x i32> zeroinitializer
841 %out = fmul <vscale x 4 x float> %a, %splat
842 ret <vscale x 4 x float> %out
845 define <vscale x 2 x float> @fmul_2s_immhalf(<vscale x 2 x float> %a) #0 {
846 ; CHECK-LABEL: fmul_2s_immhalf:
848 ; CHECK-NEXT: ptrue p0.d
849 ; CHECK-NEXT: fmul z0.s, p0/m, z0.s, #0.5
851 %elt = insertelement <vscale x 2 x float> undef, float 0.500000e+00, i32 0
852 %splat = shufflevector <vscale x 2 x float> %elt, <vscale x 2 x float> undef, <vscale x 2 x i32> zeroinitializer
853 %out = fmul <vscale x 2 x float> %a, %splat
854 ret <vscale x 2 x float> %out
857 define <vscale x 2 x float> @fmul_2s_immtwo(<vscale x 2 x float> %a) #0 {
858 ; CHECK-LABEL: fmul_2s_immtwo:
860 ; CHECK-NEXT: ptrue p0.d
861 ; CHECK-NEXT: fadd z0.s, p0/m, z0.s, z0.s
863 %elt = insertelement <vscale x 2 x float> undef, float 2.000000e+00, i32 0
864 %splat = shufflevector <vscale x 2 x float> %elt, <vscale x 2 x float> undef, <vscale x 2 x i32> zeroinitializer
865 %out = fmul <vscale x 2 x float> %a, %splat
866 ret <vscale x 2 x float> %out
869 define <vscale x 2 x double> @fmul_d_immhalf(<vscale x 2 x double> %a) #0 {
870 ; CHECK-LABEL: fmul_d_immhalf:
872 ; CHECK-NEXT: ptrue p0.d
873 ; CHECK-NEXT: fmul z0.d, p0/m, z0.d, #0.5
875 %elt = insertelement <vscale x 2 x double> undef, double 0.500000e+00, i32 0
876 %splat = shufflevector <vscale x 2 x double> %elt, <vscale x 2 x double> undef, <vscale x 2 x i32> zeroinitializer
877 %out = fmul <vscale x 2 x double> %a, %splat
878 ret <vscale x 2 x double> %out
881 define <vscale x 2 x double> @fmul_d_immtwo(<vscale x 2 x double> %a) #0 {
882 ; CHECK-LABEL: fmul_d_immtwo:
884 ; CHECK-NEXT: fadd z0.d, z0.d, z0.d
886 %elt = insertelement <vscale x 2 x double> undef, double 2.000000e+00, i32 0
887 %splat = shufflevector <vscale x 2 x double> %elt, <vscale x 2 x double> undef, <vscale x 2 x i32> zeroinitializer
888 %out = fmul <vscale x 2 x double> %a, %splat
889 ret <vscale x 2 x double> %out
896 define <vscale x 8 x half> @fsub_h_immhalf(<vscale x 8 x half> %a) #0 {
897 ; CHECK-LABEL: fsub_h_immhalf:
899 ; CHECK-NEXT: ptrue p0.h
900 ; CHECK-NEXT: fsub z0.h, p0/m, z0.h, #0.5
902 %elt = insertelement <vscale x 8 x half> undef, half 0.500000e+00, i32 0
903 %splat = shufflevector <vscale x 8 x half> %elt, <vscale x 8 x half> undef, <vscale x 8 x i32> zeroinitializer
904 %out = fsub <vscale x 8 x half> %a, %splat
905 ret <vscale x 8 x half> %out
908 define <vscale x 8 x half> @fsub_h_immone(<vscale x 8 x half> %a) #0 {
909 ; CHECK-LABEL: fsub_h_immone:
911 ; CHECK-NEXT: ptrue p0.h
912 ; CHECK-NEXT: fsub z0.h, p0/m, z0.h, #1.0
914 %elt = insertelement <vscale x 8 x half> undef, half 1.000000e+00, i32 0
915 %splat = shufflevector <vscale x 8 x half> %elt, <vscale x 8 x half> undef, <vscale x 8 x i32> zeroinitializer
916 %out = fsub <vscale x 8 x half> %a, %splat
917 ret <vscale x 8 x half> %out
920 define <vscale x 4 x half> @fsub_4h_immhalf(<vscale x 4 x half> %a) #0 {
921 ; CHECK-LABEL: fsub_4h_immhalf:
923 ; CHECK-NEXT: ptrue p0.s
924 ; CHECK-NEXT: fsub z0.h, p0/m, z0.h, #0.5
926 %elt = insertelement <vscale x 4 x half> undef, half 0.500000e+00, i32 0
927 %splat = shufflevector <vscale x 4 x half> %elt, <vscale x 4 x half> undef, <vscale x 4 x i32> zeroinitializer
928 %out = fsub <vscale x 4 x half> %a, %splat
929 ret <vscale x 4 x half> %out
932 define <vscale x 4 x half> @fsub_4h_immone(<vscale x 4 x half> %a) #0 {
933 ; CHECK-LABEL: fsub_4h_immone:
935 ; CHECK-NEXT: ptrue p0.s
936 ; CHECK-NEXT: fsub z0.h, p0/m, z0.h, #1.0
938 %elt = insertelement <vscale x 4 x half> undef, half 1.000000e+00, i32 0
939 %splat = shufflevector <vscale x 4 x half> %elt, <vscale x 4 x half> undef, <vscale x 4 x i32> zeroinitializer
940 %out = fsub <vscale x 4 x half> %a, %splat
941 ret <vscale x 4 x half> %out
944 define <vscale x 2 x half> @fsub_2h_immhalf(<vscale x 2 x half> %a) #0 {
945 ; CHECK-LABEL: fsub_2h_immhalf:
947 ; CHECK-NEXT: ptrue p0.d
948 ; CHECK-NEXT: fsub z0.h, p0/m, z0.h, #0.5
950 %elt = insertelement <vscale x 2 x half> undef, half 0.500000e+00, i32 0
951 %splat = shufflevector <vscale x 2 x half> %elt, <vscale x 2 x half> undef, <vscale x 2 x i32> zeroinitializer
952 %out = fsub <vscale x 2 x half> %a, %splat
953 ret <vscale x 2 x half> %out
956 define <vscale x 2 x half> @fsub_2h_immone(<vscale x 2 x half> %a) #0 {
957 ; CHECK-LABEL: fsub_2h_immone:
959 ; CHECK-NEXT: ptrue p0.d
960 ; CHECK-NEXT: fsub z0.h, p0/m, z0.h, #1.0
962 %elt = insertelement <vscale x 2 x half> undef, half 1.000000e+00, i32 0
963 %splat = shufflevector <vscale x 2 x half> %elt, <vscale x 2 x half> undef, <vscale x 2 x i32> zeroinitializer
964 %out = fsub <vscale x 2 x half> %a, %splat
965 ret <vscale x 2 x half> %out
968 define <vscale x 4 x float> @fsub_s_immhalf(<vscale x 4 x float> %a) #0 {
969 ; CHECK-LABEL: fsub_s_immhalf:
971 ; CHECK-NEXT: ptrue p0.s
972 ; CHECK-NEXT: fsub z0.s, p0/m, z0.s, #0.5
974 %elt = insertelement <vscale x 4 x float> undef, float 0.500000e+00, i32 0
975 %splat = shufflevector <vscale x 4 x float> %elt, <vscale x 4 x float> undef, <vscale x 4 x i32> zeroinitializer
976 %out = fsub <vscale x 4 x float> %a, %splat
977 ret <vscale x 4 x float> %out
980 define <vscale x 4 x float> @fsub_s_immone(<vscale x 4 x float> %a) #0 {
981 ; CHECK-LABEL: fsub_s_immone:
983 ; CHECK-NEXT: ptrue p0.s
984 ; CHECK-NEXT: fsub z0.s, p0/m, z0.s, #1.0
986 %elt = insertelement <vscale x 4 x float> undef, float 1.000000e+00, i32 0
987 %splat = shufflevector <vscale x 4 x float> %elt, <vscale x 4 x float> undef, <vscale x 4 x i32> zeroinitializer
988 %out = fsub <vscale x 4 x float> %a, %splat
989 ret <vscale x 4 x float> %out
992 define <vscale x 2 x float> @fsub_2s_immhalf(<vscale x 2 x float> %a) #0 {
993 ; CHECK-LABEL: fsub_2s_immhalf:
995 ; CHECK-NEXT: ptrue p0.d
996 ; CHECK-NEXT: fsub z0.s, p0/m, z0.s, #0.5
998 %elt = insertelement <vscale x 2 x float> undef, float 0.500000e+00, i32 0
999 %splat = shufflevector <vscale x 2 x float> %elt, <vscale x 2 x float> undef, <vscale x 2 x i32> zeroinitializer
1000 %out = fsub <vscale x 2 x float> %a, %splat
1001 ret <vscale x 2 x float> %out
1004 define <vscale x 2 x float> @fsub_2s_immone(<vscale x 2 x float> %a) #0 {
1005 ; CHECK-LABEL: fsub_2s_immone:
1007 ; CHECK-NEXT: ptrue p0.d
1008 ; CHECK-NEXT: fsub z0.s, p0/m, z0.s, #1.0
1010 %elt = insertelement <vscale x 2 x float> undef, float 1.000000e+00, i32 0
1011 %splat = shufflevector <vscale x 2 x float> %elt, <vscale x 2 x float> undef, <vscale x 2 x i32> zeroinitializer
1012 %out = fsub <vscale x 2 x float> %a, %splat
1013 ret <vscale x 2 x float> %out
1016 define <vscale x 2 x double> @fsub_d_immhalf(<vscale x 2 x double> %a) #0 {
1017 ; CHECK-LABEL: fsub_d_immhalf:
1019 ; CHECK-NEXT: ptrue p0.d
1020 ; CHECK-NEXT: fsub z0.d, p0/m, z0.d, #0.5
1022 %elt = insertelement <vscale x 2 x double> undef, double 0.500000e+00, i32 0
1023 %splat = shufflevector <vscale x 2 x double> %elt, <vscale x 2 x double> undef, <vscale x 2 x i32> zeroinitializer
1024 %out = fsub <vscale x 2 x double> %a, %splat
1025 ret <vscale x 2 x double> %out
1028 define <vscale x 2 x double> @fsub_d_immone(<vscale x 2 x double> %a) #0 {
1029 ; CHECK-LABEL: fsub_d_immone:
1031 ; CHECK-NEXT: ptrue p0.d
1032 ; CHECK-NEXT: fsub z0.d, p0/m, z0.d, #1.0
1034 %elt = insertelement <vscale x 2 x double> undef, double 1.000000e+00, i32 0
1035 %splat = shufflevector <vscale x 2 x double> %elt, <vscale x 2 x double> undef, <vscale x 2 x i32> zeroinitializer
1036 %out = fsub <vscale x 2 x double> %a, %splat
1037 ret <vscale x 2 x double> %out
1044 define <vscale x 8 x half> @fsubr_h_immhalf(<vscale x 8 x half> %a) #0 {
1045 ; CHECK-LABEL: fsubr_h_immhalf:
1047 ; CHECK-NEXT: ptrue p0.h
1048 ; CHECK-NEXT: fsubr z0.h, p0/m, z0.h, #0.5
1050 %elt = insertelement <vscale x 8 x half> undef, half 0.500000e+00, i32 0
1051 %splat = shufflevector <vscale x 8 x half> %elt, <vscale x 8 x half> undef, <vscale x 8 x i32> zeroinitializer
1052 %out = fsub <vscale x 8 x half> %splat, %a
1053 ret <vscale x 8 x half> %out
1056 define <vscale x 8 x half> @fsubr_h_immone(<vscale x 8 x half> %a) #0 {
1057 ; CHECK-LABEL: fsubr_h_immone:
1059 ; CHECK-NEXT: ptrue p0.h
1060 ; CHECK-NEXT: fsubr z0.h, p0/m, z0.h, #1.0
1062 %elt = insertelement <vscale x 8 x half> undef, half 1.000000e+00, i32 0
1063 %splat = shufflevector <vscale x 8 x half> %elt, <vscale x 8 x half> undef, <vscale x 8 x i32> zeroinitializer
1064 %out = fsub <vscale x 8 x half> %splat, %a
1065 ret <vscale x 8 x half> %out
1068 define <vscale x 4 x half> @fsubr_4h_immhalf(<vscale x 4 x half> %a) #0 {
1069 ; CHECK-LABEL: fsubr_4h_immhalf:
1071 ; CHECK-NEXT: ptrue p0.s
1072 ; CHECK-NEXT: fsubr z0.h, p0/m, z0.h, #0.5
1074 %elt = insertelement <vscale x 4 x half> undef, half 0.500000e+00, i32 0
1075 %splat = shufflevector <vscale x 4 x half> %elt, <vscale x 4 x half> undef, <vscale x 4 x i32> zeroinitializer
1076 %out = fsub <vscale x 4 x half> %splat, %a
1077 ret <vscale x 4 x half> %out
1080 define <vscale x 4 x half> @fsubr_4h_immone(<vscale x 4 x half> %a) #0 {
1081 ; CHECK-LABEL: fsubr_4h_immone:
1083 ; CHECK-NEXT: ptrue p0.s
1084 ; CHECK-NEXT: fsubr z0.h, p0/m, z0.h, #1.0
1086 %elt = insertelement <vscale x 4 x half> undef, half 1.000000e+00, i32 0
1087 %splat = shufflevector <vscale x 4 x half> %elt, <vscale x 4 x half> undef, <vscale x 4 x i32> zeroinitializer
1088 %out = fsub <vscale x 4 x half> %splat, %a
1089 ret <vscale x 4 x half> %out
1092 define <vscale x 2 x half> @fsubr_2h_immhalf(<vscale x 2 x half> %a) #0 {
1093 ; CHECK-LABEL: fsubr_2h_immhalf:
1095 ; CHECK-NEXT: ptrue p0.d
1096 ; CHECK-NEXT: fsubr z0.h, p0/m, z0.h, #0.5
1098 %elt = insertelement <vscale x 2 x half> undef, half 0.500000e+00, i32 0
1099 %splat = shufflevector <vscale x 2 x half> %elt, <vscale x 2 x half> undef, <vscale x 2 x i32> zeroinitializer
1100 %out = fsub <vscale x 2 x half> %splat, %a
1101 ret <vscale x 2 x half> %out
1104 define <vscale x 2 x half> @fsubr_2h_immone(<vscale x 2 x half> %a) #0 {
1105 ; CHECK-LABEL: fsubr_2h_immone:
1107 ; CHECK-NEXT: ptrue p0.d
1108 ; CHECK-NEXT: fsubr z0.h, p0/m, z0.h, #1.0
1110 %elt = insertelement <vscale x 2 x half> undef, half 1.000000e+00, i32 0
1111 %splat = shufflevector <vscale x 2 x half> %elt, <vscale x 2 x half> undef, <vscale x 2 x i32> zeroinitializer
1112 %out = fsub <vscale x 2 x half> %splat, %a
1113 ret <vscale x 2 x half> %out
1116 define <vscale x 4 x float> @fsubr_s_immhalf(<vscale x 4 x float> %a) #0 {
1117 ; CHECK-LABEL: fsubr_s_immhalf:
1119 ; CHECK-NEXT: ptrue p0.s
1120 ; CHECK-NEXT: fsubr z0.s, p0/m, z0.s, #0.5
1122 %elt = insertelement <vscale x 4 x float> undef, float 0.500000e+00, i32 0
1123 %splat = shufflevector <vscale x 4 x float> %elt, <vscale x 4 x float> undef, <vscale x 4 x i32> zeroinitializer
1124 %out = fsub <vscale x 4 x float> %splat, %a
1125 ret <vscale x 4 x float> %out
1128 define <vscale x 4 x float> @fsubr_s_immone(<vscale x 4 x float> %a) #0 {
1129 ; CHECK-LABEL: fsubr_s_immone:
1131 ; CHECK-NEXT: ptrue p0.s
1132 ; CHECK-NEXT: fsubr z0.s, p0/m, z0.s, #1.0
1134 %elt = insertelement <vscale x 4 x float> undef, float 1.000000e+00, i32 0
1135 %splat = shufflevector <vscale x 4 x float> %elt, <vscale x 4 x float> undef, <vscale x 4 x i32> zeroinitializer
1136 %out = fsub <vscale x 4 x float> %splat, %a
1137 ret <vscale x 4 x float> %out
1140 define <vscale x 2 x float> @fsubr_2s_immhalf(<vscale x 2 x float> %a) #0 {
1141 ; CHECK-LABEL: fsubr_2s_immhalf:
1143 ; CHECK-NEXT: ptrue p0.d
1144 ; CHECK-NEXT: fsubr z0.s, p0/m, z0.s, #0.5
1146 %elt = insertelement <vscale x 2 x float> undef, float 0.500000e+00, i32 0
1147 %splat = shufflevector <vscale x 2 x float> %elt, <vscale x 2 x float> undef, <vscale x 2 x i32> zeroinitializer
1148 %out = fsub <vscale x 2 x float> %splat, %a
1149 ret <vscale x 2 x float> %out
1152 define <vscale x 2 x float> @fsubr_2s_immone(<vscale x 2 x float> %a) #0 {
1153 ; CHECK-LABEL: fsubr_2s_immone:
1155 ; CHECK-NEXT: ptrue p0.d
1156 ; CHECK-NEXT: fsubr z0.s, p0/m, z0.s, #1.0
1158 %elt = insertelement <vscale x 2 x float> undef, float 1.000000e+00, i32 0
1159 %splat = shufflevector <vscale x 2 x float> %elt, <vscale x 2 x float> undef, <vscale x 2 x i32> zeroinitializer
1160 %out = fsub <vscale x 2 x float> %splat, %a
1161 ret <vscale x 2 x float> %out
1164 define <vscale x 2 x double> @fsubr_d_immhalf(<vscale x 2 x double> %a) #0 {
1165 ; CHECK-LABEL: fsubr_d_immhalf:
1167 ; CHECK-NEXT: ptrue p0.d
1168 ; CHECK-NEXT: fsubr z0.d, p0/m, z0.d, #0.5
1170 %elt = insertelement <vscale x 2 x double> undef, double 0.500000e+00, i32 0
1171 %splat = shufflevector <vscale x 2 x double> %elt, <vscale x 2 x double> undef, <vscale x 2 x i32> zeroinitializer
1172 %out = fsub <vscale x 2 x double> %splat, %a
1173 ret <vscale x 2 x double> %out
1176 define <vscale x 2 x double> @fsubr_d_immone(<vscale x 2 x double> %a) #0 {
1177 ; CHECK-LABEL: fsubr_d_immone:
1179 ; CHECK-NEXT: ptrue p0.d
1180 ; CHECK-NEXT: fsubr z0.d, p0/m, z0.d, #1.0
1182 %elt = insertelement <vscale x 2 x double> undef, double 1.000000e+00, i32 0
1183 %splat = shufflevector <vscale x 2 x double> %elt, <vscale x 2 x double> undef, <vscale x 2 x i32> zeroinitializer
1184 %out = fsub <vscale x 2 x double> %splat, %a
1185 ret <vscale x 2 x double> %out
1188 ;; Arithmetic intrinsic declarations
1190 declare <vscale x 8 x half> @llvm.maximum.nxv8f16(<vscale x 8 x half>, <vscale x 8 x half>)
1191 declare <vscale x 4 x half> @llvm.maximum.nxv4f16(<vscale x 4 x half>, <vscale x 4 x half>)
1192 declare <vscale x 2 x half> @llvm.maximum.nxv2f16(<vscale x 2 x half>, <vscale x 2 x half>)
1193 declare <vscale x 4 x float> @llvm.maximum.nxv4f32(<vscale x 4 x float>, <vscale x 4 x float>)
1194 declare <vscale x 2 x float> @llvm.maximum.nxv2f32(<vscale x 2 x float>, <vscale x 2 x float>)
1195 declare <vscale x 2 x double> @llvm.maximum.nxv2f64(<vscale x 2 x double>, <vscale x 2 x double>)
1197 declare <vscale x 8 x half> @llvm.maxnum.nxv8f16(<vscale x 8 x half>, <vscale x 8 x half>)
1198 declare <vscale x 4 x half> @llvm.maxnum.nxv4f16(<vscale x 4 x half>, <vscale x 4 x half>)
1199 declare <vscale x 2 x half> @llvm.maxnum.nxv2f16(<vscale x 2 x half>, <vscale x 2 x half>)
1200 declare <vscale x 4 x float> @llvm.maxnum.nxv4f32(<vscale x 4 x float>, <vscale x 4 x float>)
1201 declare <vscale x 2 x float> @llvm.maxnum.nxv2f32(<vscale x 2 x float>, <vscale x 2 x float>)
1202 declare <vscale x 2 x double> @llvm.maxnum.nxv2f64(<vscale x 2 x double>, <vscale x 2 x double>)
1204 declare <vscale x 8 x half> @llvm.minimum.nxv8f16(<vscale x 8 x half>, <vscale x 8 x half>)
1205 declare <vscale x 4 x half> @llvm.minimum.nxv4f16(<vscale x 4 x half>, <vscale x 4 x half>)
1206 declare <vscale x 2 x half> @llvm.minimum.nxv2f16(<vscale x 2 x half>, <vscale x 2 x half>)
1207 declare <vscale x 4 x float> @llvm.minimum.nxv4f32(<vscale x 4 x float>, <vscale x 4 x float>)
1208 declare <vscale x 2 x float> @llvm.minimum.nxv2f32(<vscale x 2 x float>, <vscale x 2 x float>)
1209 declare <vscale x 2 x double> @llvm.minimum.nxv2f64(<vscale x 2 x double>, <vscale x 2 x double>)
1211 declare <vscale x 8 x half> @llvm.minnum.nxv8f16(<vscale x 8 x half>, <vscale x 8 x half>)
1212 declare <vscale x 4 x half> @llvm.minnum.nxv4f16(<vscale x 4 x half>, <vscale x 4 x half>)
1213 declare <vscale x 2 x half> @llvm.minnum.nxv2f16(<vscale x 2 x half>, <vscale x 2 x half>)
1214 declare <vscale x 4 x float> @llvm.minnum.nxv4f32(<vscale x 4 x float>, <vscale x 4 x float>)
1215 declare <vscale x 2 x float> @llvm.minnum.nxv2f32(<vscale x 2 x float>, <vscale x 2 x float>)
1216 declare <vscale x 2 x double> @llvm.minnum.nxv2f64(<vscale x 2 x double>, <vscale x 2 x double>)
1218 attributes #0 = { "target-features"="+sve" }
1219 attributes #1 = { "target-features"="+sve,+use-experimental-zeroing-pseudos" }