Bruno Cardoso Lopes | 972f589 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 1 | //===- Mips.td - Describe the Mips Target Machine ---------------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | 4ee451d | 2007-12-29 20:36:04 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Bruno Cardoso Lopes | 972f589 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
Bruno Cardoso Lopes | 6d32ca0 | 2007-08-18 02:18:07 +0000 | [diff] [blame] | 9 | // This is the top level entry point for the Mips target. |
| 10 | //===----------------------------------------------------------------------===// |
Bruno Cardoso Lopes | 972f589 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 11 | |
| 12 | //===----------------------------------------------------------------------===// |
Bruno Cardoso Lopes | 6d32ca0 | 2007-08-18 02:18:07 +0000 | [diff] [blame] | 13 | // Target-independent interfaces |
Bruno Cardoso Lopes | 972f589 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 14 | //===----------------------------------------------------------------------===// |
| 15 | |
| 16 | include "../Target.td" |
| 17 | |
| 18 | //===----------------------------------------------------------------------===// |
Bruno Cardoso Lopes | 225ca9c | 2008-07-05 19:05:21 +0000 | [diff] [blame] | 19 | // Register File, Calling Conv, Instruction Descriptions |
Bruno Cardoso Lopes | 972f589 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 20 | //===----------------------------------------------------------------------===// |
| 21 | |
| 22 | include "MipsRegisterInfo.td" |
Bruno Cardoso Lopes | 6d32ca0 | 2007-08-18 02:18:07 +0000 | [diff] [blame] | 23 | include "MipsSchedule.td" |
Bruno Cardoso Lopes | 972f589 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 24 | include "MipsInstrInfo.td" |
Bruno Cardoso Lopes | 6d32ca0 | 2007-08-18 02:18:07 +0000 | [diff] [blame] | 25 | include "MipsCallingConv.td" |
Bruno Cardoso Lopes | 972f589 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 26 | |
| 27 | def MipsInstrInfo : InstrInfo { |
Bruno Cardoso Lopes | 972f589 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 28 | let TSFlagsFields = []; |
| 29 | let TSFlagsShifts = []; |
| 30 | } |
Bruno Cardoso Lopes | 6d32ca0 | 2007-08-18 02:18:07 +0000 | [diff] [blame] | 31 | |
Bruno Cardoso Lopes | 972f589 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 32 | //===----------------------------------------------------------------------===// |
Bruno Cardoso Lopes | 225ca9c | 2008-07-05 19:05:21 +0000 | [diff] [blame] | 33 | // Mips Subtarget features // |
Bruno Cardoso Lopes | 972f589 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 34 | //===----------------------------------------------------------------------===// |
| 35 | |
Bruno Cardoso Lopes | 7728f7e | 2008-07-09 05:32:22 +0000 | [diff] [blame] | 36 | def FeatureGP64Bit : SubtargetFeature<"gp64", "IsGP64bit", "true", |
Bruno Cardoso Lopes | 225ca9c | 2008-07-05 19:05:21 +0000 | [diff] [blame] | 37 | "General Purpose Registers are 64-bit wide.">; |
Bruno Cardoso Lopes | 7728f7e | 2008-07-09 05:32:22 +0000 | [diff] [blame] | 38 | def FeatureFP64Bit : SubtargetFeature<"fp64", "IsFP64bit", "true", |
Bruno Cardoso Lopes | 225ca9c | 2008-07-05 19:05:21 +0000 | [diff] [blame] | 39 | "Support 64-bit FP registers.">; |
Bruno Cardoso Lopes | 7728f7e | 2008-07-09 05:32:22 +0000 | [diff] [blame] | 40 | def FeatureSingleFloat : SubtargetFeature<"single-float", "IsSingleFloat", |
Bruno Cardoso Lopes | 225ca9c | 2008-07-05 19:05:21 +0000 | [diff] [blame] | 41 | "true", "Only supports single precision float">; |
Bruno Cardoso Lopes | 7728f7e | 2008-07-09 05:32:22 +0000 | [diff] [blame] | 42 | def FeatureMips2 : SubtargetFeature<"mips2", "MipsArchVersion", "Mips2", |
Bruno Cardoso Lopes | 225ca9c | 2008-07-05 19:05:21 +0000 | [diff] [blame] | 43 | "Mips2 ISA Support">; |
Bruno Cardoso Lopes | 7728f7e | 2008-07-09 05:32:22 +0000 | [diff] [blame] | 44 | def FeatureO32 : SubtargetFeature<"o32", "MipsABI", "O32", |
Bruno Cardoso Lopes | 225ca9c | 2008-07-05 19:05:21 +0000 | [diff] [blame] | 45 | "Enable o32 ABI">; |
Bruno Cardoso Lopes | 7728f7e | 2008-07-09 05:32:22 +0000 | [diff] [blame] | 46 | def FeatureEABI : SubtargetFeature<"eabi", "MipsABI", "EABI", |
Bruno Cardoso Lopes | 225ca9c | 2008-07-05 19:05:21 +0000 | [diff] [blame] | 47 | "Enable eabi ABI">; |
Bruno Cardoso Lopes | 7728f7e | 2008-07-09 05:32:22 +0000 | [diff] [blame] | 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.">; |
Bruno Cardoso Lopes | 972f589 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 52 | |
| 53 | //===----------------------------------------------------------------------===// |
| 54 | // Mips processors supported. |
| 55 | //===----------------------------------------------------------------------===// |
| 56 | |
Bruno Cardoso Lopes | 225ca9c | 2008-07-05 19:05:21 +0000 | [diff] [blame] | 57 | class Proc<string Name, list<SubtargetFeature> Features> |
| 58 | : Processor<Name, MipsGenericItineraries, Features>; |
| 59 | |
| 60 | def : Proc<"mips1", []>; |
| 61 | def : Proc<"r2000", []>; |
| 62 | def : Proc<"r3000", []>; |
| 63 | |
| 64 | def : Proc<"mips2", [FeatureMips2]>; |
| 65 | def : 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 Lopes | 7728f7e | 2008-07-09 05:32:22 +0000 | [diff] [blame] | 69 | def : Proc<"allegrex", [FeatureMips2, FeatureSingleFloat, FeatureEABI, |
| 70 | FeatureSEInReg, FeatureVFPU]>; |
Bruno Cardoso Lopes | 972f589 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 71 | |
| 72 | def Mips : Target { |
Bruno Cardoso Lopes | 972f589 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 73 | let InstructionSet = MipsInstrInfo; |
| 74 | } |