Skip to content
Snippets Groups Projects
Commit 3d9cdd44 authored by Bill Wendling's avatar Bill Wendling
Browse files

Introduce two new "add" intrinsics. These return the sum plus a bit indicating

that an overflow/carry occured. These are converted into ISD::[SU]ADDO nodes,
which are lowered in a target-independent way into something sane. Eventually,
each target can implement their own method of checking the overflow/carry flags.

llvm-svn: 59756
parent 50ff154e
No related branches found
No related tags found
No related merge requests found
......@@ -314,6 +314,15 @@ def int_init_trampoline : Intrinsic<[llvm_ptr_ty],
[]>,
GCCBuiltin<"__builtin_init_trampoline">;
//===------------------------ Overflow Intrinsics -------------------------===//
//
// Expose the carry flag from add operations on two integrals.
def int_sadd_with_overflow : Intrinsic<[llvm_anyint_ty, llvm_i1_ty],
[LLVMMatchType<0>, LLVMMatchType<0>]>;
def int_uadd_with_overflow : Intrinsic<[llvm_anyint_ty, llvm_i1_ty],
[LLVMMatchType<0>, LLVMMatchType<0>]>;
//===------------------------- Atomic Intrinsics --------------------------===//
//
def int_memory_barrier : Intrinsic<[llvm_void_ty],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment