diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2019-05-28 20:47:44 +0000 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2019-05-28 20:47:44 +0000 |
commit | 6d7bf5e8df5455fa32cc437f7043bbb0a0607d49 (patch) | |
tree | 2003d25498af8a576b461c14b43f1e72cf57c81e /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | |
parent | dfc34f0211b78a288cddfdc59798132c8087592d (diff) | |
download | bcm5719-llvm-6d7bf5e8df5455fa32cc437f7043bbb0a0607d49.tar.gz bcm5719-llvm-6d7bf5e8df5455fa32cc437f7043bbb0a0607d49.zip |
[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
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index a5274877ece..fe857f73b25 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -6029,12 +6029,16 @@ void SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, return; } case Intrinsic::lround: - case Intrinsic::llround: { + case Intrinsic::llround: + case Intrinsic::lrint: + case Intrinsic::llrint: { unsigned Opcode; switch (Intrinsic) { default: llvm_unreachable("Impossible intrinsic"); // Can't reach here. case Intrinsic::lround: Opcode = ISD::LROUND; break; case Intrinsic::llround: Opcode = ISD::LLROUND; break; + case Intrinsic::lrint: Opcode = ISD::LRINT; break; + case Intrinsic::llrint: Opcode = ISD::LLRINT; break; } EVT RetVT = TLI.getValueType(DAG.getDataLayout(), I.getType()); |