diff options
author | Leonard Chan <leonardchan@google.com> | 2018-10-16 17:35:41 +0000 |
---|---|---|
committer | Leonard Chan <leonardchan@google.com> | 2018-10-16 17:35:41 +0000 |
commit | 699b3b54da2f483228544234e5ed375aa81acd9f (patch) | |
tree | 145a229fe95f4d87fbd99ae1ee8fc2e912876d04 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | |
parent | d3ff1ecfde95549db960aaca4848f7436ca28431 (diff) | |
download | bcm5719-llvm-699b3b54da2f483228544234e5ed375aa81acd9f.tar.gz bcm5719-llvm-699b3b54da2f483228544234e5ed375aa81acd9f.zip |
[Intrinsic] Signed Saturation Addition Intrinsic
Add an intrinsic that takes 2 integers and perform saturation addition on them.
This is a part of implementing fixed point arithmetic in clang where some of
the more complex operations will be implemented as intrinsics.
Differential Revision: https://reviews.llvm.org/D53053
llvm-svn: 344629
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 3907f647142..2e0456edef7 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -5771,6 +5771,12 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) { setValue(&I, DAG.getSelect(sdl, VT, IsZeroShift, IsFSHL ? X : Y, Or)); return nullptr; } + case Intrinsic::sadd_sat: { + SDValue Op1 = getValue(I.getArgOperand(0)); + SDValue Op2 = getValue(I.getArgOperand(1)); + setValue(&I, DAG.getNode(ISD::SADDSAT, sdl, Op1.getValueType(), Op1, Op2)); + return nullptr; + } case Intrinsic::stacksave: { SDValue Op = getRoot(); Res = DAG.getNode( |