[PATCH] D149063: [RISCV] Custom lowering of llvm.is.fpclass

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 24 11:05:42 PDT 2023


craig.topper added a comment.

Can you add double and half to this patch? Doesn't seem like it would require very much additional code.



================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:4170
+  case ISD::IS_FPCLASS: {
+    SDLoc DL(Op);
+    MVT VT = Op.getSimpleValueType();
----------------
Please put this in a separate function. We need to stop putting so much code into this switch.


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfo.h:270
+const unsigned FPMASK_Negative_Normal = 0x002;
+const unsigned FPMASK_Negative_Infinity = 0x001;
 } // namespace RISCV
----------------
Can you reverse the order here so we start with the least significant bit first.


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfoF.td:33
+def SDT_RISCVFPCLASS
+    : SDTypeProfile<1, 1, [SDTCisVT<0, XLenVT>, SDTCisVT<1, f32>]>;
+
----------------
Don't use f32 here, you're going to need to change it for double and half. Just use SDTCisFP<1>


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149063



More information about the llvm-commits mailing list