1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 04:22:57 +02:00
llvm-mirror/utils/TableGen
Petr Pavlu 4f9907e752 [TableGen] Improve decoding options for non-orthogonal instructions
When FixedLenDecoder matches an input bitpattern of form [01]+ with an
instruction bitpattern of form [01?]+ (where 0/1 are static bits and ? are
mixed/variable bits) it passes the input bitpattern to a specific instruction
decoder method which then makes a final decision whether the bitpattern is a
valid instruction or not. This means the decoder must handle all possible
values of the variable bits which sometimes leads to opcode rewrites in the
decoder method when the instructions are not fully orthogonal.

The patch provides a way for the decoder method to say that when it returns
Fail it does not necessarily mean the bitpattern is invalid, but rather that
the bitpattern is definitely not an instruction that is recognized by the
decoder method. The decoder can then try to match the input bitpattern with
other possible instruction bitpatterns.

For example, this allows to solve a situation on AArch64 where the `MSR
(immediate)` instruction has form:
1101 0101 0000 0??? 0100 ???? ???1 1111
but not all values of the ? bits are allowed. The rejected values should be
handled by the `extended MSR (register)` instruction:
1101 0101 000? ???? ???? ???? ???? ????

The decoder will first try to decode an input bitpattern that matches both
bitpatterns as `MSR (immediate)` but currently this puts the decoder method of
`MSR (immediate)` into a situation when it must be able to decode all possible
values of the ? bits, i.e. it would need to rewrite the instruction to `MSR
(register)` when it is not `MSR (immediate)`.

The patch allows to specify that the decoder method cannot determine if the
instruction is valid for all variable values. The decoder method can simply
return Fail when it knows it is definitely not `MSR (immediate)`. The decoder
will then backtrack the decoding and find that it can match the input
bitpattern with the more generic `MSR (register)` bitpattern too.

Differential Revision: http://reviews.llvm.org/D7174

