1 //===-- MipsMTInstrFormats.td - Mips 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 //===----------------------------------------------------------------------===//
10 // Describe the MIPS MT instructions format
12 // opcode - operation code.
13 // rt - destination register
15 //===----------------------------------------------------------------------===//
17 class MipsMTInst : MipsInst<(outs), (ins), "", [], NoItinerary, FrmOther> {
18 let DecoderNamespace = "Mips";
19 let EncodingPredicates = [HasStdEnc];
22 class OPCODE1<bits<1> Val> {
26 def OPCODE_SC_D : OPCODE1<0b0>;
27 def OPCODE_SC_E : OPCODE1<0b1>;
29 class FIELD5<bits<5> Val> {
33 def FIELD5_1_DMT_EMT : FIELD5<0b00001>;
34 def FIELD5_2_DMT_EMT : FIELD5<0b01111>;
35 def FIELD5_1_2_DVPE_EVPE : FIELD5<0b00000>;
36 def FIELD5_MFTR : FIELD5<0b01000>;
37 def FIELD5_MTTR : FIELD5<0b01100>;
39 class COP0_MFMC0_MT<FIELD5 Op1, FIELD5 Op2, OPCODE1 sc> : MipsMTInst {
43 let Inst{31-26} = 0b010000; // COP0
44 let Inst{25-21} = 0b01011; // MFMC0
46 let Inst{15-11} = Op1.Value;
47 let Inst{10-6} = Op2.Value;
48 let Inst{5} = sc.Value;
50 let Inst{2-0} = 0b001;
53 class COP0_MFTTR_MT<FIELD5 Op> : MipsMTInst {
61 let Inst{31-26} = 0b010000; // COP0
62 let Inst{25-21} = Op.Value; // MFMC0
65 let Inst{10-6} = 0b00000; // rx - currently unsupported.
72 class SPECIAL3_MT_FORK : MipsMTInst {
78 let Inst{31-26} = 0b011111; // SPECIAL3
82 let Inst{10-6} = 0b00000;
83 let Inst{5-0} = 0b001000; // FORK
86 class SPECIAL3_MT_YIELD : MipsMTInst {
91 let Inst{31-26} = 0b011111; // SPECIAL3
93 let Inst{20-16} = 0b00000;
95 let Inst{10-6} = 0b00000;
96 let Inst{5-0} = 0b001001; // FORK