1 //===-- Sparc.td - Describe the Sparc Target Machine -------*- tablegen -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
13 //===----------------------------------------------------------------------===//
14 // Target-independent interfaces which we are implementing
15 //===----------------------------------------------------------------------===//
17 include "llvm/Target/Target.td"
19 //===----------------------------------------------------------------------===//
20 // SPARC Subtarget features.
24 : SubtargetFeature<"v9", "IsV9", "true", "Enable SPARC-V9 instructions">;
25 def FeatureV8Deprecated
26 : SubtargetFeature<"deprecated-v8", "V8DeprecatedInsts", "true",
27 "Enable deprecated V8 instructions in V9 mode">;
29 : SubtargetFeature<"vis", "IsVIS", "true",
30 "Enable UltraSPARC Visual Instruction Set extensions">;
32 : SubtargetFeature<"vis2", "IsVIS2", "true",
33 "Enable Visual Instruction Set extensions II">;
35 : SubtargetFeature<"vis3", "IsVIS3", "true",
36 "Enable Visual Instruction Set extensions III">;
38 : SubtargetFeature<"leon", "IsLeon", "true", "Enable LEON extensions">;
41 : SubtargetFeature<"hard-quad-float", "HasHardQuad", "true",
42 "Enable quad-word floating point instructions">;
44 def UsePopc : SubtargetFeature<"popc", "UsePopc", "true",
45 "Use the popc (population count) instruction">;
48 : SubtargetFeature<"soft-float", "UseSoftFloat", "true",
49 "Use software emulation for floating point">;
51 //==== Features added predmoninantly for LEON subtarget support
52 include "LeonFeatures.td"
54 //===----------------------------------------------------------------------===//
55 // Register File, Calling Conv, Instruction Descriptions
56 //===----------------------------------------------------------------------===//
58 include "SparcRegisterInfo.td"
59 include "SparcCallingConv.td"
60 include "SparcSchedule.td"
61 include "SparcInstrInfo.td"
63 def SparcInstrInfo : InstrInfo;
65 def SparcAsmParser : AsmParser { bit ShouldEmitMatchRegisterName = 0; }
67 //===----------------------------------------------------------------------===//
68 // SPARC processors supported.
69 //===----------------------------------------------------------------------===//
71 class Proc<string Name, list<SubtargetFeature> Features>
72 : Processor<Name, NoItineraries, Features>;
74 def : Proc<"generic", []>;
77 def : Proc<"supersparc", []>;
78 def : Proc<"sparclite", []>;
79 def : Proc<"f934", []>;
80 def : Proc<"hypersparc", []>;
81 def : Proc<"sparclite86x", []>;
82 def : Proc<"sparclet", []>;
83 def : Proc<"tsc701", []>;
84 def : Proc<"myriad2", []>;
85 def : Proc<"myriad2.1", []>;
86 def : Proc<"myriad2.2", []>;
87 def : Proc<"v9", [ FeatureV9 ]>;
88 def : Proc<"ultrasparc", [ FeatureV9, FeatureV8Deprecated, FeatureVIS ]>;
89 def : Proc<"ultrasparc3",
90 [ FeatureV9, FeatureV8Deprecated, FeatureVIS, FeatureVIS2 ]>;
92 [ FeatureV9, FeatureV8Deprecated, FeatureVIS, FeatureVIS2 ]>;
93 def : Proc<"niagara2", [
94 FeatureV9, FeatureV8Deprecated, UsePopc, FeatureVIS, FeatureVIS2
96 def : Proc<"niagara3", [
97 FeatureV9, FeatureV8Deprecated, UsePopc, FeatureVIS, FeatureVIS2
99 def : Proc<"niagara4", [
100 FeatureV9, FeatureV8Deprecated, UsePopc, FeatureVIS, FeatureVIS2, FeatureVIS3
104 def : Processor<"leon2", LEON2Itineraries, [ FeatureLeon ]>;
106 // LEON 2 FT (AT697E)
107 // AT697E: Provides full coverage of AT697E - covers all the erratum fixes for
109 def : Processor<"at697e", LEON2Itineraries, [
110 FeatureLeon, ReplaceSDIV, FixCALL, IgnoreZeroFlag, InsertNOPDoublePrecision
113 // LEON 2 FT (AT697F)
114 // AT697F: Provides full coverage of AT697F - covers all the erratum fixes for
116 def : Processor<"at697f", LEON2Itineraries,
117 [ FeatureLeon, InsertNOPDoublePrecision ]>;
120 def : Processor<"leon3", LEON3Itineraries, [ FeatureLeon, UMACSMACSupport ]>;
122 // LEON 3 FT (UT699). Provides features for the UT699 processor
123 // - covers all the erratum fixes for LEON3, but does not support the CASA
125 def : Processor<"ut699", LEON3Itineraries, [
126 FeatureLeon, FixFSMULD, ReplaceFMULS, PreventRoundChange,
127 FixAllFDIVSQRT, InsertNOPLoad, FlushCacheLineSWAP, InsertNOPsLoadStore
130 // LEON3 FT (GR712RC). Provides features for the GR712RC processor.
131 // - covers all the erratum fixed for LEON3 and support for the CASA
133 def : Processor<"gr712rc", LEON3Itineraries,
134 [ FeatureLeon, LeonCASA ]>;
137 def : Processor<"leon4", LEON4Itineraries,
138 [ FeatureLeon, LeonCASA ]>;
140 // GR740: Provides full coverage of GR740 - covers all the erratum fixes for
141 // LEON3 + support to CASA + LEON 4 instruction timings
142 def : Processor<"gr740", LEON4Itineraries,
143 [ FeatureLeon, LeonCASA ]> {}
145 //===----------------------------------------------------------------------===//
146 // Declare the target which we are implementing
147 //===----------------------------------------------------------------------===//
149 def SparcAsmWriter : AsmWriter {
150 string AsmWriterClassName = "InstPrinter";
151 int PassSubtarget = 1;
156 // Pull in Instruction Info:
157 let InstructionSet = SparcInstrInfo;
158 let AssemblyParsers = [ SparcAsmParser ];
159 let AssemblyWriters = [ SparcAsmWriter ];