1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=aarch64-apple-darwin -fast-isel -fast-isel-abort=1 -code-model=small -verify-machineinstrs < %s | FileCheck %s --check-prefix=SMALL 2*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=aarch64-apple-darwin -fast-isel -fast-isel-abort=1 -code-model=large -verify-machineinstrs < %s | FileCheck %s --check-prefix=LARGE 3*9880d681SAndroid Build Coastguard Worker 4*9880d681SAndroid Build Coastguard Workerdefine float @frem_f32(float %a, float %b) { 5*9880d681SAndroid Build Coastguard Worker; SMALL-LABEL: frem_f32 6*9880d681SAndroid Build Coastguard Worker; SMALL: bl _fmodf 7*9880d681SAndroid Build Coastguard Worker; LARGE-LABEL: frem_f32 8*9880d681SAndroid Build Coastguard Worker; LARGE: adrp [[REG:x[0-9]+]], _fmodf@GOTPAGE 9*9880d681SAndroid Build Coastguard Worker; LARGE: ldr [[REG]], {{\[}}[[REG]], _fmodf@GOTPAGEOFF{{\]}} 10*9880d681SAndroid Build Coastguard Worker; LARGE-NEXT: blr [[REG]] 11*9880d681SAndroid Build Coastguard Worker %1 = frem float %a, %b 12*9880d681SAndroid Build Coastguard Worker ret float %1 13*9880d681SAndroid Build Coastguard Worker} 14*9880d681SAndroid Build Coastguard Worker 15*9880d681SAndroid Build Coastguard Workerdefine double @frem_f64(double %a, double %b) { 16*9880d681SAndroid Build Coastguard Worker; SMALL-LABEL: frem_f64 17*9880d681SAndroid Build Coastguard Worker; SMALL: bl _fmod 18*9880d681SAndroid Build Coastguard Worker; LARGE-LABEL: frem_f64 19*9880d681SAndroid Build Coastguard Worker; LARGE: adrp [[REG:x[0-9]+]], _fmod@GOTPAGE 20*9880d681SAndroid Build Coastguard Worker; LARGE: ldr [[REG]], {{\[}}[[REG]], _fmod@GOTPAGEOFF{{\]}} 21*9880d681SAndroid Build Coastguard Worker; LARGE-NEXT: blr [[REG]] 22*9880d681SAndroid Build Coastguard Worker %1 = frem double %a, %b 23*9880d681SAndroid Build Coastguard Worker ret double %1 24*9880d681SAndroid Build Coastguard Worker} 25*9880d681SAndroid Build Coastguard Worker 26*9880d681SAndroid Build Coastguard Workerdefine float @sin_f32(float %a) { 27*9880d681SAndroid Build Coastguard Worker; SMALL-LABEL: sin_f32 28*9880d681SAndroid Build Coastguard Worker; SMALL: bl _sinf 29*9880d681SAndroid Build Coastguard Worker; LARGE-LABEL: sin_f32 30*9880d681SAndroid Build Coastguard Worker; LARGE: adrp [[REG:x[0-9]+]], _sinf@GOTPAGE 31*9880d681SAndroid Build Coastguard Worker; LARGE: ldr [[REG]], {{\[}}[[REG]], _sinf@GOTPAGEOFF{{\]}} 32*9880d681SAndroid Build Coastguard Worker; LARGE-NEXT: blr [[REG]] 33*9880d681SAndroid Build Coastguard Worker %1 = call float @llvm.sin.f32(float %a) 34*9880d681SAndroid Build Coastguard Worker ret float %1 35*9880d681SAndroid Build Coastguard Worker} 36*9880d681SAndroid Build Coastguard Worker 37*9880d681SAndroid Build Coastguard Workerdefine double @sin_f64(double %a) { 38*9880d681SAndroid Build Coastguard Worker; SMALL-LABEL: sin_f64 39*9880d681SAndroid Build Coastguard Worker; SMALL: bl _sin 40*9880d681SAndroid Build Coastguard Worker; LARGE-LABEL: sin_f64 41*9880d681SAndroid Build Coastguard Worker; LARGE: adrp [[REG:x[0-9]+]], _sin@GOTPAGE 42*9880d681SAndroid Build Coastguard Worker; LARGE: ldr [[REG]], {{\[}}[[REG]], _sin@GOTPAGEOFF{{\]}} 43*9880d681SAndroid Build Coastguard Worker; LARGE-NEXT: blr [[REG]] 44*9880d681SAndroid Build Coastguard Worker %1 = call double @llvm.sin.f64(double %a) 45*9880d681SAndroid Build Coastguard Worker ret double %1 46*9880d681SAndroid Build Coastguard Worker} 47*9880d681SAndroid Build Coastguard Worker 48*9880d681SAndroid Build Coastguard Workerdefine float @cos_f32(float %a) { 49*9880d681SAndroid Build Coastguard Worker; SMALL-LABEL: cos_f32 50*9880d681SAndroid Build Coastguard Worker; SMALL: bl _cosf 51*9880d681SAndroid Build Coastguard Worker; LARGE-LABEL: cos_f32 52*9880d681SAndroid Build Coastguard Worker; LARGE: adrp [[REG:x[0-9]+]], _cosf@GOTPAGE 53*9880d681SAndroid Build Coastguard Worker; LARGE: ldr [[REG]], {{\[}}[[REG]], _cosf@GOTPAGEOFF{{\]}} 54*9880d681SAndroid Build Coastguard Worker; LARGE-NEXT: blr [[REG]] 55*9880d681SAndroid Build Coastguard Worker %1 = call float @llvm.cos.f32(float %a) 56*9880d681SAndroid Build Coastguard Worker ret float %1 57*9880d681SAndroid Build Coastguard Worker} 58*9880d681SAndroid Build Coastguard Worker 59*9880d681SAndroid Build Coastguard Workerdefine double @cos_f64(double %a) { 60*9880d681SAndroid Build Coastguard Worker; SMALL-LABEL: cos_f64 61*9880d681SAndroid Build Coastguard Worker; SMALL: bl _cos 62*9880d681SAndroid Build Coastguard Worker; LARGE-LABEL: cos_f64 63*9880d681SAndroid Build Coastguard Worker; LARGE: adrp [[REG:x[0-9]+]], _cos@GOTPAGE 64*9880d681SAndroid Build Coastguard Worker; LARGE: ldr [[REG]], {{\[}}[[REG]], _cos@GOTPAGEOFF{{\]}} 65*9880d681SAndroid Build Coastguard Worker; LARGE-NEXT: blr [[REG]] 66*9880d681SAndroid Build Coastguard Worker %1 = call double @llvm.cos.f64(double %a) 67*9880d681SAndroid Build Coastguard Worker ret double %1 68*9880d681SAndroid Build Coastguard Worker} 69*9880d681SAndroid Build Coastguard Worker 70*9880d681SAndroid Build Coastguard Workerdefine float @pow_f32(float %a, float %b) { 71*9880d681SAndroid Build Coastguard Worker; SMALL-LABEL: pow_f32 72*9880d681SAndroid Build Coastguard Worker; SMALL: bl _powf 73*9880d681SAndroid Build Coastguard Worker; LARGE-LABEL: pow_f32 74*9880d681SAndroid Build Coastguard Worker; LARGE: adrp [[REG:x[0-9]+]], _powf@GOTPAGE 75*9880d681SAndroid Build Coastguard Worker; LARGE: ldr [[REG]], {{\[}}[[REG]], _powf@GOTPAGEOFF{{\]}} 76*9880d681SAndroid Build Coastguard Worker; LARGE-NEXT: blr [[REG]] 77*9880d681SAndroid Build Coastguard Worker %1 = call float @llvm.pow.f32(float %a, float %b) 78*9880d681SAndroid Build Coastguard Worker ret float %1 79*9880d681SAndroid Build Coastguard Worker} 80*9880d681SAndroid Build Coastguard Worker 81*9880d681SAndroid Build Coastguard Workerdefine double @pow_f64(double %a, double %b) { 82*9880d681SAndroid Build Coastguard Worker; SMALL-LABEL: pow_f64 83*9880d681SAndroid Build Coastguard Worker; SMALL: bl _pow 84*9880d681SAndroid Build Coastguard Worker; LARGE-LABEL: pow_f64 85*9880d681SAndroid Build Coastguard Worker; LARGE: adrp [[REG:x[0-9]+]], _pow@GOTPAGE 86*9880d681SAndroid Build Coastguard Worker; LARGE: ldr [[REG]], {{\[}}[[REG]], _pow@GOTPAGEOFF{{\]}} 87*9880d681SAndroid Build Coastguard Worker; LARGE-NEXT: blr [[REG]] 88*9880d681SAndroid Build Coastguard Worker %1 = call double @llvm.pow.f64(double %a, double %b) 89*9880d681SAndroid Build Coastguard Worker ret double %1 90*9880d681SAndroid Build Coastguard Worker} 91*9880d681SAndroid Build Coastguard Workerdeclare float @llvm.sin.f32(float) 92*9880d681SAndroid Build Coastguard Workerdeclare double @llvm.sin.f64(double) 93*9880d681SAndroid Build Coastguard Workerdeclare float @llvm.cos.f32(float) 94*9880d681SAndroid Build Coastguard Workerdeclare double @llvm.cos.f64(double) 95*9880d681SAndroid Build Coastguard Workerdeclare float @llvm.pow.f32(float, float) 96*9880d681SAndroid Build Coastguard Workerdeclare double @llvm.pow.f64(double, double) 97