llvm-project/llvm/utils/TableGen
Bruno Cardoso Lopes 2315beba24 Implement support for custom target specific asm parsing of operands.
Motivation: Improve the parsing of not usual (different from registers or
immediates) operand forms.

This commit implements only the generic support. The ARM specific modifications
will come next.

A table like the one below is autogenerated for every instruction
containing a 'ParserMethod' in its AsmOperandClass

static const OperandMatchEntry OperandMatchTable[20] = {
 /* Mnemonic, Operand List Mask, Operand Class, Features */
 { "cdp", 29 /* 0, 2, 3, 4 */, MCK_Coproc, Feature_IsThumb|Feature_HasV6 },
 { "cdp", 58 /* 1, 3, 4, 5 */, MCK_Coproc, Feature_IsARM },

A matcher function very similar (but lot more naive) to
MatchInstructionImpl scans the table. After the mnemonic match, the
features are checked and if the "to be parsed" operand index is
present in the mask, there's a real match. Then, a switch like the one
below dispatch the parsing to the custom method provided in
'ParseMethod':

 case MCK_Coproc:
   return TryParseCoprocessorOperandName(Operands);

llvm-svn: 125030
2011-02-07 19:38:32 +00:00
..
ARMDecoderEmitter.cpp Add support for parsing and encoding ARM's official syntax for the BFI instruction 2011-01-18 20:45:56 +00:00
ARMDecoderEmitter.h I swear I did a make clean and make before committing all this... 2010-11-29 18:47:54 +00:00
AsmMatcherEmitter.cpp Implement support for custom target specific asm parsing of operands. 2011-02-07 19:38:32 +00:00
AsmMatcherEmitter.h Stub out assembly matcher (.s -> MCInst) tblgen backend. 2009-07-11 19:39:44 +00:00
AsmWriterEmitter.cpp eliminate the Records global variable, patch by Garrison Venn! 2010-12-13 00:23:57 +00:00
AsmWriterEmitter.h enhance llvm-mc -show-inst to print the enum of an instruction, like so: 2010-02-11 22:57:32 +00:00
AsmWriterInst.cpp factor the operand list (and related fields/operations) out of 2010-11-01 04:03:32 +00:00
AsmWriterInst.h trailing whitespace cleanup 2010-10-11 19:38:01 +00:00
CMakeLists.txt Changes for building Clang and others using LLVM as an external 2011-02-03 20:57:36 +00:00
CallingConvEmitter.cpp In the calling convention logic, ValVT is always a legal type, 2010-11-04 10:49:57 +00:00
CallingConvEmitter.h Replace std::iostreams with raw_ostream in TableGen. 2009-07-03 00:10:29 +00:00
ClangASTNodesEmitter.cpp Allow for creation of clang DeclNodes tables. 2010-05-30 07:21:42 +00:00
ClangASTNodesEmitter.h eliminate the Records global variable, patch by Garrison Venn! 2010-12-13 00:23:57 +00:00
ClangAttrEmitter.cpp tblgen: Add support for non-inheritable attributes 2011-01-21 02:08:26 +00:00
ClangAttrEmitter.h Add a way to emit StringSwitch of clang attribute spellings. 2010-10-20 01:21:53 +00:00
ClangDiagnosticsEmitter.cpp Clang: separate the access-control diagnostics from other diagnostics that do not have SFINAE behavior. 2011-01-27 21:06:17 +00:00
ClangDiagnosticsEmitter.h Replace std::iostreams with raw_ostream in TableGen. 2009-07-03 00:10:29 +00:00
CodeEmitterGen.cpp Tidy up a bit. 2011-02-03 23:26:36 +00:00
CodeEmitterGen.h Move <map> include out of .h and into .cpp. 2010-12-13 01:05:54 +00:00
CodeGenDAGPatterns.cpp Silence uninitialized value warnings. 2011-02-04 17:01:53 +00:00
CodeGenDAGPatterns.h [AVX] Add type checking support for vector/subvector type constraints. 2011-01-24 20:53:18 +00:00
CodeGenInstruction.cpp Improve the AsmMatcher's ability to handle suboperands. 2011-01-26 19:44:55 +00:00
CodeGenInstruction.h Improve the AsmMatcher's ability to handle suboperands. 2011-01-26 19:44:55 +00:00
CodeGenIntrinsics.h Remove IntrWriteMem, as it's the default. Rename IntrWriteArgMem 2010-08-05 23:36:21 +00:00
CodeGenRegisters.h add (and document) the ability for alias results to have 2010-11-06 19:57:21 +00:00
CodeGenTarget.cpp Flag -> Glue, the ongoing saga 2010-12-23 18:28:41 +00:00
CodeGenTarget.h Flag -> Glue, the ongoing saga 2010-12-23 18:28:41 +00:00
DAGISelEmitter.cpp Stop emitting predicate functions. They are no longer used. 2010-09-03 00:39:50 +00:00
DAGISelEmitter.h Stop emitting predicate functions. They are no longer used. 2010-09-03 00:39:50 +00:00
DAGISelMatcher.cpp Flag -> Glue, the ongoing saga 2010-12-23 18:28:41 +00:00
DAGISelMatcher.h Flag -> Glue, the ongoing saga 2010-12-23 18:28:41 +00:00
DAGISelMatcherEmitter.cpp flags -> glue for selectiondag 2010-12-23 17:24:32 +00:00
DAGISelMatcherGen.cpp Flag -> Glue, the ongoing saga 2010-12-23 18:28:41 +00:00
DAGISelMatcherOpt.cpp Flag -> Glue, the ongoing saga 2010-12-23 18:28:41 +00:00
DisassemblerEmitter.cpp eliminate the Records global variable, patch by Garrison Venn! 2010-12-13 00:23:57 +00:00
DisassemblerEmitter.h Sketch TableGen disassembler emitter, based on patch by Sean Callanan. 2009-11-25 02:13:23 +00:00
EDEmitter.cpp Teach ARM/MC/ELF to handle R_ARM_JUMP24 relocation type for conditional jumps. 2011-02-04 19:47:15 +00:00
EDEmitter.h remove option from tablegen for building static header. 2010-07-20 19:45:21 +00:00
FastISelEmitter.cpp Add source Record* reference to PatternToMatch. Allows better diagnostics. 2010-12-07 23:05:49 +00:00
FastISelEmitter.h Replace std::iostreams with raw_ostream in TableGen. 2009-07-03 00:10:29 +00:00
InstrEnumEmitter.cpp eliminate the Records global variable, patch by Garrison Venn! 2010-12-13 00:23:57 +00:00
InstrEnumEmitter.h Replace std::iostreams with raw_ostream in TableGen. 2009-07-03 00:10:29 +00:00
InstrInfoEmitter.cpp Remove ARM isel hacks that fold large immediates into a pair of add, sub, and, 2010-11-17 20:13:28 +00:00
InstrInfoEmitter.h Replace TSFlagsFields and TSFlagsShifts with a simpler TSFlags field. 2010-04-05 03:10:20 +00:00
IntrinsicEmitter.cpp Rename AccessesArguments and AccessesArgumentsReadonly, and rewrite 2010-11-10 18:30:00 +00:00
IntrinsicEmitter.h Fixes for Microsoft Visual Studio 2010, from Steven Watanabe! 2010-05-11 06:17:44 +00:00
LLVMCConfigurationEmitter.cpp llvmc: make switch options ZeroOrMore by default. 2010-12-15 01:21:59 +00:00
LLVMCConfigurationEmitter.h various cleanups to tblgen, patch by Garrison Venn! 2010-12-15 04:48:22 +00:00
Makefile Merge System into Support. 2010-11-29 18:16:10 +00:00
NeonEmitter.cpp Use __builtin_shufflevector to implement vget_low and vget_high intrinsics. 2011-01-07 23:40:49 +00:00
NeonEmitter.h Add a Neon intrinsic test generator. 2010-12-15 16:58:45 +00:00
OptParserEmitter.cpp tblgen/OptParser: Use EmitSourceFileHeader. 2010-01-04 22:03:51 +00:00
OptParserEmitter.h TableGen: Add initial backend for clang Driver's option parsing. 2009-11-18 21:29:51 +00:00
Record.cpp Rename lisp-like functions as suggested by Gabor Greif as loooong time 2011-01-07 17:05:37 +00:00
Record.h Rename lisp-like functions as suggested by Gabor Greif as loooong time 2011-01-07 17:05:37 +00:00
RegisterInfoEmitter.cpp Introduce TargetRegisterInfo::getOverlaps(Reg), returning a list of all 2010-12-14 23:03:42 +00:00
RegisterInfoEmitter.h Replace std::iostreams with raw_ostream in TableGen. 2009-07-03 00:10:29 +00:00
StringMatcher.cpp fix a fixme in stringmatcher, having it generate nice looking code if the 2010-10-30 19:57:17 +00:00
StringMatcher.h allow specifying an indentation level for the string matcher. 2010-09-06 03:50:59 +00:00
StringToOffsetTable.h Use raw_ostream::write_escaped instead of EscapeString. 2009-10-17 20:43:19 +00:00
SubtargetEmitter.cpp eliminate the Records global variable, patch by Garrison Venn! 2010-12-13 00:23:57 +00:00
SubtargetEmitter.h Add support to model pipeline bypass / forwarding. 2010-09-28 23:50:49 +00:00
TGLexer.cpp Rename lisp-like functions as suggested by Gabor Greif as loooong time 2011-01-07 17:05:37 +00:00
TGLexer.h Rename lisp-like functions as suggested by Gabor Greif as loooong time 2011-01-07 17:05:37 +00:00
TGParser.cpp Rename lisp-like functions as suggested by Gabor Greif as loooong time 2011-01-07 17:05:37 +00:00
TGParser.h various cleanups to tblgen, patch by Garrison Venn! 2010-12-15 04:48:22 +00:00
TGValueTypes.cpp Add contexts to some of the MVT APIs. No functionality change yet, just the infrastructure work needed to get the contexts to where they need to be first. 2009-08-12 00:36:31 +00:00
TableGen.cpp Fix comment for gen-clang-decl-nodes tblgen backend, from Michael Han 2011-01-19 15:57:47 +00:00
TableGenBackend.cpp Replace std::iostreams with raw_ostream in TableGen. 2009-07-03 00:10:29 +00:00
TableGenBackend.h Replace std::iostreams with raw_ostream in TableGen. 2009-07-03 00:10:29 +00:00
X86DisassemblerShared.h fix build and while at it remove a redudant include 2009-12-19 11:52:18 +00:00
X86DisassemblerTables.cpp Constify another 2 disassembler tables. 2010-10-23 09:28:42 +00:00
X86DisassemblerTables.h Table-driven disassembler for the X86 architecture (16-, 32-, and 64-bit 2009-12-19 02:59:52 +00:00
X86ModRMFilters.h I swear I did a make clean and make before committing all this... 2010-11-29 18:47:54 +00:00
X86RecognizableInstr.cpp In Thumb2, direct branches can be encoded as either a "short" conditional branch with a null predicate, or 2010-12-13 19:31:11 +00:00
X86RecognizableInstr.h I swear I did a make clean and make before committing all this... 2010-11-29 18:47:54 +00:00