[LLVMdev] Checked arithmetic

Jonathan S. Shapiro shap at eros-os.com
Wed Mar 26 11:02:47 PDT 2008

On Wed, 2008-03-26 at 11:02 -0700, Chris Lattner wrote:
> On Wed, 26 Mar 2008, Jonathan S. Shapiro wrote:
> > I want to background process this for a bit, but it would be helpful to
> > discuss some approaches first.
> >
> > There would appear to be three approaches:
> >
> >  1. Introduce a CC register class into the IR. This seems to be a
> >     fairly major overhaul.
> >
> >  2. Introduce a set of scalar and fp computation quasi-instructions
> >     that accept the same arguments as their computational counterparts,
> >     but produce *only* the condition code. For example:
> Why not define an "add with overflow" intrinsic that returns its value and 
> overflow bit as an i1?


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.


More information about the llvm-dev mailing list