diff options
author | Leonard Chan <leonardchan@google.com> | 2018-10-29 16:54:37 +0000 |
---|---|---|
committer | Leonard Chan <leonardchan@google.com> | 2018-10-29 16:54:37 +0000 |
commit | 905abe5b5d8bfb0e7819d9215a4b52c9f3296414 (patch) | |
tree | ca1adf55a814679c655ec95d0294f51454ab7cfc /llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | |
parent | 71c989ae1f77b31fb4ee50d9f9510a6f839e381b (diff) | |
download | bcm5719-llvm-905abe5b5d8bfb0e7819d9215a4b52c9f3296414.tar.gz bcm5719-llvm-905abe5b5d8bfb0e7819d9215a4b52c9f3296414.zip |
[Intrinsic] Signed and Unsigned Saturation Subtraction Intirnsics
Add an intrinsic that takes 2 integers and perform saturation subtraction 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/D53783
llvm-svn: 345512
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 130b33d0767..6d9e69e2d64 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -1115,7 +1115,9 @@ void SelectionDAGLegalize::LegalizeOp(SDNode *Node) { Node->getValueType(0)); break; case ISD::SADDSAT: - case ISD::UADDSAT: { + case ISD::UADDSAT: + case ISD::SSUBSAT: + case ISD::USUBSAT: { Action = TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0)); break; } @@ -3254,8 +3256,10 @@ bool SelectionDAGLegalize::ExpandNode(SDNode *Node) { break; } case ISD::SADDSAT: - case ISD::UADDSAT: { - Results.push_back(TLI.getExpandedSaturationAddition(Node, DAG)); + case ISD::UADDSAT: + case ISD::SSUBSAT: + case ISD::USUBSAT: { + Results.push_back(TLI.getExpandedSaturationAdditionSubtraction(Node, DAG)); break; } case ISD::SADDO: |