Merge branch 'master' into msp430
[llvm/msp430.git] / lib / Target / Mips / Mips.td
blob79ae5d2425f4685a5912bad8ca063410fabeef0b
1 //===- Mips.td - Describe the Mips Target Machine ---------------*- C++ -*-===//
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 //===----------------------------------------------------------------------===//
12 //===----------------------------------------------------------------------===//
13 // Target-independent interfaces
14 //===----------------------------------------------------------------------===//
16 include "llvm/Target/Target.td"
18 //===----------------------------------------------------------------------===//
19 // Register File, Calling Conv, Instruction Descriptions
20 //===----------------------------------------------------------------------===//
22 include "MipsRegisterInfo.td"
23 include "MipsSchedule.td"
24 include "MipsInstrInfo.td"
25 include "MipsCallingConv.td"
27 def MipsInstrInfo : InstrInfo {
28   let TSFlagsFields = [];
29   let TSFlagsShifts = [];
32 //===----------------------------------------------------------------------===//
33 // Mips Subtarget features                                                    //
34 //===----------------------------------------------------------------------===//
36 def FeatureGP64Bit     : SubtargetFeature<"gp64", "IsGP64bit", "true",
37                                 "General Purpose Registers are 64-bit wide.">;
38 def FeatureFP64Bit     : SubtargetFeature<"fp64", "IsFP64bit", "true",
39                                 "Support 64-bit FP registers.">;
40 def FeatureSingleFloat : SubtargetFeature<"single-float", "IsSingleFloat",
41                                 "true", "Only supports single precision float">;
42 def FeatureMips2       : SubtargetFeature<"mips2", "MipsArchVersion", "Mips2",
43                                 "Mips2 ISA Support">;
44 def FeatureO32         : SubtargetFeature<"o32", "MipsABI", "O32",
45                                 "Enable o32 ABI">;
46 def FeatureEABI        : SubtargetFeature<"eabi", "MipsABI", "EABI",
47                                 "Enable eabi ABI">;
48 def FeatureVFPU        : SubtargetFeature<"vfpu", "HasVFPU", 
49                                 "true", "Enable vector FPU instructions.">;
50 def FeatureSEInReg     : SubtargetFeature<"seinreg", "HasSEInReg", "true", 
51                                 "Enable 'signext in register' instructions.">;
52 def FeatureCondMov     : SubtargetFeature<"condmov", "HasCondMov", "true", 
53                                 "Enable 'conditional move' instructions.">;
54 def FeatureMulDivAdd   : SubtargetFeature<"muldivadd", "HasMulDivAdd", "true",
55                                 "Enable 'multiply add/sub' instructions.">;
56 def FeatureMinMax      : SubtargetFeature<"minmax", "HasMinMax", "true",
57                                 "Enable 'min/max' instructions.">;
58 def FeatureSwap        : SubtargetFeature<"swap", "HasSwap", "true",
59                                 "Enable 'byte/half swap' instructions.">;
60 def FeatureBitCount    : SubtargetFeature<"bitcount", "HasBitCount", "true",
61                                 "Enable 'count leading bits' instructions.">;
63 //===----------------------------------------------------------------------===//
64 // Mips processors supported.
65 //===----------------------------------------------------------------------===//
67 class Proc<string Name, list<SubtargetFeature> Features>
68  : Processor<Name, MipsGenericItineraries, Features>;
70 def : Proc<"mips1", []>;
71 def : Proc<"r2000", []>;
72 def : Proc<"r3000", []>;
74 def : Proc<"mips2", [FeatureMips2]>;
75 def : Proc<"r6000", [FeatureMips2]>;
77 // Allegrex is a 32bit subset of r4000, both for interger and fp registers, 
78 // but much more similar to Mips2 than Mips3. It also contains some of 
79 // Mips32/Mips32r2 instructions and a custom vector fpu processor. 
80 def : Proc<"allegrex", [FeatureMips2, FeatureSingleFloat, FeatureEABI, 
81       FeatureVFPU, FeatureSEInReg, FeatureCondMov, FeatureMulDivAdd,
82       FeatureMinMax, FeatureSwap, FeatureBitCount]>;
84 def Mips : Target {
85   let InstructionSet = MipsInstrInfo;