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

David Majnemer david.majnemer at gmail.com
Tue Feb 17 11:10:15 PST 2015


A hypothetical 'uadd' would have the exact same behavior as 'sadd' when
using two's complement.  We need both 'udiv' and 'sdiv' because dividing
acts differently with negative numbers.  For example, dividing by 1 by
0b11111111111111111111111111111111 gives -1 for signed division and '0' for
unsigned division.

On Tue, Feb 17, 2015 at 10:41 AM, kewuzhang <kewu.zhang at amd.com> wrote:

> Hi guys,
>
> 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?
>
> best
>
> kevin
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150217/a73dd732/attachment.html>


More information about the llvm-dev mailing list