[llvm-commits] [llvm] r63090 - in /llvm/trunk: lib/Target/X86/X86InstrInfo.td test/CodeGen/X86/smul-with-overflow-2.ll

Török Edwin edwintorok at gmail.com
Mon Feb 2 02:07:07 PST 2009


On 2009-01-27 05:30, Evan Cheng wrote:
> Author: evancheng
> Date: Mon Jan 26 21:30:42 2009
> New Revision: 63090
>
> URL: http://llvm.org/viewvc/llvm-project?rev=63090&view=rev
> Log:
> Implement multiple with overflow by 2 with an add instruction.
>
> +	%tmp1 = call { i32, i1 } @llvm.smul.with.overflow.i32(i32 %tmp0, i32 2)
>   

On 2008-12-03 04:43, Bill Wendling wrote:
> Author: void
> Date: Tue Dec  2 20:43:12 2008
> New Revision: 60460
>
> URL: http://llvm.org/viewvc/llvm-project?rev=60460&view=rev
> Log:
> Change label to 'carry' for unsigned adds.
>    %t = call {i32, i1} @llvm.uadd.with.overflow.i32(i32 %v1, i32 %v2)

What are the semantics of llvm.OP.with.overflow intrinsics that I keep
seeing lately? LangRef makes no mention of them.
For example how does llvm.uadd.with.overflow differ from a simple add?
According to LangRef overflow is defined for add: "If an integer sum has
unsigned overflow, the result returned is the mathematical result modulo
2^n , where n is the bit width of the result"

Best regards,
--Edwin




More information about the llvm-commits mailing list