@@ -398,49 +398,11 @@ include "llvm/Target/TargetSchedule.td"
398
398
399
399
class Predicate; // Forward def
400
400
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
-
439
401
//===----------------------------------------------------------------------===//
440
402
// Instruction set description - These classes correspond to the C++ classes in
441
403
// the Target/TargetInstrInfo.h file.
442
404
//
443
- class Instruction : InstructionEncoding {
405
+ class Instruction {
444
406
string Namespace = "";
445
407
446
408
dag OutOperandList; // An dag containing the MI def operand list.
@@ -465,6 +427,10 @@ class Instruction : InstructionEncoding {
465
427
// from the opcode.
466
428
int Size = 0;
467
429
430
+ // DecoderNamespace - The "namespace" in which this instruction exists, on
431
+ // targets like ARM which multiple ISA namespaces exist.
432
+ string DecoderNamespace = "";
433
+
468
434
// Code size, for instruction selection.
469
435
// FIXME: What does this actually mean?
470
436
int CodeSize = 0;
@@ -566,6 +532,31 @@ class Instruction : InstructionEncoding {
566
532
string DisableEncoding = "";
567
533
568
534
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;
569
560
570
561
/// Target-specific flags. This becomes the TSFlags field in TargetInstrDesc.
571
562
bits<64> TSFlags = 0;
@@ -602,13 +593,6 @@ class Instruction : InstructionEncoding {
602
593
bit FastISelShouldIgnore = 0;
603
594
}
604
595
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
-
612
596
/// PseudoInstExpansion - Expansion information for a pseudo-instruction.
613
597
/// Which instruction it expands to and how the operands map from the
614
598
/// pseudo.
0 commit comments