[PATCH] D97130: [RISCV] Have sexti32 also recognize AssertZExt from types smaller than i32.

Luís Marques via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 22 14:12:54 PST 2021


luismarques accepted this revision.
luismarques added a comment.
This revision is now accepted and ready to land.

Makes sense to me.



================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfoF.td:403
 // [u]int->fp. Match GCC and default to using dynamic rounding mode.
-def : Pat<(sint_to_fp (i64 (sexti32 GPR:$rs1))), (FCVT_S_W $rs1, 0b111)>;
+def : Pat<(sint_to_fp (i64 (sexti32 i64:$rs1))), (FCVT_S_W $rs1, 0b111)>;
 def : Pat<(uint_to_fp (i64 (zexti32 GPR:$rs1))), (FCVT_S_WU $rs1, 0b111)>;
----------------
craig.topper wrote:
> The i64 instead of GPR here tricks tablegen into not generating extra patterns for RV32.
I think there would be a benefit in adding this as a code comment. In at least one of the tablegen files, if not all of them.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97130



More information about the llvm-commits mailing list