[LLVMdev] why llvm does not have uadd, iadd node

kewuzhang kewu.zhang at amd.com
Tue Feb 17 11:03:16 PST 2015


Thank you very much!

best

keivn
On Feb 17, 2015, at 2:01 PM, Tim Northover <t.p.northover at gmail.com> wrote:

> Hi Kevin,
> 
> On 17 February 2015 at 10:41, kewuzhang <kewu.zhang at amd.com> wrote:
>> I just noticed that the LLVM has some node for signed/unsigned type( like udiv, sdiv), but why the ADD, SUB do not have the counter part sadd, uadd?
> 
> That's because in 2s complement arithmetic the bit pattern of the
> result doesn't depend on whether the operation is signed (unlike
> multiplication & division).
> 
> Cheers.
> 
> Tim.





More information about the llvm-dev mailing list