[PATCH] D54719: [Intrinsic] Signed Fixed Point Multiplication Intrinsic

Bevin Hansson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 4 03:39:24 PST 2018


ebevhan added inline comments.


================
Comment at: llvm/docs/LangRef.rst:12830
+value is rounded up or down to the closest representable value. The rounding
+direction is unspecified.
+
----------------
efriedma wrote:
> "The rounding direction is unspecified" seems scary to me... is there really no standard for rounding these operations?
The Embedded-C standard says that the rounding direction is implementation-defined, and is allowed to be indeterminable. 

I also think it's a bit unfortunate that we can't express the rounding direction, since it inhibits optimization, but locking it down to either rounding up or down will make things annoying for any target with operations that round the other direction.

Saying that it's unspecified lets us properly legalize this to something sensible while allowing targets to implement it with legal operations if they have them.

For what it's worth, the legalization will make it round down (toward negative infinity).


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54719/new/

https://reviews.llvm.org/D54719





More information about the llvm-commits mailing list