llvm-6502/include/llvm/MC
Petr Pavlu d2e1e42c1a [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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242274 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-15 08:04:27 +00:00
..
MCParser Make header parse standalone. NFC. 2015-06-26 19:04:11 +00:00
ConstantPools.h Move alignment from MCSectionData to MCSection. 2015-05-21 19:20:38 +00:00
MachineLocation.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MCAsmBackend.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MCAsmInfo.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MCAsmInfoCOFF.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MCAsmInfoDarwin.h Recommit r224935 with a fix for the ObjC++/AArch64 bug that that revision 2015-01-09 18:55:42 +00:00
MCAsmInfoELF.h Move alignment from MCSectionData to MCSection. 2015-05-21 19:20:38 +00:00
MCAsmLayout.h Merge MCSymbol and MCSymbolData. 2015-05-29 20:31:23 +00:00
MCAssembler.h Devirtualize and pack MCFragment to reduce memory usage. 2015-06-17 22:01:28 +00:00
MCCodeEmitter.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MCCodeGenInfo.h MC: MCCodeGenInfo naming update. NFC. 2015-05-15 19:13:31 +00:00
MCContext.h Rename llvm.frameescape and llvm.framerecover to localescape and localrecover 2015-07-07 22:25:32 +00:00
MCDirectives.h
MCDisassembler.h Remove unused MCRelocationInfo.h include from MCDisassembler.h. NFC 2015-05-19 18:18:49 +00:00
MCDwarf.h MC: Shrink MCDwarfLoc/MCLineEntry 2015-07-10 23:55:34 +00:00
MCELFObjectWriter.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MCELFStreamer.h Devirtualize and pack MCFragment to reduce memory usage. 2015-06-17 22:01:28 +00:00
MCExpr.h MC: Add target hook to control symbol quoting 2015-06-09 00:31:39 +00:00
MCExternalSymbolizer.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MCFixedLenDisassembler.h [TableGen] Improve decoding options for non-orthogonal instructions 2015-07-15 08:04:27 +00:00
MCFixup.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MCFixupKindInfo.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MCInst.h [MC] Allowing operands to be erased from MCInst. 2015-06-04 19:49:52 +00:00
MCInstBuilder.h MC: Modernize MCOperand API naming. NFC. 2015-05-13 18:37:00 +00:00
MCInstPrinter.h [MC] Function naming NFC. 2015-06-07 20:29:37 +00:00
MCInstrAnalysis.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MCInstrDesc.h MC: Constify MCSubtargetInfo in getDeprecationInfo(), NFC 2015-07-08 17:30:55 +00:00
MCInstrInfo.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MCInstrItineraries.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MCLabel.h MC: Tidy up formatting a bit. NFC. 2015-06-01 23:55:02 +00:00
MCLinkerOptimizationHint.h MC: Tidy up LOH naming a bit. NFC. 2015-06-01 23:55:06 +00:00
MCMachObjectWriter.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MCObjectFileInfo.h Recommit r239721: Replace string GNU Triples with llvm::Triple in InitMCObjectFileInfo. NFC. 2015-06-16 12:18:07 +00:00
MCObjectStreamer.h MC: Prune \return corresponding to r239552. [-Wdocumentation] 2015-06-11 23:04:56 +00:00
MCObjectWriter.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MCRegisterInfo.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MCRelocationInfo.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MCSchedule.h MC: Remove the copy of MCSchedModel in MCSubtargetInfo 2015-07-10 22:13:43 +00:00
MCSection.h Devirtualize and pack MCFragment to reduce memory usage. 2015-06-17 22:01:28 +00:00
MCSectionCOFF.h Use 'override/final' instead of 'virtual' for overridden methods 2015-04-11 02:11:45 +00:00
MCSectionELF.h Store whether a symbol is a comdat signature in MCSymbolELF. 2015-06-03 21:41:59 +00:00
MCSectionMachO.h Create symbols marking the start of a section earlier. 2015-03-10 22:00:25 +00:00
MCStreamer.h Change .thumb_set to have the same error checks as .set. 2015-06-22 19:35:57 +00:00
MCSubtargetInfo.h MC: Only allow changing feature bits in MCSubtargetInfo 2015-07-10 22:52:15 +00:00
MCSymbol.h [MC] Switch static const to an enum to silence MSVC linker warnings 2015-07-10 21:50:04 +00:00
MCSymbolCOFF.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MCSymbolELF.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MCSymbolizer.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MCSymbolMachO.h Fix include guard typo introduced in r239315. 2015-07-11 09:40:28 +00:00
MCTargetAsmParser.h Reverting r241058 because it's causing buildbot failures. 2015-06-30 12:32:53 +00:00
MCTargetOptions.h Untabify. 2015-07-06 00:48:17 +00:00
MCTargetOptionsCommandFlags.h [cleanup] Re-sort all the #include lines in LLVM using 2015-01-14 11:23:27 +00:00
MCValue.h MC: Tidy up comments and clean up formatting a bit. NFC. 2015-05-02 00:44:14 +00:00
MCWin64EH.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MCWinCOFFObjectWriter.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MCWinCOFFStreamer.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MCWinEH.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
SectionKind.h Remove MergeableConst. 2015-01-29 14:12:41 +00:00
StringTableBuilder.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
SubtargetFeature.h [ARM] Add knowledge of FPU subtarget features to TargetParser 2015-06-05 13:29:24 +00:00
YAML.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00