blob: aec6ac5e9787459e4b16cacff4707aa01bbd7f5c [file] [log] [blame]
Zoran Jovanovic2e386d32015-10-12 16:07:25 +00001//===-- MicroMipsDSPInstrFormats.td - 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
10class MMDSPInst<string opstr = "">
11 : MipsInst<(outs), (ins), "", [], NoItinerary, FrmOther>, PredicateControl {
12 let InsnPredicates = [HasDSP];
Zlatko Buljan54b1eb42015-10-15 08:59:45 +000013 let AdditionalPredicates = [InMicroMips];
Zoran Jovanovic2e386d32015-10-12 16:07:25 +000014 string BaseOpcode = opstr;
15 string Arch = "mmdsp";
16 let DecoderNamespace = "MicroMips";
17}
18
Zlatko Buljan54b1eb42015-10-15 08:59:45 +000019class POOL32A_3R_FMT<string opstr, bits<11> op> : MMDSPInst<opstr> {
Zoran Jovanovic2e386d32015-10-12 16:07:25 +000020 bits<5> rd;
21 bits<5> rs;
22 bits<5> rt;
23
24 let Inst{31-26} = 0b000000;
25 let Inst{25-21} = rt;
26 let Inst{20-16} = rs;
27 let Inst{15-11} = rd;
28 let Inst{10-0} = op;
29}
Zlatko Buljan54b1eb42015-10-15 08:59:45 +000030
31class POOL32A_AC2R_FMT<string opstr, bits<8> funct> : MMDSPInst<opstr> {
32 bits<2> ac;
33 bits<5> rs;
34 bits<5> rt;
35
36 let Inst{31-26} = 0;
37 let Inst{25-21} = rt;
38 let Inst{20-16} = rs;
39 let Inst{15-14} = ac;
40 let Inst{13-6} = funct;
41 let Inst{5-0} = 0b111100;
42}
Zlatko Buljand0a7d6e2015-10-19 06:34:44 +000043
44class POOL32A_2R_FMT<string opstr, bits<10> op> : MMDSPInst<opstr> {
45 bits<5> rt;
46 bits<5> rs;
47
48 let Inst{31-26} = 0b000000;
49 let Inst{25-21} = rt;
50 let Inst{20-16} = rs;
51 let Inst{15-6} = op;
52 let Inst{5-0} = 0b111100;
53}
54
55class POOL32A_2RAC_FMT<string opstr, bits<8> op> : MMDSPInst<opstr> {
56 bits<5> rt;
57 bits<5> rs;
58 bits<2> ac;
59
60 let Inst{31-26} = 0b000000;
61 let Inst{25-21} = rt;
62 let Inst{20-16} = rs;
63 let Inst{15-14} = ac;
64 let Inst{13-6} = op;
65 let Inst{5-0} = 0b111100;
66}
Zlatko Buljan52920832015-10-19 07:16:26 +000067
68class POOL32A_3RB0_FMT<string opstr, bits<10> op> : MMDSPInst<opstr> {
69 bits<5> rd;
70 bits<5> rs;
71 bits<5> rt;
72
73 let Inst{31-26} = 0b000000;
74 let Inst{25-21} = rt;
75 let Inst{20-16} = rs;
76 let Inst{15-11} = rd;
77 let Inst{10} = 0b0;
78 let Inst{9-0} = op;
79}