blob: bb83fc07c2009ad10a1dea56a712f765d12bfcb3 [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 Lopes7728f7e2008-07-09 05:32:22 +000036def FeatureGP64Bit : SubtargetFeature<"gp64", "IsGP64bit", "true",
Bruno Cardoso Lopes225ca9c2008-07-05 19:05:21 +000037 "General Purpose Registers are 64-bit wide.">;
Bruno Cardoso Lopes7728f7e2008-07-09 05:32:22 +000038def FeatureFP64Bit : SubtargetFeature<"fp64", "IsFP64bit", "true",
Bruno Cardoso Lopes225ca9c2008-07-05 19:05:21 +000039 "Support 64-bit FP registers.">;
Bruno Cardoso Lopes7728f7e2008-07-09 05:32:22 +000040def FeatureSingleFloat : SubtargetFeature<"single-float", "IsSingleFloat",
Bruno Cardoso Lopes225ca9c2008-07-05 19:05:21 +000041 "true", "Only supports single precision float">;
Bruno Cardoso Lopes7728f7e2008-07-09 05:32:22 +000042def FeatureMips2 : SubtargetFeature<"mips2", "MipsArchVersion", "Mips2",
Bruno Cardoso Lopes225ca9c2008-07-05 19:05:21 +000043 "Mips2 ISA Support">;
Bruno Cardoso Lopes7728f7e2008-07-09 05:32:22 +000044def FeatureO32 : SubtargetFeature<"o32", "MipsABI", "O32",
Bruno Cardoso Lopes225ca9c2008-07-05 19:05:21 +000045 "Enable o32 ABI">;
Bruno Cardoso Lopes7728f7e2008-07-09 05:32:22 +000046def FeatureEABI : SubtargetFeature<"eabi", "MipsABI", "EABI",
Bruno Cardoso Lopes225ca9c2008-07-05 19:05:21 +000047 "Enable eabi ABI">;
Bruno Cardoso Lopes7728f7e2008-07-09 05:32:22 +000048def FeatureVFPU : SubtargetFeature<"vfpu", "HasVFPU",
49 "true", "Enable vector FPU instructions.">;
50def FeatureSEInReg : SubtargetFeature<"seinreg", "HasSEInReg", "true",
51 "Enable 'signext in register' instructions.">;
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000052
53//===----------------------------------------------------------------------===//
54// Mips processors supported.
55//===----------------------------------------------------------------------===//
56
Bruno Cardoso Lopes225ca9c2008-07-05 19:05:21 +000057class Proc<string Name, list<SubtargetFeature> Features>
58 : Processor<Name, MipsGenericItineraries, Features>;
59
60def : Proc<"mips1", []>;
61def : Proc<"r2000", []>;
62def : Proc<"r3000", []>;
63
64def : Proc<"mips2", [FeatureMips2]>;
65def : Proc<"r6000", [FeatureMips2]>;
66
67// Allegrex is a 32bit subset of r4000, both for interger and fp registers,
68// but much more similar to Mips2 than Mips3.
Bruno Cardoso Lopes7728f7e2008-07-09 05:32:22 +000069def : Proc<"allegrex", [FeatureMips2, FeatureSingleFloat, FeatureEABI,
70 FeatureSEInReg, FeatureVFPU]>;
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000071
72def Mips : Target {
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000073 let InstructionSet = MipsInstrInfo;
74}