blob: 0b82ef8941cfb3a1c0914c1f41e4a02539182a0e [file] [log] [blame]
Akira Hatanakabe6a8182013-04-19 19:03:11 +00001class MMArch {
2 string Arch = "micromips";
3 list<dag> Pattern = [];
4}
5
6class ADD_FM_MM<bits<6> op, bits<10> funct> : MMArch {
7 bits<5> rt;
8 bits<5> rs;
9 bits<5> rd;
10
11 bits<32> Inst;
12
13 let Inst{31-26} = op;
14 let Inst{25-21} = rt;
15 let Inst{20-16} = rs;
16 let Inst{15-11} = rd;
17 let Inst{10} = 0;
18 let Inst{9-0} = funct;
19}
20
21class ADDI_FM_MM<bits<6> op> : MMArch {
22 bits<5> rs;
23 bits<5> rt;
24 bits<16> imm16;
25
26 bits<32> Inst;
27
28 let Inst{31-26} = op;
29 let Inst{25-21} = rt;
30 let Inst{20-16} = rs;
31 let Inst{15-0} = imm16;
32}
33
34class SLTI_FM_MM<bits<6> op> : MMArch {
35 bits<5> rt;
36 bits<5> rs;
37 bits<16> imm16;
38
39 bits<32> Inst;
40
41 let Inst{31-26} = op;
42 let Inst{25-21} = rs;
43 let Inst{20-16} = rt;
44 let Inst{15-0} = imm16;
45}
46
47class LUI_FM_MM : MMArch {
48 bits<5> rt;
49 bits<16> imm16;
50
51 bits<32> Inst;
52
53 let Inst{31-26} = 0x10;
54 let Inst{25-21} = 0xd;
55 let Inst{20-16} = rt;
56 let Inst{15-0} = imm16;
57}
58
59class MULT_FM_MM<bits<10> funct> : MMArch {
60 bits<5> rs;
61 bits<5> rt;
62
63 bits<32> Inst;
64
65 let Inst{31-26} = 0x00;
66 let Inst{25-21} = rt;
67 let Inst{20-16} = rs;
68 let Inst{15-6} = funct;
69 let Inst{5-0} = 0x3c;
70}
Akira Hatanakacd9b74a2013-04-25 01:11:15 +000071
72class SRA_FM_MM<bits<10> funct, bit rotate> : MMArch {
73 bits<5> rd;
74 bits<5> rt;
75 bits<5> shamt;
76
77 bits<32> Inst;
78
79 let Inst{31-26} = 0;
80 let Inst{25-21} = rd;
81 let Inst{20-16} = rt;
82 let Inst{15-11} = shamt;
83 let Inst{10} = rotate;
84 let Inst{9-0} = funct;
85}
86
87class SRLV_FM_MM<bits<10> funct, bit rotate> : MMArch {
88 bits<5> rd;
89 bits<5> rt;
90 bits<5> rs;
91
92 bits<32> Inst;
93
94 let Inst{31-26} = 0;
95 let Inst{25-21} = rt;
96 let Inst{20-16} = rs;
97 let Inst{15-11} = rd;
98 let Inst{10} = rotate;
99 let Inst{9-0} = funct;
100}
Akira Hatanakaf0aa6c92013-04-25 01:21:25 +0000101
102class LW_FM_MM<bits<6> op> : MMArch {
103 bits<5> rt;
104 bits<21> addr;
105
106 bits<32> Inst;
107
108 let Inst{31-26} = op;
109 let Inst{25-21} = rt;
110 let Inst{20-16} = addr{20-16};
111 let Inst{15-0} = addr{15-0};
112}
Jack Carter97700972013-08-13 20:19:16 +0000113
114class LWL_FM_MM<bits<4> funct> {
115 bits<5> rt;
116 bits<21> addr;
117
118 bits<32> Inst;
119
120 let Inst{31-26} = 0x18;
121 let Inst{25-21} = rt;
122 let Inst{20-16} = addr{20-16};
123 let Inst{15-12} = funct;
124 let Inst{11-0} = addr{11-0};
125}
Vladimir Medice0fbb442013-09-06 12:41:17 +0000126
127class CMov_F_I_FM_MM<bits<7> func> : MMArch {
128 bits<5> rd;
129 bits<5> rs;
130 bits<3> fcc;
131
132 bits<32> Inst;
133
134 let Inst{31-26} = 0x15;
135 let Inst{25-21} = rd;
136 let Inst{20-16} = rs;
137 let Inst{15-13} = fcc;
138 let Inst{12-6} = func;
139 let Inst{5-0} = 0x3b;
140}
Vladimir Medic457ba562013-09-06 12:53:21 +0000141
142class MTLO_FM_MM<bits<10> funct> : MMArch {
143 bits<5> rs;
144
145 bits<32> Inst;
146
147 let Inst{31-26} = 0x00;
148 let Inst{25-21} = 0x00;
149 let Inst{20-16} = rs;
150 let Inst{15-6} = funct;
151 let Inst{5-0} = 0x3c;
152}
153
154class MFLO_FM_MM<bits<10> funct> : MMArch {
155 bits<5> rd;
156
157 bits<32> Inst;
158
159 let Inst{31-26} = 0x00;
160 let Inst{25-21} = 0x00;
161 let Inst{20-16} = rd;
162 let Inst{15-6} = funct;
163 let Inst{5-0} = 0x3c;
164}
Zoran Jovanovicab852782013-09-14 06:49:25 +0000165
166class CLO_FM_MM<bits<10> funct> : MMArch {
167 bits<5> rd;
168 bits<5> rs;
169
170 bits<32> Inst;
171
172 let Inst{31-26} = 0x00;
173 let Inst{25-21} = rd;
174 let Inst{20-16} = rs;
175 let Inst{15-6} = funct;
176 let Inst{5-0} = 0x3c;
177}
178
179class SEB_FM_MM<bits<10> funct> : MMArch {
180 bits<5> rd;
181 bits<5> rt;
182
183 bits<32> Inst;
184
185 let Inst{31-26} = 0x00;
186 let Inst{25-21} = rd;
187 let Inst{20-16} = rt;
188 let Inst{15-6} = funct;
189 let Inst{5-0} = 0x3c;
190}
191
192class EXT_FM_MM<bits<6> funct> : MMArch {
193 bits<5> rt;
194 bits<5> rs;
195 bits<5> pos;
196 bits<5> size;
197
198 bits<32> Inst;
199
200 let Inst{31-26} = 0x00;
201 let Inst{25-21} = rt;
202 let Inst{20-16} = rs;
203 let Inst{15-11} = size;
204 let Inst{10-6} = pos;
205 let Inst{5-0} = funct;
206}