39 lines · plain
1// RUN: llvm-tblgen -gen-disassembler -I %p/../../../include %s | FileCheck %s2 3include "llvm/Target/Target.td"4 5class I : Instruction {6 let InOperandList = (ins i32imm:$op);7 let OutOperandList = (outs);8}9 10// Check that we don't try to read the second byte without ruling out11// 1-byte encodings first. This should actually be a decoding conflict,12// but DecoderEmitter heuristics decide that I8_0 and I8_1 are more specific13// than the rest and give them priority.14 15// _______0 I8_016// _______1 I8_117// 00000000 ________ I16_018// 00000001 ________ I16_119// 00000010 ________ I16_220 21// CHECK: switch Inst[0]22// CHECK: decode to I8_023// CHECK: decode to I8_124// CHECK: switch Inst[15:8]25// CHECK: decode to I16_026// CHECK: decode to I16_127 28def I8_0 : I { dag Inst = (descend (operand "$op", 7), 0b0); }29def I8_1 : I { dag Inst = (descend (operand "$op", 7), 0b1); }30def I16_0 : I { dag Inst = (descend 0b00000000, (operand "$op", 8)); }31def I16_1 : I { dag Inst = (descend 0b00000001, (operand "$op", 8)); }32def I16_2 : I { dag Inst = (descend 0b00000010, (operand "$op", 8)); }33 34def II : InstrInfo;35 36def MyTarget : Target {37 let InstructionSet = II;38}39