<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV><DIV>On Sep 21, 2007, at 6:18 PM, Dound wrote:</DIV><BLOCKQUOTE type="cite">I am a little confused by the results of the result of fptoui ... seems to conflict with the instructions semantics as defined in the language reference (<A href="http://llvm.org/docs/LangRef.html#i_fptoui" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://llvm.org/docs/LangRef.html#i_fptoui </A>):<BR><BR>  %tmp1001 = fptoui float 1.0E+300 to i1   ; % yields tmp1001 = 0 on my machine! <BR><BR>but the ref says:<BR><BR>   %Y = fptoui float 1.0E+300 to i1     ; yields i1:true<BR></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV>This is a bug in LangRef.html.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Originally, "cast to bool" was defined as a comparison against zero.  Now, we expect you do to a comparison against zero, like this:</DIV><BR><BLOCKQUOTE type="cite">(checked the return value with ... icmp eq i1 %tmp1001, 0 ... it is returning true)<BR></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV>if you want those semantics.  This freed us to make the semantics of fptoui not have to special case bool (which has become i1).  The semantics of fptoui are that the result is undefined if the input doesn't fit into the result as an unsigned value.  </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I'll update the docs, thanks!</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>-Chris</DIV><BR><BLOCKQUOTE type="cite">Any ideas?  Probably a really dumb mistake on my part, but it certainly seems to me like it doesn't follow what the manual says.  I am using LLVM 2.0.<BR><BR><BR>Thanks ~ David<BR><BR><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">LLVM Developers mailing list</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</A> <SPAN class="Apple-converted-space">        </SPAN><A href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</A></DIV> </BLOCKQUOTE></DIV><BR></BODY></HTML>