1 //===-- Sparc.td - Describe the Sparc Target Machine -------*- tablegen -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
10 //===----------------------------------------------------------------------===//
12 //===----------------------------------------------------------------------===//
13 // Target-independent interfaces which we are implementing
14 //===----------------------------------------------------------------------===//
16 include "llvm/Target/Target.td"
18 //===----------------------------------------------------------------------===//
19 // SPARC Subtarget features.
23 : SubtargetFeature<"soft-mul-div", "UseSoftMulDiv", "true",
24 "Use software emulation for integer multiply and divide">;
27 : SubtargetFeature<"no-fsmuld", "HasNoFSMULD", "true",
28 "Disable the fsmuld instruction.">;
30 : SubtargetFeature<"no-fmuls", "HasNoFMULS", "true",
31 "Disable the fmuls instruction.">;
34 : SubtargetFeature<"v9", "IsV9", "true",
35 "Enable SPARC-V9 instructions">;
36 def FeatureV8Deprecated
37 : SubtargetFeature<"deprecated-v8", "UseV8DeprecatedInsts", "true",
38 "Enable deprecated V8 instructions in V9 mode">;
40 : SubtargetFeature<"vis", "IsVIS", "true",
41 "Enable UltraSPARC Visual Instruction Set extensions">;
43 : SubtargetFeature<"vis2", "IsVIS2", "true",
44 "Enable Visual Instruction Set extensions II">;
46 : SubtargetFeature<"vis3", "IsVIS3", "true",
47 "Enable Visual Instruction Set extensions III">;
49 : SubtargetFeature<"leon", "IsLeon", "true",
50 "Enable LEON extensions">;
52 : SubtargetFeature<"leonpwrpsr", "HasPWRPSR", "true",
53 "Enable the PWRPSR instruction">;
56 : SubtargetFeature<"hard-quad-float", "HasHardQuad", "true",
57 "Enable quad-word floating point instructions">;
59 def UsePopc : SubtargetFeature<"popc", "UsePopc", "true",
60 "Use the popc (population count) instruction">;
62 def FeatureSoftFloat : SubtargetFeature<"soft-float", "UseSoftFloat", "true",
63 "Use software emulation for floating point">;
65 //==== Features added predmoninantly for LEON subtarget support
66 include "LeonFeatures.td"
68 //===----------------------------------------------------------------------===//
69 // Register File, Calling Conv, Instruction Descriptions
70 //===----------------------------------------------------------------------===//
72 include "SparcASITags.td"
73 include "SparcRegisterInfo.td"
74 include "SparcCallingConv.td"
75 include "SparcSchedule.td"
76 include "SparcInstrInfo.td"
78 def SparcInstrInfo : InstrInfo;
80 def SparcAsmParser : AsmParser {
81 bit ShouldEmitMatchRegisterName = 0;
84 def SparcAsmParserVariant : AsmParserVariant {
85 let RegisterPrefix = "%";
88 //===----------------------------------------------------------------------===//
89 // SPARC processors supported.
90 //===----------------------------------------------------------------------===//
92 class Proc<string Name, list<SubtargetFeature> Features>
93 : Processor<Name, NoItineraries, Features>;
95 def : Proc<"generic", []>;
96 def : Proc<"v7", [FeatureSoftMulDiv, FeatureNoFSMULD]>;
98 def : Proc<"supersparc", []>;
99 def : Proc<"sparclite", []>;
100 def : Proc<"f934", []>;
101 def : Proc<"hypersparc", []>;
102 def : Proc<"sparclite86x", []>;
103 def : Proc<"sparclet", []>;
104 def : Proc<"tsc701", []>;
105 def : Proc<"myriad2", [FeatureLeon, LeonCASA]>;
106 def : Proc<"myriad2.1", [FeatureLeon, LeonCASA]>;
107 def : Proc<"myriad2.2", [FeatureLeon, LeonCASA]>;
108 def : Proc<"myriad2.3", [FeatureLeon, LeonCASA]>;
109 def : Proc<"ma2100", [FeatureLeon, LeonCASA]>;
110 def : Proc<"ma2150", [FeatureLeon, LeonCASA]>;
111 def : Proc<"ma2155", [FeatureLeon, LeonCASA]>;
112 def : Proc<"ma2450", [FeatureLeon, LeonCASA]>;
113 def : Proc<"ma2455", [FeatureLeon, LeonCASA]>;
114 def : Proc<"ma2x5x", [FeatureLeon, LeonCASA]>;
115 def : Proc<"ma2080", [FeatureLeon, LeonCASA]>;
116 def : Proc<"ma2085", [FeatureLeon, LeonCASA]>;
117 def : Proc<"ma2480", [FeatureLeon, LeonCASA]>;
118 def : Proc<"ma2485", [FeatureLeon, LeonCASA]>;
119 def : Proc<"ma2x8x", [FeatureLeon, LeonCASA]>;
120 def : Proc<"v9", [FeatureV9]>;
121 def : Proc<"ultrasparc", [FeatureV9, FeatureV8Deprecated, FeatureVIS]>;
122 def : Proc<"ultrasparc3", [FeatureV9, FeatureV8Deprecated, FeatureVIS,
124 def : Proc<"niagara", [FeatureV9, FeatureV8Deprecated, FeatureVIS,
126 def : Proc<"niagara2", [FeatureV9, FeatureV8Deprecated, UsePopc,
127 FeatureVIS, FeatureVIS2]>;
128 def : Proc<"niagara3", [FeatureV9, FeatureV8Deprecated, UsePopc,
129 FeatureVIS, FeatureVIS2]>;
130 def : Proc<"niagara4", [FeatureV9, FeatureV8Deprecated, UsePopc,
131 FeatureVIS, FeatureVIS2, FeatureVIS3]>;
134 def : Processor<"leon2", LEON2Itineraries,
137 // LEON 2 FT (AT697E)
138 // TO DO: Place-holder: Processor specific features will be added *very* soon here.
139 def : Processor<"at697e", LEON2Itineraries,
140 [FeatureLeon, InsertNOPLoad]>;
142 // LEON 2 FT (AT697F)
143 // TO DO: Place-holder: Processor specific features will be added *very* soon here.
144 def : Processor<"at697f", LEON2Itineraries,
145 [FeatureLeon, InsertNOPLoad]>;
149 def : Processor<"leon3", LEON3Itineraries,
150 [FeatureLeon, UMACSMACSupport]>;
152 // LEON 3 FT (UT699). Provides features for the UT699 processor
153 // - covers all the erratum fixes for LEON3, but does not support the CASA instruction.
154 def : Processor<"ut699", LEON3Itineraries,
155 [FeatureLeon, InsertNOPLoad, FeatureNoFSMULD, FeatureNoFMULS, FixAllFDIVSQRT]>;
157 // LEON3 FT (GR712RC). Provides features for the GR712RC processor.
158 // - covers all the erratum fixed for LEON3 and support for the CASA instruction.
159 def : Processor<"gr712rc", LEON3Itineraries,
160 [FeatureLeon, LeonCASA]>;
163 def : Processor<"leon4", LEON4Itineraries,
164 [FeatureLeon, UMACSMACSupport, LeonCASA]>;
167 // TO DO: Place-holder: Processor specific features will be added *very* soon here.
168 def : Processor<"gr740", LEON4Itineraries,
169 [FeatureLeon, UMACSMACSupport, LeonCASA, LeonCycleCounter,
172 //===----------------------------------------------------------------------===//
173 // Declare the target which we are implementing
174 //===----------------------------------------------------------------------===//
176 def SparcAsmWriter : AsmWriter {
177 string AsmWriterClassName = "InstPrinter";
178 int PassSubtarget = 1;
183 // Pull in Instruction Info:
184 let InstructionSet = SparcInstrInfo;
185 let AssemblyParsers = [SparcAsmParser];
186 let AssemblyParserVariants = [SparcAsmParserVariant];
187 let AssemblyWriters = [SparcAsmWriter];
188 let AllowRegisterRenaming = 1;