[PATCH] D128899: [LoongArch] Add codegen support for fpround, fpextend and converting between signed integer and floating-point

WÁNG Xuěruì via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 1 11:19:16 PDT 2022


xen0n added inline comments.


================
Comment at: llvm/lib/Target/LoongArch/LoongArchFloat32InstrInfo.td:17-20
+def SDT_LoongArchMOVGR2FR_W_LA64
+    : SDTypeProfile<1, 1, [SDTCisVT<0, f32>, SDTCisVT<1, i64>]>;
+def SDT_LoongArchMOVFR2GR_S_LA64
+    : SDTypeProfile<1, 1, [SDTCisVT<0, i64>, SDTCisVT<1, f32>]>;
----------------
Actually I don't quite get why this needs to be different just for LA64. Isn't the behavior for these two insns identical between LA32 and LA64?


================
Comment at: llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp:131-133
+    SDValue FPConv =
+        DAG.getNode(LoongArchISD::MOVGR2FR_W_LA64, DL, MVT::f32, NewOp0);
+    return FPConv;
----------------



================
Comment at: llvm/lib/Target/LoongArch/LoongArchISelLowering.h:38
 
+  // FP to int conversions
+  MOVGR2FR_W_LA64,
----------------
`movgr2fr` is definitely not "FP to int". Maybe this comment should be fixed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128899



More information about the llvm-commits mailing list