[PATCH] D138418: [LoongArch] Add remaining intrinsics for CRC check instructions

Gong LingQin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 22 23:39:27 PST 2022


gonglingqin added inline comments.


================
Comment at: llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp:925
       llvm_unreachable("Unexpected Intrinsic.");
-    case Intrinsic::loongarch_crc_w_d_w: {
-      Results.push_back(DAG.getNode(
-          ISD::TRUNCATE, DL, N->getValueType(0),
-          DAG.getNode(
-              LoongArchISD::CRC_W_D_W, DL, MVT::i64, N->getOperand(2),
-              DAG.getNode(ISD::ANY_EXTEND, DL, MVT::i64, N->getOperand(3)))));
-      Results.push_back(N->getOperand(0));
-      break;
-    }
+#define CRC_CASE_EXT_TWOOP(NAME, NODE)                                         \
+  case Intrinsic::loongarch_##NAME: {                                          \
----------------
xen0n wrote:
> What's a "two op", are you meaning "binary op" instead?
Yes, thank you for your correction!


================
Comment at: llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp:942
+
+#define CRC_CASE_EXT_ONEOP(NAME, NODE)                                         \
+  case Intrinsic::loongarch_##NAME: {                                          \
----------------
xen0n wrote:
> Similarly, is this actually "unary op"?
Thanks a lot! I will modify it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138418



More information about the llvm-commits mailing list