[PATCH] D136662: [VP][RISCV] Add vp.rint and RISC-V support.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 25 22:56:10 PDT 2022


craig.topper added a comment.

Please update the cost model in RISCVTargetTransformInfo.cpp and add test to llvm/test/Analysis/CostModel/RISCV/fround.ll



================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:1988
 // Expand vector FTRUNC, FCEIL, FFLOOR, FROUND, VP_FCEIL, VP_FFLOOR, VP_FROUND
-// VP_FROUNDEVEN and VP_FROUNDTOZERO by converting to the integer domain and
-// back. Taking care to avoid converting values that are nan or already correct.
+// VP_FROUNDEVEN, VP_FROUNDTOZERO and VP_RINT by converting to the integer
+// domain and back. Taking care to avoid converting values that are nan or
----------------
VP_RINT -> VP_FRINT


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:2008
   SDValue Mask, VL;
-  bool IsVP = Op->getOpcode() == ISD::VP_FCEIL ||
-              Op->getOpcode() == ISD::VP_FFLOOR ||
-              Op->getOpcode() == ISD::VP_FROUND ||
-              Op->getOpcode() == ISD::VP_FROUNDEVEN ||
-              Op->getOpcode() == ISD::VP_FROUNDTOZERO;
+  bool IsVP =
+      Op->getOpcode() == ISD::VP_FCEIL || Op->getOpcode() == ISD::VP_FFLOOR ||
----------------
Can we use Op->isVPOpcode()?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136662



More information about the llvm-commits mailing list