• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
14class MipsEVAInst : MipsInst<(outs), (ins), "", [], NoItinerary, FrmOther>,
15                    PredicateControl, StdArch {
16  let DecoderNamespace = "Mips";
17  let EncodingPredicates = [HasStdEnc];
18}
19
20//===----------------------------------------------------------------------===//
21//
22// Field Values
23//
24//===----------------------------------------------------------------------===//
25
26// Memory Load/Store EVA
27def OPCODE6_LBE        : OPCODE6<0b101100>;
28def OPCODE6_LBuE       : OPCODE6<0b101000>;
29def OPCODE6_LHE        : OPCODE6<0b101101>;
30def OPCODE6_LHuE       : OPCODE6<0b101001>;
31def OPCODE6_LWE        : OPCODE6<0b101111>;
32
33def OPCODE6_SBE        : OPCODE6<0b011100>;
34def OPCODE6_SHE        : OPCODE6<0b011101>;
35def OPCODE6_SWE        : OPCODE6<0b011111>;
36
37// load/store left/right EVA
38def OPCODE6_LWLE       : OPCODE6<0b011001>;
39def OPCODE6_LWRE       : OPCODE6<0b011010>;
40def OPCODE6_SWLE       : OPCODE6<0b100001>;
41def OPCODE6_SWRE       : OPCODE6<0b100010>;
42
43// Load-linked EVA, Store-conditional EVA
44def OPCODE6_LLE        : OPCODE6<0b101110>;
45def OPCODE6_SCE        : OPCODE6<0b011110>;
46
47def OPCODE6_TLBINV     : OPCODE6<0b000011>;
48def OPCODE6_TLBINVF    : OPCODE6<0b000100>;
49
50def OPCODE6_CACHEE     : OPCODE6<0b011011>;
51def OPCODE6_PREFE      : OPCODE6<0b100011>;
52
53def OPGROUP_COP0       : OPGROUP<0b010000>;
54
55//===----------------------------------------------------------------------===//
56//
57// Encoding Formats
58//
59//===----------------------------------------------------------------------===//
60
61class 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
77class TLB_FM<OPCODE6 Operation> : MipsEVAInst {
78  bits<32> Inst;
79
80  let Inst{31-26} = OPGROUP_COP0.Value;
81  let Inst{25} = 1;       // CO
82  let Inst{24-6} = 0;
83  let Inst{5-0} = Operation.Value;
84}
85