1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
llvm-mirror/test/CodeGen/ARM/llrint-conv.ll
Adhemerval Zanella 1dcd9f1f31 [CodeGen] Add lrint/llrint builtins
This patch add the ISD::LRINT and ISD::LLRINT along with new
intrinsics.  The changes are straightforward as for other
floating-point rounding functions, with just some adjustments
required to handle the return value being an interger.

The idea is to optimize lrint/llrint generation for AArch64
in a subsequent patch.  Current semantic is just route it to libm
symbol.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D62017

llvm-svn: 361875
2019-05-28 20:47:44 +00:00

26 lines
772 B
LLVM

; RUN: llc < %s -mtriple=arm-eabi -float-abi=soft | FileCheck %s --check-prefix=SOFTFP
; RUN: llc < %s -mtriple=arm-eabi -float-abi=hard | FileCheck %s --check-prefix=HARDFP
; SOFTFP-LABEL: testmsxs_builtin:
; SOFTFP: bl llrintf
; HARDFP-LABEL: testmsxs_builtin:
; HARDFP: bl llrintf
define i64 @testmsxs_builtin(float %x) {
entry:
%0 = tail call i64 @llvm.llrint.f32(float %x)
ret i64 %0
}
; SOFTFP-LABEL: testmsxd_builtin:
; SOFTFP: bl llrint
; HARDFP-LABEL: testmsxd_builtin:
; HARDFP: bl llrint
define i64 @testmsxd_builtin(double %x) {
entry:
%0 = tail call i64 @llvm.llrint.f64(double %x)
ret i64 %0
}
declare i64 @llvm.llrint.f32(float) nounwind readnone
declare i64 @llvm.llrint.f64(double) nounwind readnone