[PATCH] D110579: [AMDGPU] Add two new intrinsics to control fp_trunc rounding mode

Serge Pavlov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 1 21:32:28 PST 2021


sepavloff added inline comments.


================
Comment at: llvm/include/llvm/IR/Intrinsics.td:914
+// Trunc a floating point number with a -inf rounding
+def int_experimental_fptrunc_round_downward : DefaultAttrsIntrinsic<[ llvm_anyfloat_ty ],
+                                                    [ llvm_anyfloat_ty ]>;
----------------
sepavloff wrote:
> What is the difference between this function and `llvm.floor`?
> 
> There are also functions `llvm.nearbyint` and `llvm.rint` that can be used to make rounding with any mode.
Oh, I see, this is conversion between floats.

There is `llvm.experimental.constrained.fptrunc`, which seems to do the same thing?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110579



More information about the llvm-commits mailing list