llvm-svn: 242274
2015-07-15 08:04:27 +00:00
..
AsmMatcherEmitter.cpp Reverting r241058 because it's causing buildbot failures. 2015-06-30 12:32:53 +00:00
AsmWriterEmitter.cpp Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types 2015-05-29 19:43:39 +00:00
AsmWriterInst.cpp Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types 2015-05-29 19:43:39 +00:00
AsmWriterInst.h [MCInstPrinter] Enable MCInstPrinter to change its behavior based on the 2015-03-27 20:36:02 +00:00
CallingConvEmitter.cpp [TableGen] Rename ListInit::getSize to just 'size' to be more consistent. 2015-06-02 04:15:57 +00:00
CMakeLists.txt Move SetTheory from utils/TableGen into lib/TableGen so Clang can use it. 2014-06-17 13:10:38 +00:00
CodeEmitterGen.cpp Replace size method call of containers to empty method where appropriate 2015-01-15 11:41:30 +00:00
CodeGenDAGPatterns.cpp Avoid a Symbol -> Name -> Symbol conversion. 2015-06-22 17:46:53 +00:00
CodeGenDAGPatterns.h [TableGen] Add support constraining a vector type in a pattern to have a specific element type and for constraining a vector type to have the same number of elements as another vector type. This is useful for AVX512 mask operations so we relate the mask type to the type of the other arguments. 2015-03-05 07:11:34 +00:00
CodeGenInstruction.cpp Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types 2015-05-29 19:43:39 +00:00
CodeGenInstruction.h [TableGen] Use the SMLoc header file instead of SourceMgr header file in a couple places. NFC 2015-06-08 01:35:40 +00:00
CodeGenIntrinsics.h Add initial support for the convergent attribute. 2015-05-26 23:48:40 +00:00
CodeGenMapTable.cpp [TableGen] Rename ListInit::getSize to just 'size' to be more consistent. 2015-06-02 04:15:57 +00:00
CodeGenRegisters.cpp [TableGen] Rename ListInit::getSize to just 'size' to be more consistent. 2015-06-02 04:15:57 +00:00
CodeGenRegisters.h RegAllocGreedy: Allow target to specify register class ordering. 2015-03-31 19:57:53 +00:00
CodeGenSchedule.cpp Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types 2015-05-29 19:43:39 +00:00
CodeGenSchedule.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
CodeGenTarget.cpp Rename llvm.frameescape and llvm.framerecover to localescape and localrecover 2015-07-07 22:25:32 +00:00
CodeGenTarget.h Use unique_ptr instead of DeleteContainerSeconds. 2014-12-10 06:18:57 +00:00
CTagsEmitter.cpp [TableGen] Remove unnecessary default constructed SMLoc that just existed to return. Instead just call the default constructor in the return. 2015-06-08 01:35:45 +00:00
DAGISelEmitter.cpp Use unique_ptr to remove explicit delete. 2014-12-15 00:40:07 +00:00
DAGISelMatcher.cpp [C++11] More 'nullptr' conversion. In some cases just using a boolean check instead of comparing to nullptr. 2014-04-15 07:20:03 +00:00
DAGISelMatcher.h Use 'override/final' instead of 'virtual' for overridden methods 2015-04-11 02:11:45 +00:00
DAGISelMatcherEmitter.cpp Teach raw_ostream to accept SmallString. 2015-03-10 07:33:23 +00:00
DAGISelMatcherGen.cpp Fix tablegen's PrintFatalError function to run registered file 2015-05-11 22:17:13 +00:00
DAGISelMatcherOpt.cpp Use unique_ptr to remove explicit delete. 2014-12-15 00:40:07 +00:00
DFAPacketizerEmitter.cpp Replace size method call of containers to empty method where appropriate 2015-01-15 11:41:30 +00:00
DisassemblerEmitter.cpp [TableGen] Improve decoding options for non-orthogonal instructions 2015-07-15 08:04:27 +00:00
FastISelEmitter.cpp Change order of tablegen generated fast-isel instruction code to be 2014-11-14 21:05:45 +00:00
FixedLenDecoderEmitter.cpp [TableGen] Improve decoding options for non-orthogonal instructions 2015-07-15 08:04:27 +00:00
InstrInfoEmitter.cpp Add support for the convergent flag at the MC and MachineInstr levels. 2015-05-28 18:33:39 +00:00
IntrinsicEmitter.cpp Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types 2015-05-29 19:43:39 +00:00
LLVMBuild.txt
Makefile
module.modulemap [modules] Add module maps for LLVM. These are not quite ready for prime-time 2014-05-21 02:46:14 +00:00
OptParserEmitter.cpp Option: Propagate flags from groups to options in each group 2014-07-12 00:18:58 +00:00
PseudoLoweringEmitter.cpp MC: Modernize MCOperand API naming. NFC. 2015-05-13 18:37:00 +00:00
RegisterInfoEmitter.cpp Target RegisterInfo: devirtualize TargetFrameLowering 2015-07-10 18:13:17 +00:00
SequenceToOffsetTable.h Reduce size of some tables in tablegen register info output. 2014-11-22 18:30:18 +00:00
SubtargetEmitter.cpp MC: Remove MCSubtargetInfo() default constructor 2015-07-10 22:43:42 +00:00
TableGen.cpp Use range-based for loops. NFC 2014-12-11 07:04:54 +00:00
TableGenBackends.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
tdtags
X86DisassemblerShared.h Revert r234389. It really was needed but really should have been cstring instead of string.h 2015-04-08 06:03:17 +00:00
X86DisassemblerTables.cpp AVX-512: Added all AVX-512 forms of Vector Convert for Float/Double/Int/Long types. 2015-07-13 13:26:20 +00:00
X86DisassemblerTables.h [X86] Make the instructions that use AdSize16/32/64 co-exist together without using mode predicates. 2015-01-02 07:02:25 +00:00
X86ModRMFilters.cpp
X86ModRMFilters.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
X86RecognizableInstr.cpp AVX-512: Added all SKX forms of GATHER instructions. 2015-06-28 10:53:29 +00:00
X86RecognizableInstr.h [X86] Remove the single AdSize indicator and replace it with separate AdSize16/32/64 flags. 2014-12-24 06:05:22 +00:00