[PATCH] D54034: [RISCV] Add expansions for floating-point intrinsics

Alex Bradbury via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 2 08:16:07 PDT 2018


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

Thanks Luis, this looks good to me. Just a minor nitpick re OP -> Op.

Expanding FMA to a libcall is better than a compiler assertion, so it makes sense to add this as a minimal incremental improvement and then follow-up with a patch adding patterns for FMAs.



================
Comment at: lib/Target/RISCV/RISCVISelLowering.cpp:116
+  // (FMADD.S, FMSUB.S, FNMSUB.S, FNMADD.S).
+  ISD::NodeType FPOPToExtend[] = {
+      ISD::FSIN, ISD::FCOS, ISD::FSINCOS, ISD::FPOW, ISD::FMA};
----------------
Nitpick: should be FPOpToExtend


================
Comment at: lib/Target/RISCV/RISCVISelLowering.cpp:127
     setOperationAction(ISD::BR_CC, MVT::f32, Expand);
+    for (auto OP : FPOPToExtend)
+      setOperationAction(OP, MVT::f32, Expand);
----------------
OP -> Op


================
Comment at: lib/Target/RISCV/RISCVISelLowering.cpp:141
     setTruncStoreAction(MVT::f64, MVT::f32, Expand);
+    for (auto OP : FPOPToExtend)
+      setOperationAction(OP, MVT::f64, Expand);
----------------
OP -> Op


Repository:
  rL LLVM

https://reviews.llvm.org/D54034





More information about the llvm-commits mailing list