aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetLoweringBase.cpp
diff options
context:
space:
mode:
authorBevin Hansson <bevin.hansson@ericsson.com>2020-07-16 17:02:04 +0200
committerBevin Hansson <bevin.hansson@ericsson.com>2020-08-07 15:09:24 +0200
commit5de6c56f7e862958cfc6de1abae49c07f6e8c7ed (patch)
treedbb7a77f78dcc87f500a75e4faca5842fac4b4a1 /llvm/lib/CodeGen/TargetLoweringBase.cpp
parent177735aac7fcac2b1085bfcdcf589681248b5ec8 (diff)
downloadllvm-5de6c56f7e862958cfc6de1abae49c07f6e8c7ed.zip
llvm-5de6c56f7e862958cfc6de1abae49c07f6e8c7ed.tar.gz
llvm-5de6c56f7e862958cfc6de1abae49c07f6e8c7ed.tar.bz2
[Intrinsic] Add sshl.sat/ushl.sat, saturated shift intrinsics.
Summary: This patch adds two intrinsics, llvm.sshl.sat and llvm.ushl.sat, which perform signed and unsigned saturating left shift, respectively. These are useful for implementing the Embedded-C fixed point support in Clang, originally discussed in http://lists.llvm.org/pipermail/llvm-dev/2018-August/125433.html and http://lists.llvm.org/pipermail/cfe-dev/2018-May/058019.html Reviewers: leonardchan, craig.topper, bjope, jdoerfert Subscribers: hiraditya, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D83216
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringBase.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringBase.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringBase.cpp b/llvm/lib/CodeGen/TargetLoweringBase.cpp
index 4562e1e..63e55c9 100644
--- a/llvm/lib/CodeGen/TargetLoweringBase.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringBase.cpp
@@ -657,6 +657,8 @@ void TargetLoweringBase::initActions() {
setOperationAction(ISD::UADDSAT, VT, Expand);
setOperationAction(ISD::SSUBSAT, VT, Expand);
setOperationAction(ISD::USUBSAT, VT, Expand);
+ setOperationAction(ISD::SSHLSAT, VT, Expand);
+ setOperationAction(ISD::USHLSAT, VT, Expand);
setOperationAction(ISD::SMULFIX, VT, Expand);
setOperationAction(ISD::SMULFIXSAT, VT, Expand);
setOperationAction(ISD::UMULFIX, VT, Expand);