d55d7afba98ea7e1c2be9b84fa3d6b0dc5f8668a
[oota-llvm.git] / lib / Target / Mips / Mips.td
1 //===- Mips.td - Describe the Mips Target Machine ----------*- 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 // This is the top level entry point for the Mips target.
10 //===----------------------------------------------------------------------===//
11
12 //===----------------------------------------------------------------------===//
13 // Target-independent interfaces
14 //===----------------------------------------------------------------------===//
15
16 include "llvm/Target/Target.td"
17
18 //===----------------------------------------------------------------------===//
19 // Register File, Calling Conv, Instruction Descriptions
20 //===----------------------------------------------------------------------===//
21
22 include "MipsRegisterInfo.td"
23 include "MipsSchedule.td"
24 include "MipsInstrInfo.td"
25 include "MipsCallingConv.td"
26
27 def MipsInstrInfo : InstrInfo;
28
29 //===----------------------------------------------------------------------===//
30 // Mips Subtarget features                                                    //
31 //===----------------------------------------------------------------------===//
32
33 def FeatureGP64Bit     : SubtargetFeature<"gp64", "IsGP64bit", "true",
34                                 "General Purpose Registers are 64-bit wide.">;
35 def FeatureFP64Bit     : SubtargetFeature<"fp64", "IsFP64bit", "true",
36                                 "Support 64-bit FP registers.">;
37 def FeatureSingleFloat : SubtargetFeature<"single-float", "IsSingleFloat",
38                                 "true", "Only supports single precision float">;
39 def FeatureO32         : SubtargetFeature<"o32", "MipsABI", "O32",
40                                 "Enable o32 ABI">;
41 def FeatureEABI        : SubtargetFeature<"eabi", "MipsABI", "EABI",
42                                 "Enable eabi ABI">;
43 def FeatureVFPU        : SubtargetFeature<"vfpu", "HasVFPU",
44                                 "true", "Enable vector FPU instructions.">;
45 def FeatureSEInReg     : SubtargetFeature<"seinreg", "HasSEInReg", "true",
46                                 "Enable 'signext in register' instructions.">;
47 def FeatureCondMov     : SubtargetFeature<"condmov", "HasCondMov", "true",
48                                 "Enable 'conditional move' instructions.">;
49 def FeatureMulDivAdd   : SubtargetFeature<"muldivadd", "HasMulDivAdd", "true",
50                                 "Enable 'multiply add/sub' instructions.">;
51 def FeatureMinMax      : SubtargetFeature<"minmax", "HasMinMax", "true",
52                                 "Enable 'min/max' instructions.">;
53 def FeatureSwap        : SubtargetFeature<"swap", "HasSwap", "true",
54                                 "Enable 'byte/half swap' instructions.">;
55 def FeatureBitCount    : SubtargetFeature<"bitcount", "HasBitCount", "true",
56                                 "Enable 'count leading bits' instructions.">;
57 def FeatureMips32      : SubtargetFeature<"mips32", "MipsArchVersion", "Mips32",
58                                 "Mips32 ISA Support",
59                                 [FeatureCondMov, FeatureBitCount]>;
60 def FeatureMips32r2    : SubtargetFeature<"mips32r2", "MipsArchVersion",
61                                 "Mips32r2", "Mips32r2 ISA Support",
62                                 [FeatureMips32, FeatureSEInReg]>;
63
64 //===----------------------------------------------------------------------===//
65 // Mips processors supported.
66 //===----------------------------------------------------------------------===//
67
68 class Proc<string Name, list<SubtargetFeature> Features>
69  : Processor<Name, MipsGenericItineraries, Features>;
70
71 def : Proc<"mips32r1", [FeatureMips32]>;
72 def : Proc<"4ke", [FeatureMips32r2]>;
73
74 def MipsAsmWriter : AsmWriter {
75   string AsmWriterClassName  = "InstPrinter";
76   bit isMCAsmWriter = 1;
77 }
78
79 def Mips : Target {
80   let InstructionSet = MipsInstrInfo;
81
82   let AssemblyWriters = [MipsAsmWriter];
83 }
84