[PATCH] D115997: [RISCV] Support strict FP conversion operations.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 22 06:36:04 PST 2021


craig.topper added a comment.

In D115997#3206395 <https://reviews.llvm.org/D115997#3206395>, @luismarques wrote:

> Is it out of scope of this patch to check the rounding mode metadata argument? I've checked that changing the r.m. in a test case of e.g. fptrunc doesn't do anything, it just keeps emitting an fcvt with dynamic rounding. It's probably a good idea to add a short note describing the status/limitations of that to the tests / code / commit message, as appropriate.

Rounding mode doesn't make it through SelectionDAGBuilder so isel can't use it. I think the metadata is intended to convey the compiler's knowledge about the most recent call to fesetround for constant folding purposes. (Though I don't think that information is captured at all today.) It is not intended to select static rounding mode. The dynamic mode was already updated so using a static instruction wouldn't do much unless the compiler was able to optimize out the dynamic change if all operations were able to use static rounding mode instruction.

I can add comments for this.

> Nit: is there any reason for not using a hard-float ABI in the tests? It seems like we could cut down on the loads/conversion noise in the tests. This probably also applies to D115680 <https://reviews.llvm.org/D115680>.

Command lines and test case names came from the equivalent test files without "-strict". I only added the `-disable-strictnode-mutation` to make sure isel would fail if STRICT nodes were not handled. I diffed the files during patch development to make sure the same code was produced for the equivalent test without constrained intrinsics.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115997



More information about the llvm-commits mailing list