1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00
llvm-mirror/test/CodeGen/AArch64/fast-isel-runtime-libcall.ll
Mehdi Amini 32875af6e3 Change the fast-isel-abort option from bool to int to enable "levels"
Summary:
Currently fast-isel-abort will only abort for regular instructions,
and just warn for function calls, terminators, function arguments.
There is already fast-isel-abort-args but nothing for calls and
terminators.

This change turns the fast-isel-abort options into an integer option,
so that multiple levels of strictness can be defined.
This will help no being surprised when the "abort" option indeed does
not abort, and enables the possibility to write test that verifies
that no intrinsics are forgotten by fast-isel.

Reviewers: resistor, echristo

Subscribers: jfb, llvm-commits

Differential Revision: http://reviews.llvm.org/D7941

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 230775
2015-02-27 18:32:11 +00:00

97 lines
3.0 KiB
LLVM

; RUN: llc -mtriple=aarch64-apple-darwin -fast-isel -fast-isel-abort=1 -code-model=small -verify-machineinstrs < %s | FileCheck %s --check-prefix=SMALL
; RUN: llc -mtriple=aarch64-apple-darwin -fast-isel -fast-isel-abort=1 -code-model=large -verify-machineinstrs < %s | FileCheck %s --check-prefix=LARGE
define float @frem_f32(float %a, float %b) {
; SMALL-LABEL: frem_f32
; SMALL: bl _fmodf
; LARGE-LABEL: frem_f32
; LARGE: adrp [[REG:x[0-9]+]], _fmodf@GOTPAGE
; LARGE: ldr [[REG]], {{\[}}[[REG]], _fmodf@GOTPAGEOFF{{\]}}
; LARGE-NEXT: blr [[REG]]
%1 = frem float %a, %b
ret float %1
}
define double @frem_f64(double %a, double %b) {
; SMALL-LABEL: frem_f64
; SMALL: bl _fmod
; LARGE-LABEL: frem_f64
; LARGE: adrp [[REG:x[0-9]+]], _fmod@GOTPAGE
; LARGE: ldr [[REG]], {{\[}}[[REG]], _fmod@GOTPAGEOFF{{\]}}
; LARGE-NEXT: blr [[REG]]
%1 = frem double %a, %b
ret double %1
}
define float @sin_f32(float %a) {
; SMALL-LABEL: sin_f32
; SMALL: bl _sinf
; LARGE-LABEL: sin_f32
; LARGE: adrp [[REG:x[0-9]+]], _sinf@GOTPAGE
; LARGE: ldr [[REG]], {{\[}}[[REG]], _sinf@GOTPAGEOFF{{\]}}
; LARGE-NEXT: blr [[REG]]
%1 = call float @llvm.sin.f32(float %a)
ret float %1
}
define double @sin_f64(double %a) {
; SMALL-LABEL: sin_f64
; SMALL: bl _sin
; LARGE-LABEL: sin_f64
; LARGE: adrp [[REG:x[0-9]+]], _sin@GOTPAGE
; LARGE: ldr [[REG]], {{\[}}[[REG]], _sin@GOTPAGEOFF{{\]}}
; LARGE-NEXT: blr [[REG]]
%1 = call double @llvm.sin.f64(double %a)
ret double %1
}
define float @cos_f32(float %a) {
; SMALL-LABEL: cos_f32
; SMALL: bl _cosf
; LARGE-LABEL: cos_f32
; LARGE: adrp [[REG:x[0-9]+]], _cosf@GOTPAGE
; LARGE: ldr [[REG]], {{\[}}[[REG]], _cosf@GOTPAGEOFF{{\]}}
; LARGE-NEXT: blr [[REG]]
%1 = call float @llvm.cos.f32(float %a)
ret float %1
}
define double @cos_f64(double %a) {
; SMALL-LABEL: cos_f64
; SMALL: bl _cos
; LARGE-LABEL: cos_f64
; LARGE: adrp [[REG:x[0-9]+]], _cos@GOTPAGE
; LARGE: ldr [[REG]], {{\[}}[[REG]], _cos@GOTPAGEOFF{{\]}}
; LARGE-NEXT: blr [[REG]]
%1 = call double @llvm.cos.f64(double %a)
ret double %1
}
define float @pow_f32(float %a, float %b) {
; SMALL-LABEL: pow_f32
; SMALL: bl _powf
; LARGE-LABEL: pow_f32
; LARGE: adrp [[REG:x[0-9]+]], _powf@GOTPAGE
; LARGE: ldr [[REG]], {{\[}}[[REG]], _powf@GOTPAGEOFF{{\]}}
; LARGE-NEXT: blr [[REG]]
%1 = call float @llvm.pow.f32(float %a, float %b)
ret float %1
}
define double @pow_f64(double %a, double %b) {
; SMALL-LABEL: pow_f64
; SMALL: bl _pow
; LARGE-LABEL: pow_f64
; LARGE: adrp [[REG:x[0-9]+]], _pow@GOTPAGE
; LARGE: ldr [[REG]], {{\[}}[[REG]], _pow@GOTPAGEOFF{{\]}}
; LARGE-NEXT: blr [[REG]]
%1 = call double @llvm.pow.f64(double %a, double %b)
ret double %1
}
declare float @llvm.sin.f32(float)
declare double @llvm.sin.f64(double)
declare float @llvm.cos.f32(float)
declare double @llvm.cos.f64(double)
declare float @llvm.pow.f32(float, float)
declare double @llvm.pow.f64(double, double)