diff options
| author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2019-05-28 21:16:04 +0000 |
|---|---|---|
| committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2019-05-28 21:16:04 +0000 |
| commit | 14689910737b8e63a0ef7caf407d13aa68bbd6f8 (patch) | |
| tree | 2f4c086044199b5542bdb8150112cf074676fb7f /clang/lib/CodeGen | |
| parent | 34d8daae539dfdbb3133d18b61caddd57e29adfe (diff) | |
| download | bcm5719-llvm-14689910737b8e63a0ef7caf407d13aa68bbd6f8.tar.gz bcm5719-llvm-14689910737b8e63a0ef7caf407d13aa68bbd6f8.zip | |
[clang] Handle lrint/llrint builtins
As for other floating-point rounding builtins that can be optimized
when build with -fno-math-errno, this patch adds support for lrint
and llrint. It currently only optimize for AArch64 backend.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D62019
llvm-svn: 361878
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CGBuiltin.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp index d59e0fc960b..bc798cab11e 100644 --- a/clang/lib/CodeGen/CGBuiltin.cpp +++ b/clang/lib/CodeGen/CGBuiltin.cpp @@ -1741,6 +1741,22 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, case Builtin::BI__builtin_llroundl: return RValue::get(emitFPToIntRoundBuiltin(*this, E, Intrinsic::llround)); + case Builtin::BIlrint: + case Builtin::BIlrintf: + case Builtin::BIlrintl: + case Builtin::BI__builtin_lrint: + case Builtin::BI__builtin_lrintf: + case Builtin::BI__builtin_lrintl: + return RValue::get(emitFPToIntRoundBuiltin(*this, E, Intrinsic::lrint)); + + case Builtin::BIllrint: + case Builtin::BIllrintf: + case Builtin::BIllrintl: + case Builtin::BI__builtin_llrint: + case Builtin::BI__builtin_llrintf: + case Builtin::BI__builtin_llrintl: + return RValue::get(emitFPToIntRoundBuiltin(*this, E, Intrinsic::llrint)); + default: break; } |

