[LLVMdev] Checked arithmetic

Chris Lattner sabre at nondot.org
Wed Mar 26 14:11:52 PDT 2008


On Wed, 26 Mar 2008, Jonathan S. Shapiro wrote:
>> Why not define an "add with overflow" intrinsic that returns its value and
>> overflow bit as an i1?
>
> Chris:
>
> I understand several simple ways to implement add with carry. Your
> suggestion is one of them. What I'm trying to understand is how to
> handle the conditional code issue generally.

I'm suggesting basically:

res,overflow = add_with_cary(a,b);
if (overflow) goto somewhere
use(res)

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list