This adds lowering rules for the llvm.readcyclecounter intrinsic along with a codegen test for the ARC backend. To perform the lowering, we needed to generate the LR (Load from Auxiliary Register) instruction to read from the COUNT0 timer register (which has number 33 or 0x22). Thus, this patch also adds support for the LR instruction with both LR_rs12 and LR_ru6 immediate formats along with custom disassembler code and tests.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/ARC/ARCISelLowering.cpp | ||
---|---|---|
172 | Please use setOperationAction(ISD::READCYCLECOUNTER,MVT::i64, isTypeLegal(MVT::i64)?Legal:Custom); | |
llvm/lib/Target/ARC/ARCInstrFormats.td | ||
417 | Can this one be DecodeSOPwithRS12? | |
439 | Can this one be DecodeSOPwithRU6? | |
llvm/lib/Target/ARC/Disassembler/ARCDisassembler.cpp | ||
322 | I'd rather see you use two separate functions: DecodeSOPwithRU6 and DecodeSOPwithRS12 |
Separate S12 and U6 single operand decoding into different methods. Check legality of i64 in ARCISelLowering.
Please use