[PATCH] D55506: [RFC v2] Allow target to handle STRICT floating-point nodes

Cameron McInally via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 14 13:12:08 PST 2018


cameron.mcinally added a comment.

> Well, this is because I'm really only using this feature to handle exceptions (b.t.w. just like the MemOperands in the alternate attempt).
> 
> Rounding mode is handled completely in the back-end: we simply make all floating-point instructions (strict or not doesn't even matter here) use the FPC control register, and mark all instructions that change the rounding mode as changing FPC. The one missing piece is that we need to mark all function calls to functions marked as within FENV_ACCESS ON regions as also clobbering FPC -- that can be done easily in the target ABI code as soon as the front-end marks such function calls (which we need anyway).

Hm, I may be thinking about this a little differently. I'll elaborate to make sure we're on the same page...

I was envisioning a `-frounding-math`-like option that is more than just adhering to the current rounding mode. That option would also suppress optimizations affecting rounding results. This would be very much like how we use STRICT_ nodes to suppress optimizations on instructions that may trap. That's why I suggested that `mayRaiseException` and friends may be a little too narrow.

Is that how you are envisioning the rounding mode support to work too?


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

https://reviews.llvm.org/D55506





More information about the llvm-commits mailing list