1 //===-- MicroMipsDSPInstrFormats.td - 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 class MMDSPInst<string opstr = "">
10 : MipsInst<(outs), (ins), "", [], NoItinerary, FrmOther> {
11 let ASEPredicate = [HasDSP];
12 let EncodingPredicates = [InMicroMips];
13 string BaseOpcode = opstr;
14 string Arch = "mmdsp";
15 let DecoderNamespace = "MicroMips";
18 class MMDSPInstAlias<string Asm, dag Result, bit Emit = 0b1>
19 : InstAlias<Asm, Result, Emit>, PredicateControl {
20 let ASEPredicate = [HasDSP];
21 let AdditionalPredicates = [InMicroMips];
24 class POOL32A_3R_FMT<string opstr, bits<11> op> : MMDSPInst<opstr> {
29 let Inst{31-26} = 0b000000;
36 class POOL32A_2R_FMT<string opstr, bits<10> op> : MMDSPInst<opstr> {
40 let Inst{31-26} = 0b000000;
44 let Inst{5-0} = 0b111100;
47 class POOL32A_2RAC_FMT<string opstr, bits<8> op> : MMDSPInst<opstr> {
52 let Inst{31-26} = 0b000000;
57 let Inst{5-0} = 0b111100;
60 class POOL32A_3RB0_FMT<string opstr, bits<10> op> : MMDSPInst<opstr> {
65 let Inst{31-26} = 0b000000;
73 class POOL32A_2RSA4_FMT<string opstr, bits<12> op> : MMDSPInst<opstr> {
78 let Inst{31-26} = 0b000000;
85 class POOL32A_2RSA3_FMT<string opstr, bits<7> op> : MMDSPInst<opstr> {
90 let Inst{31-26} = 0b000000;
95 let Inst{5-0} = 0b111100;
98 class POOL32A_2RSA5B0_FMT<string opstr, bits<10> op> : MMDSPInst<opstr> {
103 let Inst{31-26} = 0b000000;
104 let Inst{25-21} = rt;
105 let Inst{20-16} = rs;
106 let Inst{15-11} = sa;
111 class POOL32A_2RSA4B0_FMT<string opstr, bits<11> op> : MMDSPInst<opstr> {
116 let Inst{31-26} = 0b000000;
117 let Inst{25-21} = rt;
118 let Inst{20-16} = rs;
119 let Inst{15-12} = sa;
124 class POOL32A_2RSA4OP6_FMT<string opstr, bits<6> op> : MMDSPInst<opstr> {
129 let Inst{31-26} = 0b000000;
130 let Inst{25-21} = rt;
131 let Inst{20-16} = rs;
132 let Inst{15-12} = sa;
134 let Inst{5-0} = 0b111100;
137 class POOL32A_1RIMM5AC_FMT<string opstr, bits<8> funct> : MMDSPInst<opstr> {
142 let Inst{31-26} = 0b000000;
143 let Inst{25-21} = rt;
144 let Inst{20-16} = imm;
145 let Inst{15-14} = ac;
146 let Inst{13-6} = funct;
147 let Inst{5-0} = 0b111100;
150 class POOL32A_2RSA5_FMT<string opstr, bits<11> op> : MMDSPInst<opstr> {
155 let Inst{31-26} = 0b000000;
156 let Inst{25-21} = rt;
157 let Inst{20-16} = rs;
158 let Inst{15-11} = sa;
162 class POOL32A_1RMEMB0_FMT<string opstr, bits<10> funct> : MMDSPInst<opstr> {
168 let Inst{25-21} = index;
169 let Inst{20-16} = base;
170 let Inst{15-11} = rd;
172 let Inst{9-0} = funct;
175 class POOL32A_1RAC_FMT<string instr_asm, bits<8> funct> : MMDSPInst<instr_asm> {
181 let Inst{20-16} = rs;
182 let Inst{15-14} = ac;
183 let Inst{13-6} = funct;
184 let Inst{5-0} = 0b111100;
187 class POOL32A_1RMASK7_FMT<string opstr, bits<8> op> : MMDSPInst<opstr> {
191 let Inst{31-26} = 0b000000;
192 let Inst{25-21} = rt;
193 let Inst{20-14} = mask;
195 let Inst{5-0} = 0b111100;
198 class POOL32A_1RIMM10_FMT<string opstr, bits<10> op> : MMDSPInst<opstr> {
203 let Inst{25-16} = imm;
204 let Inst{15-11} = rd;
209 class POOL32A_1RIMM8_FMT<string opstr, bits<6> op> : MMDSPInst<opstr> {
214 let Inst{25-21} = rt;
215 let Inst{20-13} = imm;
218 let Inst{5-0} = 0b111100;
221 class POOL32A_4B0SHIFT6AC4B0_FMT<string opstr, bits<10> op> : MMDSPInst<opstr> {
225 let Inst{31-26} = 0b000000;
226 let Inst{25-22} = 0b0000;
227 let Inst{21-16} = shift;
228 let Inst{15-14} = ac;
229 let Inst{13-10} = 0b0000;
233 class POOL32A_5B01RAC_FMT<string opstr, bits<8> op> : MMDSPInst<opstr> {
237 let Inst{31-26} = 0b000000;
238 let Inst{25-21} = 0b00000;
239 let Inst{20-16} = rs;
240 let Inst{15-14} = ac;
242 let Inst{5-0} = 0b111100;
245 class POOL32I_IMMB0_FMT<string opstr, bits<5> op> : MMDSPInst<opstr> {
248 let Inst{31-26} = 0b010000;
249 let Inst{25-21} = op;
251 let Inst{15-0} = offset;
254 class POOL32A_2RBP_FMT<string opstr> : MMDSPInst<opstr> {
260 let Inst{25-21} = rt;
261 let Inst{20-16} = rs;
262 let Inst{15-14} = bp;
263 let Inst{13-6} = 0b00100010;
264 let Inst{5-0} = 0b111100;
267 class POOL32A_2RB0_FMT<string opstr, bits<10> op> : MMDSPInst<opstr> {
272 let Inst{25-21} = rt;
273 let Inst{20-16} = rs;
278 class POOL32S_3RB0_FMT<string opstr, bits<10> op> : MMDSPInst<opstr> {
283 let Inst{31-26} = 0b010110;
284 let Inst{25-21} = rt;
285 let Inst{20-16} = rs;
286 let Inst{15-11} = rd;
291 class POOL32A_2R2B0_FMT<string opstr, bits<10> op> : MMDSPInst<opstr> {
296 let Inst{25-21} = rt;
297 let Inst{20-16} = rs;