Zoran Jovanovic | 2e386d3 | 2015-10-12 16:07:25 +0000 | [diff] [blame] | 1 | //===-- 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 | |
| 10 | class MMDSPInst<string opstr = ""> |
| 11 | : MipsInst<(outs), (ins), "", [], NoItinerary, FrmOther>, PredicateControl { |
| 12 | let InsnPredicates = [HasDSP]; |
Zlatko Buljan | 54b1eb4 | 2015-10-15 08:59:45 +0000 | [diff] [blame] | 13 | let AdditionalPredicates = [InMicroMips]; |
Zoran Jovanovic | 2e386d3 | 2015-10-12 16:07:25 +0000 | [diff] [blame] | 14 | string BaseOpcode = opstr; |
| 15 | string Arch = "mmdsp"; |
| 16 | let DecoderNamespace = "MicroMips"; |
| 17 | } |
| 18 | |
Zlatko Buljan | 54b1eb4 | 2015-10-15 08:59:45 +0000 | [diff] [blame] | 19 | class POOL32A_3R_FMT<string opstr, bits<11> op> : MMDSPInst<opstr> { |
Zoran Jovanovic | 2e386d3 | 2015-10-12 16:07:25 +0000 | [diff] [blame] | 20 | 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 Buljan | 54b1eb4 | 2015-10-15 08:59:45 +0000 | [diff] [blame] | 30 | |
Zlatko Buljan | d0a7d6e | 2015-10-19 06:34:44 +0000 | [diff] [blame] | 31 | class POOL32A_2R_FMT<string opstr, bits<10> op> : MMDSPInst<opstr> { |
| 32 | bits<5> rt; |
| 33 | bits<5> rs; |
| 34 | |
| 35 | let Inst{31-26} = 0b000000; |
| 36 | let Inst{25-21} = rt; |
| 37 | let Inst{20-16} = rs; |
| 38 | let Inst{15-6} = op; |
| 39 | let Inst{5-0} = 0b111100; |
| 40 | } |
| 41 | |
| 42 | class POOL32A_2RAC_FMT<string opstr, bits<8> op> : MMDSPInst<opstr> { |
| 43 | bits<5> rt; |
| 44 | bits<5> rs; |
| 45 | bits<2> ac; |
| 46 | |
| 47 | let Inst{31-26} = 0b000000; |
| 48 | let Inst{25-21} = rt; |
| 49 | let Inst{20-16} = rs; |
| 50 | let Inst{15-14} = ac; |
| 51 | let Inst{13-6} = op; |
| 52 | let Inst{5-0} = 0b111100; |
| 53 | } |
Zlatko Buljan | 5292083 | 2015-10-19 07:16:26 +0000 | [diff] [blame] | 54 | |
| 55 | class POOL32A_3RB0_FMT<string opstr, bits<10> op> : MMDSPInst<opstr> { |
| 56 | bits<5> rd; |
| 57 | bits<5> rs; |
| 58 | bits<5> rt; |
| 59 | |
| 60 | let Inst{31-26} = 0b000000; |
| 61 | let Inst{25-21} = rt; |
| 62 | let Inst{20-16} = rs; |
| 63 | let Inst{15-11} = rd; |
| 64 | let Inst{10} = 0b0; |
| 65 | let Inst{9-0} = op; |
| 66 | } |
Zlatko Buljan | 2cf6102 | 2015-10-23 06:39:29 +0000 | [diff] [blame^] | 67 | |
| 68 | class POOL32A_2RSA4_FMT<string opstr, bits<12> op> : MMDSPInst<opstr> { |
| 69 | bits<5> rt; |
| 70 | bits<5> rs; |
| 71 | bits<4> sa; |
| 72 | |
| 73 | let Inst{31-26} = 0b000000; |
| 74 | let Inst{25-21} = rt; |
| 75 | let Inst{20-16} = rs; |
| 76 | let Inst{15-12} = sa; |
| 77 | let Inst{11-0} = op; |
| 78 | } |
| 79 | |
| 80 | class POOL32A_2RSA3_FMT<string opstr, bits<7> op> : MMDSPInst<opstr> { |
| 81 | bits<5> rt; |
| 82 | bits<5> rs; |
| 83 | bits<3> sa; |
| 84 | |
| 85 | let Inst{31-26} = 0b000000; |
| 86 | let Inst{25-21} = rt; |
| 87 | let Inst{20-16} = rs; |
| 88 | let Inst{15-13} = sa; |
| 89 | let Inst{12-6} = op; |
| 90 | let Inst{5-0} = 0b111100; |
| 91 | } |
| 92 | |
| 93 | class POOL32A_2RSA5B0_FMT<string opstr, bits<10> op> : MMDSPInst<opstr> { |
| 94 | bits<5> rt; |
| 95 | bits<5> rs; |
| 96 | bits<5> sa; |
| 97 | |
| 98 | let Inst{31-26} = 0b000000; |
| 99 | let Inst{25-21} = rt; |
| 100 | let Inst{20-16} = rs; |
| 101 | let Inst{15-11} = sa; |
| 102 | let Inst{10} = 0b0; |
| 103 | let Inst{9-0} = op; |
| 104 | } |