blob: 6193e97c010eaaa837018aa7d5a65e80aab05042 [file] [log] [blame]
Jia Liub22310f2012-02-18 12:03:15 +00001//===-- Sparc.td - Describe the Sparc Target Machine -------*- tablegen -*-===//
2//
Chris Lattner158e1f52006-02-05 05:50:24 +00003// The LLVM Compiler Infrastructure
4//
Chris Lattnerf3ebc3f2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Jia Liub22310f2012-02-18 12:03:15 +00007//
Chris Lattner158e1f52006-02-05 05:50:24 +00008//===----------------------------------------------------------------------===//
9//
10//
11//===----------------------------------------------------------------------===//
12
13//===----------------------------------------------------------------------===//
14// Target-independent interfaces which we are implementing
15//===----------------------------------------------------------------------===//
16
Evan Cheng977e7be2008-11-24 07:34:46 +000017include "llvm/Target/Target.td"
Chris Lattner158e1f52006-02-05 05:50:24 +000018
19//===----------------------------------------------------------------------===//
20// SPARC Subtarget features.
21//
Venkatraman Govindarajua54533ed2013-06-04 18:33:25 +000022
Chris Lattner158e1f52006-02-05 05:50:24 +000023def FeatureV9
24 : SubtargetFeature<"v9", "IsV9", "true",
25 "Enable SPARC-V9 instructions">;
26def FeatureV8Deprecated
27 : SubtargetFeature<"deprecated-v8", "V8DeprecatedInsts", "true",
28 "Enable deprecated V8 instructions in V9 mode">;
29def FeatureVIS
30 : SubtargetFeature<"vis", "IsVIS", "true",
31 "Enable UltraSPARC Visual Instruction Set extensions">;
Venkatraman Govindarajuf9a202a2014-03-02 19:31:21 +000032def FeatureVIS2
33 : SubtargetFeature<"vis2", "IsVIS2", "true",
34 "Enable Visual Instruction Set extensions II">;
35def FeatureVIS3
36 : SubtargetFeature<"vis3", "IsVIS3", "true",
37 "Enable Visual Instruction Set extensions III">;
Chris Dewhurst60197022016-04-22 08:17:17 +000038def FeatureLeon
39 : SubtargetFeature<"leon", "IsLeon", "true",
40 "Enable LEON extensions">;
Chris Lattner158e1f52006-02-05 05:50:24 +000041
Venkatraman Govindaraju35e0c382013-08-25 18:30:06 +000042def FeatureHardQuad
43 : SubtargetFeature<"hard-quad-float", "HasHardQuad", "true",
44 "Enable quad-word floating point instructions">;
45
Jakob Stoklund Olesenead3b3d2014-01-26 06:09:59 +000046def UsePopc : SubtargetFeature<"popc", "UsePopc", "true",
47 "Use the popc (population count) instruction">;
48
Chris Dewhurste3b86452016-05-09 11:55:15 +000049//==== Features added predmoninantly for LEON subtarget support
50include "LeonFeatures.td"
51
Chris Lattner158e1f52006-02-05 05:50:24 +000052//===----------------------------------------------------------------------===//
Chris Lattner49b269d2008-03-17 05:41:48 +000053// Register File, Calling Conv, Instruction Descriptions
Chris Lattner158e1f52006-02-05 05:50:24 +000054//===----------------------------------------------------------------------===//
55
56include "SparcRegisterInfo.td"
Chris Lattner49b269d2008-03-17 05:41:48 +000057include "SparcCallingConv.td"
Chris Dewhurst60197022016-04-22 08:17:17 +000058include "SparcSchedule.td"
Chris Lattner158e1f52006-02-05 05:50:24 +000059include "SparcInstrInfo.td"
60
Jakob Stoklund Olesenb93331f2010-04-05 03:10:20 +000061def SparcInstrInfo : InstrInfo;
Chris Lattner158e1f52006-02-05 05:50:24 +000062
Venkatraman Govindarajuc2dee7d2014-01-04 11:30:13 +000063def SparcAsmParser : AsmParser {
64 bit ShouldEmitMatchRegisterName = 0;
65}
66
Chris Lattner158e1f52006-02-05 05:50:24 +000067//===----------------------------------------------------------------------===//
68// SPARC processors supported.
69//===----------------------------------------------------------------------===//
70
71class Proc<string Name, list<SubtargetFeature> Features>
72 : Processor<Name, NoItineraries, Features>;
73
74def : Proc<"generic", []>;
Venkatraman Govindarajua66b3142014-01-11 23:56:13 +000075def : Proc<"v7", []>;
Chris Lattner158e1f52006-02-05 05:50:24 +000076def : Proc<"v8", []>;
77def : Proc<"supersparc", []>;
78def : Proc<"sparclite", []>;
79def : Proc<"f934", []>;
80def : Proc<"hypersparc", []>;
81def : Proc<"sparclite86x", []>;
82def : Proc<"sparclet", []>;
83def : Proc<"tsc701", []>;
Douglas Katzman708eeb02016-03-15 16:41:47 +000084def : Proc<"myriad2", []>;
85def : Proc<"myriad2.1", []>;
86def : Proc<"myriad2.2", []>;
Chris Lattner158e1f52006-02-05 05:50:24 +000087def : Proc<"v9", [FeatureV9]>;
Venkatraman Govindarajuf9a202a2014-03-02 19:31:21 +000088def : Proc<"ultrasparc", [FeatureV9, FeatureV8Deprecated, FeatureVIS]>;
89def : Proc<"ultrasparc3", [FeatureV9, FeatureV8Deprecated, FeatureVIS,
90 FeatureVIS2]>;
91def : Proc<"niagara", [FeatureV9, FeatureV8Deprecated, FeatureVIS,
92 FeatureVIS2]>;
93def : Proc<"niagara2", [FeatureV9, FeatureV8Deprecated, UsePopc,
94 FeatureVIS, FeatureVIS2]>;
95def : Proc<"niagara3", [FeatureV9, FeatureV8Deprecated, UsePopc,
96 FeatureVIS, FeatureVIS2]>;
97def : Proc<"niagara4", [FeatureV9, FeatureV8Deprecated, UsePopc,
98 FeatureVIS, FeatureVIS2, FeatureVIS3]>;
Chris Lattner158e1f52006-02-05 05:50:24 +000099
Chris Dewhurst60197022016-04-22 08:17:17 +0000100// LEON 2 FT generic
101def : Processor<"leon2", LEON2Itineraries,
102 [FeatureLeon]>;
103
104// LEON 2 FT (AT697E)
105// TO DO: Place-holder: Processor specific features will be added *very* soon here.
106def : Processor<"at697e", LEON2Itineraries,
107 [FeatureLeon]>;
108
109// LEON 2 FT (AT697F)
110// TO DO: Place-holder: Processor specific features will be added *very* soon here.
111def : Processor<"at697f", LEON2Itineraries,
112 [FeatureLeon]>;
113
114
115// LEON 3 FT generic
116def : Processor<"leon3", LEON3Itineraries,
Chris Dewhurste3b86452016-05-09 11:55:15 +0000117 [FeatureLeon, UMACSMACSupport]>;
Chris Dewhurst60197022016-04-22 08:17:17 +0000118
Chris Dewhurst7d8412f2016-05-16 11:02:00 +0000119// LEON 3 FT (UT699). Provides features for the UT699 processor
120// - covers all the erratum fixes for LEON3, but does not support the CASA instruction.
Chris Dewhurst60197022016-04-22 08:17:17 +0000121def : Processor<"ut699", LEON3Itineraries,
Chris Dewhurste3b86452016-05-09 11:55:15 +0000122 [FeatureLeon, UMACSMACSupport]>;
Chris Dewhurst60197022016-04-22 08:17:17 +0000123
Chris Dewhurst7d8412f2016-05-16 11:02:00 +0000124// LEON3 FT (GR712RC). Provides features for the GR712RC processor.
125// - covers all the erratum fixed for LEON3 and support for the CASA instruction.
Chris Dewhurst60197022016-04-22 08:17:17 +0000126def : Processor<"gr712rc", LEON3Itineraries,
Chris Dewhurst7d8412f2016-05-16 11:02:00 +0000127 [FeatureLeon, UMACSMACSupport, LeonCASA]>;
Chris Dewhurst60197022016-04-22 08:17:17 +0000128
129// LEON 4 FT generic
130def : Processor<"leon4", LEON4Itineraries,
Chris Dewhurst7d8412f2016-05-16 11:02:00 +0000131 [FeatureLeon, UMACSMACSupport, LeonCASA]>;
Chris Dewhurst60197022016-04-22 08:17:17 +0000132
133// LEON 4 FT (GR740)
134// TO DO: Place-holder: Processor specific features will be added *very* soon here.
135def : Processor<"gr740", LEON4Itineraries,
Chris Dewhurst7d8412f2016-05-16 11:02:00 +0000136 [FeatureLeon, UMACSMACSupport, LeonCASA]>;
Chris Lattner158e1f52006-02-05 05:50:24 +0000137
138//===----------------------------------------------------------------------===//
139// Declare the target which we are implementing
140//===----------------------------------------------------------------------===//
141
Akira Hatanaka725657b2015-03-28 04:03:51 +0000142def SparcAsmWriter : AsmWriter {
143 string AsmWriterClassName = "InstPrinter";
144 int PassSubtarget = 1;
145 int Variant = 0;
146}
147
Chris Lattner158e1f52006-02-05 05:50:24 +0000148def Sparc : Target {
Chris Lattner158e1f52006-02-05 05:50:24 +0000149 // Pull in Instruction Info:
150 let InstructionSet = SparcInstrInfo;
Venkatraman Govindarajuc2dee7d2014-01-04 11:30:13 +0000151 let AssemblyParsers = [SparcAsmParser];
Akira Hatanaka725657b2015-03-28 04:03:51 +0000152 let AssemblyWriters = [SparcAsmWriter];
Chris Lattner158e1f52006-02-05 05:50:24 +0000153}