1 // RUN: llvm-tblgen -gen-pseudo-lowering -I %p/../../include %s | FileCheck %s
3 include "llvm/Target/Target.td"
5 def TestTargetInstrInfo : InstrInfo;
7 def TestTarget : Target {
8 let InstructionSet = TestTargetInstrInfo;
11 def REG : Register<"REG">;
12 def GPR : RegisterClass<"TestTarget", [i32], 32, (add REG)>;
14 class SysReg<bits<12> op> {
15 bits<12> Encoding = op;
17 def SR : SysReg<0b111100001111>;
19 class Pseudo<dag outs, dag ins, list<dag> pattern>
21 dag OutOperandList = outs;
22 dag InOperandList = ins;
23 let Pattern = pattern;
27 def INSTR : Instruction {
28 let OutOperandList = (outs GPR:$rd);
29 let InOperandList = (ins i32imm:$val);
33 def PSEUDO : Pseudo<(outs GPR:$rd), (ins),
34 [(set GPR:$rd, (i32 SR.Encoding))]>,
35 PseudoInstExpansion<(INSTR GPR:$rd, SR.Encoding)>;
37 // CHECK: .addOperand(MCOperand::createImm(3855));