[llvm-commits] [llvm] r59756 - /llvm/trunk/include/llvm/Intrinsics.td
Bill Wendling
isanbard at gmail.com
Thu Nov 20 16:05:33 PST 2008
Author: void
Date: Thu Nov 20 18:05:31 2008
New Revision: 59756
URL: http://llvm.org/viewvc/llvm-project?rev=59756&view=rev
Log:
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.
Modified:
llvm/trunk/include/llvm/Intrinsics.td
Modified: llvm/trunk/include/llvm/Intrinsics.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Intrinsics.td?rev=59756&r1=59755&r2=59756&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Intrinsics.td (original)
+++ llvm/trunk/include/llvm/Intrinsics.td Thu Nov 20 18:05:31 2008
@@ -314,6 +314,15 @@
[]>,
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],
More information about the llvm-commits
mailing list