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
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
| Time | Test | |
|---|---|---|
| 60,030 ms | x64 debian > libFuzzer.libFuzzer::minimize_crash.test |
Event Timeline
| llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp | ||
|---|---|---|
| 925–933 | 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) | |
LGTM.
| llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp | ||
|---|---|---|
| 925 | You could use uppercase to keep consistency. | |
| llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp | ||
|---|---|---|
| 925 | Thanks, I will modify it. | |
| llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp | ||
|---|---|---|
| 925–952 | 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. | |
You could use uppercase to keep consistency.