blob: 51e0b9acdb05d62c80d4f6b7358d0e232436759e [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 Dewhurst68388a02016-05-18 09:14:13 +000049def FeatureSoftFloat : SubtargetFeature<"soft-float", "UseSoftFloat", "true",
50 "Use software emulation for floating point">;
51
Chris Dewhurste3b86452016-05-09 11:55:15 +000052//==== Features added predmoninantly for LEON subtarget support
53include "LeonFeatures.td"
54
Chris Lattner158e1f52006-02-05 05:50:24 +000055//===----------------------------------------------------------------------===//
Chris Lattner49b269d2008-03-17 05:41:48 +000056// Register File, Calling Conv, Instruction Descriptions
Chris Lattner158e1f52006-02-05 05:50:24 +000057//===----------------------------------------------------------------------===//
58
59include "SparcRegisterInfo.td"
Chris Lattner49b269d2008-03-17 05:41:48 +000060include "SparcCallingConv.td"
Chris Dewhurst60197022016-04-22 08:17:17 +000061include "SparcSchedule.td"
Chris Lattner158e1f52006-02-05 05:50:24 +000062include "SparcInstrInfo.td"
63
Jakob Stoklund Olesenb93331f2010-04-05 03:10:20 +000064def SparcInstrInfo : InstrInfo;
Chris Lattner158e1f52006-02-05 05:50:24 +000065
Venkatraman Govindarajuc2dee7d2014-01-04 11:30:13 +000066def SparcAsmParser : AsmParser {
67 bit ShouldEmitMatchRegisterName = 0;
68}
69
Chris Lattner158e1f52006-02-05 05:50:24 +000070//===----------------------------------------------------------------------===//
71// SPARC processors supported.
72//===----------------------------------------------------------------------===//
73
74class Proc<string Name, list<SubtargetFeature> Features>
75 : Processor<Name, NoItineraries, Features>;
76
77def : Proc<"generic", []>;
Venkatraman Govindarajua66b3142014-01-11 23:56:13 +000078def : Proc<"v7", []>;
Chris Lattner158e1f52006-02-05 05:50:24 +000079def : Proc<"v8", []>;
80def : Proc<"supersparc", []>;
81def : Proc<"sparclite", []>;
82def : Proc<"f934", []>;
83def : Proc<"hypersparc", []>;
84def : Proc<"sparclite86x", []>;
85def : Proc<"sparclet", []>;
86def : Proc<"tsc701", []>;
Douglas Katzman708eeb02016-03-15 16:41:47 +000087def : Proc<"myriad2", []>;
88def : Proc<"myriad2.1", []>;
89def : Proc<"myriad2.2", []>;
Chris Lattner158e1f52006-02-05 05:50:24 +000090def : Proc<"v9", [FeatureV9]>;
Venkatraman Govindarajuf9a202a2014-03-02 19:31:21 +000091def : Proc<"ultrasparc", [FeatureV9, FeatureV8Deprecated, FeatureVIS]>;
92def : Proc<"ultrasparc3", [FeatureV9, FeatureV8Deprecated, FeatureVIS,
93 FeatureVIS2]>;
94def : Proc<"niagara", [FeatureV9, FeatureV8Deprecated, FeatureVIS,
95 FeatureVIS2]>;
96def : Proc<"niagara2", [FeatureV9, FeatureV8Deprecated, UsePopc,
97 FeatureVIS, FeatureVIS2]>;
98def : Proc<"niagara3", [FeatureV9, FeatureV8Deprecated, UsePopc,
99 FeatureVIS, FeatureVIS2]>;
100def : Proc<"niagara4", [FeatureV9, FeatureV8Deprecated, UsePopc,
101 FeatureVIS, FeatureVIS2, FeatureVIS3]>;
Chris Lattner158e1f52006-02-05 05:50:24 +0000102
Chris Dewhurst60197022016-04-22 08:17:17 +0000103// LEON 2 FT generic
104def : Processor<"leon2", LEON2Itineraries,
105 [FeatureLeon]>;
106
107// LEON 2 FT (AT697E)
108// TO DO: Place-holder: Processor specific features will be added *very* soon here.
109def : Processor<"at697e", LEON2Itineraries,
110 [FeatureLeon]>;
111
112// LEON 2 FT (AT697F)
113// TO DO: Place-holder: Processor specific features will be added *very* soon here.
114def : Processor<"at697f", LEON2Itineraries,
115 [FeatureLeon]>;
116
117
118// LEON 3 FT generic
119def : Processor<"leon3", LEON3Itineraries,
Chris Dewhurste3b86452016-05-09 11:55:15 +0000120 [FeatureLeon, UMACSMACSupport]>;
Chris Dewhurst60197022016-04-22 08:17:17 +0000121
Chris Dewhurst7d8412f2016-05-16 11:02:00 +0000122// LEON 3 FT (UT699). Provides features for the UT699 processor
123// - covers all the erratum fixes for LEON3, but does not support the CASA instruction.
Chris Dewhurst60197022016-04-22 08:17:17 +0000124def : Processor<"ut699", LEON3Itineraries,
Chris Dewhurste3b86452016-05-09 11:55:15 +0000125 [FeatureLeon, UMACSMACSupport]>;
Chris Dewhurst60197022016-04-22 08:17:17 +0000126
Chris Dewhurst7d8412f2016-05-16 11:02:00 +0000127// LEON3 FT (GR712RC). Provides features for the GR712RC processor.
128// - covers all the erratum fixed for LEON3 and support for the CASA instruction.
Chris Dewhurst60197022016-04-22 08:17:17 +0000129def : Processor<"gr712rc", LEON3Itineraries,
Chris Dewhurst7d8412f2016-05-16 11:02:00 +0000130 [FeatureLeon, UMACSMACSupport, LeonCASA]>;
Chris Dewhurst60197022016-04-22 08:17:17 +0000131
132// LEON 4 FT generic
133def : Processor<"leon4", LEON4Itineraries,
Chris Dewhurst7d8412f2016-05-16 11:02:00 +0000134 [FeatureLeon, UMACSMACSupport, LeonCASA]>;
Chris Dewhurst60197022016-04-22 08:17:17 +0000135
136// LEON 4 FT (GR740)
137// TO DO: Place-holder: Processor specific features will be added *very* soon here.
138def : Processor<"gr740", LEON4Itineraries,
Chris Dewhurst7d8412f2016-05-16 11:02:00 +0000139 [FeatureLeon, UMACSMACSupport, LeonCASA]>;
Chris Lattner158e1f52006-02-05 05:50:24 +0000140
141//===----------------------------------------------------------------------===//
142// Declare the target which we are implementing
143//===----------------------------------------------------------------------===//
144
Akira Hatanaka725657b2015-03-28 04:03:51 +0000145def SparcAsmWriter : AsmWriter {
146 string AsmWriterClassName = "InstPrinter";
147 int PassSubtarget = 1;
148 int Variant = 0;
149}
150
Chris Lattner158e1f52006-02-05 05:50:24 +0000151def Sparc : Target {
Chris Lattner158e1f52006-02-05 05:50:24 +0000152 // Pull in Instruction Info:
153 let InstructionSet = SparcInstrInfo;
Venkatraman Govindarajuc2dee7d2014-01-04 11:30:13 +0000154 let AssemblyParsers = [SparcAsmParser];
Akira Hatanaka725657b2015-03-28 04:03:51 +0000155 let AssemblyWriters = [SparcAsmWriter];
Chris Lattner158e1f52006-02-05 05:50:24 +0000156}