mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 04:32:44 +01:00
c00c3084e9
This patch add the ISD::LROUND and ISD::LLROUND 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 lround/llround generation for AArch64 in a subsequent patch. Current semantic is just route it to libm symbol. llvm-svn: 360889
26 lines
780 B
LLVM
26 lines
780 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 llroundf
|
|
; HARDFP-LABEL: testmsxs_builtin:
|
|
; HARDFP: bl llroundf
|
|
define i64 @testmsxs_builtin(float %x) {
|
|
entry:
|
|
%0 = tail call i64 @llvm.llround.f32(float %x)
|
|
ret i64 %0
|
|
}
|
|
|
|
; SOFTFP-LABEL: testmsxd_builtin:
|
|
; SOFTFP: bl llround
|
|
; HARDFP-LABEL: testmsxd_builtin:
|
|
; HARDFP: bl llround
|
|
define i64 @testmsxd_builtin(double %x) {
|
|
entry:
|
|
%0 = tail call i64 @llvm.llround.f64(double %x)
|
|
ret i64 %0
|
|
}
|
|
|
|
declare i64 @llvm.llround.f32(float) nounwind readnone
|
|
declare i64 @llvm.llround.f64(double) nounwind readnone
|