Skip to content

Commit 4053d95

Browse files
committed
Revert [tblgen][disasm] Allow multiple encodings to disassemble to the same instruction
This reverts r363744 (git commit 9b22521) This breaks many buildbots, e.g. http://lab.llvm.org:8011/builders/clang-atom-d525-fedora-rel/builds/203/steps/build%20stage%201/logs/stdio llvm-svn: 363747
1 parent c2885de commit 4053d95

File tree

2 files changed

+78
-144
lines changed

2 files changed

+78
-144
lines changed

llvm/include/llvm/Target/Target.td

Lines changed: 30 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -398,49 +398,11 @@ include "llvm/Target/TargetSchedule.td"
398398

399399
class Predicate; // Forward def
400400

401-
class InstructionEncoding {
402-
// Size of encoded instruction.
403-
int Size;
404-
405-
// The "namespace" in which this instruction exists, on targets like ARM
406-
// which multiple ISA namespaces exist.
407-
string DecoderNamespace = "";
408-
409-
// List of predicates which will be turned into isel matching code.
410-
list<Predicate> Predicates = [];
411-
412-
string DecoderMethod = "";
413-
414-
// Is the instruction decoder method able to completely determine if the
415-
// given instruction is valid or not. If the TableGen definition of the
416-
// instruction specifies bitpattern A??B where A and B are static bits, the
417-
// hasCompleteDecoder flag says whether the decoder method fully handles the
418-
// ?? space, i.e. if it is a final arbiter for the instruction validity.
419-
// If not then the decoder attempts to continue decoding when the decoder
420-
// method fails.
421-
//
422-
// This allows to handle situations where the encoding is not fully
423-
// orthogonal. Example:
424-
// * InstA with bitpattern 0b0000????,
425-
// * InstB with bitpattern 0b000000?? but the associated decoder method
426-
// DecodeInstB() returns Fail when ?? is 0b00 or 0b11.
427-
//
428-
// The decoder tries to decode a bitpattern that matches both InstA and
429-
// InstB bitpatterns first as InstB (because it is the most specific
430-
// encoding). In the default case (hasCompleteDecoder = 1), when
431-
// DecodeInstB() returns Fail the bitpattern gets rejected. By setting
432-
// hasCompleteDecoder = 0 in InstB, the decoder is informed that
433-
// DecodeInstB() is not able to determine if all possible values of ?? are
434-
// valid or not. If DecodeInstB() returns Fail the decoder will attempt to
435-
// decode the bitpattern as InstA too.
436-
bit hasCompleteDecoder = 1;
437-
}
438-
439401
//===----------------------------------------------------------------------===//
440402
// Instruction set description - These classes correspond to the C++ classes in
441403
// the Target/TargetInstrInfo.h file.
442404
//
443-
class Instruction : InstructionEncoding {
405+
class Instruction {
444406
string Namespace = "";
445407

446408
dag OutOperandList; // An dag containing the MI def operand list.
@@ -465,6 +427,10 @@ class Instruction : InstructionEncoding {
465427
// from the opcode.
466428
int Size = 0;
467429

430+
// DecoderNamespace - The "namespace" in which this instruction exists, on
431+
// targets like ARM which multiple ISA namespaces exist.
432+
string DecoderNamespace = "";
433+
468434
// Code size, for instruction selection.
469435
// FIXME: What does this actually mean?
470436
int CodeSize = 0;
@@ -566,6 +532,31 @@ class Instruction : InstructionEncoding {
566532
string DisableEncoding = "";
567533

568534
string PostEncoderMethod = "";
535+
string DecoderMethod = "";
536+
537+
// Is the instruction decoder method able to completely determine if the
538+
// given instruction is valid or not. If the TableGen definition of the
539+
// instruction specifies bitpattern A??B where A and B are static bits, the
540+
// hasCompleteDecoder flag says whether the decoder method fully handles the
541+
// ?? space, i.e. if it is a final arbiter for the instruction validity.
542+
// If not then the decoder attempts to continue decoding when the decoder
543+
// method fails.
544+
//
545+
// This allows to handle situations where the encoding is not fully
546+
// orthogonal. Example:
547+
// * InstA with bitpattern 0b0000????,
548+
// * InstB with bitpattern 0b000000?? but the associated decoder method
549+
// DecodeInstB() returns Fail when ?? is 0b00 or 0b11.
550+
//
551+
// The decoder tries to decode a bitpattern that matches both InstA and
552+
// InstB bitpatterns first as InstB (because it is the most specific
553+
// encoding). In the default case (hasCompleteDecoder = 1), when
554+
// DecodeInstB() returns Fail the bitpattern gets rejected. By setting
555+
// hasCompleteDecoder = 0 in InstB, the decoder is informed that
556+
// DecodeInstB() is not able to determine if all possible values of ?? are
557+
// valid or not. If DecodeInstB() returns Fail the decoder will attempt to
558+
// decode the bitpattern as InstA too.
559+
bit hasCompleteDecoder = 1;
569560

570561
/// Target-specific flags. This becomes the TSFlags field in TargetInstrDesc.
571562
bits<64> TSFlags = 0;
@@ -602,13 +593,6 @@ class Instruction : InstructionEncoding {
602593
bit FastISelShouldIgnore = 0;
603594
}
604595

605-
/// Defines an additional encoding that disassembles to the given instruction
606-
/// Like Instruction, the Inst and SoftFail fields are omitted to allow targets
607-
// to specify their size.
608-
class AdditionalEncoding<Instruction I> : InstructionEncoding {
609-
Instruction AliasOf = I;
610-
}
611-
612596
/// PseudoInstExpansion - Expansion information for a pseudo-instruction.
613597
/// Which instruction it expands to and how the operands map from the
614598
/// pseudo.

0 commit comments

Comments
 (0)