[mips][microMIPSr6] Implement MUL, MUH, MULU and MUHU instructions
[oota-llvm.git] / lib / Target / Mips / MicroMips32r6InstrFormats.td
1 //=- MicroMips32r6InstrFormats.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 microMIPS32r6 instruction formats.
11 //
12 //===----------------------------------------------------------------------===//
13
14 class MMR6Arch<string opstr> {
15   string Arch = "micromipsr6";
16   string BaseOpcode = opstr;
17 }
18
19 class POOL32A_BITSWAP_FM_MMR6<bits<6> funct> : MipsR6Inst {
20   bits<5> rd;
21   bits<5> rt;
22
23   bits<32> Inst;
24
25   let Inst{31-26} = 0b000000;
26   let Inst{25-21} = rt;
27   let Inst{20-16} = rd;
28   let Inst{15-12} = 0b0000;
29   let Inst{11-6} = funct;
30   let Inst{5-0} = 0b111100;
31 }
32
33 class CACHE_PREF_FM_MMR6<bits<6> opgroup, bits<4> funct> : MipsR6Inst {
34   bits<21> addr;
35   bits<5> hint;
36
37   bits<32> Inst;
38
39   let Inst{31-26} = opgroup;
40   let Inst{25-21} = hint;
41   let Inst{20-16} = addr{20-16};
42   let Inst{15-12} = funct;
43   let Inst{11-0}  = addr{11-0};
44 }
45
46 class ARITH_FM_MMR6<string instr_asm, bits<10> funct> : MMR6Arch<instr_asm> {
47   bits<5> rd;
48   bits<5> rt;
49   bits<5> rs;
50
51   bits<32> Inst;
52
53   let Inst{31-26} = 0;
54   let Inst{25-21} = rt;
55   let Inst{20-16} = rs;
56   let Inst{15-11} = rd;
57   let Inst{10}    = 0;
58   let Inst{9-0}   = funct;
59 }
60
61 class ADDI_FM_MMR6<string instr_asm, bits<6> op> : MMR6Arch<instr_asm> {
62   bits<5>  rt;
63   bits<5>  rs;
64   bits<16> imm16;
65
66   bits<32> Inst;
67
68   let Inst{31-26} = op;
69   let Inst{25-21} = rt;
70   let Inst{20-16} = rs;
71   let Inst{15-0}  = imm16;
72 }