llvm-6502/utils/TableGen
Tom Stellard 898b9f020d TableGen: Generate a function for getting operand indices based on their defined names
This patch modifies TableGen to generate a function in
${TARGET}GenInstrInfo.inc called getNamedOperandIdx(), which can be used
to look up indices for operands based on their names.

In order to activate this feature for an instruction, you must set the
UseNamedOperandTable bit.

For example, if you have an instruction like:

def ADD : TargetInstr <(outs GPR:$dst), (ins GPR:$src0, GPR:$src1)>;

You can look up the operand indices using the new function, like this:

Target::getNamedOperandIdx(Target::ADD, Target::OpName::dst)  => 0
Target::getNamedOperandIdx(Target::ADD, Target::OpName::src0) => 1
Target::getNamedOperandIdx(Target::ADD, Target::OpName::src1) => 2

The operand names are case sensitive, so $dst and $DST are considered
different operands.

This change is useful for R600 which has instructions with a large number
of operands, many of which model single bit instruction configuration
values.  These configuration bits are common across most instructions,
but may have a different operand index depending on the instruction type.
It is useful to have a convenient way to look up the operand indices,
so these bits can be generically set on any instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184879 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-25 21:22:09 +00:00
..
AsmMatcherEmitter.cpp Handle tied sub-operands in AsmMatcherEmitter 2013-04-27 18:48:23 +00:00
AsmWriterEmitter.cpp This patch that sets the EmitAlias flag in td files 2013-02-05 08:32:10 +00:00
AsmWriterInst.cpp Remove exception handling usage from tblgen. 2012-10-25 20:33:17 +00:00
AsmWriterInst.h trailing whitespace cleanup 2010-10-11 19:38:01 +00:00
CallingConvEmitter.cpp Remove exception handling usage from tblgen. 2012-10-25 20:33:17 +00:00
CMakeLists.txt Add TableGen ctags(1) emitter and helper script. 2013-03-21 23:40:38 +00:00
CodeEmitterGen.cpp Sort the #include lines for utils/... 2012-12-04 10:37:14 +00:00
CodeGenDAGPatterns.cpp Allow types to be omitted in output patterns. 2013-03-24 19:37:00 +00:00
CodeGenDAGPatterns.h Make all unnamed RegisterClass TreePatternNodes typed MVT::i32. 2013-03-23 18:08:44 +00:00
CodeGenInstruction.cpp Sort the #include lines for utils/... 2012-12-04 10:37:14 +00:00
CodeGenInstruction.h Sort the #include lines for utils/... 2012-12-04 10:37:14 +00:00
CodeGenIntrinsics.h Sort the #include lines for utils/... 2012-12-04 10:37:14 +00:00
CodeGenMapTable.cpp Fix for bug 15246 -- out-of-bound error in the TableGen backend, CodeGenMapTable.cpp. 2013-02-14 17:58:13 +00:00
CodeGenRegisters.cpp Make SubRegIndex size mandatory, following r183020. 2013-05-31 23:45:26 +00:00
CodeGenRegisters.h Make SubRegIndex size mandatory, following r183020. 2013-05-31 23:45:26 +00:00
CodeGenSchedule.cpp Support BufferSize on ProcResGroup for unified MOp schedulers. 2013-06-15 04:50:06 +00:00
CodeGenSchedule.h Support BufferSize on ProcResGroup for unified MOp schedulers. 2013-06-15 04:50:06 +00:00
CodeGenTarget.cpp Use ArrayRef<MVT::SimpleValueType> when possible. 2013-03-17 17:26:09 +00:00
CodeGenTarget.h Use ArrayRef<MVT::SimpleValueType> when possible. 2013-03-17 17:26:09 +00:00
CTagsEmitter.cpp Add TableGen ctags(1) emitter and helper script. 2013-03-21 23:40:38 +00:00
DAGISelEmitter.cpp Write llvm-tblgen backends as functions instead of sub-classes. 2012-06-11 15:37:55 +00:00
DAGISelMatcher.cpp Sort the #include lines for utils/... 2012-12-04 10:37:14 +00:00
DAGISelMatcher.h Sort the #include lines for utils/... 2012-12-04 10:37:14 +00:00
DAGISelMatcherEmitter.cpp Fix comments 2013-02-05 16:53:11 +00:00
DAGISelMatcherGen.cpp Allow types to be omitted in output patterns. 2013-03-24 19:37:00 +00:00
DAGISelMatcherOpt.cpp Remove unused STL header includes. 2011-04-23 19:53:52 +00:00
DFAPacketizerEmitter.cpp Fix PR14568: Avoid the DFA packetizer from making an invalid read 2012-12-10 22:45:57 +00:00
DisassemblerEmitter.cpp Add AArch64 as an experimental target. 2013-01-31 12:12:40 +00:00
FastISelEmitter.cpp Recognize ValueType operands in source patterns for fast-isel. 2013-05-22 20:45:11 +00:00
FixedLenDecoderEmitter.cpp TableGen/FixedLenDecoderEmitter.cpp: Fix a potential mask overflow in fieldFromInstruction(). 2012-12-26 06:43:14 +00:00
InstrInfoEmitter.cpp TableGen: Generate a function for getting operand indices based on their defined names 2013-06-25 21:22:09 +00:00
IntrinsicEmitter.cpp Use the AttributeSet instead of AttributeWithIndex. 2013-01-27 03:25:05 +00:00
LLVMBuild.txt LLVMBuild: Remove trailing newline, which irked me. 2011-12-12 19:48:00 +00:00
Makefile Remove exception handling usage from tblgen. 2012-10-25 20:33:17 +00:00
OptParserEmitter.cpp Sort a few more #include lines in tools/... unittests/... and utils/... 2013-01-02 10:26:28 +00:00
PseudoLoweringEmitter.cpp PR14992 - Tablegen incorrectly converts ARM tLDMIA_UPD pseudo to tLDMIA 2013-02-13 19:21:47 +00:00
RegisterInfoEmitter.cpp Remove unimplemented definition. Found using [-Wunused-member-function]. 2013-06-06 17:52:45 +00:00
SequenceToOffsetTable.h Sort the #include lines for utils/... 2012-12-04 10:37:14 +00:00
SetTheory.cpp Sort the #include lines for utils/... 2012-12-04 10:37:14 +00:00
SetTheory.h Sort the #include lines for utils/... 2012-12-04 10:37:14 +00:00
StringToOffsetTable.h Sort the #include lines for utils/... 2012-12-04 10:37:14 +00:00
SubtargetEmitter.cpp Support BufferSize on ProcResGroup for unified MOp schedulers. 2013-06-15 04:50:06 +00:00
TableGen.cpp Add TableGen ctags(1) emitter and helper script. 2013-03-21 23:40:38 +00:00
TableGenBackends.h Add TableGen ctags(1) emitter and helper script. 2013-03-21 23:40:38 +00:00
tdtags Add TableGen ctags(1) emitter and helper script. 2013-03-21 23:40:38 +00:00
TGValueTypes.cpp Remove extra semicolons. 2012-10-11 22:25:56 +00:00
X86DisassemblerShared.h Sort the #include lines for utils/... 2012-12-04 10:37:14 +00:00
X86DisassemblerTables.cpp Sort the #include lines for utils/... 2012-12-04 10:37:14 +00:00
X86DisassemblerTables.h Sort the #include lines for utils/... 2012-12-04 10:37:14 +00:00
X86ModRMFilters.cpp Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch 2011-12-20 02:50:00 +00:00
X86ModRMFilters.h Fix Doxygen issues: 2012-09-13 12:34:29 +00:00
X86RecognizableInstr.cpp Add support for encoding the HLE XACQUIRE and XRELEASE prefixes. 2013-06-18 17:08:10 +00:00
X86RecognizableInstr.h Sort the #include lines for utils/... 2012-12-04 10:37:14 +00:00