[RISCV][VLOPT] Add vector narrowing integer right shift instructions to isSupportedIn...
[llvm-project.git] / llvm / test / CodeGen / AArch64 / sve-streaming-mode-fixed-length-fp-rounding.ll
blob03bc39a6ef3ee1c6e5eb827e5fa69e2b832c1f06
1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mattr=+sve -force-streaming-compatible  < %s | FileCheck %s
3 ; RUN: llc -mattr=+sme -force-streaming  < %s | FileCheck %s
4 ; RUN: llc -force-streaming-compatible < %s | FileCheck %s --check-prefix=NONEON-NOSVE
6 target triple = "aarch64-unknown-linux-gnu"
9 ; CEIL -> FRINTP
12 define <2 x half> @frintp_v2f16(<2 x half> %op) {
13 ; CHECK-LABEL: frintp_v2f16:
14 ; CHECK:       // %bb.0:
15 ; CHECK-NEXT:    ptrue p0.h, vl4
16 ; CHECK-NEXT:    // kill: def $d0 killed $d0 def $z0
17 ; CHECK-NEXT:    frintp z0.h, p0/m, z0.h
18 ; CHECK-NEXT:    // kill: def $d0 killed $d0 killed $z0
19 ; CHECK-NEXT:    ret
21 ; NONEON-NOSVE-LABEL: frintp_v2f16:
22 ; NONEON-NOSVE:       // %bb.0:
23 ; NONEON-NOSVE-NEXT:    str d0, [sp, #-16]!
24 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 16
25 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #6]
26 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
27 ; NONEON-NOSVE-NEXT:    frintp s0, s0
28 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
29 ; NONEON-NOSVE-NEXT:    str h0, [sp, #14]
30 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #4]
31 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
32 ; NONEON-NOSVE-NEXT:    frintp s0, s0
33 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
34 ; NONEON-NOSVE-NEXT:    str h0, [sp, #12]
35 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #2]
36 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
37 ; NONEON-NOSVE-NEXT:    frintp s0, s0
38 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
39 ; NONEON-NOSVE-NEXT:    str h0, [sp, #10]
40 ; NONEON-NOSVE-NEXT:    ldr h0, [sp]
41 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
42 ; NONEON-NOSVE-NEXT:    frintp s0, s0
43 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
44 ; NONEON-NOSVE-NEXT:    str h0, [sp, #8]
45 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
46 ; NONEON-NOSVE-NEXT:    add sp, sp, #16
47 ; NONEON-NOSVE-NEXT:    ret
48   %res = call <2 x half> @llvm.ceil.v2f16(<2 x half> %op)
49   ret <2 x half> %res
52 define <4 x half> @frintp_v4f16(<4 x half> %op) {
53 ; CHECK-LABEL: frintp_v4f16:
54 ; CHECK:       // %bb.0:
55 ; CHECK-NEXT:    ptrue p0.h, vl4
56 ; CHECK-NEXT:    // kill: def $d0 killed $d0 def $z0
57 ; CHECK-NEXT:    frintp z0.h, p0/m, z0.h
58 ; CHECK-NEXT:    // kill: def $d0 killed $d0 killed $z0
59 ; CHECK-NEXT:    ret
61 ; NONEON-NOSVE-LABEL: frintp_v4f16:
62 ; NONEON-NOSVE:       // %bb.0:
63 ; NONEON-NOSVE-NEXT:    str d0, [sp, #-16]!
64 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 16
65 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #6]
66 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
67 ; NONEON-NOSVE-NEXT:    frintp s0, s0
68 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
69 ; NONEON-NOSVE-NEXT:    str h0, [sp, #14]
70 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #4]
71 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
72 ; NONEON-NOSVE-NEXT:    frintp s0, s0
73 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
74 ; NONEON-NOSVE-NEXT:    str h0, [sp, #12]
75 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #2]
76 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
77 ; NONEON-NOSVE-NEXT:    frintp s0, s0
78 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
79 ; NONEON-NOSVE-NEXT:    str h0, [sp, #10]
80 ; NONEON-NOSVE-NEXT:    ldr h0, [sp]
81 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
82 ; NONEON-NOSVE-NEXT:    frintp s0, s0
83 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
84 ; NONEON-NOSVE-NEXT:    str h0, [sp, #8]
85 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
86 ; NONEON-NOSVE-NEXT:    add sp, sp, #16
87 ; NONEON-NOSVE-NEXT:    ret
88   %res = call <4 x half> @llvm.ceil.v4f16(<4 x half> %op)
89   ret <4 x half> %res
92 define <8 x half> @frintp_v8f16(<8 x half> %op) {
93 ; CHECK-LABEL: frintp_v8f16:
94 ; CHECK:       // %bb.0:
95 ; CHECK-NEXT:    ptrue p0.h, vl8
96 ; CHECK-NEXT:    // kill: def $q0 killed $q0 def $z0
97 ; CHECK-NEXT:    frintp z0.h, p0/m, z0.h
98 ; CHECK-NEXT:    // kill: def $q0 killed $q0 killed $z0
99 ; CHECK-NEXT:    ret
101 ; NONEON-NOSVE-LABEL: frintp_v8f16:
102 ; NONEON-NOSVE:       // %bb.0:
103 ; NONEON-NOSVE-NEXT:    str q0, [sp, #-32]!
104 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 32
105 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #14]
106 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
107 ; NONEON-NOSVE-NEXT:    frintp s0, s0
108 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
109 ; NONEON-NOSVE-NEXT:    str h0, [sp, #30]
110 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #12]
111 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
112 ; NONEON-NOSVE-NEXT:    frintp s0, s0
113 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
114 ; NONEON-NOSVE-NEXT:    str h0, [sp, #28]
115 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #10]
116 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
117 ; NONEON-NOSVE-NEXT:    frintp s0, s0
118 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
119 ; NONEON-NOSVE-NEXT:    str h0, [sp, #26]
120 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #8]
121 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
122 ; NONEON-NOSVE-NEXT:    frintp s0, s0
123 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
124 ; NONEON-NOSVE-NEXT:    str h0, [sp, #24]
125 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #6]
126 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
127 ; NONEON-NOSVE-NEXT:    frintp s0, s0
128 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
129 ; NONEON-NOSVE-NEXT:    str h0, [sp, #22]
130 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #4]
131 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
132 ; NONEON-NOSVE-NEXT:    frintp s0, s0
133 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
134 ; NONEON-NOSVE-NEXT:    str h0, [sp, #20]
135 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #2]
136 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
137 ; NONEON-NOSVE-NEXT:    frintp s0, s0
138 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
139 ; NONEON-NOSVE-NEXT:    str h0, [sp, #18]
140 ; NONEON-NOSVE-NEXT:    ldr h0, [sp]
141 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
142 ; NONEON-NOSVE-NEXT:    frintp s0, s0
143 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
144 ; NONEON-NOSVE-NEXT:    str h0, [sp, #16]
145 ; NONEON-NOSVE-NEXT:    ldr q0, [sp, #16]
146 ; NONEON-NOSVE-NEXT:    add sp, sp, #32
147 ; NONEON-NOSVE-NEXT:    ret
148   %res = call <8 x half> @llvm.ceil.v8f16(<8 x half> %op)
149   ret <8 x half> %res
152 define void @frintp_v16f16(ptr %a) {
153 ; CHECK-LABEL: frintp_v16f16:
154 ; CHECK:       // %bb.0:
155 ; CHECK-NEXT:    ldp q0, q1, [x0]
156 ; CHECK-NEXT:    ptrue p0.h, vl8
157 ; CHECK-NEXT:    frintp z0.h, p0/m, z0.h
158 ; CHECK-NEXT:    frintp z1.h, p0/m, z1.h
159 ; CHECK-NEXT:    stp q0, q1, [x0]
160 ; CHECK-NEXT:    ret
162 ; NONEON-NOSVE-LABEL: frintp_v16f16:
163 ; NONEON-NOSVE:       // %bb.0:
164 ; NONEON-NOSVE-NEXT:    ldp q1, q0, [x0]
165 ; NONEON-NOSVE-NEXT:    stp q1, q0, [sp, #-64]!
166 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 64
167 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #30]
168 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
169 ; NONEON-NOSVE-NEXT:    frintp s0, s0
170 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
171 ; NONEON-NOSVE-NEXT:    str h0, [sp, #62]
172 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #28]
173 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
174 ; NONEON-NOSVE-NEXT:    frintp s0, s0
175 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
176 ; NONEON-NOSVE-NEXT:    str h0, [sp, #60]
177 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #26]
178 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
179 ; NONEON-NOSVE-NEXT:    frintp s0, s0
180 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
181 ; NONEON-NOSVE-NEXT:    str h0, [sp, #58]
182 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #24]
183 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
184 ; NONEON-NOSVE-NEXT:    frintp s0, s0
185 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
186 ; NONEON-NOSVE-NEXT:    str h0, [sp, #56]
187 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #22]
188 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
189 ; NONEON-NOSVE-NEXT:    frintp s0, s0
190 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
191 ; NONEON-NOSVE-NEXT:    str h0, [sp, #54]
192 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #20]
193 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
194 ; NONEON-NOSVE-NEXT:    frintp s0, s0
195 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
196 ; NONEON-NOSVE-NEXT:    str h0, [sp, #52]
197 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #18]
198 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
199 ; NONEON-NOSVE-NEXT:    frintp s0, s0
200 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
201 ; NONEON-NOSVE-NEXT:    str h0, [sp, #50]
202 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #16]
203 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
204 ; NONEON-NOSVE-NEXT:    frintp s0, s0
205 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
206 ; NONEON-NOSVE-NEXT:    str h0, [sp, #48]
207 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #14]
208 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
209 ; NONEON-NOSVE-NEXT:    frintp s0, s0
210 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
211 ; NONEON-NOSVE-NEXT:    str h0, [sp, #46]
212 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #12]
213 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
214 ; NONEON-NOSVE-NEXT:    frintp s0, s0
215 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
216 ; NONEON-NOSVE-NEXT:    str h0, [sp, #44]
217 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #10]
218 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
219 ; NONEON-NOSVE-NEXT:    frintp s0, s0
220 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
221 ; NONEON-NOSVE-NEXT:    str h0, [sp, #42]
222 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #8]
223 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
224 ; NONEON-NOSVE-NEXT:    frintp s0, s0
225 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
226 ; NONEON-NOSVE-NEXT:    str h0, [sp, #40]
227 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #6]
228 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
229 ; NONEON-NOSVE-NEXT:    frintp s0, s0
230 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
231 ; NONEON-NOSVE-NEXT:    str h0, [sp, #38]
232 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #4]
233 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
234 ; NONEON-NOSVE-NEXT:    frintp s0, s0
235 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
236 ; NONEON-NOSVE-NEXT:    str h0, [sp, #36]
237 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #2]
238 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
239 ; NONEON-NOSVE-NEXT:    frintp s0, s0
240 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
241 ; NONEON-NOSVE-NEXT:    str h0, [sp, #34]
242 ; NONEON-NOSVE-NEXT:    ldr h0, [sp]
243 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
244 ; NONEON-NOSVE-NEXT:    frintp s0, s0
245 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
246 ; NONEON-NOSVE-NEXT:    str h0, [sp, #32]
247 ; NONEON-NOSVE-NEXT:    ldp q0, q1, [sp, #32]
248 ; NONEON-NOSVE-NEXT:    stp q0, q1, [x0]
249 ; NONEON-NOSVE-NEXT:    add sp, sp, #64
250 ; NONEON-NOSVE-NEXT:    ret
251   %op = load <16 x half>, ptr %a
252   %res = call <16 x half> @llvm.ceil.v16f16(<16 x half> %op)
253   store <16 x half> %res, ptr %a
254   ret void
257 define <2 x float> @frintp_v2f32(<2 x float> %op) {
258 ; CHECK-LABEL: frintp_v2f32:
259 ; CHECK:       // %bb.0:
260 ; CHECK-NEXT:    ptrue p0.s, vl2
261 ; CHECK-NEXT:    // kill: def $d0 killed $d0 def $z0
262 ; CHECK-NEXT:    frintp z0.s, p0/m, z0.s
263 ; CHECK-NEXT:    // kill: def $d0 killed $d0 killed $z0
264 ; CHECK-NEXT:    ret
266 ; NONEON-NOSVE-LABEL: frintp_v2f32:
267 ; NONEON-NOSVE:       // %bb.0:
268 ; NONEON-NOSVE-NEXT:    str d0, [sp, #-16]!
269 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 16
270 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #4]
271 ; NONEON-NOSVE-NEXT:    frintp s1, s0
272 ; NONEON-NOSVE-NEXT:    ldr s0, [sp]
273 ; NONEON-NOSVE-NEXT:    frintp s0, s0
274 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #8]
275 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
276 ; NONEON-NOSVE-NEXT:    add sp, sp, #16
277 ; NONEON-NOSVE-NEXT:    ret
278   %res = call <2 x float> @llvm.ceil.v2f32(<2 x float> %op)
279   ret <2 x float> %res
282 define <4 x float> @frintp_v4f32(<4 x float> %op) {
283 ; CHECK-LABEL: frintp_v4f32:
284 ; CHECK:       // %bb.0:
285 ; CHECK-NEXT:    ptrue p0.s, vl4
286 ; CHECK-NEXT:    // kill: def $q0 killed $q0 def $z0
287 ; CHECK-NEXT:    frintp z0.s, p0/m, z0.s
288 ; CHECK-NEXT:    // kill: def $q0 killed $q0 killed $z0
289 ; CHECK-NEXT:    ret
291 ; NONEON-NOSVE-LABEL: frintp_v4f32:
292 ; NONEON-NOSVE:       // %bb.0:
293 ; NONEON-NOSVE-NEXT:    str q0, [sp, #-32]!
294 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 32
295 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #12]
296 ; NONEON-NOSVE-NEXT:    frintp s1, s0
297 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #8]
298 ; NONEON-NOSVE-NEXT:    frintp s0, s0
299 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #24]
300 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #4]
301 ; NONEON-NOSVE-NEXT:    frintp s1, s0
302 ; NONEON-NOSVE-NEXT:    ldr s0, [sp]
303 ; NONEON-NOSVE-NEXT:    frintp s0, s0
304 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #16]
305 ; NONEON-NOSVE-NEXT:    ldr q0, [sp, #16]
306 ; NONEON-NOSVE-NEXT:    add sp, sp, #32
307 ; NONEON-NOSVE-NEXT:    ret
308   %res = call <4 x float> @llvm.ceil.v4f32(<4 x float> %op)
309   ret <4 x float> %res
312 define void @frintp_v8f32(ptr %a) {
313 ; CHECK-LABEL: frintp_v8f32:
314 ; CHECK:       // %bb.0:
315 ; CHECK-NEXT:    ldp q0, q1, [x0]
316 ; CHECK-NEXT:    ptrue p0.s, vl4
317 ; CHECK-NEXT:    frintp z0.s, p0/m, z0.s
318 ; CHECK-NEXT:    frintp z1.s, p0/m, z1.s
319 ; CHECK-NEXT:    stp q0, q1, [x0]
320 ; CHECK-NEXT:    ret
322 ; NONEON-NOSVE-LABEL: frintp_v8f32:
323 ; NONEON-NOSVE:       // %bb.0:
324 ; NONEON-NOSVE-NEXT:    ldp q1, q0, [x0]
325 ; NONEON-NOSVE-NEXT:    stp q1, q0, [sp, #-64]!
326 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 64
327 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #28]
328 ; NONEON-NOSVE-NEXT:    frintp s1, s0
329 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #24]
330 ; NONEON-NOSVE-NEXT:    frintp s0, s0
331 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #56]
332 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #20]
333 ; NONEON-NOSVE-NEXT:    frintp s1, s0
334 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #16]
335 ; NONEON-NOSVE-NEXT:    frintp s0, s0
336 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #48]
337 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #12]
338 ; NONEON-NOSVE-NEXT:    frintp s1, s0
339 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #8]
340 ; NONEON-NOSVE-NEXT:    frintp s0, s0
341 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #40]
342 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #4]
343 ; NONEON-NOSVE-NEXT:    frintp s1, s0
344 ; NONEON-NOSVE-NEXT:    ldr s0, [sp]
345 ; NONEON-NOSVE-NEXT:    frintp s0, s0
346 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #32]
347 ; NONEON-NOSVE-NEXT:    ldp q0, q1, [sp, #32]
348 ; NONEON-NOSVE-NEXT:    stp q0, q1, [x0]
349 ; NONEON-NOSVE-NEXT:    add sp, sp, #64
350 ; NONEON-NOSVE-NEXT:    ret
351   %op = load <8 x float>, ptr %a
352   %res = call <8 x float> @llvm.ceil.v8f32(<8 x float> %op)
353   store <8 x float> %res, ptr %a
354   ret void
357 define <1 x double> @frintp_v1f64(<1 x double> %op) {
358 ; CHECK-LABEL: frintp_v1f64:
359 ; CHECK:       // %bb.0:
360 ; CHECK-NEXT:    frintp d0, d0
361 ; CHECK-NEXT:    ret
363 ; NONEON-NOSVE-LABEL: frintp_v1f64:
364 ; NONEON-NOSVE:       // %bb.0:
365 ; NONEON-NOSVE-NEXT:    sub sp, sp, #16
366 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 16
367 ; NONEON-NOSVE-NEXT:    frintp d0, d0
368 ; NONEON-NOSVE-NEXT:    str d0, [sp, #8]
369 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
370 ; NONEON-NOSVE-NEXT:    add sp, sp, #16
371 ; NONEON-NOSVE-NEXT:    ret
372   %res = call <1 x double> @llvm.ceil.v1f64(<1 x double> %op)
373   ret <1 x double> %res
376 define <2 x double> @frintp_v2f64(<2 x double> %op) {
377 ; CHECK-LABEL: frintp_v2f64:
378 ; CHECK:       // %bb.0:
379 ; CHECK-NEXT:    ptrue p0.d, vl2
380 ; CHECK-NEXT:    // kill: def $q0 killed $q0 def $z0
381 ; CHECK-NEXT:    frintp z0.d, p0/m, z0.d
382 ; CHECK-NEXT:    // kill: def $q0 killed $q0 killed $z0
383 ; CHECK-NEXT:    ret
385 ; NONEON-NOSVE-LABEL: frintp_v2f64:
386 ; NONEON-NOSVE:       // %bb.0:
387 ; NONEON-NOSVE-NEXT:    str q0, [sp, #-32]!
388 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 32
389 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
390 ; NONEON-NOSVE-NEXT:    frintp d1, d0
391 ; NONEON-NOSVE-NEXT:    ldr d0, [sp]
392 ; NONEON-NOSVE-NEXT:    frintp d0, d0
393 ; NONEON-NOSVE-NEXT:    stp d0, d1, [sp, #16]
394 ; NONEON-NOSVE-NEXT:    ldr q0, [sp, #16]
395 ; NONEON-NOSVE-NEXT:    add sp, sp, #32
396 ; NONEON-NOSVE-NEXT:    ret
397   %res = call <2 x double> @llvm.ceil.v2f64(<2 x double> %op)
398   ret <2 x double> %res
401 define void @frintp_v4f64(ptr %a) {
402 ; CHECK-LABEL: frintp_v4f64:
403 ; CHECK:       // %bb.0:
404 ; CHECK-NEXT:    ldp q0, q1, [x0]
405 ; CHECK-NEXT:    ptrue p0.d, vl2
406 ; CHECK-NEXT:    frintp z0.d, p0/m, z0.d
407 ; CHECK-NEXT:    frintp z1.d, p0/m, z1.d
408 ; CHECK-NEXT:    stp q0, q1, [x0]
409 ; CHECK-NEXT:    ret
411 ; NONEON-NOSVE-LABEL: frintp_v4f64:
412 ; NONEON-NOSVE:       // %bb.0:
413 ; NONEON-NOSVE-NEXT:    ldp q1, q0, [x0]
414 ; NONEON-NOSVE-NEXT:    stp q1, q0, [sp, #-64]!
415 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 64
416 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #24]
417 ; NONEON-NOSVE-NEXT:    frintp d1, d0
418 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #16]
419 ; NONEON-NOSVE-NEXT:    frintp d0, d0
420 ; NONEON-NOSVE-NEXT:    stp d0, d1, [sp, #48]
421 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
422 ; NONEON-NOSVE-NEXT:    frintp d1, d0
423 ; NONEON-NOSVE-NEXT:    ldr d0, [sp]
424 ; NONEON-NOSVE-NEXT:    frintp d0, d0
425 ; NONEON-NOSVE-NEXT:    stp d0, d1, [sp, #32]
426 ; NONEON-NOSVE-NEXT:    ldp q0, q1, [sp, #32]
427 ; NONEON-NOSVE-NEXT:    stp q0, q1, [x0]
428 ; NONEON-NOSVE-NEXT:    add sp, sp, #64
429 ; NONEON-NOSVE-NEXT:    ret
430   %op = load <4 x double>, ptr %a
431   %res = call <4 x double> @llvm.ceil.v4f64(<4 x double> %op)
432   store <4 x double> %res, ptr %a
433   ret void
437 ; FLOOR -> FRINTM
440 define <2 x half> @frintm_v2f16(<2 x half> %op) {
441 ; CHECK-LABEL: frintm_v2f16:
442 ; CHECK:       // %bb.0:
443 ; CHECK-NEXT:    ptrue p0.h, vl4
444 ; CHECK-NEXT:    // kill: def $d0 killed $d0 def $z0
445 ; CHECK-NEXT:    frintm z0.h, p0/m, z0.h
446 ; CHECK-NEXT:    // kill: def $d0 killed $d0 killed $z0
447 ; CHECK-NEXT:    ret
449 ; NONEON-NOSVE-LABEL: frintm_v2f16:
450 ; NONEON-NOSVE:       // %bb.0:
451 ; NONEON-NOSVE-NEXT:    str d0, [sp, #-16]!
452 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 16
453 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #6]
454 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
455 ; NONEON-NOSVE-NEXT:    frintm s0, s0
456 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
457 ; NONEON-NOSVE-NEXT:    str h0, [sp, #14]
458 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #4]
459 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
460 ; NONEON-NOSVE-NEXT:    frintm s0, s0
461 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
462 ; NONEON-NOSVE-NEXT:    str h0, [sp, #12]
463 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #2]
464 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
465 ; NONEON-NOSVE-NEXT:    frintm s0, s0
466 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
467 ; NONEON-NOSVE-NEXT:    str h0, [sp, #10]
468 ; NONEON-NOSVE-NEXT:    ldr h0, [sp]
469 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
470 ; NONEON-NOSVE-NEXT:    frintm s0, s0
471 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
472 ; NONEON-NOSVE-NEXT:    str h0, [sp, #8]
473 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
474 ; NONEON-NOSVE-NEXT:    add sp, sp, #16
475 ; NONEON-NOSVE-NEXT:    ret
476   %res = call <2 x half> @llvm.floor.v2f16(<2 x half> %op)
477   ret <2 x half> %res
480 define <4 x half> @frintm_v4f16(<4 x half> %op) {
481 ; CHECK-LABEL: frintm_v4f16:
482 ; CHECK:       // %bb.0:
483 ; CHECK-NEXT:    ptrue p0.h, vl4
484 ; CHECK-NEXT:    // kill: def $d0 killed $d0 def $z0
485 ; CHECK-NEXT:    frintm z0.h, p0/m, z0.h
486 ; CHECK-NEXT:    // kill: def $d0 killed $d0 killed $z0
487 ; CHECK-NEXT:    ret
489 ; NONEON-NOSVE-LABEL: frintm_v4f16:
490 ; NONEON-NOSVE:       // %bb.0:
491 ; NONEON-NOSVE-NEXT:    str d0, [sp, #-16]!
492 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 16
493 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #6]
494 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
495 ; NONEON-NOSVE-NEXT:    frintm s0, s0
496 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
497 ; NONEON-NOSVE-NEXT:    str h0, [sp, #14]
498 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #4]
499 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
500 ; NONEON-NOSVE-NEXT:    frintm s0, s0
501 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
502 ; NONEON-NOSVE-NEXT:    str h0, [sp, #12]
503 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #2]
504 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
505 ; NONEON-NOSVE-NEXT:    frintm s0, s0
506 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
507 ; NONEON-NOSVE-NEXT:    str h0, [sp, #10]
508 ; NONEON-NOSVE-NEXT:    ldr h0, [sp]
509 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
510 ; NONEON-NOSVE-NEXT:    frintm s0, s0
511 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
512 ; NONEON-NOSVE-NEXT:    str h0, [sp, #8]
513 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
514 ; NONEON-NOSVE-NEXT:    add sp, sp, #16
515 ; NONEON-NOSVE-NEXT:    ret
516   %res = call <4 x half> @llvm.floor.v4f16(<4 x half> %op)
517   ret <4 x half> %res
520 define <8 x half> @frintm_v8f16(<8 x half> %op) {
521 ; CHECK-LABEL: frintm_v8f16:
522 ; CHECK:       // %bb.0:
523 ; CHECK-NEXT:    ptrue p0.h, vl8
524 ; CHECK-NEXT:    // kill: def $q0 killed $q0 def $z0
525 ; CHECK-NEXT:    frintm z0.h, p0/m, z0.h
526 ; CHECK-NEXT:    // kill: def $q0 killed $q0 killed $z0
527 ; CHECK-NEXT:    ret
529 ; NONEON-NOSVE-LABEL: frintm_v8f16:
530 ; NONEON-NOSVE:       // %bb.0:
531 ; NONEON-NOSVE-NEXT:    str q0, [sp, #-32]!
532 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 32
533 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #14]
534 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
535 ; NONEON-NOSVE-NEXT:    frintm s0, s0
536 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
537 ; NONEON-NOSVE-NEXT:    str h0, [sp, #30]
538 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #12]
539 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
540 ; NONEON-NOSVE-NEXT:    frintm s0, s0
541 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
542 ; NONEON-NOSVE-NEXT:    str h0, [sp, #28]
543 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #10]
544 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
545 ; NONEON-NOSVE-NEXT:    frintm s0, s0
546 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
547 ; NONEON-NOSVE-NEXT:    str h0, [sp, #26]
548 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #8]
549 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
550 ; NONEON-NOSVE-NEXT:    frintm s0, s0
551 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
552 ; NONEON-NOSVE-NEXT:    str h0, [sp, #24]
553 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #6]
554 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
555 ; NONEON-NOSVE-NEXT:    frintm s0, s0
556 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
557 ; NONEON-NOSVE-NEXT:    str h0, [sp, #22]
558 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #4]
559 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
560 ; NONEON-NOSVE-NEXT:    frintm s0, s0
561 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
562 ; NONEON-NOSVE-NEXT:    str h0, [sp, #20]
563 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #2]
564 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
565 ; NONEON-NOSVE-NEXT:    frintm s0, s0
566 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
567 ; NONEON-NOSVE-NEXT:    str h0, [sp, #18]
568 ; NONEON-NOSVE-NEXT:    ldr h0, [sp]
569 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
570 ; NONEON-NOSVE-NEXT:    frintm s0, s0
571 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
572 ; NONEON-NOSVE-NEXT:    str h0, [sp, #16]
573 ; NONEON-NOSVE-NEXT:    ldr q0, [sp, #16]
574 ; NONEON-NOSVE-NEXT:    add sp, sp, #32
575 ; NONEON-NOSVE-NEXT:    ret
576   %res = call <8 x half> @llvm.floor.v8f16(<8 x half> %op)
577   ret <8 x half> %res
580 define void @frintm_v16f16(ptr %a) {
581 ; CHECK-LABEL: frintm_v16f16:
582 ; CHECK:       // %bb.0:
583 ; CHECK-NEXT:    ldp q0, q1, [x0]
584 ; CHECK-NEXT:    ptrue p0.h, vl8
585 ; CHECK-NEXT:    frintm z0.h, p0/m, z0.h
586 ; CHECK-NEXT:    frintm z1.h, p0/m, z1.h
587 ; CHECK-NEXT:    stp q0, q1, [x0]
588 ; CHECK-NEXT:    ret
590 ; NONEON-NOSVE-LABEL: frintm_v16f16:
591 ; NONEON-NOSVE:       // %bb.0:
592 ; NONEON-NOSVE-NEXT:    ldp q1, q0, [x0]
593 ; NONEON-NOSVE-NEXT:    stp q1, q0, [sp, #-64]!
594 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 64
595 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #30]
596 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
597 ; NONEON-NOSVE-NEXT:    frintm s0, s0
598 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
599 ; NONEON-NOSVE-NEXT:    str h0, [sp, #62]
600 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #28]
601 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
602 ; NONEON-NOSVE-NEXT:    frintm s0, s0
603 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
604 ; NONEON-NOSVE-NEXT:    str h0, [sp, #60]
605 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #26]
606 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
607 ; NONEON-NOSVE-NEXT:    frintm s0, s0
608 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
609 ; NONEON-NOSVE-NEXT:    str h0, [sp, #58]
610 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #24]
611 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
612 ; NONEON-NOSVE-NEXT:    frintm s0, s0
613 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
614 ; NONEON-NOSVE-NEXT:    str h0, [sp, #56]
615 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #22]
616 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
617 ; NONEON-NOSVE-NEXT:    frintm s0, s0
618 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
619 ; NONEON-NOSVE-NEXT:    str h0, [sp, #54]
620 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #20]
621 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
622 ; NONEON-NOSVE-NEXT:    frintm s0, s0
623 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
624 ; NONEON-NOSVE-NEXT:    str h0, [sp, #52]
625 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #18]
626 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
627 ; NONEON-NOSVE-NEXT:    frintm s0, s0
628 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
629 ; NONEON-NOSVE-NEXT:    str h0, [sp, #50]
630 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #16]
631 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
632 ; NONEON-NOSVE-NEXT:    frintm s0, s0
633 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
634 ; NONEON-NOSVE-NEXT:    str h0, [sp, #48]
635 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #14]
636 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
637 ; NONEON-NOSVE-NEXT:    frintm s0, s0
638 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
639 ; NONEON-NOSVE-NEXT:    str h0, [sp, #46]
640 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #12]
641 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
642 ; NONEON-NOSVE-NEXT:    frintm s0, s0
643 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
644 ; NONEON-NOSVE-NEXT:    str h0, [sp, #44]
645 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #10]
646 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
647 ; NONEON-NOSVE-NEXT:    frintm s0, s0
648 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
649 ; NONEON-NOSVE-NEXT:    str h0, [sp, #42]
650 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #8]
651 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
652 ; NONEON-NOSVE-NEXT:    frintm s0, s0
653 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
654 ; NONEON-NOSVE-NEXT:    str h0, [sp, #40]
655 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #6]
656 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
657 ; NONEON-NOSVE-NEXT:    frintm s0, s0
658 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
659 ; NONEON-NOSVE-NEXT:    str h0, [sp, #38]
660 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #4]
661 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
662 ; NONEON-NOSVE-NEXT:    frintm s0, s0
663 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
664 ; NONEON-NOSVE-NEXT:    str h0, [sp, #36]
665 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #2]
666 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
667 ; NONEON-NOSVE-NEXT:    frintm s0, s0
668 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
669 ; NONEON-NOSVE-NEXT:    str h0, [sp, #34]
670 ; NONEON-NOSVE-NEXT:    ldr h0, [sp]
671 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
672 ; NONEON-NOSVE-NEXT:    frintm s0, s0
673 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
674 ; NONEON-NOSVE-NEXT:    str h0, [sp, #32]
675 ; NONEON-NOSVE-NEXT:    ldp q0, q1, [sp, #32]
676 ; NONEON-NOSVE-NEXT:    stp q0, q1, [x0]
677 ; NONEON-NOSVE-NEXT:    add sp, sp, #64
678 ; NONEON-NOSVE-NEXT:    ret
679   %op = load <16 x half>, ptr %a
680   %res = call <16 x half> @llvm.floor.v16f16(<16 x half> %op)
681   store <16 x half> %res, ptr %a
682   ret void
685 define <2 x float> @frintm_v2f32(<2 x float> %op) {
686 ; CHECK-LABEL: frintm_v2f32:
687 ; CHECK:       // %bb.0:
688 ; CHECK-NEXT:    ptrue p0.s, vl2
689 ; CHECK-NEXT:    // kill: def $d0 killed $d0 def $z0
690 ; CHECK-NEXT:    frintm z0.s, p0/m, z0.s
691 ; CHECK-NEXT:    // kill: def $d0 killed $d0 killed $z0
692 ; CHECK-NEXT:    ret
694 ; NONEON-NOSVE-LABEL: frintm_v2f32:
695 ; NONEON-NOSVE:       // %bb.0:
696 ; NONEON-NOSVE-NEXT:    str d0, [sp, #-16]!
697 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 16
698 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #4]
699 ; NONEON-NOSVE-NEXT:    frintm s1, s0
700 ; NONEON-NOSVE-NEXT:    ldr s0, [sp]
701 ; NONEON-NOSVE-NEXT:    frintm s0, s0
702 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #8]
703 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
704 ; NONEON-NOSVE-NEXT:    add sp, sp, #16
705 ; NONEON-NOSVE-NEXT:    ret
706   %res = call <2 x float> @llvm.floor.v2f32(<2 x float> %op)
707   ret <2 x float> %res
710 define <4 x float> @frintm_v4f32(<4 x float> %op) {
711 ; CHECK-LABEL: frintm_v4f32:
712 ; CHECK:       // %bb.0:
713 ; CHECK-NEXT:    ptrue p0.s, vl4
714 ; CHECK-NEXT:    // kill: def $q0 killed $q0 def $z0
715 ; CHECK-NEXT:    frintm z0.s, p0/m, z0.s
716 ; CHECK-NEXT:    // kill: def $q0 killed $q0 killed $z0
717 ; CHECK-NEXT:    ret
719 ; NONEON-NOSVE-LABEL: frintm_v4f32:
720 ; NONEON-NOSVE:       // %bb.0:
721 ; NONEON-NOSVE-NEXT:    str q0, [sp, #-32]!
722 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 32
723 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #12]
724 ; NONEON-NOSVE-NEXT:    frintm s1, s0
725 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #8]
726 ; NONEON-NOSVE-NEXT:    frintm s0, s0
727 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #24]
728 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #4]
729 ; NONEON-NOSVE-NEXT:    frintm s1, s0
730 ; NONEON-NOSVE-NEXT:    ldr s0, [sp]
731 ; NONEON-NOSVE-NEXT:    frintm s0, s0
732 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #16]
733 ; NONEON-NOSVE-NEXT:    ldr q0, [sp, #16]
734 ; NONEON-NOSVE-NEXT:    add sp, sp, #32
735 ; NONEON-NOSVE-NEXT:    ret
736   %res = call <4 x float> @llvm.floor.v4f32(<4 x float> %op)
737   ret <4 x float> %res
740 define void @frintm_v8f32(ptr %a) {
741 ; CHECK-LABEL: frintm_v8f32:
742 ; CHECK:       // %bb.0:
743 ; CHECK-NEXT:    ldp q0, q1, [x0]
744 ; CHECK-NEXT:    ptrue p0.s, vl4
745 ; CHECK-NEXT:    frintm z0.s, p0/m, z0.s
746 ; CHECK-NEXT:    frintm z1.s, p0/m, z1.s
747 ; CHECK-NEXT:    stp q0, q1, [x0]
748 ; CHECK-NEXT:    ret
750 ; NONEON-NOSVE-LABEL: frintm_v8f32:
751 ; NONEON-NOSVE:       // %bb.0:
752 ; NONEON-NOSVE-NEXT:    ldp q1, q0, [x0]
753 ; NONEON-NOSVE-NEXT:    stp q1, q0, [sp, #-64]!
754 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 64
755 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #28]
756 ; NONEON-NOSVE-NEXT:    frintm s1, s0
757 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #24]
758 ; NONEON-NOSVE-NEXT:    frintm s0, s0
759 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #56]
760 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #20]
761 ; NONEON-NOSVE-NEXT:    frintm s1, s0
762 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #16]
763 ; NONEON-NOSVE-NEXT:    frintm s0, s0
764 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #48]
765 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #12]
766 ; NONEON-NOSVE-NEXT:    frintm s1, s0
767 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #8]
768 ; NONEON-NOSVE-NEXT:    frintm s0, s0
769 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #40]
770 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #4]
771 ; NONEON-NOSVE-NEXT:    frintm s1, s0
772 ; NONEON-NOSVE-NEXT:    ldr s0, [sp]
773 ; NONEON-NOSVE-NEXT:    frintm s0, s0
774 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #32]
775 ; NONEON-NOSVE-NEXT:    ldp q0, q1, [sp, #32]
776 ; NONEON-NOSVE-NEXT:    stp q0, q1, [x0]
777 ; NONEON-NOSVE-NEXT:    add sp, sp, #64
778 ; NONEON-NOSVE-NEXT:    ret
779   %op = load <8 x float>, ptr %a
780   %res = call <8 x float> @llvm.floor.v8f32(<8 x float> %op)
781   store <8 x float> %res, ptr %a
782   ret void
785 define <1 x double> @frintm_v1f64(<1 x double> %op) {
786 ; CHECK-LABEL: frintm_v1f64:
787 ; CHECK:       // %bb.0:
788 ; CHECK-NEXT:    frintm d0, d0
789 ; CHECK-NEXT:    ret
791 ; NONEON-NOSVE-LABEL: frintm_v1f64:
792 ; NONEON-NOSVE:       // %bb.0:
793 ; NONEON-NOSVE-NEXT:    sub sp, sp, #16
794 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 16
795 ; NONEON-NOSVE-NEXT:    frintm d0, d0
796 ; NONEON-NOSVE-NEXT:    str d0, [sp, #8]
797 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
798 ; NONEON-NOSVE-NEXT:    add sp, sp, #16
799 ; NONEON-NOSVE-NEXT:    ret
800   %res = call <1 x double> @llvm.floor.v1f64(<1 x double> %op)
801   ret <1 x double> %res
804 define <2 x double> @frintm_v2f64(<2 x double> %op) {
805 ; CHECK-LABEL: frintm_v2f64:
806 ; CHECK:       // %bb.0:
807 ; CHECK-NEXT:    ptrue p0.d, vl2
808 ; CHECK-NEXT:    // kill: def $q0 killed $q0 def $z0
809 ; CHECK-NEXT:    frintm z0.d, p0/m, z0.d
810 ; CHECK-NEXT:    // kill: def $q0 killed $q0 killed $z0
811 ; CHECK-NEXT:    ret
813 ; NONEON-NOSVE-LABEL: frintm_v2f64:
814 ; NONEON-NOSVE:       // %bb.0:
815 ; NONEON-NOSVE-NEXT:    str q0, [sp, #-32]!
816 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 32
817 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
818 ; NONEON-NOSVE-NEXT:    frintm d1, d0
819 ; NONEON-NOSVE-NEXT:    ldr d0, [sp]
820 ; NONEON-NOSVE-NEXT:    frintm d0, d0
821 ; NONEON-NOSVE-NEXT:    stp d0, d1, [sp, #16]
822 ; NONEON-NOSVE-NEXT:    ldr q0, [sp, #16]
823 ; NONEON-NOSVE-NEXT:    add sp, sp, #32
824 ; NONEON-NOSVE-NEXT:    ret
825   %res = call <2 x double> @llvm.floor.v2f64(<2 x double> %op)
826   ret <2 x double> %res
829 define void @frintm_v4f64(ptr %a) {
830 ; CHECK-LABEL: frintm_v4f64:
831 ; CHECK:       // %bb.0:
832 ; CHECK-NEXT:    ldp q0, q1, [x0]
833 ; CHECK-NEXT:    ptrue p0.d, vl2
834 ; CHECK-NEXT:    frintm z0.d, p0/m, z0.d
835 ; CHECK-NEXT:    frintm z1.d, p0/m, z1.d
836 ; CHECK-NEXT:    stp q0, q1, [x0]
837 ; CHECK-NEXT:    ret
839 ; NONEON-NOSVE-LABEL: frintm_v4f64:
840 ; NONEON-NOSVE:       // %bb.0:
841 ; NONEON-NOSVE-NEXT:    ldp q1, q0, [x0]
842 ; NONEON-NOSVE-NEXT:    stp q1, q0, [sp, #-64]!
843 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 64
844 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #24]
845 ; NONEON-NOSVE-NEXT:    frintm d1, d0
846 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #16]
847 ; NONEON-NOSVE-NEXT:    frintm d0, d0
848 ; NONEON-NOSVE-NEXT:    stp d0, d1, [sp, #48]
849 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
850 ; NONEON-NOSVE-NEXT:    frintm d1, d0
851 ; NONEON-NOSVE-NEXT:    ldr d0, [sp]
852 ; NONEON-NOSVE-NEXT:    frintm d0, d0
853 ; NONEON-NOSVE-NEXT:    stp d0, d1, [sp, #32]
854 ; NONEON-NOSVE-NEXT:    ldp q0, q1, [sp, #32]
855 ; NONEON-NOSVE-NEXT:    stp q0, q1, [x0]
856 ; NONEON-NOSVE-NEXT:    add sp, sp, #64
857 ; NONEON-NOSVE-NEXT:    ret
858   %op = load <4 x double>, ptr %a
859   %res = call <4 x double> @llvm.floor.v4f64(<4 x double> %op)
860   store <4 x double> %res, ptr %a
861   ret void
865 ; FNEARBYINT -> FRINTI
868 define <2 x half> @frinti_v2f16(<2 x half> %op) {
869 ; CHECK-LABEL: frinti_v2f16:
870 ; CHECK:       // %bb.0:
871 ; CHECK-NEXT:    ptrue p0.h, vl4
872 ; CHECK-NEXT:    // kill: def $d0 killed $d0 def $z0
873 ; CHECK-NEXT:    frinti z0.h, p0/m, z0.h
874 ; CHECK-NEXT:    // kill: def $d0 killed $d0 killed $z0
875 ; CHECK-NEXT:    ret
877 ; NONEON-NOSVE-LABEL: frinti_v2f16:
878 ; NONEON-NOSVE:       // %bb.0:
879 ; NONEON-NOSVE-NEXT:    str d0, [sp, #-16]!
880 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 16
881 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #6]
882 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
883 ; NONEON-NOSVE-NEXT:    frinti s0, s0
884 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
885 ; NONEON-NOSVE-NEXT:    str h0, [sp, #14]
886 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #4]
887 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
888 ; NONEON-NOSVE-NEXT:    frinti s0, s0
889 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
890 ; NONEON-NOSVE-NEXT:    str h0, [sp, #12]
891 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #2]
892 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
893 ; NONEON-NOSVE-NEXT:    frinti s0, s0
894 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
895 ; NONEON-NOSVE-NEXT:    str h0, [sp, #10]
896 ; NONEON-NOSVE-NEXT:    ldr h0, [sp]
897 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
898 ; NONEON-NOSVE-NEXT:    frinti s0, s0
899 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
900 ; NONEON-NOSVE-NEXT:    str h0, [sp, #8]
901 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
902 ; NONEON-NOSVE-NEXT:    add sp, sp, #16
903 ; NONEON-NOSVE-NEXT:    ret
904   %res = call <2 x half> @llvm.nearbyint.v2f16(<2 x half> %op)
905   ret <2 x half> %res
908 define <4 x half> @frinti_v4f16(<4 x half> %op) {
909 ; CHECK-LABEL: frinti_v4f16:
910 ; CHECK:       // %bb.0:
911 ; CHECK-NEXT:    ptrue p0.h, vl4
912 ; CHECK-NEXT:    // kill: def $d0 killed $d0 def $z0
913 ; CHECK-NEXT:    frinti z0.h, p0/m, z0.h
914 ; CHECK-NEXT:    // kill: def $d0 killed $d0 killed $z0
915 ; CHECK-NEXT:    ret
917 ; NONEON-NOSVE-LABEL: frinti_v4f16:
918 ; NONEON-NOSVE:       // %bb.0:
919 ; NONEON-NOSVE-NEXT:    str d0, [sp, #-16]!
920 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 16
921 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #6]
922 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
923 ; NONEON-NOSVE-NEXT:    frinti s0, s0
924 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
925 ; NONEON-NOSVE-NEXT:    str h0, [sp, #14]
926 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #4]
927 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
928 ; NONEON-NOSVE-NEXT:    frinti s0, s0
929 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
930 ; NONEON-NOSVE-NEXT:    str h0, [sp, #12]
931 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #2]
932 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
933 ; NONEON-NOSVE-NEXT:    frinti s0, s0
934 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
935 ; NONEON-NOSVE-NEXT:    str h0, [sp, #10]
936 ; NONEON-NOSVE-NEXT:    ldr h0, [sp]
937 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
938 ; NONEON-NOSVE-NEXT:    frinti s0, s0
939 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
940 ; NONEON-NOSVE-NEXT:    str h0, [sp, #8]
941 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
942 ; NONEON-NOSVE-NEXT:    add sp, sp, #16
943 ; NONEON-NOSVE-NEXT:    ret
944   %res = call <4 x half> @llvm.nearbyint.v4f16(<4 x half> %op)
945   ret <4 x half> %res
948 define <8 x half> @frinti_v8f16(<8 x half> %op) {
949 ; CHECK-LABEL: frinti_v8f16:
950 ; CHECK:       // %bb.0:
951 ; CHECK-NEXT:    ptrue p0.h, vl8
952 ; CHECK-NEXT:    // kill: def $q0 killed $q0 def $z0
953 ; CHECK-NEXT:    frinti z0.h, p0/m, z0.h
954 ; CHECK-NEXT:    // kill: def $q0 killed $q0 killed $z0
955 ; CHECK-NEXT:    ret
957 ; NONEON-NOSVE-LABEL: frinti_v8f16:
958 ; NONEON-NOSVE:       // %bb.0:
959 ; NONEON-NOSVE-NEXT:    str q0, [sp, #-32]!
960 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 32
961 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #14]
962 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
963 ; NONEON-NOSVE-NEXT:    frinti s0, s0
964 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
965 ; NONEON-NOSVE-NEXT:    str h0, [sp, #30]
966 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #12]
967 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
968 ; NONEON-NOSVE-NEXT:    frinti s0, s0
969 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
970 ; NONEON-NOSVE-NEXT:    str h0, [sp, #28]
971 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #10]
972 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
973 ; NONEON-NOSVE-NEXT:    frinti s0, s0
974 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
975 ; NONEON-NOSVE-NEXT:    str h0, [sp, #26]
976 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #8]
977 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
978 ; NONEON-NOSVE-NEXT:    frinti s0, s0
979 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
980 ; NONEON-NOSVE-NEXT:    str h0, [sp, #24]
981 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #6]
982 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
983 ; NONEON-NOSVE-NEXT:    frinti s0, s0
984 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
985 ; NONEON-NOSVE-NEXT:    str h0, [sp, #22]
986 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #4]
987 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
988 ; NONEON-NOSVE-NEXT:    frinti s0, s0
989 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
990 ; NONEON-NOSVE-NEXT:    str h0, [sp, #20]
991 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #2]
992 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
993 ; NONEON-NOSVE-NEXT:    frinti s0, s0
994 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
995 ; NONEON-NOSVE-NEXT:    str h0, [sp, #18]
996 ; NONEON-NOSVE-NEXT:    ldr h0, [sp]
997 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
998 ; NONEON-NOSVE-NEXT:    frinti s0, s0
999 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1000 ; NONEON-NOSVE-NEXT:    str h0, [sp, #16]
1001 ; NONEON-NOSVE-NEXT:    ldr q0, [sp, #16]
1002 ; NONEON-NOSVE-NEXT:    add sp, sp, #32
1003 ; NONEON-NOSVE-NEXT:    ret
1004   %res = call <8 x half> @llvm.nearbyint.v8f16(<8 x half> %op)
1005   ret <8 x half> %res
1008 define void @frinti_v16f16(ptr %a) {
1009 ; CHECK-LABEL: frinti_v16f16:
1010 ; CHECK:       // %bb.0:
1011 ; CHECK-NEXT:    ldp q0, q1, [x0]
1012 ; CHECK-NEXT:    ptrue p0.h, vl8
1013 ; CHECK-NEXT:    frinti z0.h, p0/m, z0.h
1014 ; CHECK-NEXT:    frinti z1.h, p0/m, z1.h
1015 ; CHECK-NEXT:    stp q0, q1, [x0]
1016 ; CHECK-NEXT:    ret
1018 ; NONEON-NOSVE-LABEL: frinti_v16f16:
1019 ; NONEON-NOSVE:       // %bb.0:
1020 ; NONEON-NOSVE-NEXT:    ldp q1, q0, [x0]
1021 ; NONEON-NOSVE-NEXT:    stp q1, q0, [sp, #-64]!
1022 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 64
1023 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #30]
1024 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1025 ; NONEON-NOSVE-NEXT:    frinti s0, s0
1026 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1027 ; NONEON-NOSVE-NEXT:    str h0, [sp, #62]
1028 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #28]
1029 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1030 ; NONEON-NOSVE-NEXT:    frinti s0, s0
1031 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1032 ; NONEON-NOSVE-NEXT:    str h0, [sp, #60]
1033 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #26]
1034 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1035 ; NONEON-NOSVE-NEXT:    frinti s0, s0
1036 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1037 ; NONEON-NOSVE-NEXT:    str h0, [sp, #58]
1038 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #24]
1039 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1040 ; NONEON-NOSVE-NEXT:    frinti s0, s0
1041 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1042 ; NONEON-NOSVE-NEXT:    str h0, [sp, #56]
1043 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #22]
1044 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1045 ; NONEON-NOSVE-NEXT:    frinti s0, s0
1046 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1047 ; NONEON-NOSVE-NEXT:    str h0, [sp, #54]
1048 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #20]
1049 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1050 ; NONEON-NOSVE-NEXT:    frinti s0, s0
1051 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1052 ; NONEON-NOSVE-NEXT:    str h0, [sp, #52]
1053 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #18]
1054 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1055 ; NONEON-NOSVE-NEXT:    frinti s0, s0
1056 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1057 ; NONEON-NOSVE-NEXT:    str h0, [sp, #50]
1058 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #16]
1059 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1060 ; NONEON-NOSVE-NEXT:    frinti s0, s0
1061 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1062 ; NONEON-NOSVE-NEXT:    str h0, [sp, #48]
1063 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #14]
1064 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1065 ; NONEON-NOSVE-NEXT:    frinti s0, s0
1066 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1067 ; NONEON-NOSVE-NEXT:    str h0, [sp, #46]
1068 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #12]
1069 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1070 ; NONEON-NOSVE-NEXT:    frinti s0, s0
1071 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1072 ; NONEON-NOSVE-NEXT:    str h0, [sp, #44]
1073 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #10]
1074 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1075 ; NONEON-NOSVE-NEXT:    frinti s0, s0
1076 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1077 ; NONEON-NOSVE-NEXT:    str h0, [sp, #42]
1078 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #8]
1079 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1080 ; NONEON-NOSVE-NEXT:    frinti s0, s0
1081 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1082 ; NONEON-NOSVE-NEXT:    str h0, [sp, #40]
1083 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #6]
1084 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1085 ; NONEON-NOSVE-NEXT:    frinti s0, s0
1086 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1087 ; NONEON-NOSVE-NEXT:    str h0, [sp, #38]
1088 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #4]
1089 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1090 ; NONEON-NOSVE-NEXT:    frinti s0, s0
1091 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1092 ; NONEON-NOSVE-NEXT:    str h0, [sp, #36]
1093 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #2]
1094 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1095 ; NONEON-NOSVE-NEXT:    frinti s0, s0
1096 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1097 ; NONEON-NOSVE-NEXT:    str h0, [sp, #34]
1098 ; NONEON-NOSVE-NEXT:    ldr h0, [sp]
1099 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1100 ; NONEON-NOSVE-NEXT:    frinti s0, s0
1101 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1102 ; NONEON-NOSVE-NEXT:    str h0, [sp, #32]
1103 ; NONEON-NOSVE-NEXT:    ldp q0, q1, [sp, #32]
1104 ; NONEON-NOSVE-NEXT:    stp q0, q1, [x0]
1105 ; NONEON-NOSVE-NEXT:    add sp, sp, #64
1106 ; NONEON-NOSVE-NEXT:    ret
1107   %op = load <16 x half>, ptr %a
1108   %res = call <16 x half> @llvm.nearbyint.v16f16(<16 x half> %op)
1109   store <16 x half> %res, ptr %a
1110   ret void
1113 define <2 x float> @frinti_v2f32(<2 x float> %op) {
1114 ; CHECK-LABEL: frinti_v2f32:
1115 ; CHECK:       // %bb.0:
1116 ; CHECK-NEXT:    ptrue p0.s, vl2
1117 ; CHECK-NEXT:    // kill: def $d0 killed $d0 def $z0
1118 ; CHECK-NEXT:    frinti z0.s, p0/m, z0.s
1119 ; CHECK-NEXT:    // kill: def $d0 killed $d0 killed $z0
1120 ; CHECK-NEXT:    ret
1122 ; NONEON-NOSVE-LABEL: frinti_v2f32:
1123 ; NONEON-NOSVE:       // %bb.0:
1124 ; NONEON-NOSVE-NEXT:    str d0, [sp, #-16]!
1125 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 16
1126 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #4]
1127 ; NONEON-NOSVE-NEXT:    frinti s1, s0
1128 ; NONEON-NOSVE-NEXT:    ldr s0, [sp]
1129 ; NONEON-NOSVE-NEXT:    frinti s0, s0
1130 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #8]
1131 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
1132 ; NONEON-NOSVE-NEXT:    add sp, sp, #16
1133 ; NONEON-NOSVE-NEXT:    ret
1134   %res = call <2 x float> @llvm.nearbyint.v2f32(<2 x float> %op)
1135   ret <2 x float> %res
1138 define <4 x float> @frinti_v4f32(<4 x float> %op) {
1139 ; CHECK-LABEL: frinti_v4f32:
1140 ; CHECK:       // %bb.0:
1141 ; CHECK-NEXT:    ptrue p0.s, vl4
1142 ; CHECK-NEXT:    // kill: def $q0 killed $q0 def $z0
1143 ; CHECK-NEXT:    frinti z0.s, p0/m, z0.s
1144 ; CHECK-NEXT:    // kill: def $q0 killed $q0 killed $z0
1145 ; CHECK-NEXT:    ret
1147 ; NONEON-NOSVE-LABEL: frinti_v4f32:
1148 ; NONEON-NOSVE:       // %bb.0:
1149 ; NONEON-NOSVE-NEXT:    str q0, [sp, #-32]!
1150 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 32
1151 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #12]
1152 ; NONEON-NOSVE-NEXT:    frinti s1, s0
1153 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #8]
1154 ; NONEON-NOSVE-NEXT:    frinti s0, s0
1155 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #24]
1156 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #4]
1157 ; NONEON-NOSVE-NEXT:    frinti s1, s0
1158 ; NONEON-NOSVE-NEXT:    ldr s0, [sp]
1159 ; NONEON-NOSVE-NEXT:    frinti s0, s0
1160 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #16]
1161 ; NONEON-NOSVE-NEXT:    ldr q0, [sp, #16]
1162 ; NONEON-NOSVE-NEXT:    add sp, sp, #32
1163 ; NONEON-NOSVE-NEXT:    ret
1164   %res = call <4 x float> @llvm.nearbyint.v4f32(<4 x float> %op)
1165   ret <4 x float> %res
1168 define void @frinti_v8f32(ptr %a) {
1169 ; CHECK-LABEL: frinti_v8f32:
1170 ; CHECK:       // %bb.0:
1171 ; CHECK-NEXT:    ldp q0, q1, [x0]
1172 ; CHECK-NEXT:    ptrue p0.s, vl4
1173 ; CHECK-NEXT:    frinti z0.s, p0/m, z0.s
1174 ; CHECK-NEXT:    frinti z1.s, p0/m, z1.s
1175 ; CHECK-NEXT:    stp q0, q1, [x0]
1176 ; CHECK-NEXT:    ret
1178 ; NONEON-NOSVE-LABEL: frinti_v8f32:
1179 ; NONEON-NOSVE:       // %bb.0:
1180 ; NONEON-NOSVE-NEXT:    ldp q1, q0, [x0]
1181 ; NONEON-NOSVE-NEXT:    stp q1, q0, [sp, #-64]!
1182 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 64
1183 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #28]
1184 ; NONEON-NOSVE-NEXT:    frinti s1, s0
1185 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #24]
1186 ; NONEON-NOSVE-NEXT:    frinti s0, s0
1187 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #56]
1188 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #20]
1189 ; NONEON-NOSVE-NEXT:    frinti s1, s0
1190 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #16]
1191 ; NONEON-NOSVE-NEXT:    frinti s0, s0
1192 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #48]
1193 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #12]
1194 ; NONEON-NOSVE-NEXT:    frinti s1, s0
1195 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #8]
1196 ; NONEON-NOSVE-NEXT:    frinti s0, s0
1197 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #40]
1198 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #4]
1199 ; NONEON-NOSVE-NEXT:    frinti s1, s0
1200 ; NONEON-NOSVE-NEXT:    ldr s0, [sp]
1201 ; NONEON-NOSVE-NEXT:    frinti s0, s0
1202 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #32]
1203 ; NONEON-NOSVE-NEXT:    ldp q0, q1, [sp, #32]
1204 ; NONEON-NOSVE-NEXT:    stp q0, q1, [x0]
1205 ; NONEON-NOSVE-NEXT:    add sp, sp, #64
1206 ; NONEON-NOSVE-NEXT:    ret
1207   %op = load <8 x float>, ptr %a
1208   %res = call <8 x float> @llvm.nearbyint.v8f32(<8 x float> %op)
1209   store <8 x float> %res, ptr %a
1210   ret void
1213 define <1 x double> @frinti_v1f64(<1 x double> %op) {
1214 ; CHECK-LABEL: frinti_v1f64:
1215 ; CHECK:       // %bb.0:
1216 ; CHECK-NEXT:    frinti d0, d0
1217 ; CHECK-NEXT:    ret
1219 ; NONEON-NOSVE-LABEL: frinti_v1f64:
1220 ; NONEON-NOSVE:       // %bb.0:
1221 ; NONEON-NOSVE-NEXT:    sub sp, sp, #16
1222 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 16
1223 ; NONEON-NOSVE-NEXT:    frinti d0, d0
1224 ; NONEON-NOSVE-NEXT:    str d0, [sp, #8]
1225 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
1226 ; NONEON-NOSVE-NEXT:    add sp, sp, #16
1227 ; NONEON-NOSVE-NEXT:    ret
1228   %res = call <1 x double> @llvm.nearbyint.v1f64(<1 x double> %op)
1229   ret <1 x double> %res
1232 define <2 x double> @frinti_v2f64(<2 x double> %op) {
1233 ; CHECK-LABEL: frinti_v2f64:
1234 ; CHECK:       // %bb.0:
1235 ; CHECK-NEXT:    ptrue p0.d, vl2
1236 ; CHECK-NEXT:    // kill: def $q0 killed $q0 def $z0
1237 ; CHECK-NEXT:    frinti z0.d, p0/m, z0.d
1238 ; CHECK-NEXT:    // kill: def $q0 killed $q0 killed $z0
1239 ; CHECK-NEXT:    ret
1241 ; NONEON-NOSVE-LABEL: frinti_v2f64:
1242 ; NONEON-NOSVE:       // %bb.0:
1243 ; NONEON-NOSVE-NEXT:    str q0, [sp, #-32]!
1244 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 32
1245 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
1246 ; NONEON-NOSVE-NEXT:    frinti d1, d0
1247 ; NONEON-NOSVE-NEXT:    ldr d0, [sp]
1248 ; NONEON-NOSVE-NEXT:    frinti d0, d0
1249 ; NONEON-NOSVE-NEXT:    stp d0, d1, [sp, #16]
1250 ; NONEON-NOSVE-NEXT:    ldr q0, [sp, #16]
1251 ; NONEON-NOSVE-NEXT:    add sp, sp, #32
1252 ; NONEON-NOSVE-NEXT:    ret
1253   %res = call <2 x double> @llvm.nearbyint.v2f64(<2 x double> %op)
1254   ret <2 x double> %res
1257 define void @frinti_v4f64(ptr %a) {
1258 ; CHECK-LABEL: frinti_v4f64:
1259 ; CHECK:       // %bb.0:
1260 ; CHECK-NEXT:    ldp q0, q1, [x0]
1261 ; CHECK-NEXT:    ptrue p0.d, vl2
1262 ; CHECK-NEXT:    frinti z0.d, p0/m, z0.d
1263 ; CHECK-NEXT:    frinti z1.d, p0/m, z1.d
1264 ; CHECK-NEXT:    stp q0, q1, [x0]
1265 ; CHECK-NEXT:    ret
1267 ; NONEON-NOSVE-LABEL: frinti_v4f64:
1268 ; NONEON-NOSVE:       // %bb.0:
1269 ; NONEON-NOSVE-NEXT:    ldp q1, q0, [x0]
1270 ; NONEON-NOSVE-NEXT:    stp q1, q0, [sp, #-64]!
1271 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 64
1272 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #24]
1273 ; NONEON-NOSVE-NEXT:    frinti d1, d0
1274 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #16]
1275 ; NONEON-NOSVE-NEXT:    frinti d0, d0
1276 ; NONEON-NOSVE-NEXT:    stp d0, d1, [sp, #48]
1277 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
1278 ; NONEON-NOSVE-NEXT:    frinti d1, d0
1279 ; NONEON-NOSVE-NEXT:    ldr d0, [sp]
1280 ; NONEON-NOSVE-NEXT:    frinti d0, d0
1281 ; NONEON-NOSVE-NEXT:    stp d0, d1, [sp, #32]
1282 ; NONEON-NOSVE-NEXT:    ldp q0, q1, [sp, #32]
1283 ; NONEON-NOSVE-NEXT:    stp q0, q1, [x0]
1284 ; NONEON-NOSVE-NEXT:    add sp, sp, #64
1285 ; NONEON-NOSVE-NEXT:    ret
1286   %op = load <4 x double>, ptr %a
1287   %res = call <4 x double> @llvm.nearbyint.v4f64(<4 x double> %op)
1288   store <4 x double> %res, ptr %a
1289   ret void
1293 ; RINT -> FRINTX
1296 define <2 x half> @frintx_v2f16(<2 x half> %op) {
1297 ; CHECK-LABEL: frintx_v2f16:
1298 ; CHECK:       // %bb.0:
1299 ; CHECK-NEXT:    ptrue p0.h, vl4
1300 ; CHECK-NEXT:    // kill: def $d0 killed $d0 def $z0
1301 ; CHECK-NEXT:    frintx z0.h, p0/m, z0.h
1302 ; CHECK-NEXT:    // kill: def $d0 killed $d0 killed $z0
1303 ; CHECK-NEXT:    ret
1305 ; NONEON-NOSVE-LABEL: frintx_v2f16:
1306 ; NONEON-NOSVE:       // %bb.0:
1307 ; NONEON-NOSVE-NEXT:    str d0, [sp, #-16]!
1308 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 16
1309 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #6]
1310 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1311 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1312 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1313 ; NONEON-NOSVE-NEXT:    str h0, [sp, #14]
1314 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #4]
1315 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1316 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1317 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1318 ; NONEON-NOSVE-NEXT:    str h0, [sp, #12]
1319 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #2]
1320 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1321 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1322 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1323 ; NONEON-NOSVE-NEXT:    str h0, [sp, #10]
1324 ; NONEON-NOSVE-NEXT:    ldr h0, [sp]
1325 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1326 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1327 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1328 ; NONEON-NOSVE-NEXT:    str h0, [sp, #8]
1329 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
1330 ; NONEON-NOSVE-NEXT:    add sp, sp, #16
1331 ; NONEON-NOSVE-NEXT:    ret
1332   %res = call <2 x half> @llvm.rint.v2f16(<2 x half> %op)
1333   ret <2 x half> %res
1336 define <4 x half> @frintx_v4f16(<4 x half> %op) {
1337 ; CHECK-LABEL: frintx_v4f16:
1338 ; CHECK:       // %bb.0:
1339 ; CHECK-NEXT:    ptrue p0.h, vl4
1340 ; CHECK-NEXT:    // kill: def $d0 killed $d0 def $z0
1341 ; CHECK-NEXT:    frintx z0.h, p0/m, z0.h
1342 ; CHECK-NEXT:    // kill: def $d0 killed $d0 killed $z0
1343 ; CHECK-NEXT:    ret
1345 ; NONEON-NOSVE-LABEL: frintx_v4f16:
1346 ; NONEON-NOSVE:       // %bb.0:
1347 ; NONEON-NOSVE-NEXT:    str d0, [sp, #-16]!
1348 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 16
1349 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #6]
1350 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1351 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1352 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1353 ; NONEON-NOSVE-NEXT:    str h0, [sp, #14]
1354 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #4]
1355 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1356 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1357 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1358 ; NONEON-NOSVE-NEXT:    str h0, [sp, #12]
1359 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #2]
1360 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1361 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1362 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1363 ; NONEON-NOSVE-NEXT:    str h0, [sp, #10]
1364 ; NONEON-NOSVE-NEXT:    ldr h0, [sp]
1365 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1366 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1367 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1368 ; NONEON-NOSVE-NEXT:    str h0, [sp, #8]
1369 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
1370 ; NONEON-NOSVE-NEXT:    add sp, sp, #16
1371 ; NONEON-NOSVE-NEXT:    ret
1372   %res = call <4 x half> @llvm.rint.v4f16(<4 x half> %op)
1373   ret <4 x half> %res
1376 define <8 x half> @frintx_v8f16(<8 x half> %op) {
1377 ; CHECK-LABEL: frintx_v8f16:
1378 ; CHECK:       // %bb.0:
1379 ; CHECK-NEXT:    ptrue p0.h, vl8
1380 ; CHECK-NEXT:    // kill: def $q0 killed $q0 def $z0
1381 ; CHECK-NEXT:    frintx z0.h, p0/m, z0.h
1382 ; CHECK-NEXT:    // kill: def $q0 killed $q0 killed $z0
1383 ; CHECK-NEXT:    ret
1385 ; NONEON-NOSVE-LABEL: frintx_v8f16:
1386 ; NONEON-NOSVE:       // %bb.0:
1387 ; NONEON-NOSVE-NEXT:    str q0, [sp, #-32]!
1388 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 32
1389 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #14]
1390 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1391 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1392 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1393 ; NONEON-NOSVE-NEXT:    str h0, [sp, #30]
1394 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #12]
1395 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1396 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1397 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1398 ; NONEON-NOSVE-NEXT:    str h0, [sp, #28]
1399 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #10]
1400 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1401 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1402 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1403 ; NONEON-NOSVE-NEXT:    str h0, [sp, #26]
1404 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #8]
1405 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1406 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1407 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1408 ; NONEON-NOSVE-NEXT:    str h0, [sp, #24]
1409 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #6]
1410 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1411 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1412 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1413 ; NONEON-NOSVE-NEXT:    str h0, [sp, #22]
1414 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #4]
1415 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1416 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1417 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1418 ; NONEON-NOSVE-NEXT:    str h0, [sp, #20]
1419 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #2]
1420 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1421 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1422 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1423 ; NONEON-NOSVE-NEXT:    str h0, [sp, #18]
1424 ; NONEON-NOSVE-NEXT:    ldr h0, [sp]
1425 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1426 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1427 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1428 ; NONEON-NOSVE-NEXT:    str h0, [sp, #16]
1429 ; NONEON-NOSVE-NEXT:    ldr q0, [sp, #16]
1430 ; NONEON-NOSVE-NEXT:    add sp, sp, #32
1431 ; NONEON-NOSVE-NEXT:    ret
1432   %res = call <8 x half> @llvm.rint.v8f16(<8 x half> %op)
1433   ret <8 x half> %res
1436 define void @frintx_v16f16(ptr %a) {
1437 ; CHECK-LABEL: frintx_v16f16:
1438 ; CHECK:       // %bb.0:
1439 ; CHECK-NEXT:    ldp q0, q1, [x0]
1440 ; CHECK-NEXT:    ptrue p0.h, vl8
1441 ; CHECK-NEXT:    frintx z0.h, p0/m, z0.h
1442 ; CHECK-NEXT:    frintx z1.h, p0/m, z1.h
1443 ; CHECK-NEXT:    stp q0, q1, [x0]
1444 ; CHECK-NEXT:    ret
1446 ; NONEON-NOSVE-LABEL: frintx_v16f16:
1447 ; NONEON-NOSVE:       // %bb.0:
1448 ; NONEON-NOSVE-NEXT:    ldp q1, q0, [x0]
1449 ; NONEON-NOSVE-NEXT:    stp q1, q0, [sp, #-64]!
1450 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 64
1451 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #30]
1452 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1453 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1454 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1455 ; NONEON-NOSVE-NEXT:    str h0, [sp, #62]
1456 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #28]
1457 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1458 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1459 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1460 ; NONEON-NOSVE-NEXT:    str h0, [sp, #60]
1461 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #26]
1462 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1463 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1464 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1465 ; NONEON-NOSVE-NEXT:    str h0, [sp, #58]
1466 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #24]
1467 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1468 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1469 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1470 ; NONEON-NOSVE-NEXT:    str h0, [sp, #56]
1471 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #22]
1472 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1473 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1474 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1475 ; NONEON-NOSVE-NEXT:    str h0, [sp, #54]
1476 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #20]
1477 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1478 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1479 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1480 ; NONEON-NOSVE-NEXT:    str h0, [sp, #52]
1481 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #18]
1482 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1483 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1484 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1485 ; NONEON-NOSVE-NEXT:    str h0, [sp, #50]
1486 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #16]
1487 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1488 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1489 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1490 ; NONEON-NOSVE-NEXT:    str h0, [sp, #48]
1491 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #14]
1492 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1493 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1494 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1495 ; NONEON-NOSVE-NEXT:    str h0, [sp, #46]
1496 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #12]
1497 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1498 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1499 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1500 ; NONEON-NOSVE-NEXT:    str h0, [sp, #44]
1501 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #10]
1502 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1503 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1504 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1505 ; NONEON-NOSVE-NEXT:    str h0, [sp, #42]
1506 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #8]
1507 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1508 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1509 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1510 ; NONEON-NOSVE-NEXT:    str h0, [sp, #40]
1511 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #6]
1512 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1513 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1514 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1515 ; NONEON-NOSVE-NEXT:    str h0, [sp, #38]
1516 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #4]
1517 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1518 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1519 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1520 ; NONEON-NOSVE-NEXT:    str h0, [sp, #36]
1521 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #2]
1522 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1523 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1524 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1525 ; NONEON-NOSVE-NEXT:    str h0, [sp, #34]
1526 ; NONEON-NOSVE-NEXT:    ldr h0, [sp]
1527 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1528 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1529 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1530 ; NONEON-NOSVE-NEXT:    str h0, [sp, #32]
1531 ; NONEON-NOSVE-NEXT:    ldp q0, q1, [sp, #32]
1532 ; NONEON-NOSVE-NEXT:    stp q0, q1, [x0]
1533 ; NONEON-NOSVE-NEXT:    add sp, sp, #64
1534 ; NONEON-NOSVE-NEXT:    ret
1535   %op = load <16 x half>, ptr %a
1536   %res = call <16 x half> @llvm.rint.v16f16(<16 x half> %op)
1537   store <16 x half> %res, ptr %a
1538   ret void
1541 define <2 x float> @frintx_v2f32(<2 x float> %op) {
1542 ; CHECK-LABEL: frintx_v2f32:
1543 ; CHECK:       // %bb.0:
1544 ; CHECK-NEXT:    ptrue p0.s, vl2
1545 ; CHECK-NEXT:    // kill: def $d0 killed $d0 def $z0
1546 ; CHECK-NEXT:    frintx z0.s, p0/m, z0.s
1547 ; CHECK-NEXT:    // kill: def $d0 killed $d0 killed $z0
1548 ; CHECK-NEXT:    ret
1550 ; NONEON-NOSVE-LABEL: frintx_v2f32:
1551 ; NONEON-NOSVE:       // %bb.0:
1552 ; NONEON-NOSVE-NEXT:    str d0, [sp, #-16]!
1553 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 16
1554 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #4]
1555 ; NONEON-NOSVE-NEXT:    frintx s1, s0
1556 ; NONEON-NOSVE-NEXT:    ldr s0, [sp]
1557 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1558 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #8]
1559 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
1560 ; NONEON-NOSVE-NEXT:    add sp, sp, #16
1561 ; NONEON-NOSVE-NEXT:    ret
1562   %res = call <2 x float> @llvm.rint.v2f32(<2 x float> %op)
1563   ret <2 x float> %res
1566 define <4 x float> @frintx_v4f32(<4 x float> %op) {
1567 ; CHECK-LABEL: frintx_v4f32:
1568 ; CHECK:       // %bb.0:
1569 ; CHECK-NEXT:    ptrue p0.s, vl4
1570 ; CHECK-NEXT:    // kill: def $q0 killed $q0 def $z0
1571 ; CHECK-NEXT:    frintx z0.s, p0/m, z0.s
1572 ; CHECK-NEXT:    // kill: def $q0 killed $q0 killed $z0
1573 ; CHECK-NEXT:    ret
1575 ; NONEON-NOSVE-LABEL: frintx_v4f32:
1576 ; NONEON-NOSVE:       // %bb.0:
1577 ; NONEON-NOSVE-NEXT:    str q0, [sp, #-32]!
1578 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 32
1579 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #12]
1580 ; NONEON-NOSVE-NEXT:    frintx s1, s0
1581 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #8]
1582 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1583 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #24]
1584 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #4]
1585 ; NONEON-NOSVE-NEXT:    frintx s1, s0
1586 ; NONEON-NOSVE-NEXT:    ldr s0, [sp]
1587 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1588 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #16]
1589 ; NONEON-NOSVE-NEXT:    ldr q0, [sp, #16]
1590 ; NONEON-NOSVE-NEXT:    add sp, sp, #32
1591 ; NONEON-NOSVE-NEXT:    ret
1592   %res = call <4 x float> @llvm.rint.v4f32(<4 x float> %op)
1593   ret <4 x float> %res
1596 define void @frintx_v8f32(ptr %a) {
1597 ; CHECK-LABEL: frintx_v8f32:
1598 ; CHECK:       // %bb.0:
1599 ; CHECK-NEXT:    ldp q0, q1, [x0]
1600 ; CHECK-NEXT:    ptrue p0.s, vl4
1601 ; CHECK-NEXT:    frintx z0.s, p0/m, z0.s
1602 ; CHECK-NEXT:    frintx z1.s, p0/m, z1.s
1603 ; CHECK-NEXT:    stp q0, q1, [x0]
1604 ; CHECK-NEXT:    ret
1606 ; NONEON-NOSVE-LABEL: frintx_v8f32:
1607 ; NONEON-NOSVE:       // %bb.0:
1608 ; NONEON-NOSVE-NEXT:    ldp q1, q0, [x0]
1609 ; NONEON-NOSVE-NEXT:    stp q1, q0, [sp, #-64]!
1610 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 64
1611 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #28]
1612 ; NONEON-NOSVE-NEXT:    frintx s1, s0
1613 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #24]
1614 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1615 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #56]
1616 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #20]
1617 ; NONEON-NOSVE-NEXT:    frintx s1, s0
1618 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #16]
1619 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1620 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #48]
1621 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #12]
1622 ; NONEON-NOSVE-NEXT:    frintx s1, s0
1623 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #8]
1624 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1625 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #40]
1626 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #4]
1627 ; NONEON-NOSVE-NEXT:    frintx s1, s0
1628 ; NONEON-NOSVE-NEXT:    ldr s0, [sp]
1629 ; NONEON-NOSVE-NEXT:    frintx s0, s0
1630 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #32]
1631 ; NONEON-NOSVE-NEXT:    ldp q0, q1, [sp, #32]
1632 ; NONEON-NOSVE-NEXT:    stp q0, q1, [x0]
1633 ; NONEON-NOSVE-NEXT:    add sp, sp, #64
1634 ; NONEON-NOSVE-NEXT:    ret
1635   %op = load <8 x float>, ptr %a
1636   %res = call <8 x float> @llvm.rint.v8f32(<8 x float> %op)
1637   store <8 x float> %res, ptr %a
1638   ret void
1641 define <1 x double> @frintx_v1f64(<1 x double> %op) {
1642 ; CHECK-LABEL: frintx_v1f64:
1643 ; CHECK:       // %bb.0:
1644 ; CHECK-NEXT:    frintx d0, d0
1645 ; CHECK-NEXT:    ret
1647 ; NONEON-NOSVE-LABEL: frintx_v1f64:
1648 ; NONEON-NOSVE:       // %bb.0:
1649 ; NONEON-NOSVE-NEXT:    sub sp, sp, #16
1650 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 16
1651 ; NONEON-NOSVE-NEXT:    frintx d0, d0
1652 ; NONEON-NOSVE-NEXT:    str d0, [sp, #8]
1653 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
1654 ; NONEON-NOSVE-NEXT:    add sp, sp, #16
1655 ; NONEON-NOSVE-NEXT:    ret
1656   %res = call <1 x double> @llvm.rint.v1f64(<1 x double> %op)
1657   ret <1 x double> %res
1660 define <2 x double> @frintx_v2f64(<2 x double> %op) {
1661 ; CHECK-LABEL: frintx_v2f64:
1662 ; CHECK:       // %bb.0:
1663 ; CHECK-NEXT:    ptrue p0.d, vl2
1664 ; CHECK-NEXT:    // kill: def $q0 killed $q0 def $z0
1665 ; CHECK-NEXT:    frintx z0.d, p0/m, z0.d
1666 ; CHECK-NEXT:    // kill: def $q0 killed $q0 killed $z0
1667 ; CHECK-NEXT:    ret
1669 ; NONEON-NOSVE-LABEL: frintx_v2f64:
1670 ; NONEON-NOSVE:       // %bb.0:
1671 ; NONEON-NOSVE-NEXT:    str q0, [sp, #-32]!
1672 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 32
1673 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
1674 ; NONEON-NOSVE-NEXT:    frintx d1, d0
1675 ; NONEON-NOSVE-NEXT:    ldr d0, [sp]
1676 ; NONEON-NOSVE-NEXT:    frintx d0, d0
1677 ; NONEON-NOSVE-NEXT:    stp d0, d1, [sp, #16]
1678 ; NONEON-NOSVE-NEXT:    ldr q0, [sp, #16]
1679 ; NONEON-NOSVE-NEXT:    add sp, sp, #32
1680 ; NONEON-NOSVE-NEXT:    ret
1681   %res = call <2 x double> @llvm.rint.v2f64(<2 x double> %op)
1682   ret <2 x double> %res
1685 define void @frintx_v4f64(ptr %a) {
1686 ; CHECK-LABEL: frintx_v4f64:
1687 ; CHECK:       // %bb.0:
1688 ; CHECK-NEXT:    ldp q0, q1, [x0]
1689 ; CHECK-NEXT:    ptrue p0.d, vl2
1690 ; CHECK-NEXT:    frintx z0.d, p0/m, z0.d
1691 ; CHECK-NEXT:    frintx z1.d, p0/m, z1.d
1692 ; CHECK-NEXT:    stp q0, q1, [x0]
1693 ; CHECK-NEXT:    ret
1695 ; NONEON-NOSVE-LABEL: frintx_v4f64:
1696 ; NONEON-NOSVE:       // %bb.0:
1697 ; NONEON-NOSVE-NEXT:    ldp q1, q0, [x0]
1698 ; NONEON-NOSVE-NEXT:    stp q1, q0, [sp, #-64]!
1699 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 64
1700 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #24]
1701 ; NONEON-NOSVE-NEXT:    frintx d1, d0
1702 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #16]
1703 ; NONEON-NOSVE-NEXT:    frintx d0, d0
1704 ; NONEON-NOSVE-NEXT:    stp d0, d1, [sp, #48]
1705 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
1706 ; NONEON-NOSVE-NEXT:    frintx d1, d0
1707 ; NONEON-NOSVE-NEXT:    ldr d0, [sp]
1708 ; NONEON-NOSVE-NEXT:    frintx d0, d0
1709 ; NONEON-NOSVE-NEXT:    stp d0, d1, [sp, #32]
1710 ; NONEON-NOSVE-NEXT:    ldp q0, q1, [sp, #32]
1711 ; NONEON-NOSVE-NEXT:    stp q0, q1, [x0]
1712 ; NONEON-NOSVE-NEXT:    add sp, sp, #64
1713 ; NONEON-NOSVE-NEXT:    ret
1714   %op = load <4 x double>, ptr %a
1715   %res = call <4 x double> @llvm.rint.v4f64(<4 x double> %op)
1716   store <4 x double> %res, ptr %a
1717   ret void
1721 ; ROUND -> FRINTA
1724 define <2 x half> @frinta_v2f16(<2 x half> %op) {
1725 ; CHECK-LABEL: frinta_v2f16:
1726 ; CHECK:       // %bb.0:
1727 ; CHECK-NEXT:    ptrue p0.h, vl4
1728 ; CHECK-NEXT:    // kill: def $d0 killed $d0 def $z0
1729 ; CHECK-NEXT:    frinta z0.h, p0/m, z0.h
1730 ; CHECK-NEXT:    // kill: def $d0 killed $d0 killed $z0
1731 ; CHECK-NEXT:    ret
1733 ; NONEON-NOSVE-LABEL: frinta_v2f16:
1734 ; NONEON-NOSVE:       // %bb.0:
1735 ; NONEON-NOSVE-NEXT:    str d0, [sp, #-16]!
1736 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 16
1737 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #6]
1738 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1739 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1740 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1741 ; NONEON-NOSVE-NEXT:    str h0, [sp, #14]
1742 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #4]
1743 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1744 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1745 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1746 ; NONEON-NOSVE-NEXT:    str h0, [sp, #12]
1747 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #2]
1748 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1749 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1750 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1751 ; NONEON-NOSVE-NEXT:    str h0, [sp, #10]
1752 ; NONEON-NOSVE-NEXT:    ldr h0, [sp]
1753 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1754 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1755 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1756 ; NONEON-NOSVE-NEXT:    str h0, [sp, #8]
1757 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
1758 ; NONEON-NOSVE-NEXT:    add sp, sp, #16
1759 ; NONEON-NOSVE-NEXT:    ret
1760   %res = call <2 x half> @llvm.round.v2f16(<2 x half> %op)
1761   ret <2 x half> %res
1764 define <4 x half> @frinta_v4f16(<4 x half> %op) {
1765 ; CHECK-LABEL: frinta_v4f16:
1766 ; CHECK:       // %bb.0:
1767 ; CHECK-NEXT:    ptrue p0.h, vl4
1768 ; CHECK-NEXT:    // kill: def $d0 killed $d0 def $z0
1769 ; CHECK-NEXT:    frinta z0.h, p0/m, z0.h
1770 ; CHECK-NEXT:    // kill: def $d0 killed $d0 killed $z0
1771 ; CHECK-NEXT:    ret
1773 ; NONEON-NOSVE-LABEL: frinta_v4f16:
1774 ; NONEON-NOSVE:       // %bb.0:
1775 ; NONEON-NOSVE-NEXT:    str d0, [sp, #-16]!
1776 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 16
1777 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #6]
1778 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1779 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1780 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1781 ; NONEON-NOSVE-NEXT:    str h0, [sp, #14]
1782 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #4]
1783 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1784 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1785 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1786 ; NONEON-NOSVE-NEXT:    str h0, [sp, #12]
1787 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #2]
1788 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1789 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1790 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1791 ; NONEON-NOSVE-NEXT:    str h0, [sp, #10]
1792 ; NONEON-NOSVE-NEXT:    ldr h0, [sp]
1793 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1794 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1795 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1796 ; NONEON-NOSVE-NEXT:    str h0, [sp, #8]
1797 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
1798 ; NONEON-NOSVE-NEXT:    add sp, sp, #16
1799 ; NONEON-NOSVE-NEXT:    ret
1800   %res = call <4 x half> @llvm.round.v4f16(<4 x half> %op)
1801   ret <4 x half> %res
1804 define <8 x half> @frinta_v8f16(<8 x half> %op) {
1805 ; CHECK-LABEL: frinta_v8f16:
1806 ; CHECK:       // %bb.0:
1807 ; CHECK-NEXT:    ptrue p0.h, vl8
1808 ; CHECK-NEXT:    // kill: def $q0 killed $q0 def $z0
1809 ; CHECK-NEXT:    frinta z0.h, p0/m, z0.h
1810 ; CHECK-NEXT:    // kill: def $q0 killed $q0 killed $z0
1811 ; CHECK-NEXT:    ret
1813 ; NONEON-NOSVE-LABEL: frinta_v8f16:
1814 ; NONEON-NOSVE:       // %bb.0:
1815 ; NONEON-NOSVE-NEXT:    str q0, [sp, #-32]!
1816 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 32
1817 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #14]
1818 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1819 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1820 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1821 ; NONEON-NOSVE-NEXT:    str h0, [sp, #30]
1822 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #12]
1823 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1824 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1825 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1826 ; NONEON-NOSVE-NEXT:    str h0, [sp, #28]
1827 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #10]
1828 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1829 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1830 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1831 ; NONEON-NOSVE-NEXT:    str h0, [sp, #26]
1832 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #8]
1833 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1834 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1835 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1836 ; NONEON-NOSVE-NEXT:    str h0, [sp, #24]
1837 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #6]
1838 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1839 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1840 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1841 ; NONEON-NOSVE-NEXT:    str h0, [sp, #22]
1842 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #4]
1843 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1844 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1845 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1846 ; NONEON-NOSVE-NEXT:    str h0, [sp, #20]
1847 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #2]
1848 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1849 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1850 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1851 ; NONEON-NOSVE-NEXT:    str h0, [sp, #18]
1852 ; NONEON-NOSVE-NEXT:    ldr h0, [sp]
1853 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1854 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1855 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1856 ; NONEON-NOSVE-NEXT:    str h0, [sp, #16]
1857 ; NONEON-NOSVE-NEXT:    ldr q0, [sp, #16]
1858 ; NONEON-NOSVE-NEXT:    add sp, sp, #32
1859 ; NONEON-NOSVE-NEXT:    ret
1860   %res = call <8 x half> @llvm.round.v8f16(<8 x half> %op)
1861   ret <8 x half> %res
1864 define void @frinta_v16f16(ptr %a) {
1865 ; CHECK-LABEL: frinta_v16f16:
1866 ; CHECK:       // %bb.0:
1867 ; CHECK-NEXT:    ldp q0, q1, [x0]
1868 ; CHECK-NEXT:    ptrue p0.h, vl8
1869 ; CHECK-NEXT:    frinta z0.h, p0/m, z0.h
1870 ; CHECK-NEXT:    frinta z1.h, p0/m, z1.h
1871 ; CHECK-NEXT:    stp q0, q1, [x0]
1872 ; CHECK-NEXT:    ret
1874 ; NONEON-NOSVE-LABEL: frinta_v16f16:
1875 ; NONEON-NOSVE:       // %bb.0:
1876 ; NONEON-NOSVE-NEXT:    ldp q1, q0, [x0]
1877 ; NONEON-NOSVE-NEXT:    stp q1, q0, [sp, #-64]!
1878 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 64
1879 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #30]
1880 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1881 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1882 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1883 ; NONEON-NOSVE-NEXT:    str h0, [sp, #62]
1884 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #28]
1885 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1886 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1887 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1888 ; NONEON-NOSVE-NEXT:    str h0, [sp, #60]
1889 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #26]
1890 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1891 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1892 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1893 ; NONEON-NOSVE-NEXT:    str h0, [sp, #58]
1894 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #24]
1895 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1896 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1897 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1898 ; NONEON-NOSVE-NEXT:    str h0, [sp, #56]
1899 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #22]
1900 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1901 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1902 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1903 ; NONEON-NOSVE-NEXT:    str h0, [sp, #54]
1904 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #20]
1905 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1906 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1907 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1908 ; NONEON-NOSVE-NEXT:    str h0, [sp, #52]
1909 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #18]
1910 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1911 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1912 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1913 ; NONEON-NOSVE-NEXT:    str h0, [sp, #50]
1914 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #16]
1915 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1916 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1917 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1918 ; NONEON-NOSVE-NEXT:    str h0, [sp, #48]
1919 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #14]
1920 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1921 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1922 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1923 ; NONEON-NOSVE-NEXT:    str h0, [sp, #46]
1924 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #12]
1925 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1926 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1927 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1928 ; NONEON-NOSVE-NEXT:    str h0, [sp, #44]
1929 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #10]
1930 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1931 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1932 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1933 ; NONEON-NOSVE-NEXT:    str h0, [sp, #42]
1934 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #8]
1935 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1936 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1937 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1938 ; NONEON-NOSVE-NEXT:    str h0, [sp, #40]
1939 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #6]
1940 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1941 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1942 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1943 ; NONEON-NOSVE-NEXT:    str h0, [sp, #38]
1944 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #4]
1945 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1946 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1947 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1948 ; NONEON-NOSVE-NEXT:    str h0, [sp, #36]
1949 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #2]
1950 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1951 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1952 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1953 ; NONEON-NOSVE-NEXT:    str h0, [sp, #34]
1954 ; NONEON-NOSVE-NEXT:    ldr h0, [sp]
1955 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
1956 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1957 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
1958 ; NONEON-NOSVE-NEXT:    str h0, [sp, #32]
1959 ; NONEON-NOSVE-NEXT:    ldp q0, q1, [sp, #32]
1960 ; NONEON-NOSVE-NEXT:    stp q0, q1, [x0]
1961 ; NONEON-NOSVE-NEXT:    add sp, sp, #64
1962 ; NONEON-NOSVE-NEXT:    ret
1963   %op = load <16 x half>, ptr %a
1964   %res = call <16 x half> @llvm.round.v16f16(<16 x half> %op)
1965   store <16 x half> %res, ptr %a
1966   ret void
1969 define <2 x float> @frinta_v2f32(<2 x float> %op) {
1970 ; CHECK-LABEL: frinta_v2f32:
1971 ; CHECK:       // %bb.0:
1972 ; CHECK-NEXT:    ptrue p0.s, vl2
1973 ; CHECK-NEXT:    // kill: def $d0 killed $d0 def $z0
1974 ; CHECK-NEXT:    frinta z0.s, p0/m, z0.s
1975 ; CHECK-NEXT:    // kill: def $d0 killed $d0 killed $z0
1976 ; CHECK-NEXT:    ret
1978 ; NONEON-NOSVE-LABEL: frinta_v2f32:
1979 ; NONEON-NOSVE:       // %bb.0:
1980 ; NONEON-NOSVE-NEXT:    str d0, [sp, #-16]!
1981 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 16
1982 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #4]
1983 ; NONEON-NOSVE-NEXT:    frinta s1, s0
1984 ; NONEON-NOSVE-NEXT:    ldr s0, [sp]
1985 ; NONEON-NOSVE-NEXT:    frinta s0, s0
1986 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #8]
1987 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
1988 ; NONEON-NOSVE-NEXT:    add sp, sp, #16
1989 ; NONEON-NOSVE-NEXT:    ret
1990   %res = call <2 x float> @llvm.round.v2f32(<2 x float> %op)
1991   ret <2 x float> %res
1994 define <4 x float> @frinta_v4f32(<4 x float> %op) {
1995 ; CHECK-LABEL: frinta_v4f32:
1996 ; CHECK:       // %bb.0:
1997 ; CHECK-NEXT:    ptrue p0.s, vl4
1998 ; CHECK-NEXT:    // kill: def $q0 killed $q0 def $z0
1999 ; CHECK-NEXT:    frinta z0.s, p0/m, z0.s
2000 ; CHECK-NEXT:    // kill: def $q0 killed $q0 killed $z0
2001 ; CHECK-NEXT:    ret
2003 ; NONEON-NOSVE-LABEL: frinta_v4f32:
2004 ; NONEON-NOSVE:       // %bb.0:
2005 ; NONEON-NOSVE-NEXT:    str q0, [sp, #-32]!
2006 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 32
2007 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #12]
2008 ; NONEON-NOSVE-NEXT:    frinta s1, s0
2009 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #8]
2010 ; NONEON-NOSVE-NEXT:    frinta s0, s0
2011 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #24]
2012 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #4]
2013 ; NONEON-NOSVE-NEXT:    frinta s1, s0
2014 ; NONEON-NOSVE-NEXT:    ldr s0, [sp]
2015 ; NONEON-NOSVE-NEXT:    frinta s0, s0
2016 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #16]
2017 ; NONEON-NOSVE-NEXT:    ldr q0, [sp, #16]
2018 ; NONEON-NOSVE-NEXT:    add sp, sp, #32
2019 ; NONEON-NOSVE-NEXT:    ret
2020   %res = call <4 x float> @llvm.round.v4f32(<4 x float> %op)
2021   ret <4 x float> %res
2024 define void @frinta_v8f32(ptr %a) {
2025 ; CHECK-LABEL: frinta_v8f32:
2026 ; CHECK:       // %bb.0:
2027 ; CHECK-NEXT:    ldp q0, q1, [x0]
2028 ; CHECK-NEXT:    ptrue p0.s, vl4
2029 ; CHECK-NEXT:    frinta z0.s, p0/m, z0.s
2030 ; CHECK-NEXT:    frinta z1.s, p0/m, z1.s
2031 ; CHECK-NEXT:    stp q0, q1, [x0]
2032 ; CHECK-NEXT:    ret
2034 ; NONEON-NOSVE-LABEL: frinta_v8f32:
2035 ; NONEON-NOSVE:       // %bb.0:
2036 ; NONEON-NOSVE-NEXT:    ldp q1, q0, [x0]
2037 ; NONEON-NOSVE-NEXT:    stp q1, q0, [sp, #-64]!
2038 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 64
2039 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #28]
2040 ; NONEON-NOSVE-NEXT:    frinta s1, s0
2041 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #24]
2042 ; NONEON-NOSVE-NEXT:    frinta s0, s0
2043 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #56]
2044 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #20]
2045 ; NONEON-NOSVE-NEXT:    frinta s1, s0
2046 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #16]
2047 ; NONEON-NOSVE-NEXT:    frinta s0, s0
2048 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #48]
2049 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #12]
2050 ; NONEON-NOSVE-NEXT:    frinta s1, s0
2051 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #8]
2052 ; NONEON-NOSVE-NEXT:    frinta s0, s0
2053 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #40]
2054 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #4]
2055 ; NONEON-NOSVE-NEXT:    frinta s1, s0
2056 ; NONEON-NOSVE-NEXT:    ldr s0, [sp]
2057 ; NONEON-NOSVE-NEXT:    frinta s0, s0
2058 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #32]
2059 ; NONEON-NOSVE-NEXT:    ldp q0, q1, [sp, #32]
2060 ; NONEON-NOSVE-NEXT:    stp q0, q1, [x0]
2061 ; NONEON-NOSVE-NEXT:    add sp, sp, #64
2062 ; NONEON-NOSVE-NEXT:    ret
2063   %op = load <8 x float>, ptr %a
2064   %res = call <8 x float> @llvm.round.v8f32(<8 x float> %op)
2065   store <8 x float> %res, ptr %a
2066   ret void
2069 define <1 x double> @frinta_v1f64(<1 x double> %op) {
2070 ; CHECK-LABEL: frinta_v1f64:
2071 ; CHECK:       // %bb.0:
2072 ; CHECK-NEXT:    frinta d0, d0
2073 ; CHECK-NEXT:    ret
2075 ; NONEON-NOSVE-LABEL: frinta_v1f64:
2076 ; NONEON-NOSVE:       // %bb.0:
2077 ; NONEON-NOSVE-NEXT:    sub sp, sp, #16
2078 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 16
2079 ; NONEON-NOSVE-NEXT:    frinta d0, d0
2080 ; NONEON-NOSVE-NEXT:    str d0, [sp, #8]
2081 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
2082 ; NONEON-NOSVE-NEXT:    add sp, sp, #16
2083 ; NONEON-NOSVE-NEXT:    ret
2084   %res = call <1 x double> @llvm.round.v1f64(<1 x double> %op)
2085   ret <1 x double> %res
2088 define <2 x double> @frinta_v2f64(<2 x double> %op) {
2089 ; CHECK-LABEL: frinta_v2f64:
2090 ; CHECK:       // %bb.0:
2091 ; CHECK-NEXT:    ptrue p0.d, vl2
2092 ; CHECK-NEXT:    // kill: def $q0 killed $q0 def $z0
2093 ; CHECK-NEXT:    frinta z0.d, p0/m, z0.d
2094 ; CHECK-NEXT:    // kill: def $q0 killed $q0 killed $z0
2095 ; CHECK-NEXT:    ret
2097 ; NONEON-NOSVE-LABEL: frinta_v2f64:
2098 ; NONEON-NOSVE:       // %bb.0:
2099 ; NONEON-NOSVE-NEXT:    str q0, [sp, #-32]!
2100 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 32
2101 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
2102 ; NONEON-NOSVE-NEXT:    frinta d1, d0
2103 ; NONEON-NOSVE-NEXT:    ldr d0, [sp]
2104 ; NONEON-NOSVE-NEXT:    frinta d0, d0
2105 ; NONEON-NOSVE-NEXT:    stp d0, d1, [sp, #16]
2106 ; NONEON-NOSVE-NEXT:    ldr q0, [sp, #16]
2107 ; NONEON-NOSVE-NEXT:    add sp, sp, #32
2108 ; NONEON-NOSVE-NEXT:    ret
2109   %res = call <2 x double> @llvm.round.v2f64(<2 x double> %op)
2110   ret <2 x double> %res
2113 define void @frinta_v4f64(ptr %a) {
2114 ; CHECK-LABEL: frinta_v4f64:
2115 ; CHECK:       // %bb.0:
2116 ; CHECK-NEXT:    ldp q0, q1, [x0]
2117 ; CHECK-NEXT:    ptrue p0.d, vl2
2118 ; CHECK-NEXT:    frinta z0.d, p0/m, z0.d
2119 ; CHECK-NEXT:    frinta z1.d, p0/m, z1.d
2120 ; CHECK-NEXT:    stp q0, q1, [x0]
2121 ; CHECK-NEXT:    ret
2123 ; NONEON-NOSVE-LABEL: frinta_v4f64:
2124 ; NONEON-NOSVE:       // %bb.0:
2125 ; NONEON-NOSVE-NEXT:    ldp q1, q0, [x0]
2126 ; NONEON-NOSVE-NEXT:    stp q1, q0, [sp, #-64]!
2127 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 64
2128 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #24]
2129 ; NONEON-NOSVE-NEXT:    frinta d1, d0
2130 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #16]
2131 ; NONEON-NOSVE-NEXT:    frinta d0, d0
2132 ; NONEON-NOSVE-NEXT:    stp d0, d1, [sp, #48]
2133 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
2134 ; NONEON-NOSVE-NEXT:    frinta d1, d0
2135 ; NONEON-NOSVE-NEXT:    ldr d0, [sp]
2136 ; NONEON-NOSVE-NEXT:    frinta d0, d0
2137 ; NONEON-NOSVE-NEXT:    stp d0, d1, [sp, #32]
2138 ; NONEON-NOSVE-NEXT:    ldp q0, q1, [sp, #32]
2139 ; NONEON-NOSVE-NEXT:    stp q0, q1, [x0]
2140 ; NONEON-NOSVE-NEXT:    add sp, sp, #64
2141 ; NONEON-NOSVE-NEXT:    ret
2142   %op = load <4 x double>, ptr %a
2143   %res = call <4 x double> @llvm.round.v4f64(<4 x double> %op)
2144   store <4 x double> %res, ptr %a
2145   ret void
2149 ; ROUNDEVEN -> FRINTN
2152 define <2 x half> @frintn_v2f16(<2 x half> %op) {
2153 ; CHECK-LABEL: frintn_v2f16:
2154 ; CHECK:       // %bb.0:
2155 ; CHECK-NEXT:    ptrue p0.h, vl4
2156 ; CHECK-NEXT:    // kill: def $d0 killed $d0 def $z0
2157 ; CHECK-NEXT:    frintn z0.h, p0/m, z0.h
2158 ; CHECK-NEXT:    // kill: def $d0 killed $d0 killed $z0
2159 ; CHECK-NEXT:    ret
2161 ; NONEON-NOSVE-LABEL: frintn_v2f16:
2162 ; NONEON-NOSVE:       // %bb.0:
2163 ; NONEON-NOSVE-NEXT:    str d0, [sp, #-16]!
2164 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 16
2165 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #6]
2166 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2167 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2168 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2169 ; NONEON-NOSVE-NEXT:    str h0, [sp, #14]
2170 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #4]
2171 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2172 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2173 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2174 ; NONEON-NOSVE-NEXT:    str h0, [sp, #12]
2175 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #2]
2176 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2177 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2178 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2179 ; NONEON-NOSVE-NEXT:    str h0, [sp, #10]
2180 ; NONEON-NOSVE-NEXT:    ldr h0, [sp]
2181 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2182 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2183 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2184 ; NONEON-NOSVE-NEXT:    str h0, [sp, #8]
2185 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
2186 ; NONEON-NOSVE-NEXT:    add sp, sp, #16
2187 ; NONEON-NOSVE-NEXT:    ret
2188   %res = call <2 x half> @llvm.roundeven.v2f16(<2 x half> %op)
2189   ret <2 x half> %res
2192 define <4 x half> @frintn_v4f16(<4 x half> %op) {
2193 ; CHECK-LABEL: frintn_v4f16:
2194 ; CHECK:       // %bb.0:
2195 ; CHECK-NEXT:    ptrue p0.h, vl4
2196 ; CHECK-NEXT:    // kill: def $d0 killed $d0 def $z0
2197 ; CHECK-NEXT:    frintn z0.h, p0/m, z0.h
2198 ; CHECK-NEXT:    // kill: def $d0 killed $d0 killed $z0
2199 ; CHECK-NEXT:    ret
2201 ; NONEON-NOSVE-LABEL: frintn_v4f16:
2202 ; NONEON-NOSVE:       // %bb.0:
2203 ; NONEON-NOSVE-NEXT:    str d0, [sp, #-16]!
2204 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 16
2205 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #6]
2206 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2207 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2208 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2209 ; NONEON-NOSVE-NEXT:    str h0, [sp, #14]
2210 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #4]
2211 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2212 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2213 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2214 ; NONEON-NOSVE-NEXT:    str h0, [sp, #12]
2215 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #2]
2216 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2217 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2218 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2219 ; NONEON-NOSVE-NEXT:    str h0, [sp, #10]
2220 ; NONEON-NOSVE-NEXT:    ldr h0, [sp]
2221 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2222 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2223 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2224 ; NONEON-NOSVE-NEXT:    str h0, [sp, #8]
2225 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
2226 ; NONEON-NOSVE-NEXT:    add sp, sp, #16
2227 ; NONEON-NOSVE-NEXT:    ret
2228   %res = call <4 x half> @llvm.roundeven.v4f16(<4 x half> %op)
2229   ret <4 x half> %res
2232 define <8 x half> @frintn_v8f16(<8 x half> %op) {
2233 ; CHECK-LABEL: frintn_v8f16:
2234 ; CHECK:       // %bb.0:
2235 ; CHECK-NEXT:    ptrue p0.h, vl8
2236 ; CHECK-NEXT:    // kill: def $q0 killed $q0 def $z0
2237 ; CHECK-NEXT:    frintn z0.h, p0/m, z0.h
2238 ; CHECK-NEXT:    // kill: def $q0 killed $q0 killed $z0
2239 ; CHECK-NEXT:    ret
2241 ; NONEON-NOSVE-LABEL: frintn_v8f16:
2242 ; NONEON-NOSVE:       // %bb.0:
2243 ; NONEON-NOSVE-NEXT:    str q0, [sp, #-32]!
2244 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 32
2245 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #14]
2246 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2247 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2248 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2249 ; NONEON-NOSVE-NEXT:    str h0, [sp, #30]
2250 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #12]
2251 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2252 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2253 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2254 ; NONEON-NOSVE-NEXT:    str h0, [sp, #28]
2255 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #10]
2256 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2257 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2258 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2259 ; NONEON-NOSVE-NEXT:    str h0, [sp, #26]
2260 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #8]
2261 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2262 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2263 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2264 ; NONEON-NOSVE-NEXT:    str h0, [sp, #24]
2265 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #6]
2266 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2267 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2268 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2269 ; NONEON-NOSVE-NEXT:    str h0, [sp, #22]
2270 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #4]
2271 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2272 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2273 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2274 ; NONEON-NOSVE-NEXT:    str h0, [sp, #20]
2275 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #2]
2276 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2277 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2278 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2279 ; NONEON-NOSVE-NEXT:    str h0, [sp, #18]
2280 ; NONEON-NOSVE-NEXT:    ldr h0, [sp]
2281 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2282 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2283 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2284 ; NONEON-NOSVE-NEXT:    str h0, [sp, #16]
2285 ; NONEON-NOSVE-NEXT:    ldr q0, [sp, #16]
2286 ; NONEON-NOSVE-NEXT:    add sp, sp, #32
2287 ; NONEON-NOSVE-NEXT:    ret
2288   %res = call <8 x half> @llvm.roundeven.v8f16(<8 x half> %op)
2289   ret <8 x half> %res
2292 define void @frintn_v16f16(ptr %a) {
2293 ; CHECK-LABEL: frintn_v16f16:
2294 ; CHECK:       // %bb.0:
2295 ; CHECK-NEXT:    ldp q0, q1, [x0]
2296 ; CHECK-NEXT:    ptrue p0.h, vl8
2297 ; CHECK-NEXT:    frintn z0.h, p0/m, z0.h
2298 ; CHECK-NEXT:    frintn z1.h, p0/m, z1.h
2299 ; CHECK-NEXT:    stp q0, q1, [x0]
2300 ; CHECK-NEXT:    ret
2302 ; NONEON-NOSVE-LABEL: frintn_v16f16:
2303 ; NONEON-NOSVE:       // %bb.0:
2304 ; NONEON-NOSVE-NEXT:    ldp q1, q0, [x0]
2305 ; NONEON-NOSVE-NEXT:    stp q1, q0, [sp, #-64]!
2306 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 64
2307 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #30]
2308 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2309 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2310 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2311 ; NONEON-NOSVE-NEXT:    str h0, [sp, #62]
2312 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #28]
2313 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2314 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2315 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2316 ; NONEON-NOSVE-NEXT:    str h0, [sp, #60]
2317 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #26]
2318 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2319 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2320 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2321 ; NONEON-NOSVE-NEXT:    str h0, [sp, #58]
2322 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #24]
2323 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2324 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2325 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2326 ; NONEON-NOSVE-NEXT:    str h0, [sp, #56]
2327 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #22]
2328 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2329 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2330 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2331 ; NONEON-NOSVE-NEXT:    str h0, [sp, #54]
2332 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #20]
2333 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2334 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2335 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2336 ; NONEON-NOSVE-NEXT:    str h0, [sp, #52]
2337 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #18]
2338 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2339 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2340 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2341 ; NONEON-NOSVE-NEXT:    str h0, [sp, #50]
2342 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #16]
2343 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2344 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2345 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2346 ; NONEON-NOSVE-NEXT:    str h0, [sp, #48]
2347 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #14]
2348 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2349 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2350 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2351 ; NONEON-NOSVE-NEXT:    str h0, [sp, #46]
2352 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #12]
2353 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2354 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2355 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2356 ; NONEON-NOSVE-NEXT:    str h0, [sp, #44]
2357 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #10]
2358 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2359 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2360 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2361 ; NONEON-NOSVE-NEXT:    str h0, [sp, #42]
2362 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #8]
2363 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2364 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2365 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2366 ; NONEON-NOSVE-NEXT:    str h0, [sp, #40]
2367 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #6]
2368 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2369 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2370 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2371 ; NONEON-NOSVE-NEXT:    str h0, [sp, #38]
2372 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #4]
2373 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2374 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2375 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2376 ; NONEON-NOSVE-NEXT:    str h0, [sp, #36]
2377 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #2]
2378 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2379 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2380 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2381 ; NONEON-NOSVE-NEXT:    str h0, [sp, #34]
2382 ; NONEON-NOSVE-NEXT:    ldr h0, [sp]
2383 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2384 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2385 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2386 ; NONEON-NOSVE-NEXT:    str h0, [sp, #32]
2387 ; NONEON-NOSVE-NEXT:    ldp q0, q1, [sp, #32]
2388 ; NONEON-NOSVE-NEXT:    stp q0, q1, [x0]
2389 ; NONEON-NOSVE-NEXT:    add sp, sp, #64
2390 ; NONEON-NOSVE-NEXT:    ret
2391   %op = load <16 x half>, ptr %a
2392   %res = call <16 x half> @llvm.roundeven.v16f16(<16 x half> %op)
2393   store <16 x half> %res, ptr %a
2394   ret void
2397 define <2 x float> @frintn_v2f32(<2 x float> %op) {
2398 ; CHECK-LABEL: frintn_v2f32:
2399 ; CHECK:       // %bb.0:
2400 ; CHECK-NEXT:    ptrue p0.s, vl2
2401 ; CHECK-NEXT:    // kill: def $d0 killed $d0 def $z0
2402 ; CHECK-NEXT:    frintn z0.s, p0/m, z0.s
2403 ; CHECK-NEXT:    // kill: def $d0 killed $d0 killed $z0
2404 ; CHECK-NEXT:    ret
2406 ; NONEON-NOSVE-LABEL: frintn_v2f32:
2407 ; NONEON-NOSVE:       // %bb.0:
2408 ; NONEON-NOSVE-NEXT:    str d0, [sp, #-16]!
2409 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 16
2410 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #4]
2411 ; NONEON-NOSVE-NEXT:    frintn s1, s0
2412 ; NONEON-NOSVE-NEXT:    ldr s0, [sp]
2413 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2414 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #8]
2415 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
2416 ; NONEON-NOSVE-NEXT:    add sp, sp, #16
2417 ; NONEON-NOSVE-NEXT:    ret
2418   %res = call <2 x float> @llvm.roundeven.v2f32(<2 x float> %op)
2419   ret <2 x float> %res
2422 define <4 x float> @frintn_v4f32(<4 x float> %op) {
2423 ; CHECK-LABEL: frintn_v4f32:
2424 ; CHECK:       // %bb.0:
2425 ; CHECK-NEXT:    ptrue p0.s, vl4
2426 ; CHECK-NEXT:    // kill: def $q0 killed $q0 def $z0
2427 ; CHECK-NEXT:    frintn z0.s, p0/m, z0.s
2428 ; CHECK-NEXT:    // kill: def $q0 killed $q0 killed $z0
2429 ; CHECK-NEXT:    ret
2431 ; NONEON-NOSVE-LABEL: frintn_v4f32:
2432 ; NONEON-NOSVE:       // %bb.0:
2433 ; NONEON-NOSVE-NEXT:    str q0, [sp, #-32]!
2434 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 32
2435 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #12]
2436 ; NONEON-NOSVE-NEXT:    frintn s1, s0
2437 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #8]
2438 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2439 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #24]
2440 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #4]
2441 ; NONEON-NOSVE-NEXT:    frintn s1, s0
2442 ; NONEON-NOSVE-NEXT:    ldr s0, [sp]
2443 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2444 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #16]
2445 ; NONEON-NOSVE-NEXT:    ldr q0, [sp, #16]
2446 ; NONEON-NOSVE-NEXT:    add sp, sp, #32
2447 ; NONEON-NOSVE-NEXT:    ret
2448   %res = call <4 x float> @llvm.roundeven.v4f32(<4 x float> %op)
2449   ret <4 x float> %res
2452 define void @frintn_v8f32(ptr %a) {
2453 ; CHECK-LABEL: frintn_v8f32:
2454 ; CHECK:       // %bb.0:
2455 ; CHECK-NEXT:    ldp q0, q1, [x0]
2456 ; CHECK-NEXT:    ptrue p0.s, vl4
2457 ; CHECK-NEXT:    frintn z0.s, p0/m, z0.s
2458 ; CHECK-NEXT:    frintn z1.s, p0/m, z1.s
2459 ; CHECK-NEXT:    stp q0, q1, [x0]
2460 ; CHECK-NEXT:    ret
2462 ; NONEON-NOSVE-LABEL: frintn_v8f32:
2463 ; NONEON-NOSVE:       // %bb.0:
2464 ; NONEON-NOSVE-NEXT:    ldp q1, q0, [x0]
2465 ; NONEON-NOSVE-NEXT:    stp q1, q0, [sp, #-64]!
2466 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 64
2467 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #28]
2468 ; NONEON-NOSVE-NEXT:    frintn s1, s0
2469 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #24]
2470 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2471 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #56]
2472 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #20]
2473 ; NONEON-NOSVE-NEXT:    frintn s1, s0
2474 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #16]
2475 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2476 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #48]
2477 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #12]
2478 ; NONEON-NOSVE-NEXT:    frintn s1, s0
2479 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #8]
2480 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2481 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #40]
2482 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #4]
2483 ; NONEON-NOSVE-NEXT:    frintn s1, s0
2484 ; NONEON-NOSVE-NEXT:    ldr s0, [sp]
2485 ; NONEON-NOSVE-NEXT:    frintn s0, s0
2486 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #32]
2487 ; NONEON-NOSVE-NEXT:    ldp q0, q1, [sp, #32]
2488 ; NONEON-NOSVE-NEXT:    stp q0, q1, [x0]
2489 ; NONEON-NOSVE-NEXT:    add sp, sp, #64
2490 ; NONEON-NOSVE-NEXT:    ret
2491   %op = load <8 x float>, ptr %a
2492   %res = call <8 x float> @llvm.roundeven.v8f32(<8 x float> %op)
2493   store <8 x float> %res, ptr %a
2494   ret void
2497 define <1 x double> @frintn_v1f64(<1 x double> %op) {
2498 ; CHECK-LABEL: frintn_v1f64:
2499 ; CHECK:       // %bb.0:
2500 ; CHECK-NEXT:    frintn d0, d0
2501 ; CHECK-NEXT:    ret
2503 ; NONEON-NOSVE-LABEL: frintn_v1f64:
2504 ; NONEON-NOSVE:       // %bb.0:
2505 ; NONEON-NOSVE-NEXT:    sub sp, sp, #16
2506 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 16
2507 ; NONEON-NOSVE-NEXT:    frintn d0, d0
2508 ; NONEON-NOSVE-NEXT:    str d0, [sp, #8]
2509 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
2510 ; NONEON-NOSVE-NEXT:    add sp, sp, #16
2511 ; NONEON-NOSVE-NEXT:    ret
2512   %res = call <1 x double> @llvm.roundeven.v1f64(<1 x double> %op)
2513   ret <1 x double> %res
2516 define <2 x double> @frintn_v2f64(<2 x double> %op) {
2517 ; CHECK-LABEL: frintn_v2f64:
2518 ; CHECK:       // %bb.0:
2519 ; CHECK-NEXT:    ptrue p0.d, vl2
2520 ; CHECK-NEXT:    // kill: def $q0 killed $q0 def $z0
2521 ; CHECK-NEXT:    frintn z0.d, p0/m, z0.d
2522 ; CHECK-NEXT:    // kill: def $q0 killed $q0 killed $z0
2523 ; CHECK-NEXT:    ret
2525 ; NONEON-NOSVE-LABEL: frintn_v2f64:
2526 ; NONEON-NOSVE:       // %bb.0:
2527 ; NONEON-NOSVE-NEXT:    str q0, [sp, #-32]!
2528 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 32
2529 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
2530 ; NONEON-NOSVE-NEXT:    frintn d1, d0
2531 ; NONEON-NOSVE-NEXT:    ldr d0, [sp]
2532 ; NONEON-NOSVE-NEXT:    frintn d0, d0
2533 ; NONEON-NOSVE-NEXT:    stp d0, d1, [sp, #16]
2534 ; NONEON-NOSVE-NEXT:    ldr q0, [sp, #16]
2535 ; NONEON-NOSVE-NEXT:    add sp, sp, #32
2536 ; NONEON-NOSVE-NEXT:    ret
2537   %res = call <2 x double> @llvm.roundeven.v2f64(<2 x double> %op)
2538   ret <2 x double> %res
2541 define void @frintn_v4f64(ptr %a) {
2542 ; CHECK-LABEL: frintn_v4f64:
2543 ; CHECK:       // %bb.0:
2544 ; CHECK-NEXT:    ldp q0, q1, [x0]
2545 ; CHECK-NEXT:    ptrue p0.d, vl2
2546 ; CHECK-NEXT:    frintn z0.d, p0/m, z0.d
2547 ; CHECK-NEXT:    frintn z1.d, p0/m, z1.d
2548 ; CHECK-NEXT:    stp q0, q1, [x0]
2549 ; CHECK-NEXT:    ret
2551 ; NONEON-NOSVE-LABEL: frintn_v4f64:
2552 ; NONEON-NOSVE:       // %bb.0:
2553 ; NONEON-NOSVE-NEXT:    ldp q1, q0, [x0]
2554 ; NONEON-NOSVE-NEXT:    stp q1, q0, [sp, #-64]!
2555 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 64
2556 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #24]
2557 ; NONEON-NOSVE-NEXT:    frintn d1, d0
2558 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #16]
2559 ; NONEON-NOSVE-NEXT:    frintn d0, d0
2560 ; NONEON-NOSVE-NEXT:    stp d0, d1, [sp, #48]
2561 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
2562 ; NONEON-NOSVE-NEXT:    frintn d1, d0
2563 ; NONEON-NOSVE-NEXT:    ldr d0, [sp]
2564 ; NONEON-NOSVE-NEXT:    frintn d0, d0
2565 ; NONEON-NOSVE-NEXT:    stp d0, d1, [sp, #32]
2566 ; NONEON-NOSVE-NEXT:    ldp q0, q1, [sp, #32]
2567 ; NONEON-NOSVE-NEXT:    stp q0, q1, [x0]
2568 ; NONEON-NOSVE-NEXT:    add sp, sp, #64
2569 ; NONEON-NOSVE-NEXT:    ret
2570   %op = load <4 x double>, ptr %a
2571   %res = call <4 x double> @llvm.roundeven.v4f64(<4 x double> %op)
2572   store <4 x double> %res, ptr %a
2573   ret void
2577 ; TRUNC -> FRINTZ
2580 define <2 x half> @frintz_v2f16(<2 x half> %op) {
2581 ; CHECK-LABEL: frintz_v2f16:
2582 ; CHECK:       // %bb.0:
2583 ; CHECK-NEXT:    ptrue p0.h, vl4
2584 ; CHECK-NEXT:    // kill: def $d0 killed $d0 def $z0
2585 ; CHECK-NEXT:    frintz z0.h, p0/m, z0.h
2586 ; CHECK-NEXT:    // kill: def $d0 killed $d0 killed $z0
2587 ; CHECK-NEXT:    ret
2589 ; NONEON-NOSVE-LABEL: frintz_v2f16:
2590 ; NONEON-NOSVE:       // %bb.0:
2591 ; NONEON-NOSVE-NEXT:    str d0, [sp, #-16]!
2592 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 16
2593 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #6]
2594 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2595 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2596 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2597 ; NONEON-NOSVE-NEXT:    str h0, [sp, #14]
2598 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #4]
2599 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2600 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2601 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2602 ; NONEON-NOSVE-NEXT:    str h0, [sp, #12]
2603 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #2]
2604 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2605 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2606 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2607 ; NONEON-NOSVE-NEXT:    str h0, [sp, #10]
2608 ; NONEON-NOSVE-NEXT:    ldr h0, [sp]
2609 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2610 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2611 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2612 ; NONEON-NOSVE-NEXT:    str h0, [sp, #8]
2613 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
2614 ; NONEON-NOSVE-NEXT:    add sp, sp, #16
2615 ; NONEON-NOSVE-NEXT:    ret
2616   %res = call <2 x half> @llvm.trunc.v2f16(<2 x half> %op)
2617   ret <2 x half> %res
2620 define <4 x half> @frintz_v4f16(<4 x half> %op) {
2621 ; CHECK-LABEL: frintz_v4f16:
2622 ; CHECK:       // %bb.0:
2623 ; CHECK-NEXT:    ptrue p0.h, vl4
2624 ; CHECK-NEXT:    // kill: def $d0 killed $d0 def $z0
2625 ; CHECK-NEXT:    frintz z0.h, p0/m, z0.h
2626 ; CHECK-NEXT:    // kill: def $d0 killed $d0 killed $z0
2627 ; CHECK-NEXT:    ret
2629 ; NONEON-NOSVE-LABEL: frintz_v4f16:
2630 ; NONEON-NOSVE:       // %bb.0:
2631 ; NONEON-NOSVE-NEXT:    str d0, [sp, #-16]!
2632 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 16
2633 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #6]
2634 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2635 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2636 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2637 ; NONEON-NOSVE-NEXT:    str h0, [sp, #14]
2638 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #4]
2639 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2640 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2641 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2642 ; NONEON-NOSVE-NEXT:    str h0, [sp, #12]
2643 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #2]
2644 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2645 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2646 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2647 ; NONEON-NOSVE-NEXT:    str h0, [sp, #10]
2648 ; NONEON-NOSVE-NEXT:    ldr h0, [sp]
2649 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2650 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2651 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2652 ; NONEON-NOSVE-NEXT:    str h0, [sp, #8]
2653 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
2654 ; NONEON-NOSVE-NEXT:    add sp, sp, #16
2655 ; NONEON-NOSVE-NEXT:    ret
2656   %res = call <4 x half> @llvm.trunc.v4f16(<4 x half> %op)
2657   ret <4 x half> %res
2660 define <8 x half> @frintz_v8f16(<8 x half> %op) {
2661 ; CHECK-LABEL: frintz_v8f16:
2662 ; CHECK:       // %bb.0:
2663 ; CHECK-NEXT:    ptrue p0.h, vl8
2664 ; CHECK-NEXT:    // kill: def $q0 killed $q0 def $z0
2665 ; CHECK-NEXT:    frintz z0.h, p0/m, z0.h
2666 ; CHECK-NEXT:    // kill: def $q0 killed $q0 killed $z0
2667 ; CHECK-NEXT:    ret
2669 ; NONEON-NOSVE-LABEL: frintz_v8f16:
2670 ; NONEON-NOSVE:       // %bb.0:
2671 ; NONEON-NOSVE-NEXT:    str q0, [sp, #-32]!
2672 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 32
2673 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #14]
2674 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2675 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2676 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2677 ; NONEON-NOSVE-NEXT:    str h0, [sp, #30]
2678 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #12]
2679 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2680 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2681 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2682 ; NONEON-NOSVE-NEXT:    str h0, [sp, #28]
2683 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #10]
2684 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2685 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2686 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2687 ; NONEON-NOSVE-NEXT:    str h0, [sp, #26]
2688 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #8]
2689 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2690 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2691 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2692 ; NONEON-NOSVE-NEXT:    str h0, [sp, #24]
2693 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #6]
2694 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2695 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2696 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2697 ; NONEON-NOSVE-NEXT:    str h0, [sp, #22]
2698 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #4]
2699 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2700 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2701 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2702 ; NONEON-NOSVE-NEXT:    str h0, [sp, #20]
2703 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #2]
2704 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2705 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2706 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2707 ; NONEON-NOSVE-NEXT:    str h0, [sp, #18]
2708 ; NONEON-NOSVE-NEXT:    ldr h0, [sp]
2709 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2710 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2711 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2712 ; NONEON-NOSVE-NEXT:    str h0, [sp, #16]
2713 ; NONEON-NOSVE-NEXT:    ldr q0, [sp, #16]
2714 ; NONEON-NOSVE-NEXT:    add sp, sp, #32
2715 ; NONEON-NOSVE-NEXT:    ret
2716   %res = call <8 x half> @llvm.trunc.v8f16(<8 x half> %op)
2717   ret <8 x half> %res
2720 define void @frintz_v16f16(ptr %a) {
2721 ; CHECK-LABEL: frintz_v16f16:
2722 ; CHECK:       // %bb.0:
2723 ; CHECK-NEXT:    ldp q0, q1, [x0]
2724 ; CHECK-NEXT:    ptrue p0.h, vl8
2725 ; CHECK-NEXT:    frintz z0.h, p0/m, z0.h
2726 ; CHECK-NEXT:    frintz z1.h, p0/m, z1.h
2727 ; CHECK-NEXT:    stp q0, q1, [x0]
2728 ; CHECK-NEXT:    ret
2730 ; NONEON-NOSVE-LABEL: frintz_v16f16:
2731 ; NONEON-NOSVE:       // %bb.0:
2732 ; NONEON-NOSVE-NEXT:    ldp q1, q0, [x0]
2733 ; NONEON-NOSVE-NEXT:    stp q1, q0, [sp, #-64]!
2734 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 64
2735 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #30]
2736 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2737 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2738 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2739 ; NONEON-NOSVE-NEXT:    str h0, [sp, #62]
2740 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #28]
2741 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2742 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2743 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2744 ; NONEON-NOSVE-NEXT:    str h0, [sp, #60]
2745 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #26]
2746 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2747 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2748 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2749 ; NONEON-NOSVE-NEXT:    str h0, [sp, #58]
2750 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #24]
2751 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2752 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2753 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2754 ; NONEON-NOSVE-NEXT:    str h0, [sp, #56]
2755 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #22]
2756 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2757 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2758 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2759 ; NONEON-NOSVE-NEXT:    str h0, [sp, #54]
2760 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #20]
2761 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2762 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2763 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2764 ; NONEON-NOSVE-NEXT:    str h0, [sp, #52]
2765 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #18]
2766 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2767 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2768 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2769 ; NONEON-NOSVE-NEXT:    str h0, [sp, #50]
2770 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #16]
2771 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2772 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2773 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2774 ; NONEON-NOSVE-NEXT:    str h0, [sp, #48]
2775 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #14]
2776 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2777 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2778 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2779 ; NONEON-NOSVE-NEXT:    str h0, [sp, #46]
2780 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #12]
2781 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2782 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2783 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2784 ; NONEON-NOSVE-NEXT:    str h0, [sp, #44]
2785 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #10]
2786 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2787 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2788 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2789 ; NONEON-NOSVE-NEXT:    str h0, [sp, #42]
2790 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #8]
2791 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2792 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2793 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2794 ; NONEON-NOSVE-NEXT:    str h0, [sp, #40]
2795 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #6]
2796 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2797 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2798 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2799 ; NONEON-NOSVE-NEXT:    str h0, [sp, #38]
2800 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #4]
2801 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2802 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2803 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2804 ; NONEON-NOSVE-NEXT:    str h0, [sp, #36]
2805 ; NONEON-NOSVE-NEXT:    ldr h0, [sp, #2]
2806 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2807 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2808 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2809 ; NONEON-NOSVE-NEXT:    str h0, [sp, #34]
2810 ; NONEON-NOSVE-NEXT:    ldr h0, [sp]
2811 ; NONEON-NOSVE-NEXT:    fcvt s0, h0
2812 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2813 ; NONEON-NOSVE-NEXT:    fcvt h0, s0
2814 ; NONEON-NOSVE-NEXT:    str h0, [sp, #32]
2815 ; NONEON-NOSVE-NEXT:    ldp q0, q1, [sp, #32]
2816 ; NONEON-NOSVE-NEXT:    stp q0, q1, [x0]
2817 ; NONEON-NOSVE-NEXT:    add sp, sp, #64
2818 ; NONEON-NOSVE-NEXT:    ret
2819   %op = load <16 x half>, ptr %a
2820   %res = call <16 x half> @llvm.trunc.v16f16(<16 x half> %op)
2821   store <16 x half> %res, ptr %a
2822   ret void
2825 define <2 x float> @frintz_v2f32(<2 x float> %op) {
2826 ; CHECK-LABEL: frintz_v2f32:
2827 ; CHECK:       // %bb.0:
2828 ; CHECK-NEXT:    ptrue p0.s, vl2
2829 ; CHECK-NEXT:    // kill: def $d0 killed $d0 def $z0
2830 ; CHECK-NEXT:    frintz z0.s, p0/m, z0.s
2831 ; CHECK-NEXT:    // kill: def $d0 killed $d0 killed $z0
2832 ; CHECK-NEXT:    ret
2834 ; NONEON-NOSVE-LABEL: frintz_v2f32:
2835 ; NONEON-NOSVE:       // %bb.0:
2836 ; NONEON-NOSVE-NEXT:    str d0, [sp, #-16]!
2837 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 16
2838 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #4]
2839 ; NONEON-NOSVE-NEXT:    frintz s1, s0
2840 ; NONEON-NOSVE-NEXT:    ldr s0, [sp]
2841 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2842 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #8]
2843 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
2844 ; NONEON-NOSVE-NEXT:    add sp, sp, #16
2845 ; NONEON-NOSVE-NEXT:    ret
2846   %res = call <2 x float> @llvm.trunc.v2f32(<2 x float> %op)
2847   ret <2 x float> %res
2850 define <4 x float> @frintz_v4f32(<4 x float> %op) {
2851 ; CHECK-LABEL: frintz_v4f32:
2852 ; CHECK:       // %bb.0:
2853 ; CHECK-NEXT:    ptrue p0.s, vl4
2854 ; CHECK-NEXT:    // kill: def $q0 killed $q0 def $z0
2855 ; CHECK-NEXT:    frintz z0.s, p0/m, z0.s
2856 ; CHECK-NEXT:    // kill: def $q0 killed $q0 killed $z0
2857 ; CHECK-NEXT:    ret
2859 ; NONEON-NOSVE-LABEL: frintz_v4f32:
2860 ; NONEON-NOSVE:       // %bb.0:
2861 ; NONEON-NOSVE-NEXT:    str q0, [sp, #-32]!
2862 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 32
2863 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #12]
2864 ; NONEON-NOSVE-NEXT:    frintz s1, s0
2865 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #8]
2866 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2867 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #24]
2868 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #4]
2869 ; NONEON-NOSVE-NEXT:    frintz s1, s0
2870 ; NONEON-NOSVE-NEXT:    ldr s0, [sp]
2871 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2872 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #16]
2873 ; NONEON-NOSVE-NEXT:    ldr q0, [sp, #16]
2874 ; NONEON-NOSVE-NEXT:    add sp, sp, #32
2875 ; NONEON-NOSVE-NEXT:    ret
2876   %res = call <4 x float> @llvm.trunc.v4f32(<4 x float> %op)
2877   ret <4 x float> %res
2880 define void @frintz_v8f32(ptr %a) {
2881 ; CHECK-LABEL: frintz_v8f32:
2882 ; CHECK:       // %bb.0:
2883 ; CHECK-NEXT:    ldp q0, q1, [x0]
2884 ; CHECK-NEXT:    ptrue p0.s, vl4
2885 ; CHECK-NEXT:    frintz z0.s, p0/m, z0.s
2886 ; CHECK-NEXT:    frintz z1.s, p0/m, z1.s
2887 ; CHECK-NEXT:    stp q0, q1, [x0]
2888 ; CHECK-NEXT:    ret
2890 ; NONEON-NOSVE-LABEL: frintz_v8f32:
2891 ; NONEON-NOSVE:       // %bb.0:
2892 ; NONEON-NOSVE-NEXT:    ldp q1, q0, [x0]
2893 ; NONEON-NOSVE-NEXT:    stp q1, q0, [sp, #-64]!
2894 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 64
2895 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #28]
2896 ; NONEON-NOSVE-NEXT:    frintz s1, s0
2897 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #24]
2898 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2899 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #56]
2900 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #20]
2901 ; NONEON-NOSVE-NEXT:    frintz s1, s0
2902 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #16]
2903 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2904 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #48]
2905 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #12]
2906 ; NONEON-NOSVE-NEXT:    frintz s1, s0
2907 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #8]
2908 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2909 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #40]
2910 ; NONEON-NOSVE-NEXT:    ldr s0, [sp, #4]
2911 ; NONEON-NOSVE-NEXT:    frintz s1, s0
2912 ; NONEON-NOSVE-NEXT:    ldr s0, [sp]
2913 ; NONEON-NOSVE-NEXT:    frintz s0, s0
2914 ; NONEON-NOSVE-NEXT:    stp s0, s1, [sp, #32]
2915 ; NONEON-NOSVE-NEXT:    ldp q0, q1, [sp, #32]
2916 ; NONEON-NOSVE-NEXT:    stp q0, q1, [x0]
2917 ; NONEON-NOSVE-NEXT:    add sp, sp, #64
2918 ; NONEON-NOSVE-NEXT:    ret
2919   %op = load <8 x float>, ptr %a
2920   %res = call <8 x float> @llvm.trunc.v8f32(<8 x float> %op)
2921   store <8 x float> %res, ptr %a
2922   ret void
2925 define <1 x double> @frintz_v1f64(<1 x double> %op) {
2926 ; CHECK-LABEL: frintz_v1f64:
2927 ; CHECK:       // %bb.0:
2928 ; CHECK-NEXT:    frintz d0, d0
2929 ; CHECK-NEXT:    ret
2931 ; NONEON-NOSVE-LABEL: frintz_v1f64:
2932 ; NONEON-NOSVE:       // %bb.0:
2933 ; NONEON-NOSVE-NEXT:    sub sp, sp, #16
2934 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 16
2935 ; NONEON-NOSVE-NEXT:    frintz d0, d0
2936 ; NONEON-NOSVE-NEXT:    str d0, [sp, #8]
2937 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
2938 ; NONEON-NOSVE-NEXT:    add sp, sp, #16
2939 ; NONEON-NOSVE-NEXT:    ret
2940   %res = call <1 x double> @llvm.trunc.v1f64(<1 x double> %op)
2941   ret <1 x double> %res
2944 define <2 x double> @frintz_v2f64(<2 x double> %op) {
2945 ; CHECK-LABEL: frintz_v2f64:
2946 ; CHECK:       // %bb.0:
2947 ; CHECK-NEXT:    ptrue p0.d, vl2
2948 ; CHECK-NEXT:    // kill: def $q0 killed $q0 def $z0
2949 ; CHECK-NEXT:    frintz z0.d, p0/m, z0.d
2950 ; CHECK-NEXT:    // kill: def $q0 killed $q0 killed $z0
2951 ; CHECK-NEXT:    ret
2953 ; NONEON-NOSVE-LABEL: frintz_v2f64:
2954 ; NONEON-NOSVE:       // %bb.0:
2955 ; NONEON-NOSVE-NEXT:    str q0, [sp, #-32]!
2956 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 32
2957 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
2958 ; NONEON-NOSVE-NEXT:    frintz d1, d0
2959 ; NONEON-NOSVE-NEXT:    ldr d0, [sp]
2960 ; NONEON-NOSVE-NEXT:    frintz d0, d0
2961 ; NONEON-NOSVE-NEXT:    stp d0, d1, [sp, #16]
2962 ; NONEON-NOSVE-NEXT:    ldr q0, [sp, #16]
2963 ; NONEON-NOSVE-NEXT:    add sp, sp, #32
2964 ; NONEON-NOSVE-NEXT:    ret
2965   %res = call <2 x double> @llvm.trunc.v2f64(<2 x double> %op)
2966   ret <2 x double> %res
2969 define void @frintz_v4f64(ptr %a) {
2970 ; CHECK-LABEL: frintz_v4f64:
2971 ; CHECK:       // %bb.0:
2972 ; CHECK-NEXT:    ldp q0, q1, [x0]
2973 ; CHECK-NEXT:    ptrue p0.d, vl2
2974 ; CHECK-NEXT:    frintz z0.d, p0/m, z0.d
2975 ; CHECK-NEXT:    frintz z1.d, p0/m, z1.d
2976 ; CHECK-NEXT:    stp q0, q1, [x0]
2977 ; CHECK-NEXT:    ret
2979 ; NONEON-NOSVE-LABEL: frintz_v4f64:
2980 ; NONEON-NOSVE:       // %bb.0:
2981 ; NONEON-NOSVE-NEXT:    ldp q1, q0, [x0]
2982 ; NONEON-NOSVE-NEXT:    stp q1, q0, [sp, #-64]!
2983 ; NONEON-NOSVE-NEXT:    .cfi_def_cfa_offset 64
2984 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #24]
2985 ; NONEON-NOSVE-NEXT:    frintz d1, d0
2986 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #16]
2987 ; NONEON-NOSVE-NEXT:    frintz d0, d0
2988 ; NONEON-NOSVE-NEXT:    stp d0, d1, [sp, #48]
2989 ; NONEON-NOSVE-NEXT:    ldr d0, [sp, #8]
2990 ; NONEON-NOSVE-NEXT:    frintz d1, d0
2991 ; NONEON-NOSVE-NEXT:    ldr d0, [sp]
2992 ; NONEON-NOSVE-NEXT:    frintz d0, d0
2993 ; NONEON-NOSVE-NEXT:    stp d0, d1, [sp, #32]
2994 ; NONEON-NOSVE-NEXT:    ldp q0, q1, [sp, #32]
2995 ; NONEON-NOSVE-NEXT:    stp q0, q1, [x0]
2996 ; NONEON-NOSVE-NEXT:    add sp, sp, #64
2997 ; NONEON-NOSVE-NEXT:    ret
2998   %op = load <4 x double>, ptr %a
2999   %res = call <4 x double> @llvm.trunc.v4f64(<4 x double> %op)
3000   store <4 x double> %res, ptr %a
3001   ret void
3004 declare <2 x half> @llvm.ceil.v2f16(<2 x half>)
3005 declare <4 x half> @llvm.ceil.v4f16(<4 x half>)
3006 declare <8 x half> @llvm.ceil.v8f16(<8 x half>)
3007 declare <16 x half> @llvm.ceil.v16f16(<16 x half>)
3008 declare <32 x half> @llvm.ceil.v32f16(<32 x half>)
3009 declare <64 x half> @llvm.ceil.v64f16(<64 x half>)
3010 declare <128 x half> @llvm.ceil.v128f16(<128 x half>)
3011 declare <2 x float> @llvm.ceil.v2f32(<2 x float>)
3012 declare <4 x float> @llvm.ceil.v4f32(<4 x float>)
3013 declare <8 x float> @llvm.ceil.v8f32(<8 x float>)
3014 declare <16 x float> @llvm.ceil.v16f32(<16 x float>)
3015 declare <32 x float> @llvm.ceil.v32f32(<32 x float>)
3016 declare <64 x float> @llvm.ceil.v64f32(<64 x float>)
3017 declare <1 x double> @llvm.ceil.v1f64(<1 x double>)
3018 declare <2 x double> @llvm.ceil.v2f64(<2 x double>)
3019 declare <4 x double> @llvm.ceil.v4f64(<4 x double>)
3020 declare <8 x double> @llvm.ceil.v8f64(<8 x double>)
3021 declare <16 x double> @llvm.ceil.v16f64(<16 x double>)
3022 declare <32 x double> @llvm.ceil.v32f64(<32 x double>)
3024 declare <2 x half> @llvm.floor.v2f16(<2 x half>)
3025 declare <4 x half> @llvm.floor.v4f16(<4 x half>)
3026 declare <8 x half> @llvm.floor.v8f16(<8 x half>)
3027 declare <16 x half> @llvm.floor.v16f16(<16 x half>)
3028 declare <32 x half> @llvm.floor.v32f16(<32 x half>)
3029 declare <64 x half> @llvm.floor.v64f16(<64 x half>)
3030 declare <128 x half> @llvm.floor.v128f16(<128 x half>)
3031 declare <2 x float> @llvm.floor.v2f32(<2 x float>)
3032 declare <4 x float> @llvm.floor.v4f32(<4 x float>)
3033 declare <8 x float> @llvm.floor.v8f32(<8 x float>)
3034 declare <16 x float> @llvm.floor.v16f32(<16 x float>)
3035 declare <32 x float> @llvm.floor.v32f32(<32 x float>)
3036 declare <64 x float> @llvm.floor.v64f32(<64 x float>)
3037 declare <1 x double> @llvm.floor.v1f64(<1 x double>)
3038 declare <2 x double> @llvm.floor.v2f64(<2 x double>)
3039 declare <4 x double> @llvm.floor.v4f64(<4 x double>)
3040 declare <8 x double> @llvm.floor.v8f64(<8 x double>)
3041 declare <16 x double> @llvm.floor.v16f64(<16 x double>)
3042 declare <32 x double> @llvm.floor.v32f64(<32 x double>)
3044 declare <2 x half> @llvm.nearbyint.v2f16(<2 x half>)
3045 declare <4 x half> @llvm.nearbyint.v4f16(<4 x half>)
3046 declare <8 x half> @llvm.nearbyint.v8f16(<8 x half>)
3047 declare <16 x half> @llvm.nearbyint.v16f16(<16 x half>)
3048 declare <32 x half> @llvm.nearbyint.v32f16(<32 x half>)
3049 declare <64 x half> @llvm.nearbyint.v64f16(<64 x half>)
3050 declare <128 x half> @llvm.nearbyint.v128f16(<128 x half>)
3051 declare <2 x float> @llvm.nearbyint.v2f32(<2 x float>)
3052 declare <4 x float> @llvm.nearbyint.v4f32(<4 x float>)
3053 declare <8 x float> @llvm.nearbyint.v8f32(<8 x float>)
3054 declare <16 x float> @llvm.nearbyint.v16f32(<16 x float>)
3055 declare <32 x float> @llvm.nearbyint.v32f32(<32 x float>)
3056 declare <64 x float> @llvm.nearbyint.v64f32(<64 x float>)
3057 declare <1 x double> @llvm.nearbyint.v1f64(<1 x double>)
3058 declare <2 x double> @llvm.nearbyint.v2f64(<2 x double>)
3059 declare <4 x double> @llvm.nearbyint.v4f64(<4 x double>)
3060 declare <8 x double> @llvm.nearbyint.v8f64(<8 x double>)
3061 declare <16 x double> @llvm.nearbyint.v16f64(<16 x double>)
3062 declare <32 x double> @llvm.nearbyint.v32f64(<32 x double>)
3064 declare <2 x half> @llvm.rint.v2f16(<2 x half>)
3065 declare <4 x half> @llvm.rint.v4f16(<4 x half>)
3066 declare <8 x half> @llvm.rint.v8f16(<8 x half>)
3067 declare <16 x half> @llvm.rint.v16f16(<16 x half>)
3068 declare <32 x half> @llvm.rint.v32f16(<32 x half>)
3069 declare <64 x half> @llvm.rint.v64f16(<64 x half>)
3070 declare <128 x half> @llvm.rint.v128f16(<128 x half>)
3071 declare <2 x float> @llvm.rint.v2f32(<2 x float>)
3072 declare <4 x float> @llvm.rint.v4f32(<4 x float>)
3073 declare <8 x float> @llvm.rint.v8f32(<8 x float>)
3074 declare <16 x float> @llvm.rint.v16f32(<16 x float>)
3075 declare <32 x float> @llvm.rint.v32f32(<32 x float>)
3076 declare <64 x float> @llvm.rint.v64f32(<64 x float>)
3077 declare <1 x double> @llvm.rint.v1f64(<1 x double>)
3078 declare <2 x double> @llvm.rint.v2f64(<2 x double>)
3079 declare <4 x double> @llvm.rint.v4f64(<4 x double>)
3080 declare <8 x double> @llvm.rint.v8f64(<8 x double>)
3081 declare <16 x double> @llvm.rint.v16f64(<16 x double>)
3082 declare <32 x double> @llvm.rint.v32f64(<32 x double>)
3084 declare <2 x half> @llvm.round.v2f16(<2 x half>)
3085 declare <4 x half> @llvm.round.v4f16(<4 x half>)
3086 declare <8 x half> @llvm.round.v8f16(<8 x half>)
3087 declare <16 x half> @llvm.round.v16f16(<16 x half>)
3088 declare <32 x half> @llvm.round.v32f16(<32 x half>)
3089 declare <64 x half> @llvm.round.v64f16(<64 x half>)
3090 declare <128 x half> @llvm.round.v128f16(<128 x half>)
3091 declare <2 x float> @llvm.round.v2f32(<2 x float>)
3092 declare <4 x float> @llvm.round.v4f32(<4 x float>)
3093 declare <8 x float> @llvm.round.v8f32(<8 x float>)
3094 declare <16 x float> @llvm.round.v16f32(<16 x float>)
3095 declare <32 x float> @llvm.round.v32f32(<32 x float>)
3096 declare <64 x float> @llvm.round.v64f32(<64 x float>)
3097 declare <1 x double> @llvm.round.v1f64(<1 x double>)
3098 declare <2 x double> @llvm.round.v2f64(<2 x double>)
3099 declare <4 x double> @llvm.round.v4f64(<4 x double>)
3100 declare <8 x double> @llvm.round.v8f64(<8 x double>)
3101 declare <16 x double> @llvm.round.v16f64(<16 x double>)
3102 declare <32 x double> @llvm.round.v32f64(<32 x double>)
3104 declare <2 x half> @llvm.roundeven.v2f16(<2 x half>)
3105 declare <4 x half> @llvm.roundeven.v4f16(<4 x half>)
3106 declare <8 x half> @llvm.roundeven.v8f16(<8 x half>)
3107 declare <16 x half> @llvm.roundeven.v16f16(<16 x half>)
3108 declare <32 x half> @llvm.roundeven.v32f16(<32 x half>)
3109 declare <64 x half> @llvm.roundeven.v64f16(<64 x half>)
3110 declare <128 x half> @llvm.roundeven.v128f16(<128 x half>)
3111 declare <2 x float> @llvm.roundeven.v2f32(<2 x float>)
3112 declare <4 x float> @llvm.roundeven.v4f32(<4 x float>)
3113 declare <8 x float> @llvm.roundeven.v8f32(<8 x float>)
3114 declare <16 x float> @llvm.roundeven.v16f32(<16 x float>)
3115 declare <32 x float> @llvm.roundeven.v32f32(<32 x float>)
3116 declare <64 x float> @llvm.roundeven.v64f32(<64 x float>)
3117 declare <1 x double> @llvm.roundeven.v1f64(<1 x double>)
3118 declare <2 x double> @llvm.roundeven.v2f64(<2 x double>)
3119 declare <4 x double> @llvm.roundeven.v4f64(<4 x double>)
3120 declare <8 x double> @llvm.roundeven.v8f64(<8 x double>)
3121 declare <16 x double> @llvm.roundeven.v16f64(<16 x double>)
3122 declare <32 x double> @llvm.roundeven.v32f64(<32 x double>)
3124 declare <2 x half> @llvm.trunc.v2f16(<2 x half>)
3125 declare <4 x half> @llvm.trunc.v4f16(<4 x half>)
3126 declare <8 x half> @llvm.trunc.v8f16(<8 x half>)
3127 declare <16 x half> @llvm.trunc.v16f16(<16 x half>)
3128 declare <32 x half> @llvm.trunc.v32f16(<32 x half>)
3129 declare <64 x half> @llvm.trunc.v64f16(<64 x half>)
3130 declare <128 x half> @llvm.trunc.v128f16(<128 x half>)
3131 declare <2 x float> @llvm.trunc.v2f32(<2 x float>)
3132 declare <4 x float> @llvm.trunc.v4f32(<4 x float>)
3133 declare <8 x float> @llvm.trunc.v8f32(<8 x float>)
3134 declare <16 x float> @llvm.trunc.v16f32(<16 x float>)
3135 declare <32 x float> @llvm.trunc.v32f32(<32 x float>)
3136 declare <64 x float> @llvm.trunc.v64f32(<64 x float>)
3137 declare <1 x double> @llvm.trunc.v1f64(<1 x double>)
3138 declare <2 x double> @llvm.trunc.v2f64(<2 x double>)
3139 declare <4 x double> @llvm.trunc.v4f64(<4 x double>)
3140 declare <8 x double> @llvm.trunc.v8f64(<8 x double>)
3141 declare <16 x double> @llvm.trunc.v16f64(<16 x double>)
3142 declare <32 x double> @llvm.trunc.v32f64(<32 x double>)