3907fd3003c8e4ef2cf3720dc4950c043bfbb7f4
[oota-llvm.git] / test / CodeGen / AArch64 / fast-isel-frem.ll
1 ; RUN: llc -mtriple=aarch64-apple-darwin -fast-isel -fast-isel-abort -code-model=small -verify-machineinstrs < %s | FileCheck %s --check-prefix=SMALL
2 ; RUN: llc -mtriple=aarch64-apple-darwin -fast-isel -fast-isel-abort -code-model=large -verify-machineinstrs < %s | FileCheck %s --check-prefix=LARGE
3
4 define float @frem_f32(float %a, float %b) {
5 ; SMALL-LABEL: frem_f32
6 ; SMALL:       bl _fmodf
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
12   ret float %1
13 }
14
15 define double @frem_f64(double %a, double %b) {
16 ; SMALL-LABEL: frem_f64
17 ; SMALL:       bl _fmod
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
23   ret double %1
24 }