1 //===- MipsEVAInstrFormats.td - Mips Instruction Formats ---*- 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 Mips32r6 instruction formats. 11 // 12 //===----------------------------------------------------------------------===// 13 14 class MipsEVAInst : MipsInst<(outs), (ins), "", [], NoItinerary, FrmOther>, 15 StdArch { 16 let DecoderNamespace = "Mips"; 17 let EncodingPredicates = [HasStdEnc]; 18 } 19 20 //===----------------------------------------------------------------------===// 21 // 22 // Field Values 23 // 24 //===----------------------------------------------------------------------===// 25 26 // Memory Load/Store EVA 27 def OPCODE6_LBE : OPCODE6<0b101100>; 28 def OPCODE6_LBuE : OPCODE6<0b101000>; 29 def OPCODE6_LHE : OPCODE6<0b101101>; 30 def OPCODE6_LHuE : OPCODE6<0b101001>; 31 def OPCODE6_LWE : OPCODE6<0b101111>; 32 33 def OPCODE6_SBE : OPCODE6<0b011100>; 34 def OPCODE6_SHE : OPCODE6<0b011101>; 35 def OPCODE6_SWE : OPCODE6<0b011111>; 36 37 // load/store left/right EVA 38 def OPCODE6_LWLE : OPCODE6<0b011001>; 39 def OPCODE6_LWRE : OPCODE6<0b011010>; 40 def OPCODE6_SWLE : OPCODE6<0b100001>; 41 def OPCODE6_SWRE : OPCODE6<0b100010>; 42 43 // Load-linked EVA, Store-conditional EVA 44 def OPCODE6_LLE : OPCODE6<0b101110>; 45 def OPCODE6_SCE : OPCODE6<0b011110>; 46 47 def OPCODE6_TLBINV : OPCODE6<0b000011>; 48 def OPCODE6_TLBINVF : OPCODE6<0b000100>; 49 50 def OPCODE6_CACHEE : OPCODE6<0b011011>; 51 def OPCODE6_PREFE : OPCODE6<0b100011>; 52 53 def OPGROUP_COP0_TLB : OPGROUP<0b010000>; 54 55 //===----------------------------------------------------------------------===// 56 // 57 // Encoding Formats 58 // 59 //===----------------------------------------------------------------------===// 60 61 class SPECIAL3_EVA_LOAD_STORE_FM<OPCODE6 Operation> : MipsEVAInst { 62 bits<21> addr; 63 bits<5> hint; 64 bits<5> base = addr{20-16}; 65 bits<9> offset = addr{8-0}; 66 67 bits<32> Inst; 68 69 let Inst{31-26} = OPGROUP_SPECIAL3.Value; 70 let Inst{25-21} = base; 71 let Inst{20-16} = hint; 72 let Inst{15-7} = offset; 73 let Inst{6} = 0; 74 let Inst{5-0} = Operation.Value; 75 } 76 77 class TLB_FM<OPCODE6 Operation> : MipsEVAInst { 78 bits<32> Inst; 79 80 let Inst{31-26} = OPGROUP_COP0_TLB.Value; 81 let Inst{25} = 1; // CO 82 let Inst{24-6} = 0; 83 let Inst{5-0} = Operation.Value; 84 } 85