[PATCH] D110312: [X86][ISel] setOperationAction for FROUND(f16) and FROUNDEVEN(f16)

Freddy, Ye via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 26 01:11:29 PDT 2021


FreddyYe added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:1954-1957
+    setOperationAction(ISD::STRICT_FROUND,        MVT::f16, Custom);
+    setOperationAction(ISD::FROUND,               MVT::f16, Custom);
+    setOperationAction(ISD::FROUNDEVEN,           MVT::f16, Legal);
+    setOperationAction(ISD::STRICT_FROUNDEVEN,    MVT::f16, Legal);
----------------
pengfei wrote:
> How about the vector type?
For now, vector expands to vrndscalesh. While vrndscaleph can be emited. I'll refine, too.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:22503
 static SDValue LowerFROUND(SDValue Op, SelectionDAG &DAG) {
+  if (Op.getOpcode() == ISD::STRICT_FROUND &&
+      Op.getSimpleValueType() == MVT::f16)
----------------
pengfei wrote:
> Can we customize `STRICT_FROUND` here too? I think you just need to chain the FP nodes togerther.
@craig.topper created this function originally. He mentions 

> Constrained intrinsics would use STRICT_FROUND which won't go through this code.

 at https://reviews.llvm.org/D73607. Hi Craig, can we chain the FP nodes here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110312



More information about the llvm-commits mailing list