[PATCH] D137954: Enable roundeven.

Leon Clark via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 19 01:16:56 PST 2022


Leonc added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp:1195
+  case ISD::FROUNDEVEN:
+    return LowerFROUND(Op, DAG);
   case ISD::FROUND: return LowerFROUND(Op, DAG);
----------------
arsenm wrote:
> I'm perpetually confused by the variety of rounding functions.
> 
> llvm.rint => round to nearest integer, in current rounding mode (which is assumed to be round nearest even), which is implied by being non-constrained
> llvm.nearbyint => same as llvm.rint, except no FP exceptions. FP exceptions aren't supported with non-constrained intrinsics, so this distinction is pointless
> 
> llvm.round -> round, away from 0
> llvm.roundeven -> round halfway nearest 0
> 
> 
> so I think this isn't the same as round, but is supposed to be the same as llvm.rint (which we have 3 different names for)
I thought `llvm.roundeven` is supposed to always round to nearest even regardless of the rounding mode. Does our implementation of `llvm.rint` ignore the rounding mode?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137954



More information about the llvm-commits mailing list