1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
2 ; RUN: llc -mtriple=aarch64 -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-SD
3 ; RUN: llc -mtriple=aarch64 -global-isel -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-GI
5 define double @sin_f64(double %a) {
6 ; CHECK-LABEL: sin_f64:
7 ; CHECK: // %bb.0: // %entry
10 %c = call double @llvm.sin.f64(double %a)
14 define float @sin_f32(float %a) {
15 ; CHECK-LABEL: sin_f32:
16 ; CHECK: // %bb.0: // %entry
19 %c = call float @llvm.sin.f32(float %a)
23 define half @sin_f16(half %a) {
24 ; CHECK-LABEL: sin_f16:
25 ; CHECK: // %bb.0: // %entry
26 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
27 ; CHECK-NEXT: .cfi_def_cfa_offset 16
28 ; CHECK-NEXT: .cfi_offset w30, -16
29 ; CHECK-NEXT: fcvt s0, h0
31 ; CHECK-NEXT: fcvt h0, s0
32 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
35 %c = call half @llvm.sin.f16(half %a)
39 define <1 x double> @sin_v1f64(<1 x double> %x) {
40 ; CHECK-LABEL: sin_v1f64:
42 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
43 ; CHECK-NEXT: .cfi_def_cfa_offset 16
44 ; CHECK-NEXT: .cfi_offset w30, -16
46 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
48 %c = call <1 x double> @llvm.sin.v1f64(<1 x double> %x)
52 define <2 x double> @sin_v2f64(<2 x double> %a) {
53 ; CHECK-SD-LABEL: sin_v2f64:
54 ; CHECK-SD: // %bb.0: // %entry
55 ; CHECK-SD-NEXT: sub sp, sp, #48
56 ; CHECK-SD-NEXT: str x30, [sp, #32] // 8-byte Folded Spill
57 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 48
58 ; CHECK-SD-NEXT: .cfi_offset w30, -16
59 ; CHECK-SD-NEXT: str q0, [sp] // 16-byte Folded Spill
60 ; CHECK-SD-NEXT: mov d0, v0.d[1]
61 ; CHECK-SD-NEXT: bl sin
62 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
63 ; CHECK-SD-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
64 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
65 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 killed $q0
66 ; CHECK-SD-NEXT: bl sin
67 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
68 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
69 ; CHECK-SD-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload
70 ; CHECK-SD-NEXT: mov v0.d[1], v1.d[0]
71 ; CHECK-SD-NEXT: add sp, sp, #48
74 ; CHECK-GI-LABEL: sin_v2f64:
75 ; CHECK-GI: // %bb.0: // %entry
76 ; CHECK-GI-NEXT: sub sp, sp, #32
77 ; CHECK-GI-NEXT: str d8, [sp, #16] // 8-byte Folded Spill
78 ; CHECK-GI-NEXT: str x30, [sp, #24] // 8-byte Folded Spill
79 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 32
80 ; CHECK-GI-NEXT: .cfi_offset w30, -8
81 ; CHECK-GI-NEXT: .cfi_offset b8, -16
82 ; CHECK-GI-NEXT: mov d8, v0.d[1]
83 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 killed $q0
84 ; CHECK-GI-NEXT: bl sin
85 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
86 ; CHECK-GI-NEXT: str q0, [sp] // 16-byte Folded Spill
87 ; CHECK-GI-NEXT: fmov d0, d8
88 ; CHECK-GI-NEXT: bl sin
89 ; CHECK-GI-NEXT: ldr q1, [sp] // 16-byte Folded Reload
90 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
91 ; CHECK-GI-NEXT: ldr x30, [sp, #24] // 8-byte Folded Reload
92 ; CHECK-GI-NEXT: ldr d8, [sp, #16] // 8-byte Folded Reload
93 ; CHECK-GI-NEXT: mov v1.d[1], v0.d[0]
94 ; CHECK-GI-NEXT: mov v0.16b, v1.16b
95 ; CHECK-GI-NEXT: add sp, sp, #32
98 %c = call <2 x double> @llvm.sin.v2f64(<2 x double> %a)
102 define <3 x double> @sin_v3f64(<3 x double> %a) {
103 ; CHECK-SD-LABEL: sin_v3f64:
104 ; CHECK-SD: // %bb.0: // %entry
105 ; CHECK-SD-NEXT: str d10, [sp, #-32]! // 8-byte Folded Spill
106 ; CHECK-SD-NEXT: stp d9, d8, [sp, #8] // 16-byte Folded Spill
107 ; CHECK-SD-NEXT: str x30, [sp, #24] // 8-byte Folded Spill
108 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
109 ; CHECK-SD-NEXT: .cfi_offset w30, -8
110 ; CHECK-SD-NEXT: .cfi_offset b8, -16
111 ; CHECK-SD-NEXT: .cfi_offset b9, -24
112 ; CHECK-SD-NEXT: .cfi_offset b10, -32
113 ; CHECK-SD-NEXT: fmov d8, d2
114 ; CHECK-SD-NEXT: fmov d9, d1
115 ; CHECK-SD-NEXT: bl sin
116 ; CHECK-SD-NEXT: fmov d10, d0
117 ; CHECK-SD-NEXT: fmov d0, d9
118 ; CHECK-SD-NEXT: bl sin
119 ; CHECK-SD-NEXT: fmov d9, d0
120 ; CHECK-SD-NEXT: fmov d0, d8
121 ; CHECK-SD-NEXT: bl sin
122 ; CHECK-SD-NEXT: fmov d1, d9
123 ; CHECK-SD-NEXT: ldp d9, d8, [sp, #8] // 16-byte Folded Reload
124 ; CHECK-SD-NEXT: ldr x30, [sp, #24] // 8-byte Folded Reload
125 ; CHECK-SD-NEXT: fmov d2, d0
126 ; CHECK-SD-NEXT: fmov d0, d10
127 ; CHECK-SD-NEXT: ldr d10, [sp], #32 // 8-byte Folded Reload
130 ; CHECK-GI-LABEL: sin_v3f64:
131 ; CHECK-GI: // %bb.0: // %entry
132 ; CHECK-GI-NEXT: str d10, [sp, #-32]! // 8-byte Folded Spill
133 ; CHECK-GI-NEXT: stp d9, d8, [sp, #8] // 16-byte Folded Spill
134 ; CHECK-GI-NEXT: str x30, [sp, #24] // 8-byte Folded Spill
135 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 32
136 ; CHECK-GI-NEXT: .cfi_offset w30, -8
137 ; CHECK-GI-NEXT: .cfi_offset b8, -16
138 ; CHECK-GI-NEXT: .cfi_offset b9, -24
139 ; CHECK-GI-NEXT: .cfi_offset b10, -32
140 ; CHECK-GI-NEXT: fmov d8, d1
141 ; CHECK-GI-NEXT: fmov d9, d2
142 ; CHECK-GI-NEXT: bl sin
143 ; CHECK-GI-NEXT: fmov d10, d0
144 ; CHECK-GI-NEXT: fmov d0, d8
145 ; CHECK-GI-NEXT: bl sin
146 ; CHECK-GI-NEXT: fmov d8, d0
147 ; CHECK-GI-NEXT: fmov d0, d9
148 ; CHECK-GI-NEXT: bl sin
149 ; CHECK-GI-NEXT: fmov d1, d8
150 ; CHECK-GI-NEXT: ldp d9, d8, [sp, #8] // 16-byte Folded Reload
151 ; CHECK-GI-NEXT: ldr x30, [sp, #24] // 8-byte Folded Reload
152 ; CHECK-GI-NEXT: fmov d2, d0
153 ; CHECK-GI-NEXT: fmov d0, d10
154 ; CHECK-GI-NEXT: ldr d10, [sp], #32 // 8-byte Folded Reload
157 %c = call <3 x double> @llvm.sin.v3f64(<3 x double> %a)
161 define <4 x double> @sin_v4f64(<4 x double> %a) {
162 ; CHECK-SD-LABEL: sin_v4f64:
163 ; CHECK-SD: // %bb.0: // %entry
164 ; CHECK-SD-NEXT: sub sp, sp, #64
165 ; CHECK-SD-NEXT: str x30, [sp, #48] // 8-byte Folded Spill
166 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 64
167 ; CHECK-SD-NEXT: .cfi_offset w30, -16
168 ; CHECK-SD-NEXT: str q0, [sp] // 16-byte Folded Spill
169 ; CHECK-SD-NEXT: mov d0, v0.d[1]
170 ; CHECK-SD-NEXT: str q1, [sp, #32] // 16-byte Folded Spill
171 ; CHECK-SD-NEXT: bl sin
172 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
173 ; CHECK-SD-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
174 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
175 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 killed $q0
176 ; CHECK-SD-NEXT: bl sin
177 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
178 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
179 ; CHECK-SD-NEXT: mov v0.d[1], v1.d[0]
180 ; CHECK-SD-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
181 ; CHECK-SD-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload
182 ; CHECK-SD-NEXT: mov d0, v0.d[1]
183 ; CHECK-SD-NEXT: bl sin
184 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
185 ; CHECK-SD-NEXT: str q0, [sp] // 16-byte Folded Spill
186 ; CHECK-SD-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload
187 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 killed $q0
188 ; CHECK-SD-NEXT: bl sin
189 ; CHECK-SD-NEXT: fmov d1, d0
190 ; CHECK-SD-NEXT: ldp q2, q0, [sp] // 32-byte Folded Reload
191 ; CHECK-SD-NEXT: ldr x30, [sp, #48] // 8-byte Folded Reload
192 ; CHECK-SD-NEXT: mov v1.d[1], v2.d[0]
193 ; CHECK-SD-NEXT: add sp, sp, #64
196 ; CHECK-GI-LABEL: sin_v4f64:
197 ; CHECK-GI: // %bb.0: // %entry
198 ; CHECK-GI-NEXT: sub sp, sp, #80
199 ; CHECK-GI-NEXT: stp d9, d8, [sp, #48] // 16-byte Folded Spill
200 ; CHECK-GI-NEXT: str x30, [sp, #64] // 8-byte Folded Spill
201 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 80
202 ; CHECK-GI-NEXT: .cfi_offset w30, -16
203 ; CHECK-GI-NEXT: .cfi_offset b8, -24
204 ; CHECK-GI-NEXT: .cfi_offset b9, -32
205 ; CHECK-GI-NEXT: str q1, [sp] // 16-byte Folded Spill
206 ; CHECK-GI-NEXT: mov d8, v0.d[1]
207 ; CHECK-GI-NEXT: mov d9, v1.d[1]
208 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 killed $q0
209 ; CHECK-GI-NEXT: bl sin
210 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
211 ; CHECK-GI-NEXT: str q0, [sp, #32] // 16-byte Folded Spill
212 ; CHECK-GI-NEXT: fmov d0, d8
213 ; CHECK-GI-NEXT: bl sin
214 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
215 ; CHECK-GI-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
216 ; CHECK-GI-NEXT: ldr q0, [sp] // 16-byte Folded Reload
217 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 killed $q0
218 ; CHECK-GI-NEXT: bl sin
219 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
220 ; CHECK-GI-NEXT: str q0, [sp] // 16-byte Folded Spill
221 ; CHECK-GI-NEXT: fmov d0, d9
222 ; CHECK-GI-NEXT: bl sin
223 ; CHECK-GI-NEXT: ldp q1, q2, [sp, #16] // 32-byte Folded Reload
224 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
225 ; CHECK-GI-NEXT: ldr x30, [sp, #64] // 8-byte Folded Reload
226 ; CHECK-GI-NEXT: ldp d9, d8, [sp, #48] // 16-byte Folded Reload
227 ; CHECK-GI-NEXT: mov v2.d[1], v1.d[0]
228 ; CHECK-GI-NEXT: ldr q1, [sp] // 16-byte Folded Reload
229 ; CHECK-GI-NEXT: mov v1.d[1], v0.d[0]
230 ; CHECK-GI-NEXT: mov v0.16b, v2.16b
231 ; CHECK-GI-NEXT: add sp, sp, #80
234 %c = call <4 x double> @llvm.sin.v4f64(<4 x double> %a)
238 define <2 x float> @sin_v2f32(<2 x float> %a) {
239 ; CHECK-SD-LABEL: sin_v2f32:
240 ; CHECK-SD: // %bb.0: // %entry
241 ; CHECK-SD-NEXT: sub sp, sp, #48
242 ; CHECK-SD-NEXT: str x30, [sp, #32] // 8-byte Folded Spill
243 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 48
244 ; CHECK-SD-NEXT: .cfi_offset w30, -16
245 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
246 ; CHECK-SD-NEXT: str q0, [sp] // 16-byte Folded Spill
247 ; CHECK-SD-NEXT: mov s0, v0.s[1]
248 ; CHECK-SD-NEXT: bl sinf
249 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
250 ; CHECK-SD-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
251 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
252 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 killed $q0
253 ; CHECK-SD-NEXT: bl sinf
254 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
255 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
256 ; CHECK-SD-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload
257 ; CHECK-SD-NEXT: mov v0.s[1], v1.s[0]
258 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 killed $q0
259 ; CHECK-SD-NEXT: add sp, sp, #48
262 ; CHECK-GI-LABEL: sin_v2f32:
263 ; CHECK-GI: // %bb.0: // %entry
264 ; CHECK-GI-NEXT: sub sp, sp, #32
265 ; CHECK-GI-NEXT: str d8, [sp, #16] // 8-byte Folded Spill
266 ; CHECK-GI-NEXT: str x30, [sp, #24] // 8-byte Folded Spill
267 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 32
268 ; CHECK-GI-NEXT: .cfi_offset w30, -8
269 ; CHECK-GI-NEXT: .cfi_offset b8, -16
270 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
271 ; CHECK-GI-NEXT: mov s8, v0.s[1]
272 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 killed $q0
273 ; CHECK-GI-NEXT: bl sinf
274 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
275 ; CHECK-GI-NEXT: str q0, [sp] // 16-byte Folded Spill
276 ; CHECK-GI-NEXT: fmov s0, s8
277 ; CHECK-GI-NEXT: bl sinf
278 ; CHECK-GI-NEXT: ldr q1, [sp] // 16-byte Folded Reload
279 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
280 ; CHECK-GI-NEXT: ldr x30, [sp, #24] // 8-byte Folded Reload
281 ; CHECK-GI-NEXT: ldr d8, [sp, #16] // 8-byte Folded Reload
282 ; CHECK-GI-NEXT: mov v1.s[1], v0.s[0]
283 ; CHECK-GI-NEXT: fmov d0, d1
284 ; CHECK-GI-NEXT: add sp, sp, #32
287 %c = call <2 x float> @llvm.sin.v2f32(<2 x float> %a)
291 define <3 x float> @sin_v3f32(<3 x float> %a) {
292 ; CHECK-SD-LABEL: sin_v3f32:
293 ; CHECK-SD: // %bb.0: // %entry
294 ; CHECK-SD-NEXT: sub sp, sp, #48
295 ; CHECK-SD-NEXT: str x30, [sp, #32] // 8-byte Folded Spill
296 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 48
297 ; CHECK-SD-NEXT: .cfi_offset w30, -16
298 ; CHECK-SD-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
299 ; CHECK-SD-NEXT: mov s0, v0.s[1]
300 ; CHECK-SD-NEXT: bl sinf
301 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
302 ; CHECK-SD-NEXT: str q0, [sp] // 16-byte Folded Spill
303 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
304 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 killed $q0
305 ; CHECK-SD-NEXT: bl sinf
306 ; CHECK-SD-NEXT: ldr q1, [sp] // 16-byte Folded Reload
307 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
308 ; CHECK-SD-NEXT: mov v0.s[1], v1.s[0]
309 ; CHECK-SD-NEXT: str q0, [sp] // 16-byte Folded Spill
310 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
311 ; CHECK-SD-NEXT: mov s0, v0.s[2]
312 ; CHECK-SD-NEXT: bl sinf
313 ; CHECK-SD-NEXT: ldr q1, [sp] // 16-byte Folded Reload
314 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
315 ; CHECK-SD-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload
316 ; CHECK-SD-NEXT: mov v1.s[2], v0.s[0]
317 ; CHECK-SD-NEXT: mov v0.16b, v1.16b
318 ; CHECK-SD-NEXT: add sp, sp, #48
321 ; CHECK-GI-LABEL: sin_v3f32:
322 ; CHECK-GI: // %bb.0: // %entry
323 ; CHECK-GI-NEXT: sub sp, sp, #64
324 ; CHECK-GI-NEXT: stp d9, d8, [sp, #32] // 16-byte Folded Spill
325 ; CHECK-GI-NEXT: str x30, [sp, #48] // 8-byte Folded Spill
326 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 64
327 ; CHECK-GI-NEXT: .cfi_offset w30, -16
328 ; CHECK-GI-NEXT: .cfi_offset b8, -24
329 ; CHECK-GI-NEXT: .cfi_offset b9, -32
330 ; CHECK-GI-NEXT: mov s8, v0.s[1]
331 ; CHECK-GI-NEXT: mov s9, v0.s[2]
332 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 killed $q0
333 ; CHECK-GI-NEXT: bl sinf
334 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
335 ; CHECK-GI-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
336 ; CHECK-GI-NEXT: fmov s0, s8
337 ; CHECK-GI-NEXT: bl sinf
338 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
339 ; CHECK-GI-NEXT: str q0, [sp] // 16-byte Folded Spill
340 ; CHECK-GI-NEXT: fmov s0, s9
341 ; CHECK-GI-NEXT: bl sinf
342 ; CHECK-GI-NEXT: ldp q2, q1, [sp] // 32-byte Folded Reload
343 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
344 ; CHECK-GI-NEXT: ldr x30, [sp, #48] // 8-byte Folded Reload
345 ; CHECK-GI-NEXT: ldp d9, d8, [sp, #32] // 16-byte Folded Reload
346 ; CHECK-GI-NEXT: mov v1.s[1], v2.s[0]
347 ; CHECK-GI-NEXT: mov v1.s[2], v0.s[0]
348 ; CHECK-GI-NEXT: mov v0.16b, v1.16b
349 ; CHECK-GI-NEXT: add sp, sp, #64
352 %c = call <3 x float> @llvm.sin.v3f32(<3 x float> %a)
356 define <4 x float> @sin_v4f32(<4 x float> %a) {
357 ; CHECK-SD-LABEL: sin_v4f32:
358 ; CHECK-SD: // %bb.0: // %entry
359 ; CHECK-SD-NEXT: sub sp, sp, #48
360 ; CHECK-SD-NEXT: str x30, [sp, #32] // 8-byte Folded Spill
361 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 48
362 ; CHECK-SD-NEXT: .cfi_offset w30, -16
363 ; CHECK-SD-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
364 ; CHECK-SD-NEXT: mov s0, v0.s[1]
365 ; CHECK-SD-NEXT: bl sinf
366 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
367 ; CHECK-SD-NEXT: str q0, [sp] // 16-byte Folded Spill
368 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
369 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 killed $q0
370 ; CHECK-SD-NEXT: bl sinf
371 ; CHECK-SD-NEXT: ldr q1, [sp] // 16-byte Folded Reload
372 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
373 ; CHECK-SD-NEXT: mov v0.s[1], v1.s[0]
374 ; CHECK-SD-NEXT: str q0, [sp] // 16-byte Folded Spill
375 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
376 ; CHECK-SD-NEXT: mov s0, v0.s[2]
377 ; CHECK-SD-NEXT: bl sinf
378 ; CHECK-SD-NEXT: ldr q1, [sp] // 16-byte Folded Reload
379 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
380 ; CHECK-SD-NEXT: mov v1.s[2], v0.s[0]
381 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
382 ; CHECK-SD-NEXT: mov s0, v0.s[3]
383 ; CHECK-SD-NEXT: str q1, [sp] // 16-byte Folded Spill
384 ; CHECK-SD-NEXT: bl sinf
385 ; CHECK-SD-NEXT: ldr q1, [sp] // 16-byte Folded Reload
386 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
387 ; CHECK-SD-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload
388 ; CHECK-SD-NEXT: mov v1.s[3], v0.s[0]
389 ; CHECK-SD-NEXT: mov v0.16b, v1.16b
390 ; CHECK-SD-NEXT: add sp, sp, #48
393 ; CHECK-GI-LABEL: sin_v4f32:
394 ; CHECK-GI: // %bb.0: // %entry
395 ; CHECK-GI-NEXT: sub sp, sp, #80
396 ; CHECK-GI-NEXT: str d10, [sp, #48] // 8-byte Folded Spill
397 ; CHECK-GI-NEXT: stp d9, d8, [sp, #56] // 16-byte Folded Spill
398 ; CHECK-GI-NEXT: str x30, [sp, #72] // 8-byte Folded Spill
399 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 80
400 ; CHECK-GI-NEXT: .cfi_offset w30, -8
401 ; CHECK-GI-NEXT: .cfi_offset b8, -16
402 ; CHECK-GI-NEXT: .cfi_offset b9, -24
403 ; CHECK-GI-NEXT: .cfi_offset b10, -32
404 ; CHECK-GI-NEXT: mov s8, v0.s[1]
405 ; CHECK-GI-NEXT: mov s9, v0.s[2]
406 ; CHECK-GI-NEXT: mov s10, v0.s[3]
407 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 killed $q0
408 ; CHECK-GI-NEXT: bl sinf
409 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
410 ; CHECK-GI-NEXT: str q0, [sp, #32] // 16-byte Folded Spill
411 ; CHECK-GI-NEXT: fmov s0, s8
412 ; CHECK-GI-NEXT: bl sinf
413 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
414 ; CHECK-GI-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
415 ; CHECK-GI-NEXT: fmov s0, s9
416 ; CHECK-GI-NEXT: bl sinf
417 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
418 ; CHECK-GI-NEXT: str q0, [sp] // 16-byte Folded Spill
419 ; CHECK-GI-NEXT: fmov s0, s10
420 ; CHECK-GI-NEXT: bl sinf
421 ; CHECK-GI-NEXT: ldp q2, q1, [sp, #16] // 32-byte Folded Reload
422 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
423 ; CHECK-GI-NEXT: ldr x30, [sp, #72] // 8-byte Folded Reload
424 ; CHECK-GI-NEXT: ldp d9, d8, [sp, #56] // 16-byte Folded Reload
425 ; CHECK-GI-NEXT: ldr d10, [sp, #48] // 8-byte Folded Reload
426 ; CHECK-GI-NEXT: mov v1.s[1], v2.s[0]
427 ; CHECK-GI-NEXT: ldr q2, [sp] // 16-byte Folded Reload
428 ; CHECK-GI-NEXT: mov v1.s[2], v2.s[0]
429 ; CHECK-GI-NEXT: mov v1.s[3], v0.s[0]
430 ; CHECK-GI-NEXT: mov v0.16b, v1.16b
431 ; CHECK-GI-NEXT: add sp, sp, #80
434 %c = call <4 x float> @llvm.sin.v4f32(<4 x float> %a)
438 define <8 x float> @sin_v8f32(<8 x float> %a) {
439 ; CHECK-SD-LABEL: sin_v8f32:
440 ; CHECK-SD: // %bb.0: // %entry
441 ; CHECK-SD-NEXT: sub sp, sp, #64
442 ; CHECK-SD-NEXT: str x30, [sp, #48] // 8-byte Folded Spill
443 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 64
444 ; CHECK-SD-NEXT: .cfi_offset w30, -16
445 ; CHECK-SD-NEXT: stp q0, q1, [sp] // 32-byte Folded Spill
446 ; CHECK-SD-NEXT: mov s0, v0.s[1]
447 ; CHECK-SD-NEXT: bl sinf
448 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
449 ; CHECK-SD-NEXT: str q0, [sp, #32] // 16-byte Folded Spill
450 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
451 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 killed $q0
452 ; CHECK-SD-NEXT: bl sinf
453 ; CHECK-SD-NEXT: ldr q1, [sp, #32] // 16-byte Folded Reload
454 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
455 ; CHECK-SD-NEXT: mov v0.s[1], v1.s[0]
456 ; CHECK-SD-NEXT: str q0, [sp, #32] // 16-byte Folded Spill
457 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
458 ; CHECK-SD-NEXT: mov s0, v0.s[2]
459 ; CHECK-SD-NEXT: bl sinf
460 ; CHECK-SD-NEXT: ldr q1, [sp, #32] // 16-byte Folded Reload
461 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
462 ; CHECK-SD-NEXT: mov v1.s[2], v0.s[0]
463 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
464 ; CHECK-SD-NEXT: mov s0, v0.s[3]
465 ; CHECK-SD-NEXT: str q1, [sp, #32] // 16-byte Folded Spill
466 ; CHECK-SD-NEXT: bl sinf
467 ; CHECK-SD-NEXT: ldr q1, [sp, #32] // 16-byte Folded Reload
468 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
469 ; CHECK-SD-NEXT: mov v1.s[3], v0.s[0]
470 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
471 ; CHECK-SD-NEXT: mov s0, v0.s[1]
472 ; CHECK-SD-NEXT: str q1, [sp, #32] // 16-byte Folded Spill
473 ; CHECK-SD-NEXT: bl sinf
474 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
475 ; CHECK-SD-NEXT: str q0, [sp] // 16-byte Folded Spill
476 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
477 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 killed $q0
478 ; CHECK-SD-NEXT: bl sinf
479 ; CHECK-SD-NEXT: ldr q1, [sp] // 16-byte Folded Reload
480 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
481 ; CHECK-SD-NEXT: mov v0.s[1], v1.s[0]
482 ; CHECK-SD-NEXT: str q0, [sp] // 16-byte Folded Spill
483 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
484 ; CHECK-SD-NEXT: mov s0, v0.s[2]
485 ; CHECK-SD-NEXT: bl sinf
486 ; CHECK-SD-NEXT: ldr q1, [sp] // 16-byte Folded Reload
487 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
488 ; CHECK-SD-NEXT: mov v1.s[2], v0.s[0]
489 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
490 ; CHECK-SD-NEXT: mov s0, v0.s[3]
491 ; CHECK-SD-NEXT: str q1, [sp] // 16-byte Folded Spill
492 ; CHECK-SD-NEXT: bl sinf
493 ; CHECK-SD-NEXT: fmov s2, s0
494 ; CHECK-SD-NEXT: ldr q1, [sp] // 16-byte Folded Reload
495 ; CHECK-SD-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload
496 ; CHECK-SD-NEXT: ldr x30, [sp, #48] // 8-byte Folded Reload
497 ; CHECK-SD-NEXT: mov v1.s[3], v2.s[0]
498 ; CHECK-SD-NEXT: add sp, sp, #64
501 ; CHECK-GI-LABEL: sin_v8f32:
502 ; CHECK-GI: // %bb.0: // %entry
503 ; CHECK-GI-NEXT: sub sp, sp, #176
504 ; CHECK-GI-NEXT: stp d13, d12, [sp, #112] // 16-byte Folded Spill
505 ; CHECK-GI-NEXT: stp d11, d10, [sp, #128] // 16-byte Folded Spill
506 ; CHECK-GI-NEXT: stp d9, d8, [sp, #144] // 16-byte Folded Spill
507 ; CHECK-GI-NEXT: str x30, [sp, #160] // 8-byte Folded Spill
508 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 176
509 ; CHECK-GI-NEXT: .cfi_offset w30, -16
510 ; CHECK-GI-NEXT: .cfi_offset b8, -24
511 ; CHECK-GI-NEXT: .cfi_offset b9, -32
512 ; CHECK-GI-NEXT: .cfi_offset b10, -40
513 ; CHECK-GI-NEXT: .cfi_offset b11, -48
514 ; CHECK-GI-NEXT: .cfi_offset b12, -56
515 ; CHECK-GI-NEXT: .cfi_offset b13, -64
516 ; CHECK-GI-NEXT: str q1, [sp, #32] // 16-byte Folded Spill
517 ; CHECK-GI-NEXT: mov s8, v0.s[1]
518 ; CHECK-GI-NEXT: mov s9, v0.s[2]
519 ; CHECK-GI-NEXT: mov s10, v0.s[3]
520 ; CHECK-GI-NEXT: mov s11, v1.s[1]
521 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 killed $q0
522 ; CHECK-GI-NEXT: mov s12, v1.s[2]
523 ; CHECK-GI-NEXT: mov s13, v1.s[3]
524 ; CHECK-GI-NEXT: bl sinf
525 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
526 ; CHECK-GI-NEXT: str q0, [sp, #64] // 16-byte Folded Spill
527 ; CHECK-GI-NEXT: fmov s0, s8
528 ; CHECK-GI-NEXT: bl sinf
529 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
530 ; CHECK-GI-NEXT: str q0, [sp, #48] // 16-byte Folded Spill
531 ; CHECK-GI-NEXT: fmov s0, s9
532 ; CHECK-GI-NEXT: bl sinf
533 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
534 ; CHECK-GI-NEXT: str q0, [sp, #96] // 16-byte Folded Spill
535 ; CHECK-GI-NEXT: fmov s0, s10
536 ; CHECK-GI-NEXT: bl sinf
537 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
538 ; CHECK-GI-NEXT: str q0, [sp, #80] // 16-byte Folded Spill
539 ; CHECK-GI-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload
540 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 killed $q0
541 ; CHECK-GI-NEXT: bl sinf
542 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
543 ; CHECK-GI-NEXT: str q0, [sp, #32] // 16-byte Folded Spill
544 ; CHECK-GI-NEXT: fmov s0, s11
545 ; CHECK-GI-NEXT: bl sinf
546 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
547 ; CHECK-GI-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
548 ; CHECK-GI-NEXT: fmov s0, s12
549 ; CHECK-GI-NEXT: bl sinf
550 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
551 ; CHECK-GI-NEXT: str q0, [sp] // 16-byte Folded Spill
552 ; CHECK-GI-NEXT: fmov s0, s13
553 ; CHECK-GI-NEXT: bl sinf
554 ; CHECK-GI-NEXT: ldp q2, q1, [sp, #48] // 32-byte Folded Reload
555 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
556 ; CHECK-GI-NEXT: ldr x30, [sp, #160] // 8-byte Folded Reload
557 ; CHECK-GI-NEXT: ldp d9, d8, [sp, #144] // 16-byte Folded Reload
558 ; CHECK-GI-NEXT: ldp d11, d10, [sp, #128] // 16-byte Folded Reload
559 ; CHECK-GI-NEXT: mov v1.s[1], v2.s[0]
560 ; CHECK-GI-NEXT: ldp q2, q3, [sp, #16] // 32-byte Folded Reload
561 ; CHECK-GI-NEXT: ldp d13, d12, [sp, #112] // 16-byte Folded Reload
562 ; CHECK-GI-NEXT: mov v3.s[1], v2.s[0]
563 ; CHECK-GI-NEXT: ldr q2, [sp, #96] // 16-byte Folded Reload
564 ; CHECK-GI-NEXT: mov v1.s[2], v2.s[0]
565 ; CHECK-GI-NEXT: ldr q2, [sp] // 16-byte Folded Reload
566 ; CHECK-GI-NEXT: mov v3.s[2], v2.s[0]
567 ; CHECK-GI-NEXT: ldr q2, [sp, #80] // 16-byte Folded Reload
568 ; CHECK-GI-NEXT: mov v1.s[3], v2.s[0]
569 ; CHECK-GI-NEXT: mov v3.s[3], v0.s[0]
570 ; CHECK-GI-NEXT: mov v2.16b, v1.16b
571 ; CHECK-GI-NEXT: mov v1.16b, v3.16b
572 ; CHECK-GI-NEXT: mov v0.16b, v2.16b
573 ; CHECK-GI-NEXT: add sp, sp, #176
576 %c = call <8 x float> @llvm.sin.v8f32(<8 x float> %a)
580 define <7 x half> @sin_v7f16(<7 x half> %a) {
581 ; CHECK-SD-LABEL: sin_v7f16:
582 ; CHECK-SD: // %bb.0: // %entry
583 ; CHECK-SD-NEXT: sub sp, sp, #48
584 ; CHECK-SD-NEXT: str x30, [sp, #32] // 8-byte Folded Spill
585 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 48
586 ; CHECK-SD-NEXT: .cfi_offset w30, -16
587 ; CHECK-SD-NEXT: mov h1, v0.h[1]
588 ; CHECK-SD-NEXT: str q0, [sp] // 16-byte Folded Spill
589 ; CHECK-SD-NEXT: fcvt s0, h1
590 ; CHECK-SD-NEXT: bl sinf
591 ; CHECK-SD-NEXT: fcvt h0, s0
592 ; CHECK-SD-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
593 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
594 ; CHECK-SD-NEXT: fcvt s0, h0
595 ; CHECK-SD-NEXT: bl sinf
596 ; CHECK-SD-NEXT: fcvt h0, s0
597 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
598 ; CHECK-SD-NEXT: mov v0.h[1], v1.h[0]
599 ; CHECK-SD-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
600 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
601 ; CHECK-SD-NEXT: mov h0, v0.h[2]
602 ; CHECK-SD-NEXT: fcvt s0, h0
603 ; CHECK-SD-NEXT: bl sinf
604 ; CHECK-SD-NEXT: fcvt h0, s0
605 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
606 ; CHECK-SD-NEXT: mov v1.h[2], v0.h[0]
607 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
608 ; CHECK-SD-NEXT: mov h0, v0.h[3]
609 ; CHECK-SD-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
610 ; CHECK-SD-NEXT: fcvt s0, h0
611 ; CHECK-SD-NEXT: bl sinf
612 ; CHECK-SD-NEXT: fcvt h0, s0
613 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
614 ; CHECK-SD-NEXT: mov v1.h[3], v0.h[0]
615 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
616 ; CHECK-SD-NEXT: mov h0, v0.h[4]
617 ; CHECK-SD-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
618 ; CHECK-SD-NEXT: fcvt s0, h0
619 ; CHECK-SD-NEXT: bl sinf
620 ; CHECK-SD-NEXT: fcvt h0, s0
621 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
622 ; CHECK-SD-NEXT: mov v1.h[4], v0.h[0]
623 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
624 ; CHECK-SD-NEXT: mov h0, v0.h[5]
625 ; CHECK-SD-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
626 ; CHECK-SD-NEXT: fcvt s0, h0
627 ; CHECK-SD-NEXT: bl sinf
628 ; CHECK-SD-NEXT: fcvt h0, s0
629 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
630 ; CHECK-SD-NEXT: mov v1.h[5], v0.h[0]
631 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
632 ; CHECK-SD-NEXT: mov h0, v0.h[6]
633 ; CHECK-SD-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
634 ; CHECK-SD-NEXT: fcvt s0, h0
635 ; CHECK-SD-NEXT: bl sinf
636 ; CHECK-SD-NEXT: fcvt h0, s0
637 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
638 ; CHECK-SD-NEXT: mov v1.h[6], v0.h[0]
639 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
640 ; CHECK-SD-NEXT: mov h0, v0.h[7]
641 ; CHECK-SD-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
642 ; CHECK-SD-NEXT: fcvt s0, h0
643 ; CHECK-SD-NEXT: bl sinf
644 ; CHECK-SD-NEXT: fcvt h1, s0
645 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
646 ; CHECK-SD-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload
647 ; CHECK-SD-NEXT: mov v0.h[7], v1.h[0]
648 ; CHECK-SD-NEXT: add sp, sp, #48
651 ; CHECK-GI-LABEL: sin_v7f16:
652 ; CHECK-GI: // %bb.0: // %entry
653 ; CHECK-GI-NEXT: sub sp, sp, #160
654 ; CHECK-GI-NEXT: stp d13, d12, [sp, #96] // 16-byte Folded Spill
655 ; CHECK-GI-NEXT: stp d11, d10, [sp, #112] // 16-byte Folded Spill
656 ; CHECK-GI-NEXT: stp d9, d8, [sp, #128] // 16-byte Folded Spill
657 ; CHECK-GI-NEXT: str x30, [sp, #144] // 8-byte Folded Spill
658 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 160
659 ; CHECK-GI-NEXT: .cfi_offset w30, -16
660 ; CHECK-GI-NEXT: .cfi_offset b8, -24
661 ; CHECK-GI-NEXT: .cfi_offset b9, -32
662 ; CHECK-GI-NEXT: .cfi_offset b10, -40
663 ; CHECK-GI-NEXT: .cfi_offset b11, -48
664 ; CHECK-GI-NEXT: .cfi_offset b12, -56
665 ; CHECK-GI-NEXT: .cfi_offset b13, -64
666 ; CHECK-GI-NEXT: mov h8, v0.h[1]
667 ; CHECK-GI-NEXT: mov h9, v0.h[2]
668 ; CHECK-GI-NEXT: mov h10, v0.h[3]
669 ; CHECK-GI-NEXT: mov h11, v0.h[4]
670 ; CHECK-GI-NEXT: mov h12, v0.h[5]
671 ; CHECK-GI-NEXT: mov h13, v0.h[6]
672 ; CHECK-GI-NEXT: fcvt s0, h0
673 ; CHECK-GI-NEXT: bl sinf
674 ; CHECK-GI-NEXT: fcvt s1, h8
675 ; CHECK-GI-NEXT: fcvt h0, s0
676 ; CHECK-GI-NEXT: str q0, [sp, #80] // 16-byte Folded Spill
677 ; CHECK-GI-NEXT: fmov s0, s1
678 ; CHECK-GI-NEXT: bl sinf
679 ; CHECK-GI-NEXT: fcvt s1, h9
680 ; CHECK-GI-NEXT: fcvt h0, s0
681 ; CHECK-GI-NEXT: str q0, [sp, #64] // 16-byte Folded Spill
682 ; CHECK-GI-NEXT: fmov s0, s1
683 ; CHECK-GI-NEXT: bl sinf
684 ; CHECK-GI-NEXT: fcvt s1, h10
685 ; CHECK-GI-NEXT: fcvt h0, s0
686 ; CHECK-GI-NEXT: str q0, [sp, #48] // 16-byte Folded Spill
687 ; CHECK-GI-NEXT: fmov s0, s1
688 ; CHECK-GI-NEXT: bl sinf
689 ; CHECK-GI-NEXT: fcvt s1, h11
690 ; CHECK-GI-NEXT: fcvt h0, s0
691 ; CHECK-GI-NEXT: str q0, [sp, #32] // 16-byte Folded Spill
692 ; CHECK-GI-NEXT: fmov s0, s1
693 ; CHECK-GI-NEXT: bl sinf
694 ; CHECK-GI-NEXT: fcvt s1, h12
695 ; CHECK-GI-NEXT: fcvt h0, s0
696 ; CHECK-GI-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
697 ; CHECK-GI-NEXT: fmov s0, s1
698 ; CHECK-GI-NEXT: bl sinf
699 ; CHECK-GI-NEXT: fcvt s1, h13
700 ; CHECK-GI-NEXT: fcvt h0, s0
701 ; CHECK-GI-NEXT: str q0, [sp] // 16-byte Folded Spill
702 ; CHECK-GI-NEXT: fmov s0, s1
703 ; CHECK-GI-NEXT: bl sinf
704 ; CHECK-GI-NEXT: ldp q2, q1, [sp, #64] // 32-byte Folded Reload
705 ; CHECK-GI-NEXT: fcvt h0, s0
706 ; CHECK-GI-NEXT: ldp d9, d8, [sp, #128] // 16-byte Folded Reload
707 ; CHECK-GI-NEXT: ldr x30, [sp, #144] // 8-byte Folded Reload
708 ; CHECK-GI-NEXT: ldp d11, d10, [sp, #112] // 16-byte Folded Reload
709 ; CHECK-GI-NEXT: mov v1.h[1], v2.h[0]
710 ; CHECK-GI-NEXT: ldp q2, q3, [sp, #32] // 32-byte Folded Reload
711 ; CHECK-GI-NEXT: ldp d13, d12, [sp, #96] // 16-byte Folded Reload
712 ; CHECK-GI-NEXT: mov v1.h[2], v3.h[0]
713 ; CHECK-GI-NEXT: mov v1.h[3], v2.h[0]
714 ; CHECK-GI-NEXT: ldp q2, q3, [sp] // 32-byte Folded Reload
715 ; CHECK-GI-NEXT: mov v1.h[4], v3.h[0]
716 ; CHECK-GI-NEXT: mov v1.h[5], v2.h[0]
717 ; CHECK-GI-NEXT: mov v1.h[6], v0.h[0]
718 ; CHECK-GI-NEXT: mov v0.16b, v1.16b
719 ; CHECK-GI-NEXT: add sp, sp, #160
722 %c = call <7 x half> @llvm.sin.v7f16(<7 x half> %a)
726 define <4 x half> @sin_v4f16(<4 x half> %a) {
727 ; CHECK-SD-LABEL: sin_v4f16:
728 ; CHECK-SD: // %bb.0: // %entry
729 ; CHECK-SD-NEXT: sub sp, sp, #48
730 ; CHECK-SD-NEXT: str x30, [sp, #32] // 8-byte Folded Spill
731 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 48
732 ; CHECK-SD-NEXT: .cfi_offset w30, -16
733 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
734 ; CHECK-SD-NEXT: mov h1, v0.h[1]
735 ; CHECK-SD-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
736 ; CHECK-SD-NEXT: fcvt s0, h1
737 ; CHECK-SD-NEXT: bl sinf
738 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
739 ; CHECK-SD-NEXT: fcvt h0, s0
740 ; CHECK-SD-NEXT: fcvt s1, h1
741 ; CHECK-SD-NEXT: str q0, [sp] // 16-byte Folded Spill
742 ; CHECK-SD-NEXT: fmov s0, s1
743 ; CHECK-SD-NEXT: bl sinf
744 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
745 ; CHECK-SD-NEXT: fcvt h2, s0
746 ; CHECK-SD-NEXT: mov h1, v1.h[2]
747 ; CHECK-SD-NEXT: fcvt s0, h1
748 ; CHECK-SD-NEXT: ldr q1, [sp] // 16-byte Folded Reload
749 ; CHECK-SD-NEXT: mov v2.h[1], v1.h[0]
750 ; CHECK-SD-NEXT: str q2, [sp] // 16-byte Folded Spill
751 ; CHECK-SD-NEXT: bl sinf
752 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
753 ; CHECK-SD-NEXT: fcvt h2, s0
754 ; CHECK-SD-NEXT: mov h1, v1.h[3]
755 ; CHECK-SD-NEXT: fcvt s0, h1
756 ; CHECK-SD-NEXT: ldr q1, [sp] // 16-byte Folded Reload
757 ; CHECK-SD-NEXT: mov v1.h[2], v2.h[0]
758 ; CHECK-SD-NEXT: str q1, [sp] // 16-byte Folded Spill
759 ; CHECK-SD-NEXT: bl sinf
760 ; CHECK-SD-NEXT: fcvt h1, s0
761 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
762 ; CHECK-SD-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload
763 ; CHECK-SD-NEXT: mov v0.h[3], v1.h[0]
764 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 killed $q0
765 ; CHECK-SD-NEXT: add sp, sp, #48
768 ; CHECK-GI-LABEL: sin_v4f16:
769 ; CHECK-GI: // %bb.0: // %entry
770 ; CHECK-GI-NEXT: sub sp, sp, #80
771 ; CHECK-GI-NEXT: str d10, [sp, #48] // 8-byte Folded Spill
772 ; CHECK-GI-NEXT: stp d9, d8, [sp, #56] // 16-byte Folded Spill
773 ; CHECK-GI-NEXT: str x30, [sp, #72] // 8-byte Folded Spill
774 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 80
775 ; CHECK-GI-NEXT: .cfi_offset w30, -8
776 ; CHECK-GI-NEXT: .cfi_offset b8, -16
777 ; CHECK-GI-NEXT: .cfi_offset b9, -24
778 ; CHECK-GI-NEXT: .cfi_offset b10, -32
779 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
780 ; CHECK-GI-NEXT: mov h8, v0.h[1]
781 ; CHECK-GI-NEXT: mov h9, v0.h[2]
782 ; CHECK-GI-NEXT: mov h10, v0.h[3]
783 ; CHECK-GI-NEXT: fcvt s0, h0
784 ; CHECK-GI-NEXT: bl sinf
785 ; CHECK-GI-NEXT: fcvt s1, h8
786 ; CHECK-GI-NEXT: fcvt h0, s0
787 ; CHECK-GI-NEXT: str q0, [sp, #32] // 16-byte Folded Spill
788 ; CHECK-GI-NEXT: fmov s0, s1
789 ; CHECK-GI-NEXT: bl sinf
790 ; CHECK-GI-NEXT: fcvt s1, h9
791 ; CHECK-GI-NEXT: fcvt h0, s0
792 ; CHECK-GI-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
793 ; CHECK-GI-NEXT: fmov s0, s1
794 ; CHECK-GI-NEXT: bl sinf
795 ; CHECK-GI-NEXT: fcvt s1, h10
796 ; CHECK-GI-NEXT: fcvt h0, s0
797 ; CHECK-GI-NEXT: str q0, [sp] // 16-byte Folded Spill
798 ; CHECK-GI-NEXT: fmov s0, s1
799 ; CHECK-GI-NEXT: bl sinf
800 ; CHECK-GI-NEXT: ldp q2, q1, [sp, #16] // 32-byte Folded Reload
801 ; CHECK-GI-NEXT: fcvt h0, s0
802 ; CHECK-GI-NEXT: ldp d9, d8, [sp, #56] // 16-byte Folded Reload
803 ; CHECK-GI-NEXT: ldr x30, [sp, #72] // 8-byte Folded Reload
804 ; CHECK-GI-NEXT: ldr d10, [sp, #48] // 8-byte Folded Reload
805 ; CHECK-GI-NEXT: mov v1.h[1], v2.h[0]
806 ; CHECK-GI-NEXT: ldr q2, [sp] // 16-byte Folded Reload
807 ; CHECK-GI-NEXT: mov v1.h[2], v2.h[0]
808 ; CHECK-GI-NEXT: mov v1.h[3], v0.h[0]
809 ; CHECK-GI-NEXT: mov v0.16b, v1.16b
810 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 killed $q0
811 ; CHECK-GI-NEXT: add sp, sp, #80
814 %c = call <4 x half> @llvm.sin.v4f16(<4 x half> %a)
818 define <8 x half> @sin_v8f16(<8 x half> %a) {
819 ; CHECK-SD-LABEL: sin_v8f16:
820 ; CHECK-SD: // %bb.0: // %entry
821 ; CHECK-SD-NEXT: sub sp, sp, #48
822 ; CHECK-SD-NEXT: str x30, [sp, #32] // 8-byte Folded Spill
823 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 48
824 ; CHECK-SD-NEXT: .cfi_offset w30, -16
825 ; CHECK-SD-NEXT: mov h1, v0.h[1]
826 ; CHECK-SD-NEXT: str q0, [sp] // 16-byte Folded Spill
827 ; CHECK-SD-NEXT: fcvt s0, h1
828 ; CHECK-SD-NEXT: bl sinf
829 ; CHECK-SD-NEXT: fcvt h0, s0
830 ; CHECK-SD-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
831 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
832 ; CHECK-SD-NEXT: fcvt s0, h0
833 ; CHECK-SD-NEXT: bl sinf
834 ; CHECK-SD-NEXT: fcvt h0, s0
835 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
836 ; CHECK-SD-NEXT: mov v0.h[1], v1.h[0]
837 ; CHECK-SD-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
838 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
839 ; CHECK-SD-NEXT: mov h0, v0.h[2]
840 ; CHECK-SD-NEXT: fcvt s0, h0
841 ; CHECK-SD-NEXT: bl sinf
842 ; CHECK-SD-NEXT: fcvt h0, s0
843 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
844 ; CHECK-SD-NEXT: mov v1.h[2], v0.h[0]
845 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
846 ; CHECK-SD-NEXT: mov h0, v0.h[3]
847 ; CHECK-SD-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
848 ; CHECK-SD-NEXT: fcvt s0, h0
849 ; CHECK-SD-NEXT: bl sinf
850 ; CHECK-SD-NEXT: fcvt h0, s0
851 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
852 ; CHECK-SD-NEXT: mov v1.h[3], v0.h[0]
853 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
854 ; CHECK-SD-NEXT: mov h0, v0.h[4]
855 ; CHECK-SD-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
856 ; CHECK-SD-NEXT: fcvt s0, h0
857 ; CHECK-SD-NEXT: bl sinf
858 ; CHECK-SD-NEXT: fcvt h0, s0
859 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
860 ; CHECK-SD-NEXT: mov v1.h[4], v0.h[0]
861 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
862 ; CHECK-SD-NEXT: mov h0, v0.h[5]
863 ; CHECK-SD-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
864 ; CHECK-SD-NEXT: fcvt s0, h0
865 ; CHECK-SD-NEXT: bl sinf
866 ; CHECK-SD-NEXT: fcvt h0, s0
867 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
868 ; CHECK-SD-NEXT: mov v1.h[5], v0.h[0]
869 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
870 ; CHECK-SD-NEXT: mov h0, v0.h[6]
871 ; CHECK-SD-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
872 ; CHECK-SD-NEXT: fcvt s0, h0
873 ; CHECK-SD-NEXT: bl sinf
874 ; CHECK-SD-NEXT: fcvt h0, s0
875 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
876 ; CHECK-SD-NEXT: mov v1.h[6], v0.h[0]
877 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
878 ; CHECK-SD-NEXT: mov h0, v0.h[7]
879 ; CHECK-SD-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
880 ; CHECK-SD-NEXT: fcvt s0, h0
881 ; CHECK-SD-NEXT: bl sinf
882 ; CHECK-SD-NEXT: fcvt h1, s0
883 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
884 ; CHECK-SD-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload
885 ; CHECK-SD-NEXT: mov v0.h[7], v1.h[0]
886 ; CHECK-SD-NEXT: add sp, sp, #48
889 ; CHECK-GI-LABEL: sin_v8f16:
890 ; CHECK-GI: // %bb.0: // %entry
891 ; CHECK-GI-NEXT: sub sp, sp, #176
892 ; CHECK-GI-NEXT: str d14, [sp, #112] // 8-byte Folded Spill
893 ; CHECK-GI-NEXT: stp d13, d12, [sp, #120] // 16-byte Folded Spill
894 ; CHECK-GI-NEXT: stp d11, d10, [sp, #136] // 16-byte Folded Spill
895 ; CHECK-GI-NEXT: stp d9, d8, [sp, #152] // 16-byte Folded Spill
896 ; CHECK-GI-NEXT: str x30, [sp, #168] // 8-byte Folded Spill
897 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 176
898 ; CHECK-GI-NEXT: .cfi_offset w30, -8
899 ; CHECK-GI-NEXT: .cfi_offset b8, -16
900 ; CHECK-GI-NEXT: .cfi_offset b9, -24
901 ; CHECK-GI-NEXT: .cfi_offset b10, -32
902 ; CHECK-GI-NEXT: .cfi_offset b11, -40
903 ; CHECK-GI-NEXT: .cfi_offset b12, -48
904 ; CHECK-GI-NEXT: .cfi_offset b13, -56
905 ; CHECK-GI-NEXT: .cfi_offset b14, -64
906 ; CHECK-GI-NEXT: mov h8, v0.h[1]
907 ; CHECK-GI-NEXT: mov h9, v0.h[2]
908 ; CHECK-GI-NEXT: mov h10, v0.h[3]
909 ; CHECK-GI-NEXT: mov h11, v0.h[4]
910 ; CHECK-GI-NEXT: mov h12, v0.h[5]
911 ; CHECK-GI-NEXT: mov h13, v0.h[6]
912 ; CHECK-GI-NEXT: mov h14, v0.h[7]
913 ; CHECK-GI-NEXT: fcvt s0, h0
914 ; CHECK-GI-NEXT: bl sinf
915 ; CHECK-GI-NEXT: fcvt s1, h8
916 ; CHECK-GI-NEXT: fcvt h0, s0
917 ; CHECK-GI-NEXT: str q0, [sp, #96] // 16-byte Folded Spill
918 ; CHECK-GI-NEXT: fmov s0, s1
919 ; CHECK-GI-NEXT: bl sinf
920 ; CHECK-GI-NEXT: fcvt s1, h9
921 ; CHECK-GI-NEXT: fcvt h0, s0
922 ; CHECK-GI-NEXT: str q0, [sp, #80] // 16-byte Folded Spill
923 ; CHECK-GI-NEXT: fmov s0, s1
924 ; CHECK-GI-NEXT: bl sinf
925 ; CHECK-GI-NEXT: fcvt s1, h10
926 ; CHECK-GI-NEXT: fcvt h0, s0
927 ; CHECK-GI-NEXT: str q0, [sp, #64] // 16-byte Folded Spill
928 ; CHECK-GI-NEXT: fmov s0, s1
929 ; CHECK-GI-NEXT: bl sinf
930 ; CHECK-GI-NEXT: fcvt s1, h11
931 ; CHECK-GI-NEXT: fcvt h0, s0
932 ; CHECK-GI-NEXT: str q0, [sp, #48] // 16-byte Folded Spill
933 ; CHECK-GI-NEXT: fmov s0, s1
934 ; CHECK-GI-NEXT: bl sinf
935 ; CHECK-GI-NEXT: fcvt s1, h12
936 ; CHECK-GI-NEXT: fcvt h0, s0
937 ; CHECK-GI-NEXT: str q0, [sp, #32] // 16-byte Folded Spill
938 ; CHECK-GI-NEXT: fmov s0, s1
939 ; CHECK-GI-NEXT: bl sinf
940 ; CHECK-GI-NEXT: fcvt s1, h13
941 ; CHECK-GI-NEXT: fcvt h0, s0
942 ; CHECK-GI-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
943 ; CHECK-GI-NEXT: fmov s0, s1
944 ; CHECK-GI-NEXT: bl sinf
945 ; CHECK-GI-NEXT: fcvt s1, h14
946 ; CHECK-GI-NEXT: fcvt h0, s0
947 ; CHECK-GI-NEXT: str q0, [sp] // 16-byte Folded Spill
948 ; CHECK-GI-NEXT: fmov s0, s1
949 ; CHECK-GI-NEXT: bl sinf
950 ; CHECK-GI-NEXT: ldp q2, q1, [sp, #80] // 32-byte Folded Reload
951 ; CHECK-GI-NEXT: fcvt h0, s0
952 ; CHECK-GI-NEXT: ldp d9, d8, [sp, #152] // 16-byte Folded Reload
953 ; CHECK-GI-NEXT: ldr x30, [sp, #168] // 8-byte Folded Reload
954 ; CHECK-GI-NEXT: ldp d11, d10, [sp, #136] // 16-byte Folded Reload
955 ; CHECK-GI-NEXT: ldr d14, [sp, #112] // 8-byte Folded Reload
956 ; CHECK-GI-NEXT: mov v1.h[1], v2.h[0]
957 ; CHECK-GI-NEXT: ldp q2, q3, [sp, #48] // 32-byte Folded Reload
958 ; CHECK-GI-NEXT: ldp d13, d12, [sp, #120] // 16-byte Folded Reload
959 ; CHECK-GI-NEXT: mov v1.h[2], v3.h[0]
960 ; CHECK-GI-NEXT: mov v1.h[3], v2.h[0]
961 ; CHECK-GI-NEXT: ldp q2, q3, [sp, #16] // 32-byte Folded Reload
962 ; CHECK-GI-NEXT: mov v1.h[4], v3.h[0]
963 ; CHECK-GI-NEXT: mov v1.h[5], v2.h[0]
964 ; CHECK-GI-NEXT: ldr q2, [sp] // 16-byte Folded Reload
965 ; CHECK-GI-NEXT: mov v1.h[6], v2.h[0]
966 ; CHECK-GI-NEXT: mov v1.h[7], v0.h[0]
967 ; CHECK-GI-NEXT: mov v0.16b, v1.16b
968 ; CHECK-GI-NEXT: add sp, sp, #176
971 %c = call <8 x half> @llvm.sin.v8f16(<8 x half> %a)
975 define <16 x half> @sin_v16f16(<16 x half> %a) {
976 ; CHECK-SD-LABEL: sin_v16f16:
977 ; CHECK-SD: // %bb.0: // %entry
978 ; CHECK-SD-NEXT: sub sp, sp, #64
979 ; CHECK-SD-NEXT: str x30, [sp, #48] // 8-byte Folded Spill
980 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 64
981 ; CHECK-SD-NEXT: .cfi_offset w30, -16
982 ; CHECK-SD-NEXT: stp q1, q0, [sp] // 32-byte Folded Spill
983 ; CHECK-SD-NEXT: mov h1, v0.h[1]
984 ; CHECK-SD-NEXT: fcvt s0, h1
985 ; CHECK-SD-NEXT: bl sinf
986 ; CHECK-SD-NEXT: fcvt h0, s0
987 ; CHECK-SD-NEXT: str q0, [sp, #32] // 16-byte Folded Spill
988 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
989 ; CHECK-SD-NEXT: fcvt s0, h0
990 ; CHECK-SD-NEXT: bl sinf
991 ; CHECK-SD-NEXT: fcvt h0, s0
992 ; CHECK-SD-NEXT: ldr q1, [sp, #32] // 16-byte Folded Reload
993 ; CHECK-SD-NEXT: mov v0.h[1], v1.h[0]
994 ; CHECK-SD-NEXT: str q0, [sp, #32] // 16-byte Folded Spill
995 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
996 ; CHECK-SD-NEXT: mov h0, v0.h[2]
997 ; CHECK-SD-NEXT: fcvt s0, h0
998 ; CHECK-SD-NEXT: bl sinf
999 ; CHECK-SD-NEXT: fcvt h0, s0
1000 ; CHECK-SD-NEXT: ldr q1, [sp, #32] // 16-byte Folded Reload
1001 ; CHECK-SD-NEXT: mov v1.h[2], v0.h[0]
1002 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
1003 ; CHECK-SD-NEXT: mov h0, v0.h[3]
1004 ; CHECK-SD-NEXT: str q1, [sp, #32] // 16-byte Folded Spill
1005 ; CHECK-SD-NEXT: fcvt s0, h0
1006 ; CHECK-SD-NEXT: bl sinf
1007 ; CHECK-SD-NEXT: fcvt h0, s0
1008 ; CHECK-SD-NEXT: ldr q1, [sp, #32] // 16-byte Folded Reload
1009 ; CHECK-SD-NEXT: mov v1.h[3], v0.h[0]
1010 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
1011 ; CHECK-SD-NEXT: mov h0, v0.h[4]
1012 ; CHECK-SD-NEXT: str q1, [sp, #32] // 16-byte Folded Spill
1013 ; CHECK-SD-NEXT: fcvt s0, h0
1014 ; CHECK-SD-NEXT: bl sinf
1015 ; CHECK-SD-NEXT: fcvt h0, s0
1016 ; CHECK-SD-NEXT: ldr q1, [sp, #32] // 16-byte Folded Reload
1017 ; CHECK-SD-NEXT: mov v1.h[4], v0.h[0]
1018 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
1019 ; CHECK-SD-NEXT: mov h0, v0.h[5]
1020 ; CHECK-SD-NEXT: str q1, [sp, #32] // 16-byte Folded Spill
1021 ; CHECK-SD-NEXT: fcvt s0, h0
1022 ; CHECK-SD-NEXT: bl sinf
1023 ; CHECK-SD-NEXT: fcvt h0, s0
1024 ; CHECK-SD-NEXT: ldr q1, [sp, #32] // 16-byte Folded Reload
1025 ; CHECK-SD-NEXT: mov v1.h[5], v0.h[0]
1026 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
1027 ; CHECK-SD-NEXT: mov h0, v0.h[6]
1028 ; CHECK-SD-NEXT: str q1, [sp, #32] // 16-byte Folded Spill
1029 ; CHECK-SD-NEXT: fcvt s0, h0
1030 ; CHECK-SD-NEXT: bl sinf
1031 ; CHECK-SD-NEXT: fcvt h0, s0
1032 ; CHECK-SD-NEXT: ldr q1, [sp, #32] // 16-byte Folded Reload
1033 ; CHECK-SD-NEXT: mov v1.h[6], v0.h[0]
1034 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
1035 ; CHECK-SD-NEXT: mov h0, v0.h[7]
1036 ; CHECK-SD-NEXT: str q1, [sp, #32] // 16-byte Folded Spill
1037 ; CHECK-SD-NEXT: fcvt s0, h0
1038 ; CHECK-SD-NEXT: bl sinf
1039 ; CHECK-SD-NEXT: fcvt h0, s0
1040 ; CHECK-SD-NEXT: ldr q1, [sp, #32] // 16-byte Folded Reload
1041 ; CHECK-SD-NEXT: mov v1.h[7], v0.h[0]
1042 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1043 ; CHECK-SD-NEXT: mov h0, v0.h[1]
1044 ; CHECK-SD-NEXT: str q1, [sp, #32] // 16-byte Folded Spill
1045 ; CHECK-SD-NEXT: fcvt s0, h0
1046 ; CHECK-SD-NEXT: bl sinf
1047 ; CHECK-SD-NEXT: fcvt h0, s0
1048 ; CHECK-SD-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
1049 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1050 ; CHECK-SD-NEXT: fcvt s0, h0
1051 ; CHECK-SD-NEXT: bl sinf
1052 ; CHECK-SD-NEXT: fcvt h0, s0
1053 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
1054 ; CHECK-SD-NEXT: mov v0.h[1], v1.h[0]
1055 ; CHECK-SD-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
1056 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1057 ; CHECK-SD-NEXT: mov h0, v0.h[2]
1058 ; CHECK-SD-NEXT: fcvt s0, h0
1059 ; CHECK-SD-NEXT: bl sinf
1060 ; CHECK-SD-NEXT: fcvt h0, s0
1061 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
1062 ; CHECK-SD-NEXT: mov v1.h[2], v0.h[0]
1063 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1064 ; CHECK-SD-NEXT: mov h0, v0.h[3]
1065 ; CHECK-SD-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
1066 ; CHECK-SD-NEXT: fcvt s0, h0
1067 ; CHECK-SD-NEXT: bl sinf
1068 ; CHECK-SD-NEXT: fcvt h0, s0
1069 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
1070 ; CHECK-SD-NEXT: mov v1.h[3], v0.h[0]
1071 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1072 ; CHECK-SD-NEXT: mov h0, v0.h[4]
1073 ; CHECK-SD-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
1074 ; CHECK-SD-NEXT: fcvt s0, h0
1075 ; CHECK-SD-NEXT: bl sinf
1076 ; CHECK-SD-NEXT: fcvt h0, s0
1077 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
1078 ; CHECK-SD-NEXT: mov v1.h[4], v0.h[0]
1079 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1080 ; CHECK-SD-NEXT: mov h0, v0.h[5]
1081 ; CHECK-SD-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
1082 ; CHECK-SD-NEXT: fcvt s0, h0
1083 ; CHECK-SD-NEXT: bl sinf
1084 ; CHECK-SD-NEXT: fcvt h0, s0
1085 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
1086 ; CHECK-SD-NEXT: mov v1.h[5], v0.h[0]
1087 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1088 ; CHECK-SD-NEXT: mov h0, v0.h[6]
1089 ; CHECK-SD-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
1090 ; CHECK-SD-NEXT: fcvt s0, h0
1091 ; CHECK-SD-NEXT: bl sinf
1092 ; CHECK-SD-NEXT: fcvt h0, s0
1093 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
1094 ; CHECK-SD-NEXT: mov v1.h[6], v0.h[0]
1095 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1096 ; CHECK-SD-NEXT: mov h0, v0.h[7]
1097 ; CHECK-SD-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
1098 ; CHECK-SD-NEXT: fcvt s0, h0
1099 ; CHECK-SD-NEXT: bl sinf
1100 ; CHECK-SD-NEXT: fmov s1, s0
1101 ; CHECK-SD-NEXT: ldr x30, [sp, #48] // 8-byte Folded Reload
1102 ; CHECK-SD-NEXT: fcvt h2, s1
1103 ; CHECK-SD-NEXT: ldp q1, q0, [sp, #16] // 32-byte Folded Reload
1104 ; CHECK-SD-NEXT: mov v1.h[7], v2.h[0]
1105 ; CHECK-SD-NEXT: add sp, sp, #64
1106 ; CHECK-SD-NEXT: ret
1108 ; CHECK-GI-LABEL: sin_v16f16:
1109 ; CHECK-GI: // %bb.0: // %entry
1110 ; CHECK-GI-NEXT: sub sp, sp, #320
1111 ; CHECK-GI-NEXT: stp d15, d14, [sp, #240] // 16-byte Folded Spill
1112 ; CHECK-GI-NEXT: stp d13, d12, [sp, #256] // 16-byte Folded Spill
1113 ; CHECK-GI-NEXT: stp d11, d10, [sp, #272] // 16-byte Folded Spill
1114 ; CHECK-GI-NEXT: stp d9, d8, [sp, #288] // 16-byte Folded Spill
1115 ; CHECK-GI-NEXT: stp x29, x30, [sp, #304] // 16-byte Folded Spill
1116 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 320
1117 ; CHECK-GI-NEXT: .cfi_offset w30, -8
1118 ; CHECK-GI-NEXT: .cfi_offset w29, -16
1119 ; CHECK-GI-NEXT: .cfi_offset b8, -24
1120 ; CHECK-GI-NEXT: .cfi_offset b9, -32
1121 ; CHECK-GI-NEXT: .cfi_offset b10, -40
1122 ; CHECK-GI-NEXT: .cfi_offset b11, -48
1123 ; CHECK-GI-NEXT: .cfi_offset b12, -56
1124 ; CHECK-GI-NEXT: .cfi_offset b13, -64
1125 ; CHECK-GI-NEXT: .cfi_offset b14, -72
1126 ; CHECK-GI-NEXT: .cfi_offset b15, -80
1127 ; CHECK-GI-NEXT: mov v2.16b, v1.16b
1128 ; CHECK-GI-NEXT: str q1, [sp, #80] // 16-byte Folded Spill
1129 ; CHECK-GI-NEXT: mov h14, v1.h[1]
1130 ; CHECK-GI-NEXT: mov h1, v1.h[2]
1131 ; CHECK-GI-NEXT: mov h15, v0.h[1]
1132 ; CHECK-GI-NEXT: mov h8, v0.h[2]
1133 ; CHECK-GI-NEXT: mov h9, v0.h[3]
1134 ; CHECK-GI-NEXT: mov h10, v0.h[4]
1135 ; CHECK-GI-NEXT: mov h11, v0.h[5]
1136 ; CHECK-GI-NEXT: mov h12, v0.h[6]
1137 ; CHECK-GI-NEXT: mov h13, v0.h[7]
1138 ; CHECK-GI-NEXT: fcvt s0, h0
1139 ; CHECK-GI-NEXT: str h1, [sp, #16] // 2-byte Folded Spill
1140 ; CHECK-GI-NEXT: mov h1, v2.h[3]
1141 ; CHECK-GI-NEXT: str h1, [sp, #32] // 2-byte Folded Spill
1142 ; CHECK-GI-NEXT: mov h1, v2.h[4]
1143 ; CHECK-GI-NEXT: str h1, [sp, #48] // 2-byte Folded Spill
1144 ; CHECK-GI-NEXT: mov h1, v2.h[5]
1145 ; CHECK-GI-NEXT: str h1, [sp, #64] // 2-byte Folded Spill
1146 ; CHECK-GI-NEXT: mov h1, v2.h[6]
1147 ; CHECK-GI-NEXT: str h1, [sp, #96] // 2-byte Folded Spill
1148 ; CHECK-GI-NEXT: mov h1, v2.h[7]
1149 ; CHECK-GI-NEXT: str h1, [sp, #160] // 2-byte Folded Spill
1150 ; CHECK-GI-NEXT: bl sinf
1151 ; CHECK-GI-NEXT: fcvt s1, h15
1152 ; CHECK-GI-NEXT: fcvt h0, s0
1153 ; CHECK-GI-NEXT: str q0, [sp, #192] // 16-byte Folded Spill
1154 ; CHECK-GI-NEXT: fmov s0, s1
1155 ; CHECK-GI-NEXT: bl sinf
1156 ; CHECK-GI-NEXT: fcvt s1, h8
1157 ; CHECK-GI-NEXT: fcvt h0, s0
1158 ; CHECK-GI-NEXT: str q0, [sp, #128] // 16-byte Folded Spill
1159 ; CHECK-GI-NEXT: fmov s0, s1
1160 ; CHECK-GI-NEXT: bl sinf
1161 ; CHECK-GI-NEXT: fcvt s1, h9
1162 ; CHECK-GI-NEXT: fcvt h0, s0
1163 ; CHECK-GI-NEXT: str q0, [sp, #224] // 16-byte Folded Spill
1164 ; CHECK-GI-NEXT: fmov s0, s1
1165 ; CHECK-GI-NEXT: bl sinf
1166 ; CHECK-GI-NEXT: fcvt s1, h10
1167 ; CHECK-GI-NEXT: fcvt h0, s0
1168 ; CHECK-GI-NEXT: str q0, [sp, #208] // 16-byte Folded Spill
1169 ; CHECK-GI-NEXT: fmov s0, s1
1170 ; CHECK-GI-NEXT: bl sinf
1171 ; CHECK-GI-NEXT: fcvt s1, h11
1172 ; CHECK-GI-NEXT: fcvt h0, s0
1173 ; CHECK-GI-NEXT: str q0, [sp, #176] // 16-byte Folded Spill
1174 ; CHECK-GI-NEXT: fmov s0, s1
1175 ; CHECK-GI-NEXT: bl sinf
1176 ; CHECK-GI-NEXT: fcvt s1, h12
1177 ; CHECK-GI-NEXT: fcvt h0, s0
1178 ; CHECK-GI-NEXT: str q0, [sp, #144] // 16-byte Folded Spill
1179 ; CHECK-GI-NEXT: fmov s0, s1
1180 ; CHECK-GI-NEXT: bl sinf
1181 ; CHECK-GI-NEXT: fcvt s1, h13
1182 ; CHECK-GI-NEXT: fcvt h0, s0
1183 ; CHECK-GI-NEXT: str q0, [sp, #112] // 16-byte Folded Spill
1184 ; CHECK-GI-NEXT: fmov s0, s1
1185 ; CHECK-GI-NEXT: bl sinf
1186 ; CHECK-GI-NEXT: ldr q1, [sp, #80] // 16-byte Folded Reload
1187 ; CHECK-GI-NEXT: fcvt h0, s0
1188 ; CHECK-GI-NEXT: fcvt s1, h1
1189 ; CHECK-GI-NEXT: str q0, [sp, #80] // 16-byte Folded Spill
1190 ; CHECK-GI-NEXT: fmov s0, s1
1191 ; CHECK-GI-NEXT: bl sinf
1192 ; CHECK-GI-NEXT: fcvt s1, h14
1193 ; CHECK-GI-NEXT: fcvt h0, s0
1194 ; CHECK-GI-NEXT: str q0, [sp] // 16-byte Folded Spill
1195 ; CHECK-GI-NEXT: fmov s0, s1
1196 ; CHECK-GI-NEXT: bl sinf
1197 ; CHECK-GI-NEXT: ldr h1, [sp, #16] // 2-byte Folded Reload
1198 ; CHECK-GI-NEXT: fcvt h0, s0
1199 ; CHECK-GI-NEXT: fcvt s1, h1
1200 ; CHECK-GI-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
1201 ; CHECK-GI-NEXT: fmov s0, s1
1202 ; CHECK-GI-NEXT: bl sinf
1203 ; CHECK-GI-NEXT: ldr h1, [sp, #32] // 2-byte Folded Reload
1204 ; CHECK-GI-NEXT: fcvt h0, s0
1205 ; CHECK-GI-NEXT: fcvt s1, h1
1206 ; CHECK-GI-NEXT: str q0, [sp, #32] // 16-byte Folded Spill
1207 ; CHECK-GI-NEXT: fmov s0, s1
1208 ; CHECK-GI-NEXT: bl sinf
1209 ; CHECK-GI-NEXT: ldr h1, [sp, #48] // 2-byte Folded Reload
1210 ; CHECK-GI-NEXT: fcvt h0, s0
1211 ; CHECK-GI-NEXT: fcvt s1, h1
1212 ; CHECK-GI-NEXT: str q0, [sp, #48] // 16-byte Folded Spill
1213 ; CHECK-GI-NEXT: fmov s0, s1
1214 ; CHECK-GI-NEXT: bl sinf
1215 ; CHECK-GI-NEXT: ldr h1, [sp, #64] // 2-byte Folded Reload
1216 ; CHECK-GI-NEXT: fcvt h0, s0
1217 ; CHECK-GI-NEXT: fcvt s1, h1
1218 ; CHECK-GI-NEXT: str q0, [sp, #64] // 16-byte Folded Spill
1219 ; CHECK-GI-NEXT: fmov s0, s1
1220 ; CHECK-GI-NEXT: bl sinf
1221 ; CHECK-GI-NEXT: ldr h1, [sp, #96] // 2-byte Folded Reload
1222 ; CHECK-GI-NEXT: fcvt h0, s0
1223 ; CHECK-GI-NEXT: fcvt s1, h1
1224 ; CHECK-GI-NEXT: str q0, [sp, #96] // 16-byte Folded Spill
1225 ; CHECK-GI-NEXT: fmov s0, s1
1226 ; CHECK-GI-NEXT: bl sinf
1227 ; CHECK-GI-NEXT: ldr h1, [sp, #160] // 2-byte Folded Reload
1228 ; CHECK-GI-NEXT: fcvt h0, s0
1229 ; CHECK-GI-NEXT: fcvt s1, h1
1230 ; CHECK-GI-NEXT: str q0, [sp, #160] // 16-byte Folded Spill
1231 ; CHECK-GI-NEXT: fmov s0, s1
1232 ; CHECK-GI-NEXT: bl sinf
1233 ; CHECK-GI-NEXT: ldr q3, [sp, #192] // 16-byte Folded Reload
1234 ; CHECK-GI-NEXT: ldr q2, [sp, #128] // 16-byte Folded Reload
1235 ; CHECK-GI-NEXT: ldp x29, x30, [sp, #304] // 16-byte Folded Reload
1236 ; CHECK-GI-NEXT: mov v3.h[1], v2.h[0]
1237 ; CHECK-GI-NEXT: ldp q1, q2, [sp] // 32-byte Folded Reload
1238 ; CHECK-GI-NEXT: ldp d9, d8, [sp, #288] // 16-byte Folded Reload
1239 ; CHECK-GI-NEXT: ldp d11, d10, [sp, #272] // 16-byte Folded Reload
1240 ; CHECK-GI-NEXT: mov v1.h[1], v2.h[0]
1241 ; CHECK-GI-NEXT: ldr q2, [sp, #224] // 16-byte Folded Reload
1242 ; CHECK-GI-NEXT: ldp d13, d12, [sp, #256] // 16-byte Folded Reload
1243 ; CHECK-GI-NEXT: mov v3.h[2], v2.h[0]
1244 ; CHECK-GI-NEXT: ldr q2, [sp, #32] // 16-byte Folded Reload
1245 ; CHECK-GI-NEXT: ldp d15, d14, [sp, #240] // 16-byte Folded Reload
1246 ; CHECK-GI-NEXT: mov v1.h[2], v2.h[0]
1247 ; CHECK-GI-NEXT: ldr q2, [sp, #208] // 16-byte Folded Reload
1248 ; CHECK-GI-NEXT: mov v3.h[3], v2.h[0]
1249 ; CHECK-GI-NEXT: ldr q2, [sp, #48] // 16-byte Folded Reload
1250 ; CHECK-GI-NEXT: mov v1.h[3], v2.h[0]
1251 ; CHECK-GI-NEXT: ldr q2, [sp, #176] // 16-byte Folded Reload
1252 ; CHECK-GI-NEXT: mov v3.h[4], v2.h[0]
1253 ; CHECK-GI-NEXT: ldr q2, [sp, #64] // 16-byte Folded Reload
1254 ; CHECK-GI-NEXT: mov v1.h[4], v2.h[0]
1255 ; CHECK-GI-NEXT: ldr q2, [sp, #144] // 16-byte Folded Reload
1256 ; CHECK-GI-NEXT: mov v3.h[5], v2.h[0]
1257 ; CHECK-GI-NEXT: ldr q2, [sp, #96] // 16-byte Folded Reload
1258 ; CHECK-GI-NEXT: mov v1.h[5], v2.h[0]
1259 ; CHECK-GI-NEXT: fcvt h2, s0
1260 ; CHECK-GI-NEXT: ldr q0, [sp, #112] // 16-byte Folded Reload
1261 ; CHECK-GI-NEXT: mov v3.h[6], v0.h[0]
1262 ; CHECK-GI-NEXT: ldr q0, [sp, #160] // 16-byte Folded Reload
1263 ; CHECK-GI-NEXT: mov v1.h[6], v0.h[0]
1264 ; CHECK-GI-NEXT: ldr q0, [sp, #80] // 16-byte Folded Reload
1265 ; CHECK-GI-NEXT: mov v3.h[7], v0.h[0]
1266 ; CHECK-GI-NEXT: mov v1.h[7], v2.h[0]
1267 ; CHECK-GI-NEXT: mov v0.16b, v3.16b
1268 ; CHECK-GI-NEXT: add sp, sp, #320
1269 ; CHECK-GI-NEXT: ret
1271 %c = call <16 x half> @llvm.sin.v16f16(<16 x half> %a)
1275 define double @cos_f64(double %a) {
1276 ; CHECK-LABEL: cos_f64:
1277 ; CHECK: // %bb.0: // %entry
1280 %c = call double @llvm.cos.f64(double %a)
1284 define float @cos_f32(float %a) {
1285 ; CHECK-LABEL: cos_f32:
1286 ; CHECK: // %bb.0: // %entry
1287 ; CHECK-NEXT: b cosf
1289 %c = call float @llvm.cos.f32(float %a)
1293 define half @cos_f16(half %a) {
1294 ; CHECK-LABEL: cos_f16:
1295 ; CHECK: // %bb.0: // %entry
1296 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
1297 ; CHECK-NEXT: .cfi_def_cfa_offset 16
1298 ; CHECK-NEXT: .cfi_offset w30, -16
1299 ; CHECK-NEXT: fcvt s0, h0
1300 ; CHECK-NEXT: bl cosf
1301 ; CHECK-NEXT: fcvt h0, s0
1302 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
1305 %c = call half @llvm.cos.f16(half %a)
1309 define <1 x double> @cos_v1f64(<1 x double> %x) {
1310 ; CHECK-LABEL: cos_v1f64:
1312 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
1313 ; CHECK-NEXT: .cfi_def_cfa_offset 16
1314 ; CHECK-NEXT: .cfi_offset w30, -16
1315 ; CHECK-NEXT: bl cos
1316 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
1318 %c = call <1 x double> @llvm.cos.v1f64(<1 x double> %x)
1322 define <2 x double> @cos_v2f64(<2 x double> %a) {
1323 ; CHECK-SD-LABEL: cos_v2f64:
1324 ; CHECK-SD: // %bb.0: // %entry
1325 ; CHECK-SD-NEXT: sub sp, sp, #48
1326 ; CHECK-SD-NEXT: str x30, [sp, #32] // 8-byte Folded Spill
1327 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 48
1328 ; CHECK-SD-NEXT: .cfi_offset w30, -16
1329 ; CHECK-SD-NEXT: str q0, [sp] // 16-byte Folded Spill
1330 ; CHECK-SD-NEXT: mov d0, v0.d[1]
1331 ; CHECK-SD-NEXT: bl cos
1332 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
1333 ; CHECK-SD-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
1334 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1335 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 killed $q0
1336 ; CHECK-SD-NEXT: bl cos
1337 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
1338 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
1339 ; CHECK-SD-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload
1340 ; CHECK-SD-NEXT: mov v0.d[1], v1.d[0]
1341 ; CHECK-SD-NEXT: add sp, sp, #48
1342 ; CHECK-SD-NEXT: ret
1344 ; CHECK-GI-LABEL: cos_v2f64:
1345 ; CHECK-GI: // %bb.0: // %entry
1346 ; CHECK-GI-NEXT: sub sp, sp, #32
1347 ; CHECK-GI-NEXT: str d8, [sp, #16] // 8-byte Folded Spill
1348 ; CHECK-GI-NEXT: str x30, [sp, #24] // 8-byte Folded Spill
1349 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 32
1350 ; CHECK-GI-NEXT: .cfi_offset w30, -8
1351 ; CHECK-GI-NEXT: .cfi_offset b8, -16
1352 ; CHECK-GI-NEXT: mov d8, v0.d[1]
1353 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 killed $q0
1354 ; CHECK-GI-NEXT: bl cos
1355 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
1356 ; CHECK-GI-NEXT: str q0, [sp] // 16-byte Folded Spill
1357 ; CHECK-GI-NEXT: fmov d0, d8
1358 ; CHECK-GI-NEXT: bl cos
1359 ; CHECK-GI-NEXT: ldr q1, [sp] // 16-byte Folded Reload
1360 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
1361 ; CHECK-GI-NEXT: ldr x30, [sp, #24] // 8-byte Folded Reload
1362 ; CHECK-GI-NEXT: ldr d8, [sp, #16] // 8-byte Folded Reload
1363 ; CHECK-GI-NEXT: mov v1.d[1], v0.d[0]
1364 ; CHECK-GI-NEXT: mov v0.16b, v1.16b
1365 ; CHECK-GI-NEXT: add sp, sp, #32
1366 ; CHECK-GI-NEXT: ret
1368 %c = call <2 x double> @llvm.cos.v2f64(<2 x double> %a)
1372 define <3 x double> @cos_v3f64(<3 x double> %a) {
1373 ; CHECK-SD-LABEL: cos_v3f64:
1374 ; CHECK-SD: // %bb.0: // %entry
1375 ; CHECK-SD-NEXT: str d10, [sp, #-32]! // 8-byte Folded Spill
1376 ; CHECK-SD-NEXT: stp d9, d8, [sp, #8] // 16-byte Folded Spill
1377 ; CHECK-SD-NEXT: str x30, [sp, #24] // 8-byte Folded Spill
1378 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
1379 ; CHECK-SD-NEXT: .cfi_offset w30, -8
1380 ; CHECK-SD-NEXT: .cfi_offset b8, -16
1381 ; CHECK-SD-NEXT: .cfi_offset b9, -24
1382 ; CHECK-SD-NEXT: .cfi_offset b10, -32
1383 ; CHECK-SD-NEXT: fmov d8, d2
1384 ; CHECK-SD-NEXT: fmov d9, d1
1385 ; CHECK-SD-NEXT: bl cos
1386 ; CHECK-SD-NEXT: fmov d10, d0
1387 ; CHECK-SD-NEXT: fmov d0, d9
1388 ; CHECK-SD-NEXT: bl cos
1389 ; CHECK-SD-NEXT: fmov d9, d0
1390 ; CHECK-SD-NEXT: fmov d0, d8
1391 ; CHECK-SD-NEXT: bl cos
1392 ; CHECK-SD-NEXT: fmov d1, d9
1393 ; CHECK-SD-NEXT: ldp d9, d8, [sp, #8] // 16-byte Folded Reload
1394 ; CHECK-SD-NEXT: ldr x30, [sp, #24] // 8-byte Folded Reload
1395 ; CHECK-SD-NEXT: fmov d2, d0
1396 ; CHECK-SD-NEXT: fmov d0, d10
1397 ; CHECK-SD-NEXT: ldr d10, [sp], #32 // 8-byte Folded Reload
1398 ; CHECK-SD-NEXT: ret
1400 ; CHECK-GI-LABEL: cos_v3f64:
1401 ; CHECK-GI: // %bb.0: // %entry
1402 ; CHECK-GI-NEXT: str d10, [sp, #-32]! // 8-byte Folded Spill
1403 ; CHECK-GI-NEXT: stp d9, d8, [sp, #8] // 16-byte Folded Spill
1404 ; CHECK-GI-NEXT: str x30, [sp, #24] // 8-byte Folded Spill
1405 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 32
1406 ; CHECK-GI-NEXT: .cfi_offset w30, -8
1407 ; CHECK-GI-NEXT: .cfi_offset b8, -16
1408 ; CHECK-GI-NEXT: .cfi_offset b9, -24
1409 ; CHECK-GI-NEXT: .cfi_offset b10, -32
1410 ; CHECK-GI-NEXT: fmov d8, d1
1411 ; CHECK-GI-NEXT: fmov d9, d2
1412 ; CHECK-GI-NEXT: bl cos
1413 ; CHECK-GI-NEXT: fmov d10, d0
1414 ; CHECK-GI-NEXT: fmov d0, d8
1415 ; CHECK-GI-NEXT: bl cos
1416 ; CHECK-GI-NEXT: fmov d8, d0
1417 ; CHECK-GI-NEXT: fmov d0, d9
1418 ; CHECK-GI-NEXT: bl cos
1419 ; CHECK-GI-NEXT: fmov d1, d8
1420 ; CHECK-GI-NEXT: ldp d9, d8, [sp, #8] // 16-byte Folded Reload
1421 ; CHECK-GI-NEXT: ldr x30, [sp, #24] // 8-byte Folded Reload
1422 ; CHECK-GI-NEXT: fmov d2, d0
1423 ; CHECK-GI-NEXT: fmov d0, d10
1424 ; CHECK-GI-NEXT: ldr d10, [sp], #32 // 8-byte Folded Reload
1425 ; CHECK-GI-NEXT: ret
1427 %c = call <3 x double> @llvm.cos.v3f64(<3 x double> %a)
1431 define <4 x double> @cos_v4f64(<4 x double> %a) {
1432 ; CHECK-SD-LABEL: cos_v4f64:
1433 ; CHECK-SD: // %bb.0: // %entry
1434 ; CHECK-SD-NEXT: sub sp, sp, #64
1435 ; CHECK-SD-NEXT: str x30, [sp, #48] // 8-byte Folded Spill
1436 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 64
1437 ; CHECK-SD-NEXT: .cfi_offset w30, -16
1438 ; CHECK-SD-NEXT: str q0, [sp] // 16-byte Folded Spill
1439 ; CHECK-SD-NEXT: mov d0, v0.d[1]
1440 ; CHECK-SD-NEXT: str q1, [sp, #32] // 16-byte Folded Spill
1441 ; CHECK-SD-NEXT: bl cos
1442 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
1443 ; CHECK-SD-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
1444 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1445 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 killed $q0
1446 ; CHECK-SD-NEXT: bl cos
1447 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
1448 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
1449 ; CHECK-SD-NEXT: mov v0.d[1], v1.d[0]
1450 ; CHECK-SD-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
1451 ; CHECK-SD-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload
1452 ; CHECK-SD-NEXT: mov d0, v0.d[1]
1453 ; CHECK-SD-NEXT: bl cos
1454 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
1455 ; CHECK-SD-NEXT: str q0, [sp] // 16-byte Folded Spill
1456 ; CHECK-SD-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload
1457 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 killed $q0
1458 ; CHECK-SD-NEXT: bl cos
1459 ; CHECK-SD-NEXT: fmov d1, d0
1460 ; CHECK-SD-NEXT: ldp q2, q0, [sp] // 32-byte Folded Reload
1461 ; CHECK-SD-NEXT: ldr x30, [sp, #48] // 8-byte Folded Reload
1462 ; CHECK-SD-NEXT: mov v1.d[1], v2.d[0]
1463 ; CHECK-SD-NEXT: add sp, sp, #64
1464 ; CHECK-SD-NEXT: ret
1466 ; CHECK-GI-LABEL: cos_v4f64:
1467 ; CHECK-GI: // %bb.0: // %entry
1468 ; CHECK-GI-NEXT: sub sp, sp, #80
1469 ; CHECK-GI-NEXT: stp d9, d8, [sp, #48] // 16-byte Folded Spill
1470 ; CHECK-GI-NEXT: str x30, [sp, #64] // 8-byte Folded Spill
1471 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 80
1472 ; CHECK-GI-NEXT: .cfi_offset w30, -16
1473 ; CHECK-GI-NEXT: .cfi_offset b8, -24
1474 ; CHECK-GI-NEXT: .cfi_offset b9, -32
1475 ; CHECK-GI-NEXT: str q1, [sp] // 16-byte Folded Spill
1476 ; CHECK-GI-NEXT: mov d8, v0.d[1]
1477 ; CHECK-GI-NEXT: mov d9, v1.d[1]
1478 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 killed $q0
1479 ; CHECK-GI-NEXT: bl cos
1480 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
1481 ; CHECK-GI-NEXT: str q0, [sp, #32] // 16-byte Folded Spill
1482 ; CHECK-GI-NEXT: fmov d0, d8
1483 ; CHECK-GI-NEXT: bl cos
1484 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
1485 ; CHECK-GI-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
1486 ; CHECK-GI-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1487 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 killed $q0
1488 ; CHECK-GI-NEXT: bl cos
1489 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
1490 ; CHECK-GI-NEXT: str q0, [sp] // 16-byte Folded Spill
1491 ; CHECK-GI-NEXT: fmov d0, d9
1492 ; CHECK-GI-NEXT: bl cos
1493 ; CHECK-GI-NEXT: ldp q1, q2, [sp, #16] // 32-byte Folded Reload
1494 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
1495 ; CHECK-GI-NEXT: ldr x30, [sp, #64] // 8-byte Folded Reload
1496 ; CHECK-GI-NEXT: ldp d9, d8, [sp, #48] // 16-byte Folded Reload
1497 ; CHECK-GI-NEXT: mov v2.d[1], v1.d[0]
1498 ; CHECK-GI-NEXT: ldr q1, [sp] // 16-byte Folded Reload
1499 ; CHECK-GI-NEXT: mov v1.d[1], v0.d[0]
1500 ; CHECK-GI-NEXT: mov v0.16b, v2.16b
1501 ; CHECK-GI-NEXT: add sp, sp, #80
1502 ; CHECK-GI-NEXT: ret
1504 %c = call <4 x double> @llvm.cos.v4f64(<4 x double> %a)
1508 define <2 x float> @cos_v2f32(<2 x float> %a) {
1509 ; CHECK-SD-LABEL: cos_v2f32:
1510 ; CHECK-SD: // %bb.0: // %entry
1511 ; CHECK-SD-NEXT: sub sp, sp, #48
1512 ; CHECK-SD-NEXT: str x30, [sp, #32] // 8-byte Folded Spill
1513 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 48
1514 ; CHECK-SD-NEXT: .cfi_offset w30, -16
1515 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
1516 ; CHECK-SD-NEXT: str q0, [sp] // 16-byte Folded Spill
1517 ; CHECK-SD-NEXT: mov s0, v0.s[1]
1518 ; CHECK-SD-NEXT: bl cosf
1519 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
1520 ; CHECK-SD-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
1521 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1522 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 killed $q0
1523 ; CHECK-SD-NEXT: bl cosf
1524 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
1525 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
1526 ; CHECK-SD-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload
1527 ; CHECK-SD-NEXT: mov v0.s[1], v1.s[0]
1528 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 killed $q0
1529 ; CHECK-SD-NEXT: add sp, sp, #48
1530 ; CHECK-SD-NEXT: ret
1532 ; CHECK-GI-LABEL: cos_v2f32:
1533 ; CHECK-GI: // %bb.0: // %entry
1534 ; CHECK-GI-NEXT: sub sp, sp, #32
1535 ; CHECK-GI-NEXT: str d8, [sp, #16] // 8-byte Folded Spill
1536 ; CHECK-GI-NEXT: str x30, [sp, #24] // 8-byte Folded Spill
1537 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 32
1538 ; CHECK-GI-NEXT: .cfi_offset w30, -8
1539 ; CHECK-GI-NEXT: .cfi_offset b8, -16
1540 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
1541 ; CHECK-GI-NEXT: mov s8, v0.s[1]
1542 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 killed $q0
1543 ; CHECK-GI-NEXT: bl cosf
1544 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
1545 ; CHECK-GI-NEXT: str q0, [sp] // 16-byte Folded Spill
1546 ; CHECK-GI-NEXT: fmov s0, s8
1547 ; CHECK-GI-NEXT: bl cosf
1548 ; CHECK-GI-NEXT: ldr q1, [sp] // 16-byte Folded Reload
1549 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
1550 ; CHECK-GI-NEXT: ldr x30, [sp, #24] // 8-byte Folded Reload
1551 ; CHECK-GI-NEXT: ldr d8, [sp, #16] // 8-byte Folded Reload
1552 ; CHECK-GI-NEXT: mov v1.s[1], v0.s[0]
1553 ; CHECK-GI-NEXT: fmov d0, d1
1554 ; CHECK-GI-NEXT: add sp, sp, #32
1555 ; CHECK-GI-NEXT: ret
1557 %c = call <2 x float> @llvm.cos.v2f32(<2 x float> %a)
1561 define <3 x float> @cos_v3f32(<3 x float> %a) {
1562 ; CHECK-SD-LABEL: cos_v3f32:
1563 ; CHECK-SD: // %bb.0: // %entry
1564 ; CHECK-SD-NEXT: sub sp, sp, #48
1565 ; CHECK-SD-NEXT: str x30, [sp, #32] // 8-byte Folded Spill
1566 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 48
1567 ; CHECK-SD-NEXT: .cfi_offset w30, -16
1568 ; CHECK-SD-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
1569 ; CHECK-SD-NEXT: mov s0, v0.s[1]
1570 ; CHECK-SD-NEXT: bl cosf
1571 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
1572 ; CHECK-SD-NEXT: str q0, [sp] // 16-byte Folded Spill
1573 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
1574 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 killed $q0
1575 ; CHECK-SD-NEXT: bl cosf
1576 ; CHECK-SD-NEXT: ldr q1, [sp] // 16-byte Folded Reload
1577 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
1578 ; CHECK-SD-NEXT: mov v0.s[1], v1.s[0]
1579 ; CHECK-SD-NEXT: str q0, [sp] // 16-byte Folded Spill
1580 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
1581 ; CHECK-SD-NEXT: mov s0, v0.s[2]
1582 ; CHECK-SD-NEXT: bl cosf
1583 ; CHECK-SD-NEXT: ldr q1, [sp] // 16-byte Folded Reload
1584 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
1585 ; CHECK-SD-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload
1586 ; CHECK-SD-NEXT: mov v1.s[2], v0.s[0]
1587 ; CHECK-SD-NEXT: mov v0.16b, v1.16b
1588 ; CHECK-SD-NEXT: add sp, sp, #48
1589 ; CHECK-SD-NEXT: ret
1591 ; CHECK-GI-LABEL: cos_v3f32:
1592 ; CHECK-GI: // %bb.0: // %entry
1593 ; CHECK-GI-NEXT: sub sp, sp, #64
1594 ; CHECK-GI-NEXT: stp d9, d8, [sp, #32] // 16-byte Folded Spill
1595 ; CHECK-GI-NEXT: str x30, [sp, #48] // 8-byte Folded Spill
1596 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 64
1597 ; CHECK-GI-NEXT: .cfi_offset w30, -16
1598 ; CHECK-GI-NEXT: .cfi_offset b8, -24
1599 ; CHECK-GI-NEXT: .cfi_offset b9, -32
1600 ; CHECK-GI-NEXT: mov s8, v0.s[1]
1601 ; CHECK-GI-NEXT: mov s9, v0.s[2]
1602 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 killed $q0
1603 ; CHECK-GI-NEXT: bl cosf
1604 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
1605 ; CHECK-GI-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
1606 ; CHECK-GI-NEXT: fmov s0, s8
1607 ; CHECK-GI-NEXT: bl cosf
1608 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
1609 ; CHECK-GI-NEXT: str q0, [sp] // 16-byte Folded Spill
1610 ; CHECK-GI-NEXT: fmov s0, s9
1611 ; CHECK-GI-NEXT: bl cosf
1612 ; CHECK-GI-NEXT: ldp q2, q1, [sp] // 32-byte Folded Reload
1613 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
1614 ; CHECK-GI-NEXT: ldr x30, [sp, #48] // 8-byte Folded Reload
1615 ; CHECK-GI-NEXT: ldp d9, d8, [sp, #32] // 16-byte Folded Reload
1616 ; CHECK-GI-NEXT: mov v1.s[1], v2.s[0]
1617 ; CHECK-GI-NEXT: mov v1.s[2], v0.s[0]
1618 ; CHECK-GI-NEXT: mov v0.16b, v1.16b
1619 ; CHECK-GI-NEXT: add sp, sp, #64
1620 ; CHECK-GI-NEXT: ret
1622 %c = call <3 x float> @llvm.cos.v3f32(<3 x float> %a)
1626 define <4 x float> @cos_v4f32(<4 x float> %a) {
1627 ; CHECK-SD-LABEL: cos_v4f32:
1628 ; CHECK-SD: // %bb.0: // %entry
1629 ; CHECK-SD-NEXT: sub sp, sp, #48
1630 ; CHECK-SD-NEXT: str x30, [sp, #32] // 8-byte Folded Spill
1631 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 48
1632 ; CHECK-SD-NEXT: .cfi_offset w30, -16
1633 ; CHECK-SD-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
1634 ; CHECK-SD-NEXT: mov s0, v0.s[1]
1635 ; CHECK-SD-NEXT: bl cosf
1636 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
1637 ; CHECK-SD-NEXT: str q0, [sp] // 16-byte Folded Spill
1638 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
1639 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 killed $q0
1640 ; CHECK-SD-NEXT: bl cosf
1641 ; CHECK-SD-NEXT: ldr q1, [sp] // 16-byte Folded Reload
1642 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
1643 ; CHECK-SD-NEXT: mov v0.s[1], v1.s[0]
1644 ; CHECK-SD-NEXT: str q0, [sp] // 16-byte Folded Spill
1645 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
1646 ; CHECK-SD-NEXT: mov s0, v0.s[2]
1647 ; CHECK-SD-NEXT: bl cosf
1648 ; CHECK-SD-NEXT: ldr q1, [sp] // 16-byte Folded Reload
1649 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
1650 ; CHECK-SD-NEXT: mov v1.s[2], v0.s[0]
1651 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
1652 ; CHECK-SD-NEXT: mov s0, v0.s[3]
1653 ; CHECK-SD-NEXT: str q1, [sp] // 16-byte Folded Spill
1654 ; CHECK-SD-NEXT: bl cosf
1655 ; CHECK-SD-NEXT: ldr q1, [sp] // 16-byte Folded Reload
1656 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
1657 ; CHECK-SD-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload
1658 ; CHECK-SD-NEXT: mov v1.s[3], v0.s[0]
1659 ; CHECK-SD-NEXT: mov v0.16b, v1.16b
1660 ; CHECK-SD-NEXT: add sp, sp, #48
1661 ; CHECK-SD-NEXT: ret
1663 ; CHECK-GI-LABEL: cos_v4f32:
1664 ; CHECK-GI: // %bb.0: // %entry
1665 ; CHECK-GI-NEXT: sub sp, sp, #80
1666 ; CHECK-GI-NEXT: str d10, [sp, #48] // 8-byte Folded Spill
1667 ; CHECK-GI-NEXT: stp d9, d8, [sp, #56] // 16-byte Folded Spill
1668 ; CHECK-GI-NEXT: str x30, [sp, #72] // 8-byte Folded Spill
1669 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 80
1670 ; CHECK-GI-NEXT: .cfi_offset w30, -8
1671 ; CHECK-GI-NEXT: .cfi_offset b8, -16
1672 ; CHECK-GI-NEXT: .cfi_offset b9, -24
1673 ; CHECK-GI-NEXT: .cfi_offset b10, -32
1674 ; CHECK-GI-NEXT: mov s8, v0.s[1]
1675 ; CHECK-GI-NEXT: mov s9, v0.s[2]
1676 ; CHECK-GI-NEXT: mov s10, v0.s[3]
1677 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 killed $q0
1678 ; CHECK-GI-NEXT: bl cosf
1679 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
1680 ; CHECK-GI-NEXT: str q0, [sp, #32] // 16-byte Folded Spill
1681 ; CHECK-GI-NEXT: fmov s0, s8
1682 ; CHECK-GI-NEXT: bl cosf
1683 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
1684 ; CHECK-GI-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
1685 ; CHECK-GI-NEXT: fmov s0, s9
1686 ; CHECK-GI-NEXT: bl cosf
1687 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
1688 ; CHECK-GI-NEXT: str q0, [sp] // 16-byte Folded Spill
1689 ; CHECK-GI-NEXT: fmov s0, s10
1690 ; CHECK-GI-NEXT: bl cosf
1691 ; CHECK-GI-NEXT: ldp q2, q1, [sp, #16] // 32-byte Folded Reload
1692 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
1693 ; CHECK-GI-NEXT: ldr x30, [sp, #72] // 8-byte Folded Reload
1694 ; CHECK-GI-NEXT: ldp d9, d8, [sp, #56] // 16-byte Folded Reload
1695 ; CHECK-GI-NEXT: ldr d10, [sp, #48] // 8-byte Folded Reload
1696 ; CHECK-GI-NEXT: mov v1.s[1], v2.s[0]
1697 ; CHECK-GI-NEXT: ldr q2, [sp] // 16-byte Folded Reload
1698 ; CHECK-GI-NEXT: mov v1.s[2], v2.s[0]
1699 ; CHECK-GI-NEXT: mov v1.s[3], v0.s[0]
1700 ; CHECK-GI-NEXT: mov v0.16b, v1.16b
1701 ; CHECK-GI-NEXT: add sp, sp, #80
1702 ; CHECK-GI-NEXT: ret
1704 %c = call <4 x float> @llvm.cos.v4f32(<4 x float> %a)
1708 define <8 x float> @cos_v8f32(<8 x float> %a) {
1709 ; CHECK-SD-LABEL: cos_v8f32:
1710 ; CHECK-SD: // %bb.0: // %entry
1711 ; CHECK-SD-NEXT: sub sp, sp, #64
1712 ; CHECK-SD-NEXT: str x30, [sp, #48] // 8-byte Folded Spill
1713 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 64
1714 ; CHECK-SD-NEXT: .cfi_offset w30, -16
1715 ; CHECK-SD-NEXT: stp q0, q1, [sp] // 32-byte Folded Spill
1716 ; CHECK-SD-NEXT: mov s0, v0.s[1]
1717 ; CHECK-SD-NEXT: bl cosf
1718 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
1719 ; CHECK-SD-NEXT: str q0, [sp, #32] // 16-byte Folded Spill
1720 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1721 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 killed $q0
1722 ; CHECK-SD-NEXT: bl cosf
1723 ; CHECK-SD-NEXT: ldr q1, [sp, #32] // 16-byte Folded Reload
1724 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
1725 ; CHECK-SD-NEXT: mov v0.s[1], v1.s[0]
1726 ; CHECK-SD-NEXT: str q0, [sp, #32] // 16-byte Folded Spill
1727 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1728 ; CHECK-SD-NEXT: mov s0, v0.s[2]
1729 ; CHECK-SD-NEXT: bl cosf
1730 ; CHECK-SD-NEXT: ldr q1, [sp, #32] // 16-byte Folded Reload
1731 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
1732 ; CHECK-SD-NEXT: mov v1.s[2], v0.s[0]
1733 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1734 ; CHECK-SD-NEXT: mov s0, v0.s[3]
1735 ; CHECK-SD-NEXT: str q1, [sp, #32] // 16-byte Folded Spill
1736 ; CHECK-SD-NEXT: bl cosf
1737 ; CHECK-SD-NEXT: ldr q1, [sp, #32] // 16-byte Folded Reload
1738 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
1739 ; CHECK-SD-NEXT: mov v1.s[3], v0.s[0]
1740 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
1741 ; CHECK-SD-NEXT: mov s0, v0.s[1]
1742 ; CHECK-SD-NEXT: str q1, [sp, #32] // 16-byte Folded Spill
1743 ; CHECK-SD-NEXT: bl cosf
1744 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
1745 ; CHECK-SD-NEXT: str q0, [sp] // 16-byte Folded Spill
1746 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
1747 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 killed $q0
1748 ; CHECK-SD-NEXT: bl cosf
1749 ; CHECK-SD-NEXT: ldr q1, [sp] // 16-byte Folded Reload
1750 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
1751 ; CHECK-SD-NEXT: mov v0.s[1], v1.s[0]
1752 ; CHECK-SD-NEXT: str q0, [sp] // 16-byte Folded Spill
1753 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
1754 ; CHECK-SD-NEXT: mov s0, v0.s[2]
1755 ; CHECK-SD-NEXT: bl cosf
1756 ; CHECK-SD-NEXT: ldr q1, [sp] // 16-byte Folded Reload
1757 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
1758 ; CHECK-SD-NEXT: mov v1.s[2], v0.s[0]
1759 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
1760 ; CHECK-SD-NEXT: mov s0, v0.s[3]
1761 ; CHECK-SD-NEXT: str q1, [sp] // 16-byte Folded Spill
1762 ; CHECK-SD-NEXT: bl cosf
1763 ; CHECK-SD-NEXT: fmov s2, s0
1764 ; CHECK-SD-NEXT: ldr q1, [sp] // 16-byte Folded Reload
1765 ; CHECK-SD-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload
1766 ; CHECK-SD-NEXT: ldr x30, [sp, #48] // 8-byte Folded Reload
1767 ; CHECK-SD-NEXT: mov v1.s[3], v2.s[0]
1768 ; CHECK-SD-NEXT: add sp, sp, #64
1769 ; CHECK-SD-NEXT: ret
1771 ; CHECK-GI-LABEL: cos_v8f32:
1772 ; CHECK-GI: // %bb.0: // %entry
1773 ; CHECK-GI-NEXT: sub sp, sp, #176
1774 ; CHECK-GI-NEXT: stp d13, d12, [sp, #112] // 16-byte Folded Spill
1775 ; CHECK-GI-NEXT: stp d11, d10, [sp, #128] // 16-byte Folded Spill
1776 ; CHECK-GI-NEXT: stp d9, d8, [sp, #144] // 16-byte Folded Spill
1777 ; CHECK-GI-NEXT: str x30, [sp, #160] // 8-byte Folded Spill
1778 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 176
1779 ; CHECK-GI-NEXT: .cfi_offset w30, -16
1780 ; CHECK-GI-NEXT: .cfi_offset b8, -24
1781 ; CHECK-GI-NEXT: .cfi_offset b9, -32
1782 ; CHECK-GI-NEXT: .cfi_offset b10, -40
1783 ; CHECK-GI-NEXT: .cfi_offset b11, -48
1784 ; CHECK-GI-NEXT: .cfi_offset b12, -56
1785 ; CHECK-GI-NEXT: .cfi_offset b13, -64
1786 ; CHECK-GI-NEXT: str q1, [sp, #32] // 16-byte Folded Spill
1787 ; CHECK-GI-NEXT: mov s8, v0.s[1]
1788 ; CHECK-GI-NEXT: mov s9, v0.s[2]
1789 ; CHECK-GI-NEXT: mov s10, v0.s[3]
1790 ; CHECK-GI-NEXT: mov s11, v1.s[1]
1791 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 killed $q0
1792 ; CHECK-GI-NEXT: mov s12, v1.s[2]
1793 ; CHECK-GI-NEXT: mov s13, v1.s[3]
1794 ; CHECK-GI-NEXT: bl cosf
1795 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
1796 ; CHECK-GI-NEXT: str q0, [sp, #64] // 16-byte Folded Spill
1797 ; CHECK-GI-NEXT: fmov s0, s8
1798 ; CHECK-GI-NEXT: bl cosf
1799 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
1800 ; CHECK-GI-NEXT: str q0, [sp, #48] // 16-byte Folded Spill
1801 ; CHECK-GI-NEXT: fmov s0, s9
1802 ; CHECK-GI-NEXT: bl cosf
1803 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
1804 ; CHECK-GI-NEXT: str q0, [sp, #96] // 16-byte Folded Spill
1805 ; CHECK-GI-NEXT: fmov s0, s10
1806 ; CHECK-GI-NEXT: bl cosf
1807 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
1808 ; CHECK-GI-NEXT: str q0, [sp, #80] // 16-byte Folded Spill
1809 ; CHECK-GI-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload
1810 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 killed $q0
1811 ; CHECK-GI-NEXT: bl cosf
1812 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
1813 ; CHECK-GI-NEXT: str q0, [sp, #32] // 16-byte Folded Spill
1814 ; CHECK-GI-NEXT: fmov s0, s11
1815 ; CHECK-GI-NEXT: bl cosf
1816 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
1817 ; CHECK-GI-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
1818 ; CHECK-GI-NEXT: fmov s0, s12
1819 ; CHECK-GI-NEXT: bl cosf
1820 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
1821 ; CHECK-GI-NEXT: str q0, [sp] // 16-byte Folded Spill
1822 ; CHECK-GI-NEXT: fmov s0, s13
1823 ; CHECK-GI-NEXT: bl cosf
1824 ; CHECK-GI-NEXT: ldp q2, q1, [sp, #48] // 32-byte Folded Reload
1825 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
1826 ; CHECK-GI-NEXT: ldr x30, [sp, #160] // 8-byte Folded Reload
1827 ; CHECK-GI-NEXT: ldp d9, d8, [sp, #144] // 16-byte Folded Reload
1828 ; CHECK-GI-NEXT: ldp d11, d10, [sp, #128] // 16-byte Folded Reload
1829 ; CHECK-GI-NEXT: mov v1.s[1], v2.s[0]
1830 ; CHECK-GI-NEXT: ldp q2, q3, [sp, #16] // 32-byte Folded Reload
1831 ; CHECK-GI-NEXT: ldp d13, d12, [sp, #112] // 16-byte Folded Reload
1832 ; CHECK-GI-NEXT: mov v3.s[1], v2.s[0]
1833 ; CHECK-GI-NEXT: ldr q2, [sp, #96] // 16-byte Folded Reload
1834 ; CHECK-GI-NEXT: mov v1.s[2], v2.s[0]
1835 ; CHECK-GI-NEXT: ldr q2, [sp] // 16-byte Folded Reload
1836 ; CHECK-GI-NEXT: mov v3.s[2], v2.s[0]
1837 ; CHECK-GI-NEXT: ldr q2, [sp, #80] // 16-byte Folded Reload
1838 ; CHECK-GI-NEXT: mov v1.s[3], v2.s[0]
1839 ; CHECK-GI-NEXT: mov v3.s[3], v0.s[0]
1840 ; CHECK-GI-NEXT: mov v2.16b, v1.16b
1841 ; CHECK-GI-NEXT: mov v1.16b, v3.16b
1842 ; CHECK-GI-NEXT: mov v0.16b, v2.16b
1843 ; CHECK-GI-NEXT: add sp, sp, #176
1844 ; CHECK-GI-NEXT: ret
1846 %c = call <8 x float> @llvm.cos.v8f32(<8 x float> %a)
1850 define <7 x half> @cos_v7f16(<7 x half> %a) {
1851 ; CHECK-SD-LABEL: cos_v7f16:
1852 ; CHECK-SD: // %bb.0: // %entry
1853 ; CHECK-SD-NEXT: sub sp, sp, #48
1854 ; CHECK-SD-NEXT: str x30, [sp, #32] // 8-byte Folded Spill
1855 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 48
1856 ; CHECK-SD-NEXT: .cfi_offset w30, -16
1857 ; CHECK-SD-NEXT: mov h1, v0.h[1]
1858 ; CHECK-SD-NEXT: str q0, [sp] // 16-byte Folded Spill
1859 ; CHECK-SD-NEXT: fcvt s0, h1
1860 ; CHECK-SD-NEXT: bl cosf
1861 ; CHECK-SD-NEXT: fcvt h0, s0
1862 ; CHECK-SD-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
1863 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1864 ; CHECK-SD-NEXT: fcvt s0, h0
1865 ; CHECK-SD-NEXT: bl cosf
1866 ; CHECK-SD-NEXT: fcvt h0, s0
1867 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
1868 ; CHECK-SD-NEXT: mov v0.h[1], v1.h[0]
1869 ; CHECK-SD-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
1870 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1871 ; CHECK-SD-NEXT: mov h0, v0.h[2]
1872 ; CHECK-SD-NEXT: fcvt s0, h0
1873 ; CHECK-SD-NEXT: bl cosf
1874 ; CHECK-SD-NEXT: fcvt h0, s0
1875 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
1876 ; CHECK-SD-NEXT: mov v1.h[2], v0.h[0]
1877 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1878 ; CHECK-SD-NEXT: mov h0, v0.h[3]
1879 ; CHECK-SD-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
1880 ; CHECK-SD-NEXT: fcvt s0, h0
1881 ; CHECK-SD-NEXT: bl cosf
1882 ; CHECK-SD-NEXT: fcvt h0, s0
1883 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
1884 ; CHECK-SD-NEXT: mov v1.h[3], v0.h[0]
1885 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1886 ; CHECK-SD-NEXT: mov h0, v0.h[4]
1887 ; CHECK-SD-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
1888 ; CHECK-SD-NEXT: fcvt s0, h0
1889 ; CHECK-SD-NEXT: bl cosf
1890 ; CHECK-SD-NEXT: fcvt h0, s0
1891 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
1892 ; CHECK-SD-NEXT: mov v1.h[4], v0.h[0]
1893 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1894 ; CHECK-SD-NEXT: mov h0, v0.h[5]
1895 ; CHECK-SD-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
1896 ; CHECK-SD-NEXT: fcvt s0, h0
1897 ; CHECK-SD-NEXT: bl cosf
1898 ; CHECK-SD-NEXT: fcvt h0, s0
1899 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
1900 ; CHECK-SD-NEXT: mov v1.h[5], v0.h[0]
1901 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1902 ; CHECK-SD-NEXT: mov h0, v0.h[6]
1903 ; CHECK-SD-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
1904 ; CHECK-SD-NEXT: fcvt s0, h0
1905 ; CHECK-SD-NEXT: bl cosf
1906 ; CHECK-SD-NEXT: fcvt h0, s0
1907 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
1908 ; CHECK-SD-NEXT: mov v1.h[6], v0.h[0]
1909 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
1910 ; CHECK-SD-NEXT: mov h0, v0.h[7]
1911 ; CHECK-SD-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
1912 ; CHECK-SD-NEXT: fcvt s0, h0
1913 ; CHECK-SD-NEXT: bl cosf
1914 ; CHECK-SD-NEXT: fcvt h1, s0
1915 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
1916 ; CHECK-SD-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload
1917 ; CHECK-SD-NEXT: mov v0.h[7], v1.h[0]
1918 ; CHECK-SD-NEXT: add sp, sp, #48
1919 ; CHECK-SD-NEXT: ret
1921 ; CHECK-GI-LABEL: cos_v7f16:
1922 ; CHECK-GI: // %bb.0: // %entry
1923 ; CHECK-GI-NEXT: sub sp, sp, #160
1924 ; CHECK-GI-NEXT: stp d13, d12, [sp, #96] // 16-byte Folded Spill
1925 ; CHECK-GI-NEXT: stp d11, d10, [sp, #112] // 16-byte Folded Spill
1926 ; CHECK-GI-NEXT: stp d9, d8, [sp, #128] // 16-byte Folded Spill
1927 ; CHECK-GI-NEXT: str x30, [sp, #144] // 8-byte Folded Spill
1928 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 160
1929 ; CHECK-GI-NEXT: .cfi_offset w30, -16
1930 ; CHECK-GI-NEXT: .cfi_offset b8, -24
1931 ; CHECK-GI-NEXT: .cfi_offset b9, -32
1932 ; CHECK-GI-NEXT: .cfi_offset b10, -40
1933 ; CHECK-GI-NEXT: .cfi_offset b11, -48
1934 ; CHECK-GI-NEXT: .cfi_offset b12, -56
1935 ; CHECK-GI-NEXT: .cfi_offset b13, -64
1936 ; CHECK-GI-NEXT: mov h8, v0.h[1]
1937 ; CHECK-GI-NEXT: mov h9, v0.h[2]
1938 ; CHECK-GI-NEXT: mov h10, v0.h[3]
1939 ; CHECK-GI-NEXT: mov h11, v0.h[4]
1940 ; CHECK-GI-NEXT: mov h12, v0.h[5]
1941 ; CHECK-GI-NEXT: mov h13, v0.h[6]
1942 ; CHECK-GI-NEXT: fcvt s0, h0
1943 ; CHECK-GI-NEXT: bl cosf
1944 ; CHECK-GI-NEXT: fcvt s1, h8
1945 ; CHECK-GI-NEXT: fcvt h0, s0
1946 ; CHECK-GI-NEXT: str q0, [sp, #80] // 16-byte Folded Spill
1947 ; CHECK-GI-NEXT: fmov s0, s1
1948 ; CHECK-GI-NEXT: bl cosf
1949 ; CHECK-GI-NEXT: fcvt s1, h9
1950 ; CHECK-GI-NEXT: fcvt h0, s0
1951 ; CHECK-GI-NEXT: str q0, [sp, #64] // 16-byte Folded Spill
1952 ; CHECK-GI-NEXT: fmov s0, s1
1953 ; CHECK-GI-NEXT: bl cosf
1954 ; CHECK-GI-NEXT: fcvt s1, h10
1955 ; CHECK-GI-NEXT: fcvt h0, s0
1956 ; CHECK-GI-NEXT: str q0, [sp, #48] // 16-byte Folded Spill
1957 ; CHECK-GI-NEXT: fmov s0, s1
1958 ; CHECK-GI-NEXT: bl cosf
1959 ; CHECK-GI-NEXT: fcvt s1, h11
1960 ; CHECK-GI-NEXT: fcvt h0, s0
1961 ; CHECK-GI-NEXT: str q0, [sp, #32] // 16-byte Folded Spill
1962 ; CHECK-GI-NEXT: fmov s0, s1
1963 ; CHECK-GI-NEXT: bl cosf
1964 ; CHECK-GI-NEXT: fcvt s1, h12
1965 ; CHECK-GI-NEXT: fcvt h0, s0
1966 ; CHECK-GI-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
1967 ; CHECK-GI-NEXT: fmov s0, s1
1968 ; CHECK-GI-NEXT: bl cosf
1969 ; CHECK-GI-NEXT: fcvt s1, h13
1970 ; CHECK-GI-NEXT: fcvt h0, s0
1971 ; CHECK-GI-NEXT: str q0, [sp] // 16-byte Folded Spill
1972 ; CHECK-GI-NEXT: fmov s0, s1
1973 ; CHECK-GI-NEXT: bl cosf
1974 ; CHECK-GI-NEXT: ldp q2, q1, [sp, #64] // 32-byte Folded Reload
1975 ; CHECK-GI-NEXT: fcvt h0, s0
1976 ; CHECK-GI-NEXT: ldp d9, d8, [sp, #128] // 16-byte Folded Reload
1977 ; CHECK-GI-NEXT: ldr x30, [sp, #144] // 8-byte Folded Reload
1978 ; CHECK-GI-NEXT: ldp d11, d10, [sp, #112] // 16-byte Folded Reload
1979 ; CHECK-GI-NEXT: mov v1.h[1], v2.h[0]
1980 ; CHECK-GI-NEXT: ldp q2, q3, [sp, #32] // 32-byte Folded Reload
1981 ; CHECK-GI-NEXT: ldp d13, d12, [sp, #96] // 16-byte Folded Reload
1982 ; CHECK-GI-NEXT: mov v1.h[2], v3.h[0]
1983 ; CHECK-GI-NEXT: mov v1.h[3], v2.h[0]
1984 ; CHECK-GI-NEXT: ldp q2, q3, [sp] // 32-byte Folded Reload
1985 ; CHECK-GI-NEXT: mov v1.h[4], v3.h[0]
1986 ; CHECK-GI-NEXT: mov v1.h[5], v2.h[0]
1987 ; CHECK-GI-NEXT: mov v1.h[6], v0.h[0]
1988 ; CHECK-GI-NEXT: mov v0.16b, v1.16b
1989 ; CHECK-GI-NEXT: add sp, sp, #160
1990 ; CHECK-GI-NEXT: ret
1992 %c = call <7 x half> @llvm.cos.v7f16(<7 x half> %a)
1996 define <4 x half> @cos_v4f16(<4 x half> %a) {
1997 ; CHECK-SD-LABEL: cos_v4f16:
1998 ; CHECK-SD: // %bb.0: // %entry
1999 ; CHECK-SD-NEXT: sub sp, sp, #48
2000 ; CHECK-SD-NEXT: str x30, [sp, #32] // 8-byte Folded Spill
2001 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 48
2002 ; CHECK-SD-NEXT: .cfi_offset w30, -16
2003 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
2004 ; CHECK-SD-NEXT: mov h1, v0.h[1]
2005 ; CHECK-SD-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
2006 ; CHECK-SD-NEXT: fcvt s0, h1
2007 ; CHECK-SD-NEXT: bl cosf
2008 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
2009 ; CHECK-SD-NEXT: fcvt h0, s0
2010 ; CHECK-SD-NEXT: fcvt s1, h1
2011 ; CHECK-SD-NEXT: str q0, [sp] // 16-byte Folded Spill
2012 ; CHECK-SD-NEXT: fmov s0, s1
2013 ; CHECK-SD-NEXT: bl cosf
2014 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
2015 ; CHECK-SD-NEXT: fcvt h2, s0
2016 ; CHECK-SD-NEXT: mov h1, v1.h[2]
2017 ; CHECK-SD-NEXT: fcvt s0, h1
2018 ; CHECK-SD-NEXT: ldr q1, [sp] // 16-byte Folded Reload
2019 ; CHECK-SD-NEXT: mov v2.h[1], v1.h[0]
2020 ; CHECK-SD-NEXT: str q2, [sp] // 16-byte Folded Spill
2021 ; CHECK-SD-NEXT: bl cosf
2022 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
2023 ; CHECK-SD-NEXT: fcvt h2, s0
2024 ; CHECK-SD-NEXT: mov h1, v1.h[3]
2025 ; CHECK-SD-NEXT: fcvt s0, h1
2026 ; CHECK-SD-NEXT: ldr q1, [sp] // 16-byte Folded Reload
2027 ; CHECK-SD-NEXT: mov v1.h[2], v2.h[0]
2028 ; CHECK-SD-NEXT: str q1, [sp] // 16-byte Folded Spill
2029 ; CHECK-SD-NEXT: bl cosf
2030 ; CHECK-SD-NEXT: fcvt h1, s0
2031 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
2032 ; CHECK-SD-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload
2033 ; CHECK-SD-NEXT: mov v0.h[3], v1.h[0]
2034 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 killed $q0
2035 ; CHECK-SD-NEXT: add sp, sp, #48
2036 ; CHECK-SD-NEXT: ret
2038 ; CHECK-GI-LABEL: cos_v4f16:
2039 ; CHECK-GI: // %bb.0: // %entry
2040 ; CHECK-GI-NEXT: sub sp, sp, #80
2041 ; CHECK-GI-NEXT: str d10, [sp, #48] // 8-byte Folded Spill
2042 ; CHECK-GI-NEXT: stp d9, d8, [sp, #56] // 16-byte Folded Spill
2043 ; CHECK-GI-NEXT: str x30, [sp, #72] // 8-byte Folded Spill
2044 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 80
2045 ; CHECK-GI-NEXT: .cfi_offset w30, -8
2046 ; CHECK-GI-NEXT: .cfi_offset b8, -16
2047 ; CHECK-GI-NEXT: .cfi_offset b9, -24
2048 ; CHECK-GI-NEXT: .cfi_offset b10, -32
2049 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
2050 ; CHECK-GI-NEXT: mov h8, v0.h[1]
2051 ; CHECK-GI-NEXT: mov h9, v0.h[2]
2052 ; CHECK-GI-NEXT: mov h10, v0.h[3]
2053 ; CHECK-GI-NEXT: fcvt s0, h0
2054 ; CHECK-GI-NEXT: bl cosf
2055 ; CHECK-GI-NEXT: fcvt s1, h8
2056 ; CHECK-GI-NEXT: fcvt h0, s0
2057 ; CHECK-GI-NEXT: str q0, [sp, #32] // 16-byte Folded Spill
2058 ; CHECK-GI-NEXT: fmov s0, s1
2059 ; CHECK-GI-NEXT: bl cosf
2060 ; CHECK-GI-NEXT: fcvt s1, h9
2061 ; CHECK-GI-NEXT: fcvt h0, s0
2062 ; CHECK-GI-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
2063 ; CHECK-GI-NEXT: fmov s0, s1
2064 ; CHECK-GI-NEXT: bl cosf
2065 ; CHECK-GI-NEXT: fcvt s1, h10
2066 ; CHECK-GI-NEXT: fcvt h0, s0
2067 ; CHECK-GI-NEXT: str q0, [sp] // 16-byte Folded Spill
2068 ; CHECK-GI-NEXT: fmov s0, s1
2069 ; CHECK-GI-NEXT: bl cosf
2070 ; CHECK-GI-NEXT: ldp q2, q1, [sp, #16] // 32-byte Folded Reload
2071 ; CHECK-GI-NEXT: fcvt h0, s0
2072 ; CHECK-GI-NEXT: ldp d9, d8, [sp, #56] // 16-byte Folded Reload
2073 ; CHECK-GI-NEXT: ldr x30, [sp, #72] // 8-byte Folded Reload
2074 ; CHECK-GI-NEXT: ldr d10, [sp, #48] // 8-byte Folded Reload
2075 ; CHECK-GI-NEXT: mov v1.h[1], v2.h[0]
2076 ; CHECK-GI-NEXT: ldr q2, [sp] // 16-byte Folded Reload
2077 ; CHECK-GI-NEXT: mov v1.h[2], v2.h[0]
2078 ; CHECK-GI-NEXT: mov v1.h[3], v0.h[0]
2079 ; CHECK-GI-NEXT: mov v0.16b, v1.16b
2080 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 killed $q0
2081 ; CHECK-GI-NEXT: add sp, sp, #80
2082 ; CHECK-GI-NEXT: ret
2084 %c = call <4 x half> @llvm.cos.v4f16(<4 x half> %a)
2088 define <8 x half> @cos_v8f16(<8 x half> %a) {
2089 ; CHECK-SD-LABEL: cos_v8f16:
2090 ; CHECK-SD: // %bb.0: // %entry
2091 ; CHECK-SD-NEXT: sub sp, sp, #48
2092 ; CHECK-SD-NEXT: str x30, [sp, #32] // 8-byte Folded Spill
2093 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 48
2094 ; CHECK-SD-NEXT: .cfi_offset w30, -16
2095 ; CHECK-SD-NEXT: mov h1, v0.h[1]
2096 ; CHECK-SD-NEXT: str q0, [sp] // 16-byte Folded Spill
2097 ; CHECK-SD-NEXT: fcvt s0, h1
2098 ; CHECK-SD-NEXT: bl cosf
2099 ; CHECK-SD-NEXT: fcvt h0, s0
2100 ; CHECK-SD-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
2101 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
2102 ; CHECK-SD-NEXT: fcvt s0, h0
2103 ; CHECK-SD-NEXT: bl cosf
2104 ; CHECK-SD-NEXT: fcvt h0, s0
2105 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
2106 ; CHECK-SD-NEXT: mov v0.h[1], v1.h[0]
2107 ; CHECK-SD-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
2108 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
2109 ; CHECK-SD-NEXT: mov h0, v0.h[2]
2110 ; CHECK-SD-NEXT: fcvt s0, h0
2111 ; CHECK-SD-NEXT: bl cosf
2112 ; CHECK-SD-NEXT: fcvt h0, s0
2113 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
2114 ; CHECK-SD-NEXT: mov v1.h[2], v0.h[0]
2115 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
2116 ; CHECK-SD-NEXT: mov h0, v0.h[3]
2117 ; CHECK-SD-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
2118 ; CHECK-SD-NEXT: fcvt s0, h0
2119 ; CHECK-SD-NEXT: bl cosf
2120 ; CHECK-SD-NEXT: fcvt h0, s0
2121 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
2122 ; CHECK-SD-NEXT: mov v1.h[3], v0.h[0]
2123 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
2124 ; CHECK-SD-NEXT: mov h0, v0.h[4]
2125 ; CHECK-SD-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
2126 ; CHECK-SD-NEXT: fcvt s0, h0
2127 ; CHECK-SD-NEXT: bl cosf
2128 ; CHECK-SD-NEXT: fcvt h0, s0
2129 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
2130 ; CHECK-SD-NEXT: mov v1.h[4], v0.h[0]
2131 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
2132 ; CHECK-SD-NEXT: mov h0, v0.h[5]
2133 ; CHECK-SD-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
2134 ; CHECK-SD-NEXT: fcvt s0, h0
2135 ; CHECK-SD-NEXT: bl cosf
2136 ; CHECK-SD-NEXT: fcvt h0, s0
2137 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
2138 ; CHECK-SD-NEXT: mov v1.h[5], v0.h[0]
2139 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
2140 ; CHECK-SD-NEXT: mov h0, v0.h[6]
2141 ; CHECK-SD-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
2142 ; CHECK-SD-NEXT: fcvt s0, h0
2143 ; CHECK-SD-NEXT: bl cosf
2144 ; CHECK-SD-NEXT: fcvt h0, s0
2145 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
2146 ; CHECK-SD-NEXT: mov v1.h[6], v0.h[0]
2147 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
2148 ; CHECK-SD-NEXT: mov h0, v0.h[7]
2149 ; CHECK-SD-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
2150 ; CHECK-SD-NEXT: fcvt s0, h0
2151 ; CHECK-SD-NEXT: bl cosf
2152 ; CHECK-SD-NEXT: fcvt h1, s0
2153 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
2154 ; CHECK-SD-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload
2155 ; CHECK-SD-NEXT: mov v0.h[7], v1.h[0]
2156 ; CHECK-SD-NEXT: add sp, sp, #48
2157 ; CHECK-SD-NEXT: ret
2159 ; CHECK-GI-LABEL: cos_v8f16:
2160 ; CHECK-GI: // %bb.0: // %entry
2161 ; CHECK-GI-NEXT: sub sp, sp, #176
2162 ; CHECK-GI-NEXT: str d14, [sp, #112] // 8-byte Folded Spill
2163 ; CHECK-GI-NEXT: stp d13, d12, [sp, #120] // 16-byte Folded Spill
2164 ; CHECK-GI-NEXT: stp d11, d10, [sp, #136] // 16-byte Folded Spill
2165 ; CHECK-GI-NEXT: stp d9, d8, [sp, #152] // 16-byte Folded Spill
2166 ; CHECK-GI-NEXT: str x30, [sp, #168] // 8-byte Folded Spill
2167 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 176
2168 ; CHECK-GI-NEXT: .cfi_offset w30, -8
2169 ; CHECK-GI-NEXT: .cfi_offset b8, -16
2170 ; CHECK-GI-NEXT: .cfi_offset b9, -24
2171 ; CHECK-GI-NEXT: .cfi_offset b10, -32
2172 ; CHECK-GI-NEXT: .cfi_offset b11, -40
2173 ; CHECK-GI-NEXT: .cfi_offset b12, -48
2174 ; CHECK-GI-NEXT: .cfi_offset b13, -56
2175 ; CHECK-GI-NEXT: .cfi_offset b14, -64
2176 ; CHECK-GI-NEXT: mov h8, v0.h[1]
2177 ; CHECK-GI-NEXT: mov h9, v0.h[2]
2178 ; CHECK-GI-NEXT: mov h10, v0.h[3]
2179 ; CHECK-GI-NEXT: mov h11, v0.h[4]
2180 ; CHECK-GI-NEXT: mov h12, v0.h[5]
2181 ; CHECK-GI-NEXT: mov h13, v0.h[6]
2182 ; CHECK-GI-NEXT: mov h14, v0.h[7]
2183 ; CHECK-GI-NEXT: fcvt s0, h0
2184 ; CHECK-GI-NEXT: bl cosf
2185 ; CHECK-GI-NEXT: fcvt s1, h8
2186 ; CHECK-GI-NEXT: fcvt h0, s0
2187 ; CHECK-GI-NEXT: str q0, [sp, #96] // 16-byte Folded Spill
2188 ; CHECK-GI-NEXT: fmov s0, s1
2189 ; CHECK-GI-NEXT: bl cosf
2190 ; CHECK-GI-NEXT: fcvt s1, h9
2191 ; CHECK-GI-NEXT: fcvt h0, s0
2192 ; CHECK-GI-NEXT: str q0, [sp, #80] // 16-byte Folded Spill
2193 ; CHECK-GI-NEXT: fmov s0, s1
2194 ; CHECK-GI-NEXT: bl cosf
2195 ; CHECK-GI-NEXT: fcvt s1, h10
2196 ; CHECK-GI-NEXT: fcvt h0, s0
2197 ; CHECK-GI-NEXT: str q0, [sp, #64] // 16-byte Folded Spill
2198 ; CHECK-GI-NEXT: fmov s0, s1
2199 ; CHECK-GI-NEXT: bl cosf
2200 ; CHECK-GI-NEXT: fcvt s1, h11
2201 ; CHECK-GI-NEXT: fcvt h0, s0
2202 ; CHECK-GI-NEXT: str q0, [sp, #48] // 16-byte Folded Spill
2203 ; CHECK-GI-NEXT: fmov s0, s1
2204 ; CHECK-GI-NEXT: bl cosf
2205 ; CHECK-GI-NEXT: fcvt s1, h12
2206 ; CHECK-GI-NEXT: fcvt h0, s0
2207 ; CHECK-GI-NEXT: str q0, [sp, #32] // 16-byte Folded Spill
2208 ; CHECK-GI-NEXT: fmov s0, s1
2209 ; CHECK-GI-NEXT: bl cosf
2210 ; CHECK-GI-NEXT: fcvt s1, h13
2211 ; CHECK-GI-NEXT: fcvt h0, s0
2212 ; CHECK-GI-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
2213 ; CHECK-GI-NEXT: fmov s0, s1
2214 ; CHECK-GI-NEXT: bl cosf
2215 ; CHECK-GI-NEXT: fcvt s1, h14
2216 ; CHECK-GI-NEXT: fcvt h0, s0
2217 ; CHECK-GI-NEXT: str q0, [sp] // 16-byte Folded Spill
2218 ; CHECK-GI-NEXT: fmov s0, s1
2219 ; CHECK-GI-NEXT: bl cosf
2220 ; CHECK-GI-NEXT: ldp q2, q1, [sp, #80] // 32-byte Folded Reload
2221 ; CHECK-GI-NEXT: fcvt h0, s0
2222 ; CHECK-GI-NEXT: ldp d9, d8, [sp, #152] // 16-byte Folded Reload
2223 ; CHECK-GI-NEXT: ldr x30, [sp, #168] // 8-byte Folded Reload
2224 ; CHECK-GI-NEXT: ldp d11, d10, [sp, #136] // 16-byte Folded Reload
2225 ; CHECK-GI-NEXT: ldr d14, [sp, #112] // 8-byte Folded Reload
2226 ; CHECK-GI-NEXT: mov v1.h[1], v2.h[0]
2227 ; CHECK-GI-NEXT: ldp q2, q3, [sp, #48] // 32-byte Folded Reload
2228 ; CHECK-GI-NEXT: ldp d13, d12, [sp, #120] // 16-byte Folded Reload
2229 ; CHECK-GI-NEXT: mov v1.h[2], v3.h[0]
2230 ; CHECK-GI-NEXT: mov v1.h[3], v2.h[0]
2231 ; CHECK-GI-NEXT: ldp q2, q3, [sp, #16] // 32-byte Folded Reload
2232 ; CHECK-GI-NEXT: mov v1.h[4], v3.h[0]
2233 ; CHECK-GI-NEXT: mov v1.h[5], v2.h[0]
2234 ; CHECK-GI-NEXT: ldr q2, [sp] // 16-byte Folded Reload
2235 ; CHECK-GI-NEXT: mov v1.h[6], v2.h[0]
2236 ; CHECK-GI-NEXT: mov v1.h[7], v0.h[0]
2237 ; CHECK-GI-NEXT: mov v0.16b, v1.16b
2238 ; CHECK-GI-NEXT: add sp, sp, #176
2239 ; CHECK-GI-NEXT: ret
2241 %c = call <8 x half> @llvm.cos.v8f16(<8 x half> %a)
2245 define <16 x half> @cos_v16f16(<16 x half> %a) {
2246 ; CHECK-SD-LABEL: cos_v16f16:
2247 ; CHECK-SD: // %bb.0: // %entry
2248 ; CHECK-SD-NEXT: sub sp, sp, #64
2249 ; CHECK-SD-NEXT: str x30, [sp, #48] // 8-byte Folded Spill
2250 ; CHECK-SD-NEXT: .cfi_def_cfa_offset 64
2251 ; CHECK-SD-NEXT: .cfi_offset w30, -16
2252 ; CHECK-SD-NEXT: stp q1, q0, [sp] // 32-byte Folded Spill
2253 ; CHECK-SD-NEXT: mov h1, v0.h[1]
2254 ; CHECK-SD-NEXT: fcvt s0, h1
2255 ; CHECK-SD-NEXT: bl cosf
2256 ; CHECK-SD-NEXT: fcvt h0, s0
2257 ; CHECK-SD-NEXT: str q0, [sp, #32] // 16-byte Folded Spill
2258 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
2259 ; CHECK-SD-NEXT: fcvt s0, h0
2260 ; CHECK-SD-NEXT: bl cosf
2261 ; CHECK-SD-NEXT: fcvt h0, s0
2262 ; CHECK-SD-NEXT: ldr q1, [sp, #32] // 16-byte Folded Reload
2263 ; CHECK-SD-NEXT: mov v0.h[1], v1.h[0]
2264 ; CHECK-SD-NEXT: str q0, [sp, #32] // 16-byte Folded Spill
2265 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
2266 ; CHECK-SD-NEXT: mov h0, v0.h[2]
2267 ; CHECK-SD-NEXT: fcvt s0, h0
2268 ; CHECK-SD-NEXT: bl cosf
2269 ; CHECK-SD-NEXT: fcvt h0, s0
2270 ; CHECK-SD-NEXT: ldr q1, [sp, #32] // 16-byte Folded Reload
2271 ; CHECK-SD-NEXT: mov v1.h[2], v0.h[0]
2272 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
2273 ; CHECK-SD-NEXT: mov h0, v0.h[3]
2274 ; CHECK-SD-NEXT: str q1, [sp, #32] // 16-byte Folded Spill
2275 ; CHECK-SD-NEXT: fcvt s0, h0
2276 ; CHECK-SD-NEXT: bl cosf
2277 ; CHECK-SD-NEXT: fcvt h0, s0
2278 ; CHECK-SD-NEXT: ldr q1, [sp, #32] // 16-byte Folded Reload
2279 ; CHECK-SD-NEXT: mov v1.h[3], v0.h[0]
2280 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
2281 ; CHECK-SD-NEXT: mov h0, v0.h[4]
2282 ; CHECK-SD-NEXT: str q1, [sp, #32] // 16-byte Folded Spill
2283 ; CHECK-SD-NEXT: fcvt s0, h0
2284 ; CHECK-SD-NEXT: bl cosf
2285 ; CHECK-SD-NEXT: fcvt h0, s0
2286 ; CHECK-SD-NEXT: ldr q1, [sp, #32] // 16-byte Folded Reload
2287 ; CHECK-SD-NEXT: mov v1.h[4], v0.h[0]
2288 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
2289 ; CHECK-SD-NEXT: mov h0, v0.h[5]
2290 ; CHECK-SD-NEXT: str q1, [sp, #32] // 16-byte Folded Spill
2291 ; CHECK-SD-NEXT: fcvt s0, h0
2292 ; CHECK-SD-NEXT: bl cosf
2293 ; CHECK-SD-NEXT: fcvt h0, s0
2294 ; CHECK-SD-NEXT: ldr q1, [sp, #32] // 16-byte Folded Reload
2295 ; CHECK-SD-NEXT: mov v1.h[5], v0.h[0]
2296 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
2297 ; CHECK-SD-NEXT: mov h0, v0.h[6]
2298 ; CHECK-SD-NEXT: str q1, [sp, #32] // 16-byte Folded Spill
2299 ; CHECK-SD-NEXT: fcvt s0, h0
2300 ; CHECK-SD-NEXT: bl cosf
2301 ; CHECK-SD-NEXT: fcvt h0, s0
2302 ; CHECK-SD-NEXT: ldr q1, [sp, #32] // 16-byte Folded Reload
2303 ; CHECK-SD-NEXT: mov v1.h[6], v0.h[0]
2304 ; CHECK-SD-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
2305 ; CHECK-SD-NEXT: mov h0, v0.h[7]
2306 ; CHECK-SD-NEXT: str q1, [sp, #32] // 16-byte Folded Spill
2307 ; CHECK-SD-NEXT: fcvt s0, h0
2308 ; CHECK-SD-NEXT: bl cosf
2309 ; CHECK-SD-NEXT: fcvt h0, s0
2310 ; CHECK-SD-NEXT: ldr q1, [sp, #32] // 16-byte Folded Reload
2311 ; CHECK-SD-NEXT: mov v1.h[7], v0.h[0]
2312 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
2313 ; CHECK-SD-NEXT: mov h0, v0.h[1]
2314 ; CHECK-SD-NEXT: str q1, [sp, #32] // 16-byte Folded Spill
2315 ; CHECK-SD-NEXT: fcvt s0, h0
2316 ; CHECK-SD-NEXT: bl cosf
2317 ; CHECK-SD-NEXT: fcvt h0, s0
2318 ; CHECK-SD-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
2319 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
2320 ; CHECK-SD-NEXT: fcvt s0, h0
2321 ; CHECK-SD-NEXT: bl cosf
2322 ; CHECK-SD-NEXT: fcvt h0, s0
2323 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
2324 ; CHECK-SD-NEXT: mov v0.h[1], v1.h[0]
2325 ; CHECK-SD-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
2326 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
2327 ; CHECK-SD-NEXT: mov h0, v0.h[2]
2328 ; CHECK-SD-NEXT: fcvt s0, h0
2329 ; CHECK-SD-NEXT: bl cosf
2330 ; CHECK-SD-NEXT: fcvt h0, s0
2331 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
2332 ; CHECK-SD-NEXT: mov v1.h[2], v0.h[0]
2333 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
2334 ; CHECK-SD-NEXT: mov h0, v0.h[3]
2335 ; CHECK-SD-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
2336 ; CHECK-SD-NEXT: fcvt s0, h0
2337 ; CHECK-SD-NEXT: bl cosf
2338 ; CHECK-SD-NEXT: fcvt h0, s0
2339 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
2340 ; CHECK-SD-NEXT: mov v1.h[3], v0.h[0]
2341 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
2342 ; CHECK-SD-NEXT: mov h0, v0.h[4]
2343 ; CHECK-SD-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
2344 ; CHECK-SD-NEXT: fcvt s0, h0
2345 ; CHECK-SD-NEXT: bl cosf
2346 ; CHECK-SD-NEXT: fcvt h0, s0
2347 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
2348 ; CHECK-SD-NEXT: mov v1.h[4], v0.h[0]
2349 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
2350 ; CHECK-SD-NEXT: mov h0, v0.h[5]
2351 ; CHECK-SD-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
2352 ; CHECK-SD-NEXT: fcvt s0, h0
2353 ; CHECK-SD-NEXT: bl cosf
2354 ; CHECK-SD-NEXT: fcvt h0, s0
2355 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
2356 ; CHECK-SD-NEXT: mov v1.h[5], v0.h[0]
2357 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
2358 ; CHECK-SD-NEXT: mov h0, v0.h[6]
2359 ; CHECK-SD-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
2360 ; CHECK-SD-NEXT: fcvt s0, h0
2361 ; CHECK-SD-NEXT: bl cosf
2362 ; CHECK-SD-NEXT: fcvt h0, s0
2363 ; CHECK-SD-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
2364 ; CHECK-SD-NEXT: mov v1.h[6], v0.h[0]
2365 ; CHECK-SD-NEXT: ldr q0, [sp] // 16-byte Folded Reload
2366 ; CHECK-SD-NEXT: mov h0, v0.h[7]
2367 ; CHECK-SD-NEXT: str q1, [sp, #16] // 16-byte Folded Spill
2368 ; CHECK-SD-NEXT: fcvt s0, h0
2369 ; CHECK-SD-NEXT: bl cosf
2370 ; CHECK-SD-NEXT: fmov s1, s0
2371 ; CHECK-SD-NEXT: ldr x30, [sp, #48] // 8-byte Folded Reload
2372 ; CHECK-SD-NEXT: fcvt h2, s1
2373 ; CHECK-SD-NEXT: ldp q1, q0, [sp, #16] // 32-byte Folded Reload
2374 ; CHECK-SD-NEXT: mov v1.h[7], v2.h[0]
2375 ; CHECK-SD-NEXT: add sp, sp, #64
2376 ; CHECK-SD-NEXT: ret
2378 ; CHECK-GI-LABEL: cos_v16f16:
2379 ; CHECK-GI: // %bb.0: // %entry
2380 ; CHECK-GI-NEXT: sub sp, sp, #320
2381 ; CHECK-GI-NEXT: stp d15, d14, [sp, #240] // 16-byte Folded Spill
2382 ; CHECK-GI-NEXT: stp d13, d12, [sp, #256] // 16-byte Folded Spill
2383 ; CHECK-GI-NEXT: stp d11, d10, [sp, #272] // 16-byte Folded Spill
2384 ; CHECK-GI-NEXT: stp d9, d8, [sp, #288] // 16-byte Folded Spill
2385 ; CHECK-GI-NEXT: stp x29, x30, [sp, #304] // 16-byte Folded Spill
2386 ; CHECK-GI-NEXT: .cfi_def_cfa_offset 320
2387 ; CHECK-GI-NEXT: .cfi_offset w30, -8
2388 ; CHECK-GI-NEXT: .cfi_offset w29, -16
2389 ; CHECK-GI-NEXT: .cfi_offset b8, -24
2390 ; CHECK-GI-NEXT: .cfi_offset b9, -32
2391 ; CHECK-GI-NEXT: .cfi_offset b10, -40
2392 ; CHECK-GI-NEXT: .cfi_offset b11, -48
2393 ; CHECK-GI-NEXT: .cfi_offset b12, -56
2394 ; CHECK-GI-NEXT: .cfi_offset b13, -64
2395 ; CHECK-GI-NEXT: .cfi_offset b14, -72
2396 ; CHECK-GI-NEXT: .cfi_offset b15, -80
2397 ; CHECK-GI-NEXT: mov v2.16b, v1.16b
2398 ; CHECK-GI-NEXT: str q1, [sp, #80] // 16-byte Folded Spill
2399 ; CHECK-GI-NEXT: mov h14, v1.h[1]
2400 ; CHECK-GI-NEXT: mov h1, v1.h[2]
2401 ; CHECK-GI-NEXT: mov h15, v0.h[1]
2402 ; CHECK-GI-NEXT: mov h8, v0.h[2]
2403 ; CHECK-GI-NEXT: mov h9, v0.h[3]
2404 ; CHECK-GI-NEXT: mov h10, v0.h[4]
2405 ; CHECK-GI-NEXT: mov h11, v0.h[5]
2406 ; CHECK-GI-NEXT: mov h12, v0.h[6]
2407 ; CHECK-GI-NEXT: mov h13, v0.h[7]
2408 ; CHECK-GI-NEXT: fcvt s0, h0
2409 ; CHECK-GI-NEXT: str h1, [sp, #16] // 2-byte Folded Spill
2410 ; CHECK-GI-NEXT: mov h1, v2.h[3]
2411 ; CHECK-GI-NEXT: str h1, [sp, #32] // 2-byte Folded Spill
2412 ; CHECK-GI-NEXT: mov h1, v2.h[4]
2413 ; CHECK-GI-NEXT: str h1, [sp, #48] // 2-byte Folded Spill
2414 ; CHECK-GI-NEXT: mov h1, v2.h[5]
2415 ; CHECK-GI-NEXT: str h1, [sp, #64] // 2-byte Folded Spill
2416 ; CHECK-GI-NEXT: mov h1, v2.h[6]
2417 ; CHECK-GI-NEXT: str h1, [sp, #96] // 2-byte Folded Spill
2418 ; CHECK-GI-NEXT: mov h1, v2.h[7]
2419 ; CHECK-GI-NEXT: str h1, [sp, #160] // 2-byte Folded Spill
2420 ; CHECK-GI-NEXT: bl cosf
2421 ; CHECK-GI-NEXT: fcvt s1, h15
2422 ; CHECK-GI-NEXT: fcvt h0, s0
2423 ; CHECK-GI-NEXT: str q0, [sp, #192] // 16-byte Folded Spill
2424 ; CHECK-GI-NEXT: fmov s0, s1
2425 ; CHECK-GI-NEXT: bl cosf
2426 ; CHECK-GI-NEXT: fcvt s1, h8
2427 ; CHECK-GI-NEXT: fcvt h0, s0
2428 ; CHECK-GI-NEXT: str q0, [sp, #128] // 16-byte Folded Spill
2429 ; CHECK-GI-NEXT: fmov s0, s1
2430 ; CHECK-GI-NEXT: bl cosf
2431 ; CHECK-GI-NEXT: fcvt s1, h9
2432 ; CHECK-GI-NEXT: fcvt h0, s0
2433 ; CHECK-GI-NEXT: str q0, [sp, #224] // 16-byte Folded Spill
2434 ; CHECK-GI-NEXT: fmov s0, s1
2435 ; CHECK-GI-NEXT: bl cosf
2436 ; CHECK-GI-NEXT: fcvt s1, h10
2437 ; CHECK-GI-NEXT: fcvt h0, s0
2438 ; CHECK-GI-NEXT: str q0, [sp, #208] // 16-byte Folded Spill
2439 ; CHECK-GI-NEXT: fmov s0, s1
2440 ; CHECK-GI-NEXT: bl cosf
2441 ; CHECK-GI-NEXT: fcvt s1, h11
2442 ; CHECK-GI-NEXT: fcvt h0, s0
2443 ; CHECK-GI-NEXT: str q0, [sp, #176] // 16-byte Folded Spill
2444 ; CHECK-GI-NEXT: fmov s0, s1
2445 ; CHECK-GI-NEXT: bl cosf
2446 ; CHECK-GI-NEXT: fcvt s1, h12
2447 ; CHECK-GI-NEXT: fcvt h0, s0
2448 ; CHECK-GI-NEXT: str q0, [sp, #144] // 16-byte Folded Spill
2449 ; CHECK-GI-NEXT: fmov s0, s1
2450 ; CHECK-GI-NEXT: bl cosf
2451 ; CHECK-GI-NEXT: fcvt s1, h13
2452 ; CHECK-GI-NEXT: fcvt h0, s0
2453 ; CHECK-GI-NEXT: str q0, [sp, #112] // 16-byte Folded Spill
2454 ; CHECK-GI-NEXT: fmov s0, s1
2455 ; CHECK-GI-NEXT: bl cosf
2456 ; CHECK-GI-NEXT: ldr q1, [sp, #80] // 16-byte Folded Reload
2457 ; CHECK-GI-NEXT: fcvt h0, s0
2458 ; CHECK-GI-NEXT: fcvt s1, h1
2459 ; CHECK-GI-NEXT: str q0, [sp, #80] // 16-byte Folded Spill
2460 ; CHECK-GI-NEXT: fmov s0, s1
2461 ; CHECK-GI-NEXT: bl cosf
2462 ; CHECK-GI-NEXT: fcvt s1, h14
2463 ; CHECK-GI-NEXT: fcvt h0, s0
2464 ; CHECK-GI-NEXT: str q0, [sp] // 16-byte Folded Spill
2465 ; CHECK-GI-NEXT: fmov s0, s1
2466 ; CHECK-GI-NEXT: bl cosf
2467 ; CHECK-GI-NEXT: ldr h1, [sp, #16] // 2-byte Folded Reload
2468 ; CHECK-GI-NEXT: fcvt h0, s0
2469 ; CHECK-GI-NEXT: fcvt s1, h1
2470 ; CHECK-GI-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
2471 ; CHECK-GI-NEXT: fmov s0, s1
2472 ; CHECK-GI-NEXT: bl cosf
2473 ; CHECK-GI-NEXT: ldr h1, [sp, #32] // 2-byte Folded Reload
2474 ; CHECK-GI-NEXT: fcvt h0, s0
2475 ; CHECK-GI-NEXT: fcvt s1, h1
2476 ; CHECK-GI-NEXT: str q0, [sp, #32] // 16-byte Folded Spill
2477 ; CHECK-GI-NEXT: fmov s0, s1
2478 ; CHECK-GI-NEXT: bl cosf
2479 ; CHECK-GI-NEXT: ldr h1, [sp, #48] // 2-byte Folded Reload
2480 ; CHECK-GI-NEXT: fcvt h0, s0
2481 ; CHECK-GI-NEXT: fcvt s1, h1
2482 ; CHECK-GI-NEXT: str q0, [sp, #48] // 16-byte Folded Spill
2483 ; CHECK-GI-NEXT: fmov s0, s1
2484 ; CHECK-GI-NEXT: bl cosf
2485 ; CHECK-GI-NEXT: ldr h1, [sp, #64] // 2-byte Folded Reload
2486 ; CHECK-GI-NEXT: fcvt h0, s0
2487 ; CHECK-GI-NEXT: fcvt s1, h1
2488 ; CHECK-GI-NEXT: str q0, [sp, #64] // 16-byte Folded Spill
2489 ; CHECK-GI-NEXT: fmov s0, s1
2490 ; CHECK-GI-NEXT: bl cosf
2491 ; CHECK-GI-NEXT: ldr h1, [sp, #96] // 2-byte Folded Reload
2492 ; CHECK-GI-NEXT: fcvt h0, s0
2493 ; CHECK-GI-NEXT: fcvt s1, h1
2494 ; CHECK-GI-NEXT: str q0, [sp, #96] // 16-byte Folded Spill
2495 ; CHECK-GI-NEXT: fmov s0, s1
2496 ; CHECK-GI-NEXT: bl cosf
2497 ; CHECK-GI-NEXT: ldr h1, [sp, #160] // 2-byte Folded Reload
2498 ; CHECK-GI-NEXT: fcvt h0, s0
2499 ; CHECK-GI-NEXT: fcvt s1, h1
2500 ; CHECK-GI-NEXT: str q0, [sp, #160] // 16-byte Folded Spill
2501 ; CHECK-GI-NEXT: fmov s0, s1
2502 ; CHECK-GI-NEXT: bl cosf
2503 ; CHECK-GI-NEXT: ldr q3, [sp, #192] // 16-byte Folded Reload
2504 ; CHECK-GI-NEXT: ldr q2, [sp, #128] // 16-byte Folded Reload
2505 ; CHECK-GI-NEXT: ldp x29, x30, [sp, #304] // 16-byte Folded Reload
2506 ; CHECK-GI-NEXT: mov v3.h[1], v2.h[0]
2507 ; CHECK-GI-NEXT: ldp q1, q2, [sp] // 32-byte Folded Reload
2508 ; CHECK-GI-NEXT: ldp d9, d8, [sp, #288] // 16-byte Folded Reload
2509 ; CHECK-GI-NEXT: ldp d11, d10, [sp, #272] // 16-byte Folded Reload
2510 ; CHECK-GI-NEXT: mov v1.h[1], v2.h[0]
2511 ; CHECK-GI-NEXT: ldr q2, [sp, #224] // 16-byte Folded Reload
2512 ; CHECK-GI-NEXT: ldp d13, d12, [sp, #256] // 16-byte Folded Reload
2513 ; CHECK-GI-NEXT: mov v3.h[2], v2.h[0]
2514 ; CHECK-GI-NEXT: ldr q2, [sp, #32] // 16-byte Folded Reload
2515 ; CHECK-GI-NEXT: ldp d15, d14, [sp, #240] // 16-byte Folded Reload
2516 ; CHECK-GI-NEXT: mov v1.h[2], v2.h[0]
2517 ; CHECK-GI-NEXT: ldr q2, [sp, #208] // 16-byte Folded Reload
2518 ; CHECK-GI-NEXT: mov v3.h[3], v2.h[0]
2519 ; CHECK-GI-NEXT: ldr q2, [sp, #48] // 16-byte Folded Reload
2520 ; CHECK-GI-NEXT: mov v1.h[3], v2.h[0]
2521 ; CHECK-GI-NEXT: ldr q2, [sp, #176] // 16-byte Folded Reload
2522 ; CHECK-GI-NEXT: mov v3.h[4], v2.h[0]
2523 ; CHECK-GI-NEXT: ldr q2, [sp, #64] // 16-byte Folded Reload
2524 ; CHECK-GI-NEXT: mov v1.h[4], v2.h[0]
2525 ; CHECK-GI-NEXT: ldr q2, [sp, #144] // 16-byte Folded Reload
2526 ; CHECK-GI-NEXT: mov v3.h[5], v2.h[0]
2527 ; CHECK-GI-NEXT: ldr q2, [sp, #96] // 16-byte Folded Reload
2528 ; CHECK-GI-NEXT: mov v1.h[5], v2.h[0]
2529 ; CHECK-GI-NEXT: fcvt h2, s0
2530 ; CHECK-GI-NEXT: ldr q0, [sp, #112] // 16-byte Folded Reload
2531 ; CHECK-GI-NEXT: mov v3.h[6], v0.h[0]
2532 ; CHECK-GI-NEXT: ldr q0, [sp, #160] // 16-byte Folded Reload
2533 ; CHECK-GI-NEXT: mov v1.h[6], v0.h[0]
2534 ; CHECK-GI-NEXT: ldr q0, [sp, #80] // 16-byte Folded Reload
2535 ; CHECK-GI-NEXT: mov v3.h[7], v0.h[0]
2536 ; CHECK-GI-NEXT: mov v1.h[7], v2.h[0]
2537 ; CHECK-GI-NEXT: mov v0.16b, v3.16b
2538 ; CHECK-GI-NEXT: add sp, sp, #320
2539 ; CHECK-GI-NEXT: ret
2541 %c = call <16 x half> @llvm.cos.v16f16(<16 x half> %a)
2545 ; This is testing that we do not produce incorrect tailcall lowerings
2546 define i64 @donttailcall(double noundef %x, double noundef %y) {
2547 ; CHECK-LABEL: donttailcall:
2548 ; CHECK: // %bb.0: // %entry
2549 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
2550 ; CHECK-NEXT: .cfi_def_cfa_offset 16
2551 ; CHECK-NEXT: .cfi_offset w30, -16
2552 ; CHECK-NEXT: bl sin
2553 ; CHECK-NEXT: fmov x0, d0
2554 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
2557 %call = tail call double @llvm.sin.f64(double noundef %x)
2558 %0 = bitcast double %call to i64
2563 declare <16 x half> @llvm.cos.v16f16(<16 x half>)
2564 declare <16 x half> @llvm.sin.v16f16(<16 x half>)
2565 declare <2 x double> @llvm.cos.v2f64(<2 x double>)
2566 declare <2 x double> @llvm.sin.v2f64(<2 x double>)
2567 declare <2 x float> @llvm.cos.v2f32(<2 x float>)
2568 declare <2 x float> @llvm.sin.v2f32(<2 x float>)
2569 declare <3 x double> @llvm.cos.v3f64(<3 x double>)
2570 declare <3 x double> @llvm.sin.v3f64(<3 x double>)
2571 declare <3 x float> @llvm.cos.v3f32(<3 x float>)
2572 declare <3 x float> @llvm.sin.v3f32(<3 x float>)
2573 declare <4 x double> @llvm.cos.v4f64(<4 x double>)
2574 declare <4 x double> @llvm.sin.v4f64(<4 x double>)
2575 declare <4 x float> @llvm.cos.v4f32(<4 x float>)
2576 declare <4 x float> @llvm.sin.v4f32(<4 x float>)
2577 declare <4 x half> @llvm.cos.v4f16(<4 x half>)
2578 declare <4 x half> @llvm.sin.v4f16(<4 x half>)
2579 declare <7 x half> @llvm.cos.v7f16(<7 x half>)
2580 declare <7 x half> @llvm.sin.v7f16(<7 x half>)
2581 declare <8 x float> @llvm.cos.v8f32(<8 x float>)
2582 declare <8 x float> @llvm.sin.v8f32(<8 x float>)
2583 declare <8 x half> @llvm.cos.v8f16(<8 x half>)
2584 declare <8 x half> @llvm.sin.v8f16(<8 x half>)
2585 declare double @llvm.cos.f64(double)
2586 declare double @llvm.sin.f64(double)
2587 declare float @llvm.cos.f32(float)
2588 declare float @llvm.sin.f32(float)
2589 declare half @llvm.cos.f16(half)
2590 declare half @llvm.sin.f16(half)