Simon Dardis | 7323f7a | 2017-07-12 12:33:40 +0000 | [diff] [blame] | 1 | //===-- MipsMTInstrFormats.td - Mips 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 | //===----------------------------------------------------------------------===// |
| 11 | // Describe the MIPS MT instructions format |
| 12 | // |
| 13 | // opcode - operation code. |
| 14 | // rt - destination register |
| 15 | // |
| 16 | //===----------------------------------------------------------------------===// |
| 17 | |
| 18 | class MipsMTInst : MipsInst<(outs), (ins), "", [], NoItinerary, FrmOther>, |
| 19 | PredicateControl { |
| 20 | let DecoderNamespace = "Mips"; |
| 21 | let EncodingPredicates = [HasStdEnc]; |
| 22 | } |
| 23 | |
| 24 | class OPCODE1<bits<1> Val> { |
| 25 | bits<1> Value = Val; |
| 26 | } |
| 27 | |
| 28 | def OPCODE_SC_DMT : OPCODE1<0b0>; |
| 29 | def OPCODE_SC_EMT : OPCODE1<0b1>; |
| 30 | |
| 31 | class FIELD5<bits<5> Val> { |
| 32 | bits<5> Value = Val; |
| 33 | } |
| 34 | |
| 35 | def FIELD5_1_DMT_EMT : FIELD5<0b00001>; |
| 36 | def FIELD5_2_DMT_EMT : FIELD5<0b01111>; |
| 37 | |
| 38 | class COP0_MFMC0_MT<FIELD5 Op1, FIELD5 Op2, OPCODE1 sc> : MipsMTInst { |
| 39 | bits<32> Inst; |
| 40 | |
| 41 | bits<5> rt; |
| 42 | let Inst{31-26} = 0b010000; // COP0 |
| 43 | let Inst{25-21} = 0b01011; // MFMC0 |
| 44 | let Inst{20-16} = rt; |
| 45 | let Inst{15-11} = Op1.Value; |
| 46 | let Inst{10-6} = Op2.Value; |
| 47 | let Inst{5} = sc.Value; |
| 48 | let Inst{4-3} = 0b00; |
| 49 | let Inst{2-0} = 0b001; |
| 50 | } |