Implement the sadd_with_overflow intrinsic. This is converted into

"ISD::ADDO". ISD::ADDO is lowered into a target-independent form that does the
addition and then checks if the result is less than one of the operands. (If it
is, then there was an overflow.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59779 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling
2008-11-21 02:03:52 +00:00
parent cb9a354d13
commit 7cdc3c8ad2
4 changed files with 63 additions and 9 deletions

View File

@@ -250,13 +250,13 @@ namespace ISD {
// values.
ADDE, SUBE,
// RESULT, OVERFLOW_FLAG, OUTCHAIN = [SU]ADDO(INCHAIN, LHS, RHS) -
// Overflow-aware nodes for arithmetic operations. These nodes take two
// operands: the normal lhs and rhs to the add. They produce two results:
// the normal result of the add, and a flag indicating whether an overflow
// occured. These nodes are generated from the llvm.[su]add.with.overflow
// intrinsics. They are lowered by target-dependent code.
SADDO, UADDO,
// RESULT, OVERFLOW_FLAG, OUTCHAIN = ADDO(INCHAIN, LHS, RHS) -
// Overflow-aware node for arithmetic operations. This node takes two
// operands: the normal lhs and rhs to the add. It produces two results: the
// normal result of the add, and a flag indicating whether an overflow
// occured. This node is generated from the llvm.sadd.with.overflow
// intrinsic. It is lowered by target-dependent code.
ADDO,
// Simple binary floating point operators.
FADD, FSUB, FMUL, FDIV, FREM,