[llvm-commits] [llvm] r76810 - in /llvm/trunk: docs/LangRef.html lib/AsmParser/LLLexer.cpp lib/AsmParser/LLParser.cpp lib/AsmParser/LLToken.h lib/VMCore/AsmWriter.cpp test/Assembler/flags-reversed.ll test/Assembler/flags-signed.ll test/Assembler/flags-unsigned.ll test/Assembler/flags.ll

Nick Lewycky nicholas at mxc.ca
Wed Jul 22 22:09:32 PDT 2009


Dan Gohman wrote:
> Author: djg
> Date: Wed Jul 22 17:44:56 2009
> New Revision: 76810
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=76810&view=rev
> Log:
> Rename the new unsigned and signed keywords to nuw and nsw,
> which stand for no-unsigned-wrap and no-signed-wrap.

Thanks Dan, I much prefer the nsw and nuw for there terseness in spite 
of their inscrutability.

> -<p>If the <tt>signed</tt> and/or <tt>unsigned</tt> keywords are present,
> -   the result value of the <tt>add</tt> is undefined if signed and/or unsigned
> -   overflow, respectively, occurs.</p>
> +<p><tt>nuw</tt> and <tt>nsw</tt> stand for "No Unsigned Wrap"
> +   and "No Signed Wrap", respectively. If the <tt>nuw</tt> and/or
> +   <tt>nsw</tt> keywords are present, the result value of the <tt>add</tt>
> +   is undefined if unsigned and/or signed overflow, respectively, occurs.</p>

I just want to be certain that I grok the intended semantics here. Given:

   %A = add nuw i8 %x, %y
   %B = add nsw i8 %x, %y
   %C1 = icmp uge i8 %A, %x
   %C2 = icmp uge i8 %A, %y
   %D1 = icmp sge i8 %A, %x
   %D2 = icmp sge i8 %A, %y

may we state that %C1, %C2, %D1 and %D2 are all true?

Nick




More information about the llvm-commits mailing list