blob: f57c55a55745bf1588d9deac54eda963302191e1 [file] [log] [blame]
Akira Hatanaka329df552012-09-22 00:06:06 +00001//===- MipsDSPInstrFormats.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
10def HasDSP : Predicate<"Subtarget.hasDSP()">,
11 AssemblerPredicate<"FeatureDSP">;
12def HasDSPR2 : Predicate<"Subtarget.hasDSPR2()">,
13 AssemblerPredicate<"FeatureDSPR2">;
14
15// Fields.
16class Field6<bits<6> val> {
17 bits<6> V = val;
18}
19
20def SPECIAL3_OPCODE : Field6<0b011111>;
21def REGIMM_OPCODE : Field6<0b000001>;
22
23class DSPInst : MipsInst<(outs), (ins), "", [], NoItinerary, FrmOther> {
24 let Predicates = [HasDSP];
25}
Akira Hatanaka1babeaa2012-09-27 02:05:42 +000026
27// EXTR.W sub-class format (type 1).
28class EXTR_W_TY1_FMT<bits<5> op> : DSPInst {
29 bits<5> rt;
30 bits<2> ac;
31 bits<5> shift_rs;
32
33 let Opcode = SPECIAL3_OPCODE.V;
34
35 let Inst{25-21} = shift_rs;
36 let Inst{20-16} = rt;
37 let Inst{15-13} = 0;
38 let Inst{12-11} = ac;
39 let Inst{10-6} = op;
40 let Inst{5-0} = 0b111000;
41}