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/IR/Verifier.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/IR/Verifier.cpp')
-rw-r--r-- | llvm/lib/IR/Verifier.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index 6e0bb5ad358..dc6c1f663d6 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -4474,6 +4474,15 @@ void Verifier::visitIntrinsicCallSite(Intrinsic::ID ID, CallSite CS) { break; } + case Intrinsic::sadd_sat: { + Value *Op1 = CS.getArgOperand(0); + Value *Op2 = CS.getArgOperand(1); + Assert(Op1->getType()->isIntOrIntVectorTy(), + "first operand of sadd_sat must be an int type or vector of ints"); + Assert(Op2->getType()->isIntOrIntVectorTy(), + "second operand of sadd_sat must be an int type or vector of ints"); + break; + } }; } |