[PATCH] D68810: Document rounding for llvm.lround and llvm.lrint
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 13 12:56:08 PST 2019
efriedma added inline comments.
================
Comment at: llvm/docs/LangRef.rst:12788
-The '``llvm.lrint.*``' intrinsics returns the operand rounded to the
-nearest integer.
+The '``llvm.lrint.*``' intrinsics return the operand rounded to the nearest
+integer.
----------------
kpn wrote:
> efriedma wrote:
> > craig.topper wrote:
> > > Doesn't lrint use the current rounding mode?
> > Sort of? I mean, in this context, we assume the "current rounding mode" is round-to-nearest-even.
> >
> > Probably worth clarifying what we mean by "nearest" here.
> We specify how rounding is done very rarely, and when we do we usually say "nearest integer" without mentioning the rounding mode.
>
> Do we want to change all references to "nearest integer" to state that the current rounding mode is used? Do we want a mention somewhere else to cover all uses?
We only use "nearest integer" in connection to rint/round/etc. In that context, it's not obvious to a casual reader what this means in the context of IEEE arithmetic.
In other contexts, floating-point arithmetic uses the default floating-point rounding mode; this is stated explicitly at http://llvm.org/docs/LangRef.html#floating-point-environment .
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D68810/new/
https://reviews.llvm.org/D68810
More information about the llvm-commits
mailing list