1 ; RUN: llc -mtriple=aarch64-apple-darwin -fast-isel -fast-isel-abort=1 -code-model=small -verify-machineinstrs < %s | FileCheck %s --check-prefix=SMALL
2 ; RUN: llc -mtriple=aarch64-apple-darwin -fast-isel -fast-isel-abort=1 -code-model=large -verify-machineinstrs < %s | FileCheck %s --check-prefix=LARGE
4 define float @frem_f32(float %a, float %b) {
5 ; SMALL-LABEL: frem_f32
7 ; LARGE-LABEL: frem_f32
8 ; LARGE: adrp [[REG:x[0-9]+]], _fmodf@GOTPAGE
9 ; LARGE: ldr [[REG]], [[[REG]], _fmodf@GOTPAGEOFF]
10 ; LARGE-NEXT: blr [[REG]]
11 %1 = frem float %a, %b
15 define double @frem_f64(double %a, double %b) {
16 ; SMALL-LABEL: frem_f64
18 ; LARGE-LABEL: frem_f64
19 ; LARGE: adrp [[REG:x[0-9]+]], _fmod@GOTPAGE
20 ; LARGE: ldr [[REG]], [[[REG]], _fmod@GOTPAGEOFF]
21 ; LARGE-NEXT: blr [[REG]]
22 %1 = frem double %a, %b
26 define float @sin_f32(float %a) {
27 ; SMALL-LABEL: sin_f32
29 ; LARGE-LABEL: sin_f32
30 ; LARGE: adrp [[REG:x[0-9]+]], _sinf@GOTPAGE
31 ; LARGE: ldr [[REG]], [[[REG]], _sinf@GOTPAGEOFF]
32 ; LARGE-NEXT: blr [[REG]]
33 %1 = call float @llvm.sin.f32(float %a)
37 define double @sin_f64(double %a) {
38 ; SMALL-LABEL: sin_f64
40 ; LARGE-LABEL: sin_f64
41 ; LARGE: adrp [[REG:x[0-9]+]], _sin@GOTPAGE
42 ; LARGE: ldr [[REG]], [[[REG]], _sin@GOTPAGEOFF]
43 ; LARGE-NEXT: blr [[REG]]
44 %1 = call double @llvm.sin.f64(double %a)
48 define float @cos_f32(float %a) {
49 ; SMALL-LABEL: cos_f32
51 ; LARGE-LABEL: cos_f32
52 ; LARGE: adrp [[REG:x[0-9]+]], _cosf@GOTPAGE
53 ; LARGE: ldr [[REG]], [[[REG]], _cosf@GOTPAGEOFF]
54 ; LARGE-NEXT: blr [[REG]]
55 %1 = call float @llvm.cos.f32(float %a)
59 define double @cos_f64(double %a) {
60 ; SMALL-LABEL: cos_f64
62 ; LARGE-LABEL: cos_f64
63 ; LARGE: adrp [[REG:x[0-9]+]], _cos@GOTPAGE
64 ; LARGE: ldr [[REG]], [[[REG]], _cos@GOTPAGEOFF]
65 ; LARGE-NEXT: blr [[REG]]
66 %1 = call double @llvm.cos.f64(double %a)
70 define float @tan_f32(float %a) {
71 ; SMALL-LABEL: tan_f32
73 ; LARGE-LABEL: tan_f32
74 ; LARGE: adrp [[REG:x[0-9]+]], _tanf@GOTPAGE
75 ; LARGE: ldr [[REG]], [[[REG]], _tanf@GOTPAGEOFF]
76 ; LARGE-NEXT: blr [[REG]]
77 %1 = call float @llvm.tan.f32(float %a)
81 define double @tan_f64(double %a) {
82 ; SMALL-LABEL: tan_f64
84 ; LARGE-LABEL: tan_f64
85 ; LARGE: adrp [[REG:x[0-9]+]], _tan@GOTPAGE
86 ; LARGE: ldr [[REG]], [[[REG]], _tan@GOTPAGEOFF]
87 ; LARGE-NEXT: blr [[REG]]
88 %1 = call double @llvm.tan.f64(double %a)
92 define float @pow_f32(float %a, float %b) {
93 ; SMALL-LABEL: pow_f32
95 ; LARGE-LABEL: pow_f32
96 ; LARGE: adrp [[REG:x[0-9]+]], _powf@GOTPAGE
97 ; LARGE: ldr [[REG]], [[[REG]], _powf@GOTPAGEOFF]
98 ; LARGE-NEXT: blr [[REG]]
99 %1 = call float @llvm.pow.f32(float %a, float %b)
103 define double @pow_f64(double %a, double %b) {
104 ; SMALL-LABEL: pow_f64
106 ; LARGE-LABEL: pow_f64
107 ; LARGE: adrp [[REG:x[0-9]+]], _pow@GOTPAGE
108 ; LARGE: ldr [[REG]], [[[REG]], _pow@GOTPAGEOFF]
109 ; LARGE-NEXT: blr [[REG]]
110 %1 = call double @llvm.pow.f64(double %a, double %b)
113 declare float @llvm.sin.f32(float)
114 declare double @llvm.sin.f64(double)
115 declare float @llvm.cos.f32(float)
116 declare double @llvm.cos.f64(double)
117 declare float @llvm.tan.f32(float)
118 declare double @llvm.tan.f64(double)
119 declare float @llvm.pow.f32(float, float)
120 declare double @llvm.pow.f64(double, double)