[llvm-dev] x.with.overflow semantics question

Pete Cooper via llvm-dev llvm-dev at lists.llvm.org
Sun May 8 13:31:33 PDT 2016


Hi John

That matches my understanding. Otherwise I guess you'd be talking about a saturating operation.

Or do you mean that the result of an add may not even be defined? In that case would reading it be considered UB in the case where the overflow bit was set?

Cheers
Pete

Sent from my iPhone

> On May 8, 2016, at 1:22 PM, John Regehr via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> Philip Reames and I are debating the semantics of x.with.overflow and I wanted to see if I could get a ruling here:
> 
> My read of the langref is that the overflow bit and the result of the operation are independent of each other.  In other words, we can count on the result of add.with.overflow being the same as the result of a (non-nsw) add, even in the case where an overflow occurs.  Is that right?
> 
> Thanks!
> 
> John
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


More information about the llvm-dev mailing list