File: llvm.sincos.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (553 lines) | stat: -rw-r--r-- 22,996 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
; RUN: llc -mtriple=aarch64-gnu-linux < %s | FileCheck -check-prefixes=CHECK %s
; RUN: llc -mtriple=aarch64-none-linux < %s | FileCheck -check-prefixes=NO-LIBCALL %s

define { half, half } @test_sincos_f16(half %a) {
; CHECK-LABEL: test_sincos_f16:
; CHECK:       // %bb.0:
; CHECK-NEXT:    str x30, [sp, #-16]! // 8-byte Folded Spill
; CHECK-NEXT:    .cfi_def_cfa_offset 16
; CHECK-NEXT:    .cfi_offset w30, -16
; CHECK-NEXT:    fcvt s0, h0
; CHECK-NEXT:    add x0, sp, #12
; CHECK-NEXT:    add x1, sp, #8
; CHECK-NEXT:    bl sincosf
; CHECK-NEXT:    ldp s1, s0, [sp, #8]
; CHECK-NEXT:    fcvt h0, s0
; CHECK-NEXT:    fcvt h1, s1
; CHECK-NEXT:    ldr x30, [sp], #16 // 8-byte Folded Reload
; CHECK-NEXT:    ret
;
; NO-LIBCALL-LABEL: test_sincos_f16:
; NO-LIBCALL:       // %bb.0:
; NO-LIBCALL-NEXT:    stp d9, d8, [sp, #-32]! // 16-byte Folded Spill
; NO-LIBCALL-NEXT:    str x30, [sp, #16] // 8-byte Folded Spill
; NO-LIBCALL-NEXT:    .cfi_def_cfa_offset 32
; NO-LIBCALL-NEXT:    .cfi_offset w30, -16
; NO-LIBCALL-NEXT:    .cfi_offset b8, -24
; NO-LIBCALL-NEXT:    .cfi_offset b9, -32
; NO-LIBCALL-NEXT:    fcvt s8, h0
; NO-LIBCALL-NEXT:    fmov s0, s8
; NO-LIBCALL-NEXT:    bl sinf
; NO-LIBCALL-NEXT:    fcvt h9, s0
; NO-LIBCALL-NEXT:    fmov s0, s8
; NO-LIBCALL-NEXT:    bl cosf
; NO-LIBCALL-NEXT:    fmov s1, s0
; NO-LIBCALL-NEXT:    ldr x30, [sp, #16] // 8-byte Folded Reload
; NO-LIBCALL-NEXT:    fmov s0, s9
; NO-LIBCALL-NEXT:    fcvt h1, s1
; NO-LIBCALL-NEXT:    ldp d9, d8, [sp], #32 // 16-byte Folded Reload
; NO-LIBCALL-NEXT:    ret
  %result = call { half, half } @llvm.sincos.f16(half %a)
  ret { half, half } %result
}

define half @test_sincos_f16_only_use_sin(half %a) {
; CHECK-LABEL: test_sincos_f16_only_use_sin:
; CHECK:       // %bb.0:
; CHECK-NEXT:    str x30, [sp, #-16]! // 8-byte Folded Spill
; CHECK-NEXT:    .cfi_def_cfa_offset 16
; CHECK-NEXT:    .cfi_offset w30, -16
; CHECK-NEXT:    fcvt s0, h0
; CHECK-NEXT:    add x0, sp, #12
; CHECK-NEXT:    add x1, sp, #8
; CHECK-NEXT:    bl sincosf
; CHECK-NEXT:    ldr s0, [sp, #12]
; CHECK-NEXT:    fcvt h0, s0
; CHECK-NEXT:    ldr x30, [sp], #16 // 8-byte Folded Reload
; CHECK-NEXT:    ret
;
; NO-LIBCALL-LABEL: test_sincos_f16_only_use_sin:
; NO-LIBCALL:       // %bb.0:
; NO-LIBCALL-NEXT:    str x30, [sp, #-16]! // 8-byte Folded Spill
; NO-LIBCALL-NEXT:    .cfi_def_cfa_offset 16
; NO-LIBCALL-NEXT:    .cfi_offset w30, -16
; NO-LIBCALL-NEXT:    fcvt s0, h0
; NO-LIBCALL-NEXT:    bl sinf
; NO-LIBCALL-NEXT:    fcvt h0, s0
; NO-LIBCALL-NEXT:    ldr x30, [sp], #16 // 8-byte Folded Reload
; NO-LIBCALL-NEXT:    ret
  %result = call { half, half } @llvm.sincos.f16(half %a)
  %result.0 = extractvalue { half, half } %result, 0
  ret half %result.0
}

define half @test_sincos_f16_only_use_cos(half %a) {
; CHECK-LABEL: test_sincos_f16_only_use_cos:
; CHECK:       // %bb.0:
; CHECK-NEXT:    str x30, [sp, #-16]! // 8-byte Folded Spill
; CHECK-NEXT:    .cfi_def_cfa_offset 16
; CHECK-NEXT:    .cfi_offset w30, -16
; CHECK-NEXT:    fcvt s0, h0
; CHECK-NEXT:    add x0, sp, #12
; CHECK-NEXT:    add x1, sp, #8
; CHECK-NEXT:    bl sincosf
; CHECK-NEXT:    ldr s0, [sp, #8]
; CHECK-NEXT:    fcvt h0, s0
; CHECK-NEXT:    ldr x30, [sp], #16 // 8-byte Folded Reload
; CHECK-NEXT:    ret
;
; NO-LIBCALL-LABEL: test_sincos_f16_only_use_cos:
; NO-LIBCALL:       // %bb.0:
; NO-LIBCALL-NEXT:    str x30, [sp, #-16]! // 8-byte Folded Spill
; NO-LIBCALL-NEXT:    .cfi_def_cfa_offset 16
; NO-LIBCALL-NEXT:    .cfi_offset w30, -16
; NO-LIBCALL-NEXT:    fcvt s0, h0
; NO-LIBCALL-NEXT:    bl cosf
; NO-LIBCALL-NEXT:    fcvt h0, s0
; NO-LIBCALL-NEXT:    ldr x30, [sp], #16 // 8-byte Folded Reload
; NO-LIBCALL-NEXT:    ret
  %result = call { half, half } @llvm.sincos.f16(half %a)
  %result.1 = extractvalue { half, half } %result, 1
  ret half %result.1
}

define { <2 x half>, <2 x half> } @test_sincos_v2f16(<2 x half> %a) {
; CHECK-LABEL: test_sincos_v2f16:
; CHECK:       // %bb.0:
; CHECK-NEXT:    sub sp, sp, #64
; CHECK-NEXT:    str x30, [sp, #48] // 8-byte Folded Spill
; CHECK-NEXT:    .cfi_def_cfa_offset 64
; CHECK-NEXT:    .cfi_offset w30, -16
; CHECK-NEXT:    // kill: def $d0 killed $d0 def $q0
; CHECK-NEXT:    mov h1, v0.h[1]
; CHECK-NEXT:    str q0, [sp] // 16-byte Folded Spill
; CHECK-NEXT:    add x0, sp, #36
; CHECK-NEXT:    add x1, sp, #32
; CHECK-NEXT:    fcvt s0, h1
; CHECK-NEXT:    bl sincosf
; CHECK-NEXT:    ldr q0, [sp] // 16-byte Folded Reload
; CHECK-NEXT:    add x0, sp, #28
; CHECK-NEXT:    add x1, sp, #24
; CHECK-NEXT:    fcvt s0, h0
; CHECK-NEXT:    bl sincosf
; CHECK-NEXT:    ldr q0, [sp] // 16-byte Folded Reload
; CHECK-NEXT:    add x0, sp, #44
; CHECK-NEXT:    add x1, sp, #40
; CHECK-NEXT:    mov h0, v0.h[2]
; CHECK-NEXT:    fcvt s0, h0
; CHECK-NEXT:    bl sincosf
; CHECK-NEXT:    ldr q0, [sp] // 16-byte Folded Reload
; CHECK-NEXT:    add x0, sp, #60
; CHECK-NEXT:    add x1, sp, #56
; CHECK-NEXT:    mov h0, v0.h[3]
; CHECK-NEXT:    fcvt s0, h0
; CHECK-NEXT:    bl sincosf
; CHECK-NEXT:    ldp s2, s0, [sp, #32]
; CHECK-NEXT:    ldr x30, [sp, #48] // 8-byte Folded Reload
; CHECK-NEXT:    ldp s3, s1, [sp, #24]
; CHECK-NEXT:    fcvt h4, s0
; CHECK-NEXT:    fcvt h2, s2
; CHECK-NEXT:    fcvt h0, s1
; CHECK-NEXT:    fcvt h1, s3
; CHECK-NEXT:    ldp s5, s3, [sp, #40]
; CHECK-NEXT:    fcvt h3, s3
; CHECK-NEXT:    mov v0.h[1], v4.h[0]
; CHECK-NEXT:    fcvt h4, s5
; CHECK-NEXT:    mov v1.h[1], v2.h[0]
; CHECK-NEXT:    ldp s5, s2, [sp, #56]
; CHECK-NEXT:    mov v0.h[2], v3.h[0]
; CHECK-NEXT:    fcvt h2, s2
; CHECK-NEXT:    fcvt h3, s5
; CHECK-NEXT:    mov v1.h[2], v4.h[0]
; CHECK-NEXT:    mov v0.h[3], v2.h[0]
; CHECK-NEXT:    mov v1.h[3], v3.h[0]
; CHECK-NEXT:    // kill: def $d0 killed $d0 killed $q0
; CHECK-NEXT:    // kill: def $d1 killed $d1 killed $q1
; CHECK-NEXT:    add sp, sp, #64
; CHECK-NEXT:    ret
;
; NO-LIBCALL-LABEL: test_sincos_v2f16:
; NO-LIBCALL:       // %bb.0:
; NO-LIBCALL-NEXT:    sub sp, sp, #80
; NO-LIBCALL-NEXT:    stp d11, d10, [sp, #32] // 16-byte Folded Spill
; NO-LIBCALL-NEXT:    stp d9, d8, [sp, #48] // 16-byte Folded Spill
; NO-LIBCALL-NEXT:    str x30, [sp, #64] // 8-byte Folded Spill
; NO-LIBCALL-NEXT:    .cfi_def_cfa_offset 80
; NO-LIBCALL-NEXT:    .cfi_offset w30, -16
; NO-LIBCALL-NEXT:    .cfi_offset b8, -24
; NO-LIBCALL-NEXT:    .cfi_offset b9, -32
; NO-LIBCALL-NEXT:    .cfi_offset b10, -40
; NO-LIBCALL-NEXT:    .cfi_offset b11, -48
; NO-LIBCALL-NEXT:    // kill: def $d0 killed $d0 def $q0
; NO-LIBCALL-NEXT:    mov h1, v0.h[1]
; NO-LIBCALL-NEXT:    str q0, [sp] // 16-byte Folded Spill
; NO-LIBCALL-NEXT:    fcvt s8, h1
; NO-LIBCALL-NEXT:    fmov s0, s8
; NO-LIBCALL-NEXT:    bl sinf
; NO-LIBCALL-NEXT:    ldr q1, [sp] // 16-byte Folded Reload
; NO-LIBCALL-NEXT:    fcvt h0, s0
; NO-LIBCALL-NEXT:    fcvt s9, h1
; NO-LIBCALL-NEXT:    str q0, [sp, #16] // 16-byte Folded Spill
; NO-LIBCALL-NEXT:    fmov s0, s9
; NO-LIBCALL-NEXT:    bl sinf
; NO-LIBCALL-NEXT:    ldr q1, [sp] // 16-byte Folded Reload
; NO-LIBCALL-NEXT:    fcvt h0, s0
; NO-LIBCALL-NEXT:    mov h1, v1.h[2]
; NO-LIBCALL-NEXT:    fcvt s10, h1
; NO-LIBCALL-NEXT:    ldr q1, [sp, #16] // 16-byte Folded Reload
; NO-LIBCALL-NEXT:    mov v0.h[1], v1.h[0]
; NO-LIBCALL-NEXT:    str q0, [sp, #16] // 16-byte Folded Spill
; NO-LIBCALL-NEXT:    fmov s0, s10
; NO-LIBCALL-NEXT:    bl sinf
; NO-LIBCALL-NEXT:    ldr q1, [sp] // 16-byte Folded Reload
; NO-LIBCALL-NEXT:    fcvt h0, s0
; NO-LIBCALL-NEXT:    mov h1, v1.h[3]
; NO-LIBCALL-NEXT:    fcvt s11, h1
; NO-LIBCALL-NEXT:    ldr q1, [sp, #16] // 16-byte Folded Reload
; NO-LIBCALL-NEXT:    mov v1.h[2], v0.h[0]
; NO-LIBCALL-NEXT:    fmov s0, s11
; NO-LIBCALL-NEXT:    str q1, [sp, #16] // 16-byte Folded Spill
; NO-LIBCALL-NEXT:    bl sinf
; NO-LIBCALL-NEXT:    fcvt h0, s0
; NO-LIBCALL-NEXT:    ldr q1, [sp, #16] // 16-byte Folded Reload
; NO-LIBCALL-NEXT:    mov v1.h[3], v0.h[0]
; NO-LIBCALL-NEXT:    fmov s0, s8
; NO-LIBCALL-NEXT:    str q1, [sp, #16] // 16-byte Folded Spill
; NO-LIBCALL-NEXT:    bl cosf
; NO-LIBCALL-NEXT:    fcvt h0, s0
; NO-LIBCALL-NEXT:    str q0, [sp] // 16-byte Folded Spill
; NO-LIBCALL-NEXT:    fmov s0, s9
; NO-LIBCALL-NEXT:    bl cosf
; NO-LIBCALL-NEXT:    fcvt h0, s0
; NO-LIBCALL-NEXT:    ldr q1, [sp] // 16-byte Folded Reload
; NO-LIBCALL-NEXT:    mov v0.h[1], v1.h[0]
; NO-LIBCALL-NEXT:    str q0, [sp] // 16-byte Folded Spill
; NO-LIBCALL-NEXT:    fmov s0, s10
; NO-LIBCALL-NEXT:    bl cosf
; NO-LIBCALL-NEXT:    fcvt h0, s0
; NO-LIBCALL-NEXT:    ldr q1, [sp] // 16-byte Folded Reload
; NO-LIBCALL-NEXT:    mov v1.h[2], v0.h[0]
; NO-LIBCALL-NEXT:    fmov s0, s11
; NO-LIBCALL-NEXT:    str q1, [sp] // 16-byte Folded Spill
; NO-LIBCALL-NEXT:    bl cosf
; NO-LIBCALL-NEXT:    fmov s1, s0
; NO-LIBCALL-NEXT:    ldp d9, d8, [sp, #48] // 16-byte Folded Reload
; NO-LIBCALL-NEXT:    ldp d11, d10, [sp, #32] // 16-byte Folded Reload
; NO-LIBCALL-NEXT:    ldr q0, [sp, #16] // 16-byte Folded Reload
; NO-LIBCALL-NEXT:    ldr x30, [sp, #64] // 8-byte Folded Reload
; NO-LIBCALL-NEXT:    // kill: def $d0 killed $d0 killed $q0
; NO-LIBCALL-NEXT:    fcvt h2, s1
; NO-LIBCALL-NEXT:    ldr q1, [sp] // 16-byte Folded Reload
; NO-LIBCALL-NEXT:    mov v1.h[3], v2.h[0]
; NO-LIBCALL-NEXT:    // kill: def $d1 killed $d1 killed $q1
; NO-LIBCALL-NEXT:    add sp, sp, #80
; NO-LIBCALL-NEXT:    ret
  %result = call { <2 x half>, <2 x half> } @llvm.sincos.v2f16(<2 x half> %a)
  ret { <2 x half>, <2 x half> } %result
}

define { float, float } @test_sincos_f32(float %a) {
; CHECK-LABEL: test_sincos_f32:
; CHECK:       // %bb.0:
; CHECK-NEXT:    str x30, [sp, #-16]! // 8-byte Folded Spill
; CHECK-NEXT:    .cfi_def_cfa_offset 16
; CHECK-NEXT:    .cfi_offset w30, -16
; CHECK-NEXT:    add x0, sp, #12
; CHECK-NEXT:    add x1, sp, #8
; CHECK-NEXT:    bl sincosf
; CHECK-NEXT:    ldp s1, s0, [sp, #8]
; CHECK-NEXT:    ldr x30, [sp], #16 // 8-byte Folded Reload
; CHECK-NEXT:    ret
;
; NO-LIBCALL-LABEL: test_sincos_f32:
; NO-LIBCALL:       // %bb.0:
; NO-LIBCALL-NEXT:    stp d9, d8, [sp, #-32]! // 16-byte Folded Spill
; NO-LIBCALL-NEXT:    str x30, [sp, #16] // 8-byte Folded Spill
; NO-LIBCALL-NEXT:    .cfi_def_cfa_offset 32
; NO-LIBCALL-NEXT:    .cfi_offset w30, -16
; NO-LIBCALL-NEXT:    .cfi_offset b8, -24
; NO-LIBCALL-NEXT:    .cfi_offset b9, -32
; NO-LIBCALL-NEXT:    fmov s8, s0
; NO-LIBCALL-NEXT:    bl sinf
; NO-LIBCALL-NEXT:    fmov s9, s0
; NO-LIBCALL-NEXT:    fmov s0, s8
; NO-LIBCALL-NEXT:    bl cosf
; NO-LIBCALL-NEXT:    ldr x30, [sp, #16] // 8-byte Folded Reload
; NO-LIBCALL-NEXT:    fmov s1, s0
; NO-LIBCALL-NEXT:    fmov s0, s9
; NO-LIBCALL-NEXT:    ldp d9, d8, [sp], #32 // 16-byte Folded Reload
; NO-LIBCALL-NEXT:    ret
  %result = call { float, float } @llvm.sincos.f32(float %a)
  ret { float, float } %result
}

define { <3 x float>, <3 x float> } @test_sincos_v3f32(<3 x float> %a) {
; CHECK-LABEL: test_sincos_v3f32:
; CHECK:       // %bb.0:
; CHECK-NEXT:    sub sp, sp, #80
; CHECK-NEXT:    str x30, [sp, #32] // 8-byte Folded Spill
; CHECK-NEXT:    stp x22, x21, [sp, #48] // 16-byte Folded Spill
; CHECK-NEXT:    stp x20, x19, [sp, #64] // 16-byte Folded Spill
; CHECK-NEXT:    .cfi_def_cfa_offset 80
; CHECK-NEXT:    .cfi_offset w19, -8
; CHECK-NEXT:    .cfi_offset w20, -16
; CHECK-NEXT:    .cfi_offset w21, -24
; CHECK-NEXT:    .cfi_offset w22, -32
; CHECK-NEXT:    .cfi_offset w30, -48
; CHECK-NEXT:    add x0, sp, #20
; CHECK-NEXT:    add x1, sp, #16
; CHECK-NEXT:    str q0, [sp] // 16-byte Folded Spill
; CHECK-NEXT:    // kill: def $s0 killed $s0 killed $q0
; CHECK-NEXT:    bl sincosf
; CHECK-NEXT:    ldr q0, [sp] // 16-byte Folded Reload
; CHECK-NEXT:    add x0, sp, #28
; CHECK-NEXT:    add x1, sp, #24
; CHECK-NEXT:    add x19, sp, #28
; CHECK-NEXT:    add x20, sp, #24
; CHECK-NEXT:    mov s0, v0.s[1]
; CHECK-NEXT:    bl sincosf
; CHECK-NEXT:    ldr q0, [sp] // 16-byte Folded Reload
; CHECK-NEXT:    add x0, sp, #44
; CHECK-NEXT:    add x1, sp, #40
; CHECK-NEXT:    add x21, sp, #44
; CHECK-NEXT:    add x22, sp, #40
; CHECK-NEXT:    mov s0, v0.s[2]
; CHECK-NEXT:    bl sincosf
; CHECK-NEXT:    ldp s1, s0, [sp, #16]
; CHECK-NEXT:    ldr x30, [sp, #32] // 8-byte Folded Reload
; CHECK-NEXT:    ld1 { v0.s }[1], [x19]
; CHECK-NEXT:    ld1 { v1.s }[1], [x20]
; CHECK-NEXT:    ldp x20, x19, [sp, #64] // 16-byte Folded Reload
; CHECK-NEXT:    ld1 { v0.s }[2], [x21]
; CHECK-NEXT:    ld1 { v1.s }[2], [x22]
; CHECK-NEXT:    ldp x22, x21, [sp, #48] // 16-byte Folded Reload
; CHECK-NEXT:    add sp, sp, #80
; CHECK-NEXT:    ret
;
; NO-LIBCALL-LABEL: test_sincos_v3f32:
; NO-LIBCALL:       // %bb.0:
; NO-LIBCALL-NEXT:    sub sp, sp, #80
; NO-LIBCALL-NEXT:    stp d9, d8, [sp, #48] // 16-byte Folded Spill
; NO-LIBCALL-NEXT:    str x30, [sp, #64] // 8-byte Folded Spill
; NO-LIBCALL-NEXT:    .cfi_def_cfa_offset 80
; NO-LIBCALL-NEXT:    .cfi_offset w30, -16
; NO-LIBCALL-NEXT:    .cfi_offset b8, -24
; NO-LIBCALL-NEXT:    .cfi_offset b9, -32
; NO-LIBCALL-NEXT:    mov s8, v0.s[1]
; NO-LIBCALL-NEXT:    str q0, [sp, #32] // 16-byte Folded Spill
; NO-LIBCALL-NEXT:    fmov s0, s8
; NO-LIBCALL-NEXT:    bl sinf
; NO-LIBCALL-NEXT:    // kill: def $s0 killed $s0 def $q0
; NO-LIBCALL-NEXT:    str q0, [sp, #16] // 16-byte Folded Spill
; NO-LIBCALL-NEXT:    ldr q0, [sp, #32] // 16-byte Folded Reload
; NO-LIBCALL-NEXT:    // kill: def $s0 killed $s0 killed $q0
; NO-LIBCALL-NEXT:    bl sinf
; NO-LIBCALL-NEXT:    ldr q1, [sp, #16] // 16-byte Folded Reload
; NO-LIBCALL-NEXT:    // kill: def $s0 killed $s0 def $q0
; NO-LIBCALL-NEXT:    mov v0.s[1], v1.s[0]
; NO-LIBCALL-NEXT:    str q0, [sp, #16] // 16-byte Folded Spill
; NO-LIBCALL-NEXT:    ldr q0, [sp, #32] // 16-byte Folded Reload
; NO-LIBCALL-NEXT:    mov s9, v0.s[2]
; NO-LIBCALL-NEXT:    fmov s0, s9
; NO-LIBCALL-NEXT:    bl sinf
; NO-LIBCALL-NEXT:    ldr q1, [sp, #16] // 16-byte Folded Reload
; NO-LIBCALL-NEXT:    // kill: def $s0 killed $s0 def $q0
; NO-LIBCALL-NEXT:    mov v1.s[2], v0.s[0]
; NO-LIBCALL-NEXT:    fmov s0, s8
; NO-LIBCALL-NEXT:    str q1, [sp, #16] // 16-byte Folded Spill
; NO-LIBCALL-NEXT:    bl cosf
; NO-LIBCALL-NEXT:    // kill: def $s0 killed $s0 def $q0
; NO-LIBCALL-NEXT:    str q0, [sp] // 16-byte Folded Spill
; NO-LIBCALL-NEXT:    ldr q0, [sp, #32] // 16-byte Folded Reload
; NO-LIBCALL-NEXT:    // kill: def $s0 killed $s0 killed $q0
; NO-LIBCALL-NEXT:    bl cosf
; NO-LIBCALL-NEXT:    ldr q1, [sp] // 16-byte Folded Reload
; NO-LIBCALL-NEXT:    // kill: def $s0 killed $s0 def $q0
; NO-LIBCALL-NEXT:    mov v0.s[1], v1.s[0]
; NO-LIBCALL-NEXT:    str q0, [sp, #32] // 16-byte Folded Spill
; NO-LIBCALL-NEXT:    fmov s0, s9
; NO-LIBCALL-NEXT:    bl cosf
; NO-LIBCALL-NEXT:    fmov s2, s0
; NO-LIBCALL-NEXT:    ldp q0, q1, [sp, #16] // 32-byte Folded Reload
; NO-LIBCALL-NEXT:    ldp d9, d8, [sp, #48] // 16-byte Folded Reload
; NO-LIBCALL-NEXT:    ldr x30, [sp, #64] // 8-byte Folded Reload
; NO-LIBCALL-NEXT:    mov v1.s[2], v2.s[0]
; NO-LIBCALL-NEXT:    add sp, sp, #80
; NO-LIBCALL-NEXT:    ret
  %result = call { <3 x float>, <3 x float> } @llvm.sincos.v3f32(<3 x float> %a)
  ret { <3 x float>, <3 x float> } %result
}

define { <2 x float>, <2 x float> } @test_sincos_v2f32(<2 x float> %a) {
; CHECK-LABEL: test_sincos_v2f32:
; CHECK:       // %bb.0:
; CHECK-NEXT:    sub sp, sp, #64
; CHECK-NEXT:    str x30, [sp, #32] // 8-byte Folded Spill
; CHECK-NEXT:    stp x20, x19, [sp, #48] // 16-byte Folded Spill
; CHECK-NEXT:    .cfi_def_cfa_offset 64
; CHECK-NEXT:    .cfi_offset w19, -8
; CHECK-NEXT:    .cfi_offset w20, -16
; CHECK-NEXT:    .cfi_offset w30, -32
; CHECK-NEXT:    // kill: def $d0 killed $d0 def $q0
; CHECK-NEXT:    add x0, sp, #44
; CHECK-NEXT:    add x1, sp, #40
; CHECK-NEXT:    str q0, [sp] // 16-byte Folded Spill
; CHECK-NEXT:    // kill: def $s0 killed $s0 killed $q0
; CHECK-NEXT:    bl sincosf
; CHECK-NEXT:    ldr q0, [sp] // 16-byte Folded Reload
; CHECK-NEXT:    add x0, sp, #28
; CHECK-NEXT:    add x1, sp, #24
; CHECK-NEXT:    add x19, sp, #28
; CHECK-NEXT:    add x20, sp, #24
; CHECK-NEXT:    mov s0, v0.s[1]
; CHECK-NEXT:    bl sincosf
; CHECK-NEXT:    ldp s1, s0, [sp, #40]
; CHECK-NEXT:    ldr x30, [sp, #32] // 8-byte Folded Reload
; CHECK-NEXT:    ld1 { v0.s }[1], [x19]
; CHECK-NEXT:    ld1 { v1.s }[1], [x20]
; CHECK-NEXT:    ldp x20, x19, [sp, #48] // 16-byte Folded Reload
; CHECK-NEXT:    // kill: def $d0 killed $d0 killed $q0
; CHECK-NEXT:    // kill: def $d1 killed $d1 killed $q1
; CHECK-NEXT:    add sp, sp, #64
; CHECK-NEXT:    ret
;
; NO-LIBCALL-LABEL: test_sincos_v2f32:
; NO-LIBCALL:       // %bb.0:
; NO-LIBCALL-NEXT:    sub sp, sp, #64
; NO-LIBCALL-NEXT:    str d8, [sp, #48] // 8-byte Folded Spill
; NO-LIBCALL-NEXT:    str x30, [sp, #56] // 8-byte Folded Spill
; NO-LIBCALL-NEXT:    .cfi_def_cfa_offset 64
; NO-LIBCALL-NEXT:    .cfi_offset w30, -8
; NO-LIBCALL-NEXT:    .cfi_offset b8, -16
; NO-LIBCALL-NEXT:    // kill: def $d0 killed $d0 def $q0
; NO-LIBCALL-NEXT:    mov s8, v0.s[1]
; NO-LIBCALL-NEXT:    str q0, [sp, #32] // 16-byte Folded Spill
; NO-LIBCALL-NEXT:    fmov s0, s8
; NO-LIBCALL-NEXT:    bl sinf
; NO-LIBCALL-NEXT:    // kill: def $s0 killed $s0 def $q0
; NO-LIBCALL-NEXT:    str q0, [sp, #16] // 16-byte Folded Spill
; NO-LIBCALL-NEXT:    ldr q0, [sp, #32] // 16-byte Folded Reload
; NO-LIBCALL-NEXT:    // kill: def $s0 killed $s0 killed $q0
; NO-LIBCALL-NEXT:    bl sinf
; NO-LIBCALL-NEXT:    ldr q1, [sp, #16] // 16-byte Folded Reload
; NO-LIBCALL-NEXT:    // kill: def $s0 killed $s0 def $q0
; NO-LIBCALL-NEXT:    mov v0.s[1], v1.s[0]
; NO-LIBCALL-NEXT:    str q0, [sp, #16] // 16-byte Folded Spill
; NO-LIBCALL-NEXT:    fmov s0, s8
; NO-LIBCALL-NEXT:    bl cosf
; NO-LIBCALL-NEXT:    // kill: def $s0 killed $s0 def $q0
; NO-LIBCALL-NEXT:    str q0, [sp] // 16-byte Folded Spill
; NO-LIBCALL-NEXT:    ldr q0, [sp, #32] // 16-byte Folded Reload
; NO-LIBCALL-NEXT:    // kill: def $s0 killed $s0 killed $q0
; NO-LIBCALL-NEXT:    bl cosf
; NO-LIBCALL-NEXT:    fmov s1, s0
; NO-LIBCALL-NEXT:    ldp q2, q0, [sp] // 32-byte Folded Reload
; NO-LIBCALL-NEXT:    ldr x30, [sp, #56] // 8-byte Folded Reload
; NO-LIBCALL-NEXT:    ldr d8, [sp, #48] // 8-byte Folded Reload
; NO-LIBCALL-NEXT:    // kill: def $d0 killed $d0 killed $q0
; NO-LIBCALL-NEXT:    mov v1.s[1], v2.s[0]
; NO-LIBCALL-NEXT:    // kill: def $d1 killed $d1 killed $q1
; NO-LIBCALL-NEXT:    add sp, sp, #64
; NO-LIBCALL-NEXT:    ret
  %result = call { <2 x float>, <2 x float> } @llvm.sincos.v2f32(<2 x float> %a)
  ret { <2 x float>, <2 x float> } %result
}

define { double, double } @test_sincos_f64(double %a) {
; CHECK-LABEL: test_sincos_f64:
; CHECK:       // %bb.0:
; CHECK-NEXT:    sub sp, sp, #32
; CHECK-NEXT:    str x30, [sp, #16] // 8-byte Folded Spill
; CHECK-NEXT:    .cfi_def_cfa_offset 32
; CHECK-NEXT:    .cfi_offset w30, -16
; CHECK-NEXT:    add x0, sp, #24
; CHECK-NEXT:    add x1, sp, #8
; CHECK-NEXT:    bl sincos
; CHECK-NEXT:    ldr d0, [sp, #24]
; CHECK-NEXT:    ldr d1, [sp, #8]
; CHECK-NEXT:    ldr x30, [sp, #16] // 8-byte Folded Reload
; CHECK-NEXT:    add sp, sp, #32
; CHECK-NEXT:    ret
;
; NO-LIBCALL-LABEL: test_sincos_f64:
; NO-LIBCALL:       // %bb.0:
; NO-LIBCALL-NEXT:    stp d9, d8, [sp, #-32]! // 16-byte Folded Spill
; NO-LIBCALL-NEXT:    str x30, [sp, #16] // 8-byte Folded Spill
; NO-LIBCALL-NEXT:    .cfi_def_cfa_offset 32
; NO-LIBCALL-NEXT:    .cfi_offset w30, -16
; NO-LIBCALL-NEXT:    .cfi_offset b8, -24
; NO-LIBCALL-NEXT:    .cfi_offset b9, -32
; NO-LIBCALL-NEXT:    fmov d8, d0
; NO-LIBCALL-NEXT:    bl sin
; NO-LIBCALL-NEXT:    fmov d9, d0
; NO-LIBCALL-NEXT:    fmov d0, d8
; NO-LIBCALL-NEXT:    bl cos
; NO-LIBCALL-NEXT:    ldr x30, [sp, #16] // 8-byte Folded Reload
; NO-LIBCALL-NEXT:    fmov d1, d0
; NO-LIBCALL-NEXT:    fmov d0, d9
; NO-LIBCALL-NEXT:    ldp d9, d8, [sp], #32 // 16-byte Folded Reload
; NO-LIBCALL-NEXT:    ret
  %result = call { double, double } @llvm.sincos.f64(double %a)
  ret { double, double } %result
}

define { <2 x double>, <2 x double> } @test_sincos_v2f64(<2 x double> %a) {
; CHECK-LABEL: test_sincos_v2f64:
; CHECK:       // %bb.0:
; CHECK-NEXT:    sub sp, sp, #80
; CHECK-NEXT:    str x30, [sp, #48] // 8-byte Folded Spill
; CHECK-NEXT:    stp x20, x19, [sp, #64] // 16-byte Folded Spill
; CHECK-NEXT:    .cfi_def_cfa_offset 80
; CHECK-NEXT:    .cfi_offset w19, -8
; CHECK-NEXT:    .cfi_offset w20, -16
; CHECK-NEXT:    .cfi_offset w30, -32
; CHECK-NEXT:    add x0, sp, #56
; CHECK-NEXT:    add x1, sp, #40
; CHECK-NEXT:    str q0, [sp] // 16-byte Folded Spill
; CHECK-NEXT:    // kill: def $d0 killed $d0 killed $q0
; CHECK-NEXT:    bl sincos
; CHECK-NEXT:    ldr q0, [sp] // 16-byte Folded Reload
; CHECK-NEXT:    add x0, sp, #32
; CHECK-NEXT:    add x1, sp, #24
; CHECK-NEXT:    add x19, sp, #32
; CHECK-NEXT:    add x20, sp, #24
; CHECK-NEXT:    mov d0, v0.d[1]
; CHECK-NEXT:    bl sincos
; CHECK-NEXT:    ldr d0, [sp, #56]
; CHECK-NEXT:    ldr d1, [sp, #40]
; CHECK-NEXT:    ldr x30, [sp, #48] // 8-byte Folded Reload
; CHECK-NEXT:    ld1 { v0.d }[1], [x19]
; CHECK-NEXT:    ld1 { v1.d }[1], [x20]
; CHECK-NEXT:    ldp x20, x19, [sp, #64] // 16-byte Folded Reload
; CHECK-NEXT:    add sp, sp, #80
; CHECK-NEXT:    ret
;
; NO-LIBCALL-LABEL: test_sincos_v2f64:
; NO-LIBCALL:       // %bb.0:
; NO-LIBCALL-NEXT:    sub sp, sp, #64
; NO-LIBCALL-NEXT:    str d8, [sp, #48] // 8-byte Folded Spill
; NO-LIBCALL-NEXT:    str x30, [sp, #56] // 8-byte Folded Spill
; NO-LIBCALL-NEXT:    .cfi_def_cfa_offset 64
; NO-LIBCALL-NEXT:    .cfi_offset w30, -8
; NO-LIBCALL-NEXT:    .cfi_offset b8, -16
; NO-LIBCALL-NEXT:    mov d8, v0.d[1]
; NO-LIBCALL-NEXT:    str q0, [sp, #32] // 16-byte Folded Spill
; NO-LIBCALL-NEXT:    fmov d0, d8
; NO-LIBCALL-NEXT:    bl sin
; NO-LIBCALL-NEXT:    // kill: def $d0 killed $d0 def $q0
; NO-LIBCALL-NEXT:    str q0, [sp, #16] // 16-byte Folded Spill
; NO-LIBCALL-NEXT:    ldr q0, [sp, #32] // 16-byte Folded Reload
; NO-LIBCALL-NEXT:    // kill: def $d0 killed $d0 killed $q0
; NO-LIBCALL-NEXT:    bl sin
; NO-LIBCALL-NEXT:    ldr q1, [sp, #16] // 16-byte Folded Reload
; NO-LIBCALL-NEXT:    // kill: def $d0 killed $d0 def $q0
; NO-LIBCALL-NEXT:    mov v0.d[1], v1.d[0]
; NO-LIBCALL-NEXT:    str q0, [sp, #16] // 16-byte Folded Spill
; NO-LIBCALL-NEXT:    fmov d0, d8
; NO-LIBCALL-NEXT:    bl cos
; NO-LIBCALL-NEXT:    // kill: def $d0 killed $d0 def $q0
; NO-LIBCALL-NEXT:    str q0, [sp] // 16-byte Folded Spill
; NO-LIBCALL-NEXT:    ldr q0, [sp, #32] // 16-byte Folded Reload
; NO-LIBCALL-NEXT:    // kill: def $d0 killed $d0 killed $q0
; NO-LIBCALL-NEXT:    bl cos
; NO-LIBCALL-NEXT:    fmov d1, d0
; NO-LIBCALL-NEXT:    ldp q2, q0, [sp] // 32-byte Folded Reload
; NO-LIBCALL-NEXT:    ldr x30, [sp, #56] // 8-byte Folded Reload
; NO-LIBCALL-NEXT:    ldr d8, [sp, #48] // 8-byte Folded Reload
; NO-LIBCALL-NEXT:    mov v1.d[1], v2.d[0]
; NO-LIBCALL-NEXT:    add sp, sp, #64
; NO-LIBCALL-NEXT:    ret
  %result = call { <2 x double>, <2 x double> } @llvm.sincos.v2f64(<2 x double> %a)
  ret { <2 x double>, <2 x double> } %result
}