等价的指令格式定义
C++
class I<bits<6> opcode, dag OOL, dag IOL, string asmstr, list<dag> pattern>
: Instruction {
field bits<32> Inst;
let Inst{5-0} = opcode;
}
class USE_I<bits<6> opcode, dag OOL, dag IOL, string asmstr, list<dag> pattern>
: I <opcode, OOL, IOL, asmstr> {
}
def RET<0x01, (outs), (ins), "nop", []>
C++
class I<dag OOL, dag IOL, string asmstr, list<dag> pattern>
: Instruction {
field bits<32> Inst;
// 使用临时变量Opcode
bits<6> Opcode = 0;
let Inst{5-0} = Opcode;
}
class USE_I<bits<6> opcode, dag OOL, dag IOL, string asmstr, list<dag> pattern>
: I <opcode, OOL, IOL, asmstr> {
let Opcode = opcode;
}
def RET<0x01, (outs), (ins), "nop", []>
def RET<0x01, (outs), (ins), "nop", []>