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 @pow_f32(float %a, float %b) {
71 ; SMALL-LABEL: pow_f32
73 ; LARGE-LABEL: pow_f32
74 ; LARGE: adrp [[REG:x[0-9]+]], _powf@GOTPAGE
75 ; LARGE: ldr [[REG]], {{\[}}[[REG]], _powf@GOTPAGEOFF{{\]}}
76 ; LARGE-NEXT: blr [[REG]]
77 %1 = call float @llvm.pow.f32(float %a, float %b)
81 define double @pow_f64(double %a, double %b) {
82 ; SMALL-LABEL: pow_f64
84 ; LARGE-LABEL: pow_f64
85 ; LARGE: adrp [[REG:x[0-9]+]], _pow@GOTPAGE
86 ; LARGE: ldr [[REG]], {{\[}}[[REG]], _pow@GOTPAGEOFF{{\]}}
87 ; LARGE-NEXT: blr [[REG]]
88 %1 = call double @llvm.pow.f64(double %a, double %b)
91 declare float @llvm.sin.f32(float)
92 declare double @llvm.sin.f64(double)
93 declare float @llvm.cos.f32(float)
94 declare double @llvm.cos.f64(double)
95 declare float @llvm.pow.f32(float, float)
96 declare double @llvm.pow.f64(double, double)