<div dir="ltr"><div>Regardless of whether "rounding towards zero" is a term of art, putting it in parentheses creates confusion. Parenthetical phrases should be used to provide additional but non-essential information to a sentence. If striking out a parenthetical expression changes the meaning of the sentence, then it shouldn't have been parenthetical.<br></div><div><br></div><div>> The ‘<code>fptosi</code>’ instruction converts its <a href="http://llvm.org/docs/LangRef.html#t-floating" target="_blank">floating-point</a> operand into the nearest <strike>(rounding towards zero)</strike> signed integer value.<br></div><div><div><br></div><div>The remaining sentence is not only different than what was intended, but it is also false.</div><div><br></div><div><div>> The ‘<code>fptosi</code>’ instruction converts its <a href="http://llvm.org/docs/LangRef.html#t-floating" target="_blank">floating-point</a> operand into the nearest signed integer value whose absolute value is not larger than the floating-point operand (i.e., it rounds towards zero).<br></div><div><br></div><div>By the way, parenthetical phrases aren't always inside parentheses. Sometimes they are set off with commas or dashes instead.</div><div><div></div></div></div><div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Sep 4, 2020 at 12:40 PM Steve (Numerics) Canon via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;"><div><blockquote type="cite"><div>On Sep 4, 2020, at 2:40 PM, Neil Nelson via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><div><blockquote type="cite" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div dir="ltr"><div>If fptosi takes 0.9 -> 0, then that is not 'rounding' in any sense I'm aware of (IEEE754 or otherwise). </div><div>Rounding (in the IEE754 sense) determines how a number is converted when it is halfway between two</div><div>candidate results. (see round(), ceil(), floor()).</div></div></blockquote></div></blockquote><br></div><div>Rounding in the IEEE 754 sense is simply an algorithm to choose one of the two closest values from some set. It does not only concern how halfway cases are handled. There are a number of rounding attributes defined by IEEE 754:</div><div><br></div><div>- round to nearest, ties to even (default rounding)</div><div>- round to nearest, ties away from zero (only for decimal)</div><div>- round to nearest, ties toward zero (used only for augmented addition)</div><div>- round up</div><div>- round down</div><div>- round toward zero</div><div><br></div><div>The last of these is the rounding mode under discussion on this thread. Note that the first three have to specify how halfway cases are handled (“ties to …”), but the latter three do not (because the result is constant across the interval between any two values, so there is not change at “halfway”).</div><div><br></div><div>– Steve</div></div>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>