1 //===- MipsEVAInstrFormats.td - Mips Instruction Formats ---*- tablegen -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file describes Mips32r6 instruction formats.
11 //===----------------------------------------------------------------------===//
13 class MipsEVAInst : MipsInst<(outs), (ins), "", [], NoItinerary, FrmOther>,
15 let DecoderNamespace = "Mips";
16 let EncodingPredicates = [HasStdEnc];
19 //===----------------------------------------------------------------------===//
23 //===----------------------------------------------------------------------===//
25 // Memory Load/Store EVA
26 def OPCODE6_LBE : OPCODE6<0b101100>;
27 def OPCODE6_LBuE : OPCODE6<0b101000>;
28 def OPCODE6_LHE : OPCODE6<0b101101>;
29 def OPCODE6_LHuE : OPCODE6<0b101001>;
30 def OPCODE6_LWE : OPCODE6<0b101111>;
32 def OPCODE6_SBE : OPCODE6<0b011100>;
33 def OPCODE6_SHE : OPCODE6<0b011101>;
34 def OPCODE6_SWE : OPCODE6<0b011111>;
36 // load/store left/right EVA
37 def OPCODE6_LWLE : OPCODE6<0b011001>;
38 def OPCODE6_LWRE : OPCODE6<0b011010>;
39 def OPCODE6_SWLE : OPCODE6<0b100001>;
40 def OPCODE6_SWRE : OPCODE6<0b100010>;
42 // Load-linked EVA, Store-conditional EVA
43 def OPCODE6_LLE : OPCODE6<0b101110>;
44 def OPCODE6_SCE : OPCODE6<0b011110>;
46 def OPCODE6_TLBINV : OPCODE6<0b000011>;
47 def OPCODE6_TLBINVF : OPCODE6<0b000100>;
49 def OPCODE6_CACHEE : OPCODE6<0b011011>;
50 def OPCODE6_PREFE : OPCODE6<0b100011>;
52 def OPGROUP_COP0_TLB : OPGROUP<0b010000>;
54 //===----------------------------------------------------------------------===//
58 //===----------------------------------------------------------------------===//
60 class SPECIAL3_EVA_LOAD_STORE_FM<OPCODE6 Operation> : MipsEVAInst {
63 bits<5> base = addr{20-16};
64 bits<9> offset = addr{8-0};
68 let Inst{31-26} = OPGROUP_SPECIAL3.Value;
69 let Inst{25-21} = base;
70 let Inst{20-16} = hint;
71 let Inst{15-7} = offset;
73 let Inst{5-0} = Operation.Value;
76 class TLB_FM<OPCODE6 Operation> : MipsEVAInst {
79 let Inst{31-26} = OPGROUP_COP0_TLB.Value;
80 let Inst{25} = 1; // CO
82 let Inst{5-0} = Operation.Value;