1 //=- MicroMips64r6InstrInfo.td - Instruction Information -*- tablegen -*- -=//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file describes MicroMips64r6 instructions.
12 //===----------------------------------------------------------------------===//
14 //===----------------------------------------------------------------------===//
16 // Instruction Encodings
18 //===----------------------------------------------------------------------===//
20 class DAUI_MMR6_ENC : DAUI_FM_MMR6;
21 class DAHI_MMR6_ENC : POOL32I_ADD_IMM_FM_MMR6<0b10001>;
22 class DATI_MMR6_ENC : POOL32I_ADD_IMM_FM_MMR6<0b10000>;
23 class DEXT_MMR6_ENC : POOL32S_EXTBITS_FM_MMR6<0b101100>;
24 class DEXTM_MMR6_ENC : POOL32S_EXTBITS_FM_MMR6<0b100100>;
25 class DEXTU_MMR6_ENC : POOL32S_EXTBITS_FM_MMR6<0b010100>;
26 class DALIGN_MMR6_ENC : POOL32S_DALIGN_FM_MMR6;
28 //===----------------------------------------------------------------------===//
30 // Instruction Descriptions
32 //===----------------------------------------------------------------------===//
34 class DAUI_MMR6_DESC_BASE<string instr_asm, RegisterOperand GPROpnd>
35 : MMR6Arch<instr_asm>, MipsR6Inst {
36 dag OutOperandList = (outs GPROpnd:$rt);
37 dag InOperandList = (ins GPROpnd:$rs, simm16:$imm);
38 string AsmString = !strconcat(instr_asm, "\t$rt, $rs, $imm");
39 list<dag> Pattern = [];
41 class DAUI_MMR6_DESC : DAUI_MMR6_DESC_BASE<"daui", GPR64Opnd>;
43 class DAHI_DATI_DESC_BASE<string instr_asm, RegisterOperand GPROpnd>
44 : MMR6Arch<instr_asm>, MipsR6Inst {
45 dag OutOperandList = (outs GPROpnd:$rs);
46 dag InOperandList = (ins GPROpnd:$rt, simm16:$imm);
47 string AsmString = !strconcat(instr_asm, "\t$rt, $imm");
48 string Constraints = "$rs = $rt";
50 class DAHI_MMR6_DESC : DAHI_DATI_DESC_BASE<"dahi", GPR64Opnd>;
51 class DATI_MMR6_DESC : DAHI_DATI_DESC_BASE<"dati", GPR64Opnd>;
53 class EXTBITS_DESC_BASE<string instr_asm, RegisterOperand RO, Operand PosOpnd,
54 SDPatternOperator Op = null_frag> : MMR6Arch<instr_asm>, MipsR6Inst {
55 dag OutOperandList = (outs RO:$rt);
56 dag InOperandList = (ins RO:$rs, PosOpnd:$pos, size_ext:$size);
57 string AsmString = !strconcat(instr_asm, "\t$rt, $rs, $pos, $size");
58 list<dag> Pattern = [(set RO:$rt, (Op RO:$rs, imm:$pos, imm:$size))];
59 InstrItinClass Itinerary = II_EXT;
61 string BaseOpcode = instr_asm;
63 class DEXT_MMR6_DESC : EXTBITS_DESC_BASE<"dext", GPR64Opnd, uimm6,
65 class DEXTM_MMR6_DESC : EXTBITS_DESC_BASE<"dextm", GPR64Opnd, uimm6,
67 class DEXTU_MMR6_DESC : EXTBITS_DESC_BASE<"dextu", GPR64Opnd, uimm6,
70 class DALIGN_DESC_BASE<string instr_asm, RegisterOperand GPROpnd,
71 Operand ImmOpnd> : MMR6Arch<instr_asm>, MipsR6Inst {
72 dag OutOperandList = (outs GPROpnd:$rd);
73 dag InOperandList = (ins GPROpnd:$rs, GPROpnd:$rt, ImmOpnd:$bp);
74 string AsmString = !strconcat(instr_asm, "\t$rd, $rs, $rt, $bp");
75 list<dag> Pattern = [];
78 class DALIGN_MMR6_DESC : DALIGN_DESC_BASE<"dalign", GPR64Opnd, uimm3>;
80 //===----------------------------------------------------------------------===//
82 // Instruction Definitions
84 //===----------------------------------------------------------------------===//
86 let DecoderNamespace = "MicroMipsR6" in {
87 def DAUI_MM64R6 : StdMMR6Rel, DAUI_MMR6_DESC, DAUI_MMR6_ENC, ISA_MICROMIPS64R6;
88 def DAHI_MM64R6 : StdMMR6Rel, DAHI_MMR6_DESC, DAHI_MMR6_ENC, ISA_MICROMIPS64R6;
89 def DATI_MM64R6 : StdMMR6Rel, DATI_MMR6_DESC, DATI_MMR6_ENC, ISA_MICROMIPS64R6;
90 def DEXT_MM64R6 : StdMMR6Rel, DEXT_MMR6_DESC, DEXT_MMR6_ENC,
92 def DEXTM_MM64R6 : StdMMR6Rel, DEXTM_MMR6_DESC, DEXTM_MMR6_ENC,
94 def DEXTU_MM64R6 : StdMMR6Rel, DEXTU_MMR6_DESC, DEXTU_MMR6_ENC,
96 def DALIGN_MM64R6 : StdMMR6Rel, DALIGN_MMR6_DESC, DALIGN_MMR6_ENC,