Chris Lattner | 4c7b43b | 2005-10-14 23:37:35 +0000 | [diff] [blame] | 1 | //===- PPC.td - Describe the PowerPC Target Machine --------*- tablegen -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file was developed by the LLVM research group and is distributed under |
| 6 | // the University of Illinois Open Source License. See LICENSE.TXT for details. |
| 7 | // |
| 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 | // |
| 16 | include "../Target.td" |
| 17 | |
| 18 | //===----------------------------------------------------------------------===// |
Jim Laskey | 5476b9b | 2005-10-22 08:04:24 +0000 | [diff] [blame] | 19 | // PowerPC Subtarget features. |
Jim Laskey | 5384214 | 2005-10-19 19:51:16 +0000 | [diff] [blame] | 20 | // |
| 21 | |
Chris Lattner | a7a5854 | 2006-06-16 17:34:12 +0000 | [diff] [blame] | 22 | def Feature64Bit : SubtargetFeature<"64bit","Has64BitSupport", "true", |
Chris Lattner | 2e1f823 | 2005-10-23 05:28:51 +0000 | [diff] [blame] | 23 | "Enable 64-bit instructions">; |
Chris Lattner | a7a5854 | 2006-06-16 17:34:12 +0000 | [diff] [blame] | 24 | def Feature64BitRegs : SubtargetFeature<"64bitregs","Use64BitRegs", "true", |
| 25 | "Enable 64-bit registers usage for ppc32 [beta]">; |
Evan Cheng | 19c9550 | 2006-01-27 08:09:42 +0000 | [diff] [blame] | 26 | def FeatureAltivec : SubtargetFeature<"altivec","HasAltivec", "true", |
Chris Lattner | 2e1f823 | 2005-10-23 05:28:51 +0000 | [diff] [blame] | 27 | "Enable Altivec instructions">; |
Evan Cheng | 19c9550 | 2006-01-27 08:09:42 +0000 | [diff] [blame] | 28 | def FeatureGPUL : SubtargetFeature<"gpul","IsGigaProcessor", "true", |
Chris Lattner | 2e1f823 | 2005-10-23 05:28:51 +0000 | [diff] [blame] | 29 | "Enable GPUL instructions">; |
Evan Cheng | 19c9550 | 2006-01-27 08:09:42 +0000 | [diff] [blame] | 30 | def FeatureFSqrt : SubtargetFeature<"fsqrt","HasFSQRT", "true", |
Chris Lattner | 2e1f823 | 2005-10-23 05:28:51 +0000 | [diff] [blame] | 31 | "Enable the fsqrt instruction">; |
Chris Lattner | bf751e2 | 2006-02-28 07:08:22 +0000 | [diff] [blame] | 32 | def FeatureSTFIWX : SubtargetFeature<"stfiwx","HasSTFIWX", "true", |
| 33 | "Enable the stfiwx instruction">; |
Jim Laskey | 5384214 | 2005-10-19 19:51:16 +0000 | [diff] [blame] | 34 | |
| 35 | //===----------------------------------------------------------------------===// |
Chris Lattner | c8d2889 | 2005-10-23 22:08:13 +0000 | [diff] [blame] | 36 | // Register File Description |
| 37 | //===----------------------------------------------------------------------===// |
| 38 | |
| 39 | include "PPCRegisterInfo.td" |
| 40 | include "PPCSchedule.td" |
| 41 | include "PPCInstrInfo.td" |
| 42 | |
| 43 | //===----------------------------------------------------------------------===// |
| 44 | // PowerPC processors supported. |
Jim Laskey | 5384214 | 2005-10-19 19:51:16 +0000 | [diff] [blame] | 45 | // |
| 46 | |
Jim Laskey | 5476b9b | 2005-10-22 08:04:24 +0000 | [diff] [blame] | 47 | def : Processor<"generic", G3Itineraries, []>; |
Jim Laskey | 5384214 | 2005-10-19 19:51:16 +0000 | [diff] [blame] | 48 | def : Processor<"601", G3Itineraries, []>; |
| 49 | def : Processor<"602", G3Itineraries, []>; |
| 50 | def : Processor<"603", G3Itineraries, []>; |
Jim Laskey | f5fc2cb | 2005-10-21 19:05:19 +0000 | [diff] [blame] | 51 | def : Processor<"603e", G3Itineraries, []>; |
| 52 | def : Processor<"603ev", G3Itineraries, []>; |
Jim Laskey | 5384214 | 2005-10-19 19:51:16 +0000 | [diff] [blame] | 53 | def : Processor<"604", G3Itineraries, []>; |
Jim Laskey | f5fc2cb | 2005-10-21 19:05:19 +0000 | [diff] [blame] | 54 | def : Processor<"604e", G3Itineraries, []>; |
| 55 | def : Processor<"620", G3Itineraries, []>; |
Jim Laskey | 5476b9b | 2005-10-22 08:04:24 +0000 | [diff] [blame] | 56 | def : Processor<"g3", G3Itineraries, []>; |
Jim Laskey | f5fc2cb | 2005-10-21 19:05:19 +0000 | [diff] [blame] | 57 | def : Processor<"7400", G4Itineraries, [FeatureAltivec]>; |
Jim Laskey | 5476b9b | 2005-10-22 08:04:24 +0000 | [diff] [blame] | 58 | def : Processor<"g4", G4Itineraries, [FeatureAltivec]>; |
Jim Laskey | f5fc2cb | 2005-10-21 19:05:19 +0000 | [diff] [blame] | 59 | def : Processor<"7450", G4PlusItineraries, [FeatureAltivec]>; |
Jim Laskey | 5476b9b | 2005-10-22 08:04:24 +0000 | [diff] [blame] | 60 | def : Processor<"g4+", G4PlusItineraries, [FeatureAltivec]>; |
Jim Laskey | 5384214 | 2005-10-19 19:51:16 +0000 | [diff] [blame] | 61 | def : Processor<"750", G3Itineraries, []>; |
Jim Laskey | 5384214 | 2005-10-19 19:51:16 +0000 | [diff] [blame] | 62 | def : Processor<"970", G5Itineraries, |
Chris Lattner | bf751e2 | 2006-02-28 07:08:22 +0000 | [diff] [blame] | 63 | [FeatureAltivec, FeatureGPUL, FeatureFSqrt, FeatureSTFIWX, |
Jim Laskey | 5476b9b | 2005-10-22 08:04:24 +0000 | [diff] [blame] | 64 | Feature64Bit /*, Feature64BitRegs */]>; |
Jim Laskey | 5384214 | 2005-10-19 19:51:16 +0000 | [diff] [blame] | 65 | def : Processor<"g5", G5Itineraries, |
Chris Lattner | bf751e2 | 2006-02-28 07:08:22 +0000 | [diff] [blame] | 66 | [FeatureAltivec, FeatureGPUL, FeatureFSqrt, FeatureSTFIWX, |
Jim Laskey | 5476b9b | 2005-10-22 08:04:24 +0000 | [diff] [blame] | 67 | Feature64Bit /*, Feature64BitRegs */]>; |
Jim Laskey | 5384214 | 2005-10-19 19:51:16 +0000 | [diff] [blame] | 68 | |
| 69 | |
Chris Lattner | 88d211f | 2006-03-12 09:13:49 +0000 | [diff] [blame] | 70 | def PPCInstrInfo : InstrInfo { |
| 71 | // Define how we want to layout our TargetSpecific information field... This |
| 72 | // should be kept up-to-date with the fields in the PPCInstrInfo.h file. |
| 73 | let TSFlagsFields = ["PPC970_First", |
| 74 | "PPC970_Single", |
Chris Lattner | fd97734 | 2006-03-13 05:15:10 +0000 | [diff] [blame] | 75 | "PPC970_Cracked", |
Chris Lattner | 88d211f | 2006-03-12 09:13:49 +0000 | [diff] [blame] | 76 | "PPC970_Unit"]; |
Chris Lattner | fd97734 | 2006-03-13 05:15:10 +0000 | [diff] [blame] | 77 | let TSFlagsShifts = [0, 1, 2, 3]; |
Chris Lattner | 88d211f | 2006-03-12 09:13:49 +0000 | [diff] [blame] | 78 | |
| 79 | let isLittleEndianEncoding = 1; |
| 80 | } |
| 81 | |
| 82 | |
Chris Lattner | 4c7b43b | 2005-10-14 23:37:35 +0000 | [diff] [blame] | 83 | def PPC : Target { |
Chris Lattner | 88d211f | 2006-03-12 09:13:49 +0000 | [diff] [blame] | 84 | // Information about the instructions. |
| 85 | let InstructionSet = PPCInstrInfo; |
Chris Lattner | 4c7b43b | 2005-10-14 23:37:35 +0000 | [diff] [blame] | 86 | } |