After D137316 implements the intrinsics of the first crc check instruction
and related diagnosis, this patch implements the intrinsics of all remaining
crc check instructions.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp | ||
---|---|---|
953–961 | Can we define a marco but not repeating similar codes? #define CRC_CASE(NAME, ISD) \ case Intrinsic::loongarch_#NAME: { \ Results.push_back(DAG.getNode( \ ISD::TRUNCATE, DL, VT, \ DAG.getNode(LoongArchISD::#ISD, DL, MVT::i64, \ DAG.getNode(ISD::ANY_EXTEND, DL, MVT::i64, Op2), \ DAG.getNode(ISD::ANY_EXTEND, DL, MVT::i64, Op3)))); \ Results.push_back(N->getOperand(0)); \ break; \ } Then CRC_CASE(crc_w_b_w, CRC_W_B_W) |
Comment Actions
LGTM.
llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp | ||
---|---|---|
953–980 | You could use uppercase to keep consistency. |
llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp | ||
---|---|---|
953–980 | Thanks, I will modify it. |
llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp | ||
---|---|---|
953–980 | Seems the difference is not binary op or unar op. They are both binary ops. The difference is that the former uses 2 ISD::ANY_EXTEND while the latter only use one. |
Can we define a marco but not repeating similar codes?
For example:
Then