[llvm-commits] [llvm] r59756 - /llvm/trunk/include/llvm/Intrinsics.td

Duncan Sands baldrick at free.fr
Fri Nov 21 00:42:23 PST 2008


Hi Bill,

> 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.

are these really needed?  Suppose you want to do 32 bit addition of x and y.
Zero extend x and y to i33.  Do the addition in i33 and check the top bit.
If it is non-zero then there was a carry/overflow.  In codegen this gets turned
into an ADDC node (sounds a lot like your ADDO node...), and on x86 at least
turns by magic into a check on the carry flag.  So at first glance it seems that
everything is already supported.

Ciao,

Duncan.



More information about the llvm-commits mailing list