brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · bb0f658 Raw
46 lines · plain
1// RUN: llvm-tblgen -gen-disassembler  -I %p/../../../include %s | FileCheck %s2 3// Test for OPC_ExtractField/OPC_CheckField with start bit > 255.4// These large start values may arise for architectures with long instruction5// words.6 7include "llvm/Target/Target.td"8 9def archInstrInfo : InstrInfo { }10 11def arch : Target {12  let InstructionSet = archInstrInfo;13}14 15class TestInstruction : Instruction {16  let Size = 64;17  let OutOperandList = (outs);18  let InOperandList = (ins);19  field bits<512> Inst;20  field bits<512> SoftFail = 0;21}22 23def InstA : TestInstruction {24  let Inst{509-502} = {0,0,0,0,?,?,?,?};25  let AsmString = "InstA";26}27 28def InstB : TestInstruction {29  let Inst{509-502} = {0,0,0,0,0,0,?,?};30  let AsmString = "InstB";31  let DecoderMethod = "DecodeInstB";32  let hasCompleteDecoder = 0;33}34 35// CHECK-LABEL: static const uint8_t DecoderTable512[20] = {36// CHECK-NEXT:    OPC_CheckField, 250, 3, 4, 0, //  0: check Inst[509:506] == 0x037// CHECK-NEXT:    OPC_Scope, 9,                 //  5: try {38// CHECK-NEXT:    OPC_CheckField, 248, 3, 2, 0, //  7:  check Inst[505:504] == 0x039// CHECK-NEXT:    OPC_Decode, {{[0-9, ]+}}, 0,  // 12:  decode to InstB using decoder 040// CHECK-NEXT:                                  // 12: } else try {41// CHECK-NEXT:    OPC_Decode, {{[0-9, ]+}}, 1,  // 16:  decode to InstA using decoder 142// CHECK-NEXT:                                  // 16: }43// CHECK-NEXT: };44 45// CHECK: if (!Check(S, DecodeInstB(MI, insn, Address, Decoder))) { DecodeComplete = false; return MCDisassembler::Fail; }46