1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=aarch64-apple-darwin | FileCheck %s
6 define float @test1(float %x, float %y) nounwind {
8 ; CHECK: ; %bb.0: ; %entry
9 ; CHECK-NEXT: mvni.4s v2, #128, lsl #24
10 ; CHECK-NEXT: ; kill: def $s0 killed $s0 def $q0
11 ; CHECK-NEXT: ; kill: def $s1 killed $s1 def $q1
12 ; CHECK-NEXT: bif.16b v0, v1, v2
13 ; CHECK-NEXT: ; kill: def $s0 killed $s0 killed $q0
16 %0 = tail call float @copysignf(float %x, float %y) nounwind readnone
20 define double @test2(double %x, double %y) nounwind {
22 ; CHECK: ; %bb.0: ; %entry
23 ; CHECK-NEXT: movi.2d v2, #0xffffffffffffffff
24 ; CHECK-NEXT: ; kill: def $d0 killed $d0 def $q0
25 ; CHECK-NEXT: ; kill: def $d1 killed $d1 def $q1
26 ; CHECK-NEXT: fneg.2d v2, v2
27 ; CHECK-NEXT: bif.16b v0, v1, v2
28 ; CHECK-NEXT: ; kill: def $d0 killed $d0 killed $q0
31 %0 = tail call double @copysign(double %x, double %y) nounwind readnone
36 define double @test3(double %a, float %b, float %c) nounwind {
39 ; CHECK-NEXT: movi.2d v3, #0xffffffffffffffff
40 ; CHECK-NEXT: fadd s1, s1, s2
41 ; CHECK-NEXT: ; kill: def $d0 killed $d0 def $q0
42 ; CHECK-NEXT: fneg.2d v2, v3
43 ; CHECK-NEXT: fcvt d1, s1
44 ; CHECK-NEXT: bif.16b v0, v1, v2
45 ; CHECK-NEXT: ; kill: def $d0 killed $d0 killed $q0
47 %tmp1 = fadd float %b, %c
48 %tmp2 = fpext float %tmp1 to double
49 %tmp = tail call double @copysign( double %a, double %tmp2 ) nounwind readnone
53 define float @test4() nounwind {
55 ; CHECK: ; %bb.0: ; %entry
56 ; CHECK-NEXT: stp x29, x30, [sp, #-16]! ; 16-byte Folded Spill
58 ; CHECK-NEXT: fcvt s0, d0
59 ; CHECK-NEXT: fmov s1, #0.50000000
60 ; CHECK-NEXT: mvni.4s v2, #128, lsl #24
61 ; CHECK-NEXT: bif.16b v1, v0, v2
62 ; CHECK-NEXT: fadd s0, s0, s1
63 ; CHECK-NEXT: ldp x29, x30, [sp], #16 ; 16-byte Folded Reload
66 %0 = tail call double (...) @bar() nounwind
67 %1 = fptrunc double %0 to float
68 %2 = tail call float @copysignf(float 5.000000e-01, float %1) nounwind readnone
69 %3 = fadd float %1, %2
73 declare double @bar(...)
74 declare double @copysign(double, double) nounwind readnone
75 declare float @copysignf(float, float) nounwind readnone