[mips][mips64r6] Add aui, daui, dahi, and dati
[oota-llvm.git] / lib / Target / Mips / Mips32r6InstrFormats.td
1 //=- Mips32r6InstrFormats.td - Mips32r6 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 MipsR6Inst : MipsInst<(outs), (ins), "", [], NoItinerary, FrmOther>,
15                    PredicateControl {
16   let DecoderNamespace = "Mips32r6_64r6";
17   let EncodingPredicates = [HasStdEnc];
18 }
19
20 //===----------------------------------------------------------------------===//
21 //
22 // Field Values
23 //
24 //===----------------------------------------------------------------------===//
25
26 def OPGROUP_COP1    { bits<6> Value = 0b010001; }
27 def OPGROUP_AUI     { bits<6> Value = 0b001111; }
28 def OPGROUP_DAUI    { bits<6> Value = 0b011101; }
29 def OPGROUP_REGIMM  { bits<6> Value = 0b000001; }
30 def OPGROUP_SPECIAL { bits<6> Value = 0b000000; }
31
32 class OPCODE5<bits<5> Val> {
33   bits<5> Value = Val;
34 }
35 def OPCODE5_DAHI : OPCODE5<0b00110>;
36 def OPCODE5_DATI : OPCODE5<0b11110>;
37
38 class FIELD_FMT<bits<5> Val> {
39   bits<5> Value = Val;
40 }
41 def FIELD_FMT_S : FIELD_FMT<0b10000>;
42 def FIELD_FMT_D : FIELD_FMT<0b10001>;
43
44 //===----------------------------------------------------------------------===//
45 //
46 // Encoding Formats
47 //
48 //===----------------------------------------------------------------------===//
49
50 class AUI_FM : MipsR6Inst {
51   bits<5> rs;
52   bits<5> rt;
53   bits<16> imm;
54
55   bits<32> Inst;
56
57   let Inst{31-26} = OPGROUP_AUI.Value;
58   let Inst{25-21} = rs;
59   let Inst{20-16} = rt;
60   let Inst{15-0} = imm;
61 }
62
63 class DAUI_FM : AUI_FM {
64   let Inst{31-26} = OPGROUP_DAUI.Value;
65 }
66
67 class COP1_3R_FM<bits<6> funct, FIELD_FMT Format> : MipsR6Inst {
68   bits<5> ft;
69   bits<5> fs;
70   bits<5> fd;
71
72   bits<32> Inst;
73
74   let Inst{31-26} = OPGROUP_COP1.Value;
75   let Inst{25-21} = Format.Value;
76   let Inst{20-16} = ft;
77   let Inst{15-11} = fs;
78   let Inst{10-6} = fd;
79   let Inst{5-0} = funct;
80 }
81
82 class SPECIAL_3R_FM<bits<5> mulop, bits<6> funct> : MipsR6Inst {
83   bits<5> rd;
84   bits<5> rs;
85   bits<5> rt;
86
87   bits<32> Inst;
88
89   let Inst{31-26} = OPGROUP_SPECIAL.Value;
90   let Inst{25-21} = rs;
91   let Inst{20-16} = rt;
92   let Inst{15-11} = rd;
93   let Inst{10-6}  = mulop;
94   let Inst{5-0}   = funct;
95 }
96
97 class REGIMM_FM<OPCODE5 Operation> : MipsR6Inst {
98   bits<5> rs;
99   bits<16> imm;
100
101   bits<32> Inst;
102
103   let Inst{31-26} = OPGROUP_REGIMM.Value;
104   let Inst{25-21} = rs;
105   let Inst{20-16} = Operation.Value;
106   let Inst{15-0} = imm;
107 }