blob: aa036aef83d0b81f340df923526b8ed9857db76a [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001//===- Mips.td - Describe the Mips Target Machine ---------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner081ce942007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Dan Gohmanf17a25c2007-07-18 16:29:46 +00007//
8//===----------------------------------------------------------------------===//
Bruno Cardoso Lopes57d896c2007-08-18 02:18:07 +00009// This is the top level entry point for the Mips target.
10//===----------------------------------------------------------------------===//
Dan Gohmanf17a25c2007-07-18 16:29:46 +000011
12//===----------------------------------------------------------------------===//
Bruno Cardoso Lopes57d896c2007-08-18 02:18:07 +000013// Target-independent interfaces
Dan Gohmanf17a25c2007-07-18 16:29:46 +000014//===----------------------------------------------------------------------===//
15
Evan Cheng301aaf52008-11-24 07:34:46 +000016include "llvm/Target/Target.td"
Dan Gohmanf17a25c2007-07-18 16:29:46 +000017
18//===----------------------------------------------------------------------===//
Bruno Cardoso Lopes4fb1f542008-07-05 19:05:21 +000019// Register File, Calling Conv, Instruction Descriptions
Dan Gohmanf17a25c2007-07-18 16:29:46 +000020//===----------------------------------------------------------------------===//
21
22include "MipsRegisterInfo.td"
Bruno Cardoso Lopes57d896c2007-08-18 02:18:07 +000023include "MipsSchedule.td"
Dan Gohmanf17a25c2007-07-18 16:29:46 +000024include "MipsInstrInfo.td"
Bruno Cardoso Lopes57d896c2007-08-18 02:18:07 +000025include "MipsCallingConv.td"
Dan Gohmanf17a25c2007-07-18 16:29:46 +000026
Jakob Stoklund Olesen4f8ea292010-04-05 03:10:20 +000027def MipsInstrInfo : InstrInfo;
Bruno Cardoso Lopes57d896c2007-08-18 02:18:07 +000028
Dan Gohmanf17a25c2007-07-18 16:29:46 +000029//===----------------------------------------------------------------------===//
Bruno Cardoso Lopes4fb1f542008-07-05 19:05:21 +000030// Mips Subtarget features //
Dan Gohmanf17a25c2007-07-18 16:29:46 +000031//===----------------------------------------------------------------------===//
32
Bruno Cardoso Lopesdfd657f2008-07-09 05:32:22 +000033def FeatureGP64Bit : SubtargetFeature<"gp64", "IsGP64bit", "true",
Bruno Cardoso Lopes4fb1f542008-07-05 19:05:21 +000034 "General Purpose Registers are 64-bit wide.">;
Bruno Cardoso Lopesdfd657f2008-07-09 05:32:22 +000035def FeatureFP64Bit : SubtargetFeature<"fp64", "IsFP64bit", "true",
Bruno Cardoso Lopes4fb1f542008-07-05 19:05:21 +000036 "Support 64-bit FP registers.">;
Bruno Cardoso Lopesdfd657f2008-07-09 05:32:22 +000037def FeatureSingleFloat : SubtargetFeature<"single-float", "IsSingleFloat",
Bruno Cardoso Lopes4fb1f542008-07-05 19:05:21 +000038 "true", "Only supports single precision float">;
Bruno Cardoso Lopes643c0402009-05-27 17:23:44 +000039def FeatureMips1 : SubtargetFeature<"mips1", "MipsArchVersion", "Mips1",
40 "Mips1 ISA Support">;
Bruno Cardoso Lopesdfd657f2008-07-09 05:32:22 +000041def FeatureMips2 : SubtargetFeature<"mips2", "MipsArchVersion", "Mips2",
Bruno Cardoso Lopes4fb1f542008-07-05 19:05:21 +000042 "Mips2 ISA Support">;
Bruno Cardoso Lopesdfd657f2008-07-09 05:32:22 +000043def FeatureO32 : SubtargetFeature<"o32", "MipsABI", "O32",
Bruno Cardoso Lopes4fb1f542008-07-05 19:05:21 +000044 "Enable o32 ABI">;
Bruno Cardoso Lopesdfd657f2008-07-09 05:32:22 +000045def FeatureEABI : SubtargetFeature<"eabi", "MipsABI", "EABI",
Bruno Cardoso Lopes4fb1f542008-07-05 19:05:21 +000046 "Enable eabi ABI">;
Bruno Cardoso Lopesdfd657f2008-07-09 05:32:22 +000047def FeatureVFPU : SubtargetFeature<"vfpu", "HasVFPU",
48 "true", "Enable vector FPU instructions.">;
49def FeatureSEInReg : SubtargetFeature<"seinreg", "HasSEInReg", "true",
50 "Enable 'signext in register' instructions.">;
Bruno Cardoso Lopes10ff0392008-07-30 17:01:06 +000051def FeatureCondMov : SubtargetFeature<"condmov", "HasCondMov", "true",
52 "Enable 'conditional move' instructions.">;
53def FeatureMulDivAdd : SubtargetFeature<"muldivadd", "HasMulDivAdd", "true",
54 "Enable 'multiply add/sub' instructions.">;
55def FeatureMinMax : SubtargetFeature<"minmax", "HasMinMax", "true",
56 "Enable 'min/max' instructions.">;
57def FeatureSwap : SubtargetFeature<"swap", "HasSwap", "true",
58 "Enable 'byte/half swap' instructions.">;
59def FeatureBitCount : SubtargetFeature<"bitcount", "HasBitCount", "true",
60 "Enable 'count leading bits' instructions.">;
Dan Gohmanf17a25c2007-07-18 16:29:46 +000061
62//===----------------------------------------------------------------------===//
63// Mips processors supported.
64//===----------------------------------------------------------------------===//
65
Bruno Cardoso Lopes4fb1f542008-07-05 19:05:21 +000066class Proc<string Name, list<SubtargetFeature> Features>
67 : Processor<Name, MipsGenericItineraries, Features>;
68
Bruno Cardoso Lopes643c0402009-05-27 17:23:44 +000069def : Proc<"mips1", [FeatureMips1]>;
70def : Proc<"r2000", [FeatureMips1]>;
71def : Proc<"r3000", [FeatureMips1]>;
Bruno Cardoso Lopes4fb1f542008-07-05 19:05:21 +000072
73def : Proc<"mips2", [FeatureMips2]>;
74def : Proc<"r6000", [FeatureMips2]>;
75
76// Allegrex is a 32bit subset of r4000, both for interger and fp registers,
Bruno Cardoso Lopes10ff0392008-07-30 17:01:06 +000077// but much more similar to Mips2 than Mips3. It also contains some of
78// Mips32/Mips32r2 instructions and a custom vector fpu processor.
Bruno Cardoso Lopesdfd657f2008-07-09 05:32:22 +000079def : Proc<"allegrex", [FeatureMips2, FeatureSingleFloat, FeatureEABI,
Bruno Cardoso Lopes10ff0392008-07-30 17:01:06 +000080 FeatureVFPU, FeatureSEInReg, FeatureCondMov, FeatureMulDivAdd,
81 FeatureMinMax, FeatureSwap, FeatureBitCount]>;
Dan Gohmanf17a25c2007-07-18 16:29:46 +000082
83def Mips : Target {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000084 let InstructionSet = MipsInstrInfo;
85}