1 ; RUN: llc < %s -mtriple=arm64-apple-darwin | FileCheck %s
5 define float @test1(float %x, float %y) nounwind {
8 ; CHECK: movi.4s v2, #128, lsl #24
9 ; CHECK: bit.16b v0, v1, v2
10 %0 = tail call float @copysignf(float %x, float %y) nounwind readnone
14 define double @test2(double %x, double %y) nounwind {
17 ; CHECK: movi.2d v2, #0
18 ; CHECK: fneg.2d v2, v2
19 ; CHECK: bit.16b v0, v1, v2
20 %0 = tail call double @copysign(double %x, double %y) nounwind readnone
25 define double @test3(double %a, float %b, float %c) nounwind {
28 ; CHECK: fneg.2d v2, v{{[0-9]+}}
29 ; CHECK: bit.16b v0, v1, v2
30 %tmp1 = fadd float %b, %c
31 %tmp2 = fpext float %tmp1 to double
32 %tmp = tail call double @copysign( double %a, double %tmp2 ) nounwind readnone
36 define float @test4() nounwind {
40 ; CHECK: movi.4s v[[CONST:[0-9]+]], #128, lsl #24
41 ; CHECK: bit.16b v{{[0-9]+}}, v0, v[[CONST]]
42 %0 = tail call double (...) @bar() nounwind
43 %1 = fptrunc double %0 to float
44 %2 = tail call float @copysignf(float 5.000000e-01, float %1) nounwind readnone
45 %3 = fadd float %1, %2
49 declare double @bar(...)
50 declare double @copysign(double, double) nounwind readnone
51 declare float @copysignf(float, float) nounwind readnone