blob: cc0c8c8fa63a06a3157f226bb70e41efc29ad259 [file] [log] [blame]
Chris Lattner4c7b43b2005-10-14 23:37:35 +00001//===- PPC.td - Describe the PowerPC Target Machine --------*- tablegen -*-===//
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.
Chris Lattner4c7b43b2005-10-14 23:37:35 +00007//
8//===----------------------------------------------------------------------===//
9//
10// This is the top level entry point for the PowerPC target.
11//
12//===----------------------------------------------------------------------===//
13
14// Get the target-independent interfaces which we are implementing.
15//
16include "../Target.td"
17
18//===----------------------------------------------------------------------===//
Jim Laskey5476b9b2005-10-22 08:04:24 +000019// PowerPC Subtarget features.
Jim Laskey53842142005-10-19 19:51:16 +000020//
21
Jim Laskeyc35010d2006-12-12 20:57:08 +000022//===----------------------------------------------------------------------===//
23// CPU Directives //
24//===----------------------------------------------------------------------===//
25
26def Directive601 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_601", "">;
27def Directive602 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_602", "">;
28def Directive603 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_603", "">;
29def Directive604 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_603", "">;
30def Directive620 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_603", "">;
31def Directive7400: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_7400", "">;
32def Directive750 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_750", "">;
33def Directive970 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_970", "">;
34def Directive32 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_32", "">;
35def Directive64 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_64", "">;
36
Chris Lattnera7a58542006-06-16 17:34:12 +000037def Feature64Bit : SubtargetFeature<"64bit","Has64BitSupport", "true",
Chris Lattner2e1f8232005-10-23 05:28:51 +000038 "Enable 64-bit instructions">;
Chris Lattnera7a58542006-06-16 17:34:12 +000039def Feature64BitRegs : SubtargetFeature<"64bitregs","Use64BitRegs", "true",
40 "Enable 64-bit registers usage for ppc32 [beta]">;
Evan Cheng19c95502006-01-27 08:09:42 +000041def FeatureAltivec : SubtargetFeature<"altivec","HasAltivec", "true",
Chris Lattner2e1f8232005-10-23 05:28:51 +000042 "Enable Altivec instructions">;
Evan Cheng19c95502006-01-27 08:09:42 +000043def FeatureGPUL : SubtargetFeature<"gpul","IsGigaProcessor", "true",
Chris Lattner2e1f8232005-10-23 05:28:51 +000044 "Enable GPUL instructions">;
Evan Cheng19c95502006-01-27 08:09:42 +000045def FeatureFSqrt : SubtargetFeature<"fsqrt","HasFSQRT", "true",
Chris Lattner2e1f8232005-10-23 05:28:51 +000046 "Enable the fsqrt instruction">;
Chris Lattnerbf751e22006-02-28 07:08:22 +000047def FeatureSTFIWX : SubtargetFeature<"stfiwx","HasSTFIWX", "true",
48 "Enable the stfiwx instruction">;
Jim Laskey53842142005-10-19 19:51:16 +000049
50//===----------------------------------------------------------------------===//
Chris Lattnerc8d28892005-10-23 22:08:13 +000051// Register File Description
52//===----------------------------------------------------------------------===//
53
54include "PPCRegisterInfo.td"
55include "PPCSchedule.td"
56include "PPCInstrInfo.td"
57
58//===----------------------------------------------------------------------===//
59// PowerPC processors supported.
Jim Laskey53842142005-10-19 19:51:16 +000060//
61
Jim Laskeyc35010d2006-12-12 20:57:08 +000062def : Processor<"generic", G3Itineraries, [Directive32]>;
63def : Processor<"601", G3Itineraries, [Directive601]>;
64def : Processor<"602", G3Itineraries, [Directive602]>;
65def : Processor<"603", G3Itineraries, [Directive603]>;
66def : Processor<"603e", G3Itineraries, [Directive603]>;
67def : Processor<"603ev", G3Itineraries, [Directive603]>;
68def : Processor<"604", G3Itineraries, [Directive604]>;
69def : Processor<"604e", G3Itineraries, [Directive604]>;
70def : Processor<"620", G3Itineraries, [Directive620]>;
71def : Processor<"g3", G3Itineraries, [Directive7400]>;
72def : Processor<"7400", G4Itineraries, [Directive7400, FeatureAltivec]>;
73def : Processor<"g4", G4Itineraries, [Directive7400, FeatureAltivec]>;
74def : Processor<"7450", G4PlusItineraries, [Directive7400, FeatureAltivec]>;
75def : Processor<"g4+", G4PlusItineraries, [Directive750, FeatureAltivec]>;
76def : Processor<"750", G4Itineraries, [Directive750, FeatureAltivec]>;
Jim Laskey53842142005-10-19 19:51:16 +000077def : Processor<"970", G5Itineraries,
Jim Laskeyc35010d2006-12-12 20:57:08 +000078 [Directive970, FeatureAltivec,
79 FeatureGPUL, FeatureFSqrt, FeatureSTFIWX,
Jim Laskey5476b9b2005-10-22 08:04:24 +000080 Feature64Bit /*, Feature64BitRegs */]>;
Jim Laskey53842142005-10-19 19:51:16 +000081def : Processor<"g5", G5Itineraries,
Jim Laskeyc35010d2006-12-12 20:57:08 +000082 [Directive970, FeatureAltivec,
83 FeatureGPUL, FeatureFSqrt, FeatureSTFIWX,
84 Feature64Bit /*, Feature64BitRegs */]>;
85def : Processor<"ppc", G3Itineraries, [Directive32]>;
86def : Processor<"ppc64", G5Itineraries,
87 [Directive64, FeatureAltivec,
88 FeatureGPUL, FeatureFSqrt, FeatureSTFIWX,
Jim Laskey5476b9b2005-10-22 08:04:24 +000089 Feature64Bit /*, Feature64BitRegs */]>;
Jim Laskey53842142005-10-19 19:51:16 +000090
91
Chris Lattnerb9a7bea2007-03-06 00:59:59 +000092//===----------------------------------------------------------------------===//
93// Calling Conventions
94//===----------------------------------------------------------------------===//
95
96include "PPCCallingConv.td"
97
Chris Lattner88d211f2006-03-12 09:13:49 +000098def PPCInstrInfo : InstrInfo {
99 // Define how we want to layout our TargetSpecific information field... This
100 // should be kept up-to-date with the fields in the PPCInstrInfo.h file.
101 let TSFlagsFields = ["PPC970_First",
102 "PPC970_Single",
Chris Lattnerfd977342006-03-13 05:15:10 +0000103 "PPC970_Cracked",
Chris Lattner88d211f2006-03-12 09:13:49 +0000104 "PPC970_Unit"];
Chris Lattnerfd977342006-03-13 05:15:10 +0000105 let TSFlagsShifts = [0, 1, 2, 3];
Chris Lattner88d211f2006-03-12 09:13:49 +0000106
107 let isLittleEndianEncoding = 1;
108}
109
110
Chris Lattner4c7b43b2005-10-14 23:37:35 +0000111def PPC : Target {
Chris Lattner88d211f2006-03-12 09:13:49 +0000112 // Information about the instructions.
113 let InstructionSet = PPCInstrInfo;
Chris Lattner4c7b43b2005-10-14 23:37:35 +0000114}