blob: 1199cc47ace7962ea13d0953a3bdf8b82c193260 [file] [log] [blame]
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +00001//===- Mips.td - Describe the Mips Target Machine ---------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner4ee451d2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +00007//
8//===----------------------------------------------------------------------===//
Bruno Cardoso Lopes6d32ca02007-08-18 02:18:07 +00009// This is the top level entry point for the Mips target.
10//===----------------------------------------------------------------------===//
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000011
12//===----------------------------------------------------------------------===//
Bruno Cardoso Lopes6d32ca02007-08-18 02:18:07 +000013// Target-independent interfaces
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000014//===----------------------------------------------------------------------===//
15
16include "../Target.td"
17
18//===----------------------------------------------------------------------===//
Bruno Cardoso Lopes225ca9c2008-07-05 19:05:21 +000019// Register File, Calling Conv, Instruction Descriptions
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000020//===----------------------------------------------------------------------===//
21
22include "MipsRegisterInfo.td"
Bruno Cardoso Lopes6d32ca02007-08-18 02:18:07 +000023include "MipsSchedule.td"
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000024include "MipsInstrInfo.td"
Bruno Cardoso Lopes6d32ca02007-08-18 02:18:07 +000025include "MipsCallingConv.td"
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000026
27def MipsInstrInfo : InstrInfo {
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000028 let TSFlagsFields = [];
29 let TSFlagsShifts = [];
30}
Bruno Cardoso Lopes6d32ca02007-08-18 02:18:07 +000031
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000032//===----------------------------------------------------------------------===//
Bruno Cardoso Lopes225ca9c2008-07-05 19:05:21 +000033// Mips Subtarget features //
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000034//===----------------------------------------------------------------------===//
35
Bruno Cardoso Lopes225ca9c2008-07-05 19:05:21 +000036def FeatureGP64Bit : SubtargetFeature<"gp64", "IsGP64bit", "true",
37 "General Purpose Registers are 64-bit wide.">;
38def FeatureFP64Bit : SubtargetFeature<"fp64", "IsFP64bit", "true",
39 "Support 64-bit FP registers.">;
40def FeatureSingleFloat : SubtargetFeature<"single-float", "IsSingleFloat",
41 "true", "Only supports single precision float">;
42def FeatureAllegrexVFPU : SubtargetFeature<"allegrex-vfpu", "HasAllegrexVFPU",
43 "true", "Enable Allegrex VFPU instructions.">;
44def FeatureMips2 : SubtargetFeature<"mips2", "MipsArchVersion", "Mips2",
45 "Mips2 ISA Support">;
46def FeatureO32 : SubtargetFeature<"o32", "MipsABI", "O32",
47 "Enable o32 ABI">;
48def FeatureEABI : SubtargetFeature<"eabi", "MipsABI", "EABI",
49 "Enable eabi ABI">;
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000050
51//===----------------------------------------------------------------------===//
52// Mips processors supported.
53//===----------------------------------------------------------------------===//
54
Bruno Cardoso Lopes225ca9c2008-07-05 19:05:21 +000055class Proc<string Name, list<SubtargetFeature> Features>
56 : Processor<Name, MipsGenericItineraries, Features>;
57
58def : Proc<"mips1", []>;
59def : Proc<"r2000", []>;
60def : Proc<"r3000", []>;
61
62def : Proc<"mips2", [FeatureMips2]>;
63def : Proc<"r6000", [FeatureMips2]>;
64
65// Allegrex is a 32bit subset of r4000, both for interger and fp registers,
66// but much more similar to Mips2 than Mips3.
67def : Proc<"allegrex", [FeatureMips2, FeatureSingleFloat, FeatureAllegrexVFPU,
68 FeatureEABI]>;
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000069
70def Mips : Target {
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000071 let InstructionSet = MipsInstrInfo;
72}