1 //===-- MicroMipsDSPInstrFormats.td - Instruction Formats --*- tablegen -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 class MMDSPInst<string opstr = "">
11 : MipsInst<(outs), (ins), "", [], NoItinerary, FrmOther> {
12 let ASEPredicate = [HasDSP];
13 let EncodingPredicates = [InMicroMips];
14 string BaseOpcode = opstr;
15 string Arch = "mmdsp";
16 let DecoderNamespace = "MicroMips";
19 class MMDSPInstAlias<string Asm, dag Result, bit Emit = 0b1>
20 : InstAlias<Asm, Result, Emit>, PredicateControl {
21 let ASEPredicate = [HasDSP];
22 let AdditionalPredicates = [InMicroMips];
25 class POOL32A_3R_FMT<string opstr, bits<11> op> : MMDSPInst<opstr> {
30 let Inst{31-26} = 0b000000;
37 class POOL32A_2R_FMT<string opstr, bits<10> op> : MMDSPInst<opstr> {
41 let Inst{31-26} = 0b000000;
45 let Inst{5-0} = 0b111100;
48 class POOL32A_2RAC_FMT<string opstr, bits<8> op> : MMDSPInst<opstr> {
53 let Inst{31-26} = 0b000000;
58 let Inst{5-0} = 0b111100;
61 class POOL32A_3RB0_FMT<string opstr, bits<10> op> : MMDSPInst<opstr> {
66 let Inst{31-26} = 0b000000;
74 class POOL32A_2RSA4_FMT<string opstr, bits<12> op> : MMDSPInst<opstr> {
79 let Inst{31-26} = 0b000000;
86 class POOL32A_2RSA3_FMT<string opstr, bits<7> op> : MMDSPInst<opstr> {
91 let Inst{31-26} = 0b000000;
96 let Inst{5-0} = 0b111100;
99 class POOL32A_2RSA5B0_FMT<string opstr, bits<10> op> : MMDSPInst<opstr> {
104 let Inst{31-26} = 0b000000;
105 let Inst{25-21} = rt;
106 let Inst{20-16} = rs;
107 let Inst{15-11} = sa;
112 class POOL32A_2RSA4B0_FMT<string opstr, bits<11> op> : MMDSPInst<opstr> {
117 let Inst{31-26} = 0b000000;
118 let Inst{25-21} = rt;
119 let Inst{20-16} = rs;
120 let Inst{15-12} = sa;
125 class POOL32A_2RSA4OP6_FMT<string opstr, bits<6> op> : MMDSPInst<opstr> {
130 let Inst{31-26} = 0b000000;
131 let Inst{25-21} = rt;
132 let Inst{20-16} = rs;
133 let Inst{15-12} = sa;
135 let Inst{5-0} = 0b111100;
138 class POOL32A_1RIMM5AC_FMT<string opstr, bits<8> funct> : MMDSPInst<opstr> {
143 let Inst{31-26} = 0b000000;
144 let Inst{25-21} = rt;
145 let Inst{20-16} = imm;
146 let Inst{15-14} = ac;
147 let Inst{13-6} = funct;
148 let Inst{5-0} = 0b111100;
151 class POOL32A_2RSA5_FMT<string opstr, bits<11> op> : MMDSPInst<opstr> {
156 let Inst{31-26} = 0b000000;
157 let Inst{25-21} = rt;
158 let Inst{20-16} = rs;
159 let Inst{15-11} = sa;
163 class POOL32A_1RMEMB0_FMT<string opstr, bits<10> funct> : MMDSPInst<opstr> {
169 let Inst{25-21} = index;
170 let Inst{20-16} = base;
171 let Inst{15-11} = rd;
173 let Inst{9-0} = funct;
176 class POOL32A_1RAC_FMT<string instr_asm, bits<8> funct> : MMDSPInst<instr_asm> {
182 let Inst{20-16} = rs;
183 let Inst{15-14} = ac;
184 let Inst{13-6} = funct;
185 let Inst{5-0} = 0b111100;
188 class POOL32A_1RMASK7_FMT<string opstr, bits<8> op> : MMDSPInst<opstr> {
192 let Inst{31-26} = 0b000000;
193 let Inst{25-21} = rt;
194 let Inst{20-14} = mask;
196 let Inst{5-0} = 0b111100;
199 class POOL32A_1RIMM10_FMT<string opstr, bits<10> op> : MMDSPInst<opstr> {
204 let Inst{25-16} = imm;
205 let Inst{15-11} = rd;
210 class POOL32A_1RIMM8_FMT<string opstr, bits<6> op> : MMDSPInst<opstr> {
215 let Inst{25-21} = rt;
216 let Inst{20-13} = imm;
219 let Inst{5-0} = 0b111100;
222 class POOL32A_4B0SHIFT6AC4B0_FMT<string opstr, bits<10> op> : MMDSPInst<opstr> {
226 let Inst{31-26} = 0b000000;
227 let Inst{25-22} = 0b0000;
228 let Inst{21-16} = shift;
229 let Inst{15-14} = ac;
230 let Inst{13-10} = 0b0000;
234 class POOL32A_5B01RAC_FMT<string opstr, bits<8> op> : MMDSPInst<opstr> {
238 let Inst{31-26} = 0b000000;
239 let Inst{25-21} = 0b00000;
240 let Inst{20-16} = rs;
241 let Inst{15-14} = ac;
243 let Inst{5-0} = 0b111100;
246 class POOL32I_IMMB0_FMT<string opstr, bits<5> op> : MMDSPInst<opstr> {
249 let Inst{31-26} = 0b010000;
250 let Inst{25-21} = op;
252 let Inst{15-0} = offset;
255 class POOL32A_2RBP_FMT<string opstr> : MMDSPInst<opstr> {
261 let Inst{25-21} = rt;
262 let Inst{20-16} = rs;
263 let Inst{15-14} = bp;
264 let Inst{13-6} = 0b00100010;
265 let Inst{5-0} = 0b111100;
268 class POOL32A_2RB0_FMT<string opstr, bits<10> op> : MMDSPInst<opstr> {
273 let Inst{25-21} = rt;
274 let Inst{20-16} = rs;
279 class POOL32S_3RB0_FMT<string opstr, bits<10> op> : MMDSPInst<opstr> {
284 let Inst{31-26} = 0b010110;
285 let Inst{25-21} = rt;
286 let Inst{20-16} = rs;
287 let Inst{15-11} = rd;
292 class POOL32A_2R2B0_FMT<string opstr, bits<10> op> : MMDSPInst<opstr> {
297 let Inst{25-21} = rt;
298 let Inst{20-16} = rs;