1//===- MipsEVAInstrInfo.td - EVA ASE instructions -*- tablegen ------------*-=// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9// 10// This file describes Mips EVA ASE instructions. 11// 12//===----------------------------------------------------------------------===// 13 14//===----------------------------------------------------------------------===// 15// 16// Instruction encodings 17// 18//===----------------------------------------------------------------------===// 19 20// Memory Load/Store EVA encodings 21class LBE_ENC : SPECIAL3_EVA_LOAD_STORE_FM<OPCODE6_LBE>; 22class LBuE_ENC : SPECIAL3_EVA_LOAD_STORE_FM<OPCODE6_LBuE>; 23class LHE_ENC : SPECIAL3_EVA_LOAD_STORE_FM<OPCODE6_LHE>; 24class LHuE_ENC : SPECIAL3_EVA_LOAD_STORE_FM<OPCODE6_LHuE>; 25class LWE_ENC : SPECIAL3_EVA_LOAD_STORE_FM<OPCODE6_LWE>; 26 27class SBE_ENC : SPECIAL3_EVA_LOAD_STORE_FM<OPCODE6_SBE>; 28class SHE_ENC : SPECIAL3_EVA_LOAD_STORE_FM<OPCODE6_SHE>; 29class SWE_ENC : SPECIAL3_EVA_LOAD_STORE_FM<OPCODE6_SWE>; 30 31// load/store left/right EVA encodings 32class LWLE_ENC : SPECIAL3_EVA_LOAD_STORE_FM<OPCODE6_LWLE>; 33class LWRE_ENC : SPECIAL3_EVA_LOAD_STORE_FM<OPCODE6_LWRE>; 34class SWLE_ENC : SPECIAL3_EVA_LOAD_STORE_FM<OPCODE6_SWLE>; 35class SWRE_ENC : SPECIAL3_EVA_LOAD_STORE_FM<OPCODE6_SWRE>; 36 37// Load-linked EVA, Store-conditional EVA encodings 38class LLE_ENC : SPECIAL3_EVA_LOAD_STORE_FM<OPCODE6_LLE>; 39class SCE_ENC : SPECIAL3_EVA_LOAD_STORE_FM<OPCODE6_SCE>; 40 41class TLBINV_ENC : TLB_FM<OPCODE6_TLBINV>; 42class TLBINVF_ENC : TLB_FM<OPCODE6_TLBINVF>; 43 44class CACHEE_ENC : SPECIAL3_EVA_LOAD_STORE_FM<OPCODE6_CACHEE>; 45class PREFE_ENC : SPECIAL3_EVA_LOAD_STORE_FM<OPCODE6_PREFE>; 46 47//===----------------------------------------------------------------------===// 48// 49// Instruction descriptions 50// 51//===----------------------------------------------------------------------===// 52 53// Memory Load/Store EVA descriptions 54class LOAD_EVA_DESC_BASE<string instr_asm, RegisterOperand GPROpnd> { 55 dag OutOperandList = (outs GPROpnd:$rt); 56 dag InOperandList = (ins mem_simm9:$addr); 57 string AsmString = !strconcat(instr_asm, "\t$rt, $addr"); 58 list<dag> Pattern = []; 59 string DecoderMethod = "DecodeMemEVA"; 60 bit canFoldAsLoad = 1; 61 bit mayLoad = 1; 62} 63 64class LBE_DESC : LOAD_EVA_DESC_BASE<"lbe", GPR32Opnd>; 65class LBuE_DESC : LOAD_EVA_DESC_BASE<"lbue", GPR32Opnd>; 66class LHE_DESC : LOAD_EVA_DESC_BASE<"lhe", GPR32Opnd>; 67class LHuE_DESC : LOAD_EVA_DESC_BASE<"lhue", GPR32Opnd>; 68class LWE_DESC : LOAD_EVA_DESC_BASE<"lwe", GPR32Opnd>; 69 70class STORE_EVA_DESC_BASE<string instr_asm, RegisterOperand GPROpnd, 71 SDPatternOperator OpNode = null_frag> { 72 dag OutOperandList = (outs); 73 dag InOperandList = (ins GPROpnd:$rt, mem_simm9:$addr); 74 string AsmString = !strconcat(instr_asm, "\t$rt, $addr"); 75 list<dag> Pattern = []; 76 string DecoderMethod = "DecodeMemEVA"; 77 bit mayStore = 1; 78} 79 80class SBE_DESC : STORE_EVA_DESC_BASE<"sbe", GPR32Opnd>; 81class SHE_DESC : STORE_EVA_DESC_BASE<"she", GPR32Opnd>; 82class SWE_DESC : STORE_EVA_DESC_BASE<"swe", GPR32Opnd>; 83 84// Load/Store Left/Right EVA descriptions 85class LOAD_LEFT_RIGHT_EVA_DESC_BASE<string instr_asm, RegisterOperand GPROpnd> { 86 dag OutOperandList = (outs GPROpnd:$rt); 87 dag InOperandList = (ins mem_simm9:$addr, GPROpnd:$src); 88 string AsmString = !strconcat(instr_asm, "\t$rt, $addr"); 89 list<dag> Pattern = []; 90 string DecoderMethod = "DecodeMemEVA"; 91 string Constraints = "$src = $rt"; 92 bit canFoldAsLoad = 1; 93} 94 95class LWLE_DESC : LOAD_LEFT_RIGHT_EVA_DESC_BASE<"lwle", GPR32Opnd>; 96class LWRE_DESC : LOAD_LEFT_RIGHT_EVA_DESC_BASE<"lwre", GPR32Opnd>; 97 98class STORE_LEFT_RIGHT_EVA_DESC_BASE<string instr_asm, RegisterOperand GPROpnd> { 99 dag OutOperandList = (outs); 100 dag InOperandList = (ins GPROpnd:$rt, mem_simm9:$addr); 101 string AsmString = !strconcat(instr_asm, "\t$rt, $addr"); 102 list<dag> Pattern = []; 103 string DecoderMethod = "DecodeMemEVA"; 104} 105 106class SWLE_DESC : LOAD_LEFT_RIGHT_EVA_DESC_BASE<"swle", GPR32Opnd>; 107class SWRE_DESC : LOAD_LEFT_RIGHT_EVA_DESC_BASE<"swre", GPR32Opnd>; 108 109// Load-linked EVA, Store-conditional EVA descriptions 110class LLE_DESC_BASE<string instr_asm, RegisterOperand GPROpnd> { 111 dag OutOperandList = (outs GPROpnd:$rt); 112 dag InOperandList = (ins mem_simm9:$addr); 113 string AsmString = !strconcat(instr_asm, "\t$rt, $addr"); 114 list<dag> Pattern = []; 115 bit mayLoad = 1; 116 string DecoderMethod = "DecodeMemEVA"; 117} 118 119class LLE_DESC : LLE_DESC_BASE<"lle", GPR32Opnd>; 120 121class SCE_DESC_BASE<string instr_asm, RegisterOperand GPROpnd> { 122 dag OutOperandList = (outs GPROpnd:$dst); 123 dag InOperandList = (ins GPROpnd:$rt, mem_simm9:$addr); 124 string AsmString = !strconcat(instr_asm, "\t$rt, $addr"); 125 list<dag> Pattern = []; 126 bit mayStore = 1; 127 string Constraints = "$rt = $dst"; 128 string DecoderMethod = "DecodeMemEVA"; 129} 130 131class SCE_DESC : SCE_DESC_BASE<"sce", GPR32Opnd>; 132 133class TLB_DESC_BASE<string instr_asm> { 134 dag OutOperandList = (outs); 135 dag InOperandList = (ins); 136 string AsmString = instr_asm; 137 list<dag> Pattern = []; 138} 139 140class TLBINV_DESC : TLB_DESC_BASE<"tlbinv">; 141class TLBINVF_DESC : TLB_DESC_BASE<"tlbinvf">; 142 143class CACHEE_DESC_BASE<string instr_asm, Operand MemOpnd> { 144 dag OutOperandList = (outs); 145 dag InOperandList = (ins MemOpnd:$addr, uimm5:$hint); 146 string AsmString = !strconcat(instr_asm, "\t$hint, $addr"); 147 list<dag> Pattern = []; 148 string DecoderMethod = "DecodeCacheeOp_CacheOpR6"; 149} 150 151class CACHEE_DESC : CACHEE_DESC_BASE<"cachee", mem>; 152class PREFE_DESC : CACHEE_DESC_BASE<"prefe", mem>; 153 154//===----------------------------------------------------------------------===// 155// 156// Instruction definitions 157// 158//===----------------------------------------------------------------------===// 159 160/// Load and Store EVA Instructions 161def LBE : LBE_ENC, LBE_DESC, INSN_EVA; 162def LBuE : LBuE_ENC, LBuE_DESC, INSN_EVA; 163def LHE : LHE_ENC, LHE_DESC, INSN_EVA; 164def LHuE : LHuE_ENC, LHuE_DESC, INSN_EVA; 165let AdditionalPredicates = [NotInMicroMips] in { 166def LWE : LWE_ENC, LWE_DESC, INSN_EVA; 167} 168def SBE : SBE_ENC, SBE_DESC, INSN_EVA; 169def SHE : SHE_ENC, SHE_DESC, INSN_EVA; 170let AdditionalPredicates = [NotInMicroMips] in { 171def SWE : SWE_ENC, SWE_DESC, INSN_EVA; 172} 173 174/// load/store left/right EVA 175let AdditionalPredicates = [NotInMicroMips] in { 176def LWLE : LWLE_ENC, LWLE_DESC, INSN_EVA_NOT_32R6_64R6; 177def LWRE : LWRE_ENC, LWRE_DESC, INSN_EVA_NOT_32R6_64R6; 178def SWLE : SWLE_ENC, SWLE_DESC, INSN_EVA_NOT_32R6_64R6; 179def SWRE : SWRE_ENC, SWRE_DESC, INSN_EVA_NOT_32R6_64R6; 180} 181 182/// Load-linked EVA, Store-conditional EVA 183let AdditionalPredicates = [NotInMicroMips] in { 184def LLE : LLE_ENC, LLE_DESC, INSN_EVA; 185def SCE : SCE_ENC, SCE_DESC, INSN_EVA; 186} 187 188def TLBINV : TLBINV_ENC, TLBINV_DESC, INSN_EVA; 189def TLBINVF : TLBINVF_ENC, TLBINVF_DESC, INSN_EVA; 190 191def CACHEE : CACHEE_ENC, CACHEE_DESC, INSN_EVA; 192def PREFE : PREFE_ENC, PREFE_DESC, INSN_EVA; 193