mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-19 15:13:49 -04:00
51646414da
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360889 91177308-0d34-0410-b5e6-96231b3b80d8
26 lines
788 B
LLVM
26 lines
788 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: testmsws_builtin:
|
|
; SOFTFP: bl lroundf
|
|
; HARDFP-LABEL: testmsws_builtin:
|
|
; HARDFP: bl lroundf
|
|
define i32 @testmsws_builtin(float %x) {
|
|
entry:
|
|
%0 = tail call i32 @llvm.lround.i32.f32(float %x)
|
|
ret i32 %0
|
|
}
|
|
|
|
; SOFTFP-LABEL: testmswd_builtin:
|
|
; SOFTFP: bl lround
|
|
; HARDFP-LABEL: testmswd_builtin:
|
|
; HARDFP: bl lround
|
|
define i32 @testmswd_builtin(double %x) {
|
|
entry:
|
|
%0 = tail call i32 @llvm.lround.i32.f64(double %x)
|
|
ret i32 %0
|
|
}
|
|
|
|
declare i32 @llvm.lround.i32.f32(float) nounwind readnone
|
|
declare i32 @llvm.lround.i32.f64(double) nounwind readnone
|