2011-11-02 13:03:06 +08:00
|
|
|
set(LLVM_LINK_COMPONENTS Support)
|
2010-10-17 10:26:16 +08:00
|
|
|
|
2011-10-06 09:51:51 +08:00
|
|
|
add_tablegen(llvm-tblgen LLVM
|
2009-07-12 05:53:14 +08:00
|
|
|
AsmMatcherEmitter.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
AsmWriterEmitter.cpp
|
2010-02-10 06:29:16 +08:00
|
|
|
AsmWriterInst.cpp
|
2015-11-12 04:35:42 +08:00
|
|
|
Attributes.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
CallingConvEmitter.cpp
|
|
|
|
CodeEmitterGen.cpp
|
|
|
|
CodeGenDAGPatterns.cpp
|
2017-09-15 00:56:21 +08:00
|
|
|
CodeGenHwModes.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
CodeGenInstruction.cpp
|
2012-10-25 23:57:56 +08:00
|
|
|
CodeGenMapTable.cpp
|
2011-06-10 02:42:07 +08:00
|
|
|
CodeGenRegisters.cpp
|
2012-07-07 12:00:00 +08:00
|
|
|
CodeGenSchedule.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
CodeGenTarget.cpp
|
|
|
|
DAGISelEmitter.cpp
|
2010-02-15 16:04:42 +08:00
|
|
|
DAGISelMatcherEmitter.cpp
|
|
|
|
DAGISelMatcherGen.cpp
|
2010-02-24 15:06:50 +08:00
|
|
|
DAGISelMatcherOpt.cpp
|
2010-02-15 16:04:42 +08:00
|
|
|
DAGISelMatcher.cpp
|
2011-12-02 05:53:39 +08:00
|
|
|
DFAPacketizerEmitter.cpp
|
2009-11-25 10:13:23 +08:00
|
|
|
DisassemblerEmitter.cpp
|
2009-03-17 01:04:14 +08:00
|
|
|
FastISelEmitter.cpp
|
2011-02-19 06:06:23 +08:00
|
|
|
FixedLenDecoderEmitter.cpp
|
2016-12-22 07:26:20 +08:00
|
|
|
GlobalISelEmitter.cpp
|
2017-09-15 00:56:21 +08:00
|
|
|
InfoByHwMode.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
InstrInfoEmitter.cpp
|
2017-11-14 23:35:15 +08:00
|
|
|
InstrDocsEmitter.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
IntrinsicEmitter.cpp
|
2012-12-05 08:29:32 +08:00
|
|
|
OptParserEmitter.cpp
|
2011-07-09 01:36:35 +08:00
|
|
|
PseudoLoweringEmitter.cpp
|
[RISCV] Tablegen-driven Instruction Compression.
Summary:
This patch implements a tablegen-driven Instruction Compression
mechanism for generating RISCV compressed instructions
(C Extension) from the expanded instruction form.
This tablegen backend processes CompressPat declarations in a
td file and generates all the compile-time and runtime checks
required to validate the declarations, validate the input
operands and generate correct instructions.
The checks include validating register operands, immediate
operands, fixed register operands and fixed immediate operands.
Example:
class CompressPat<dag input, dag output> {
dag Input = input;
dag Output = output;
list<Predicate> Predicates = [];
}
let Predicates = [HasStdExtC] in {
def : CompressPat<(ADD GPRNoX0:$rs1, GPRNoX0:$rs1, GPRNoX0:$rs2),
(C_ADD GPRNoX0:$rs1, GPRNoX0:$rs2)>;
}
The result is an auto-generated header file
'RISCVGenCompressEmitter.inc' which exports two functions for
compressing/uncompressing MCInst instructions, plus
some helper functions:
bool compressInst(MCInst& OutInst, const MCInst &MI,
const MCSubtargetInfo &STI,
MCContext &Context);
bool uncompressInst(MCInst& OutInst, const MCInst &MI,
const MCRegisterInfo &MRI,
const MCSubtargetInfo &STI);
The clients that include this auto-generated header file and
invoke these functions can compress an instruction before emitting
it, in the target-specific ASM or ELF streamer, or can uncompress
an instruction before printing it, when the expanded instruction
format aliases is favored.
The following clients were added to implement compression\uncompression
for RISCV:
1) RISCVAsmParser::MatchAndEmitInstruction:
Inserted a call to compressInst() to compresses instructions
parsed by llvm-mc coming from an ASM input.
2) RISCVAsmPrinter::EmitInstruction:
Inserted a call to compressInst() to compress instructions that
were lowered from Machine Instructions (MachineInstr).
3) RVInstPrinter::printInst:
Inserted a call to uncompressInst() to print the expanded
version of the instruction instead of the compressed one (e.g,
add s0, s0, a5 instead of c.add s0, a5) when -riscv-no-aliases
is not passed.
This patch squashes D45119, D42780 and D41932. It was reviewed in smaller patches by
asb, efriedma, apazos and mgrang.
Reviewers: asb, efriedma, apazos, llvm-commits, sabuasal
Reviewed By: sabuasal
Subscribers: mgorny, eraman, asb, rbar, johnrusso, simoncook, jordy.potman.lists, apazos, niosHD, kito-cheng, shiva0217, zzheng
Differential Revision: https://reviews.llvm.org/D45385
llvm-svn: 329455
2018-04-07 05:07:05 +08:00
|
|
|
RISCVCompressInstEmitter.cpp
|
Re-commit: [globalisel] Tablegen-erate current Register Bank Information
Summary:
Adds a RegisterBank tablegen class that can be used to declare the register
banks and an associated tablegen pass to generate the necessary code.
Changes since first commit attempt:
* Added missing guards
* Added more missing guards
* Found and fixed a use-after-free bug involving Twine locals
Reviewers: t.p.northover, ab, rovka, qcolombet
Reviewed By: qcolombet
Subscribers: aditya_nandakumar, rengolin, kristof.beyls, vkalintiris, mgorny, dberris, llvm-commits, rovka
Differential Revision: https://reviews.llvm.org/D27338
llvm-svn: 292478
2017-01-19 19:15:55 +08:00
|
|
|
RegisterBankEmitter.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
RegisterInfoEmitter.cpp
|
2017-12-21 03:36:28 +08:00
|
|
|
SDNodeProperties.cpp
|
2016-07-06 05:23:04 +08:00
|
|
|
SearchableTableEmitter.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
SubtargetEmitter.cpp
|
2016-11-15 17:51:02 +08:00
|
|
|
SubtargetFeatureInfo.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
TableGen.cpp
|
2016-11-19 20:21:34 +08:00
|
|
|
Types.cpp
|
2009-12-19 10:59:52 +08:00
|
|
|
X86DisassemblerTables.cpp
|
2017-03-07 16:11:19 +08:00
|
|
|
X86EVEX2VEXTablesEmitter.cpp
|
2017-10-08 17:20:32 +08:00
|
|
|
X86FoldTablesEmitter.cpp
|
2011-12-20 16:42:11 +08:00
|
|
|
X86ModRMFilters.cpp
|
2009-12-19 10:59:52 +08:00
|
|
|
X86RecognizableInstr.cpp
|
2018-05-11 06:16:44 +08:00
|
|
|
WebAssemblyDisassemblerEmitter.cpp
|
2013-03-22 07:40:38 +08:00
|
|
|
CTagsEmitter.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
)
|
2017-11-05 04:07:16 +08:00
|
|
|
set_target_properties(llvm-tblgen PROPERTIES FOLDER "Tablegenning")
|