blob: 11004c5a952fc9b934eef0b9ade4d14dc483b193 [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
James Y Knight2cc9da92016-08-12 14:48:09 +000024 : SubtargetFeature<"v9", "IsV9", "true",
25 "Enable SPARC-V9 instructions">;
Chris Lattner158e1f52006-02-05 05:50:24 +000026def FeatureV8Deprecated
James Y Knight2cc9da92016-08-12 14:48:09 +000027 : SubtargetFeature<"deprecated-v8", "V8DeprecatedInsts", "true",
28 "Enable deprecated V8 instructions in V9 mode">;
Chris Lattner158e1f52006-02-05 05:50:24 +000029def FeatureVIS
James Y Knight2cc9da92016-08-12 14:48:09 +000030 : SubtargetFeature<"vis", "IsVIS", "true",
31 "Enable UltraSPARC Visual Instruction Set extensions">;
Venkatraman Govindarajuf9a202a2014-03-02 19:31:21 +000032def FeatureVIS2
James Y Knight2cc9da92016-08-12 14:48:09 +000033 : SubtargetFeature<"vis2", "IsVIS2", "true",
34 "Enable Visual Instruction Set extensions II">;
Venkatraman Govindarajuf9a202a2014-03-02 19:31:21 +000035def FeatureVIS3
James Y Knight2cc9da92016-08-12 14:48:09 +000036 : SubtargetFeature<"vis3", "IsVIS3", "true",
37 "Enable Visual Instruction Set extensions III">;
Chris Dewhurst60197022016-04-22 08:17:17 +000038def FeatureLeon
James Y Knight2cc9da92016-08-12 14:48:09 +000039 : 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
James Y Knight2cc9da92016-08-12 14:48:09 +000043 : SubtargetFeature<"hard-quad-float", "HasHardQuad", "true",
44 "Enable quad-word floating point instructions">;
Venkatraman Govindaraju35e0c382013-08-25 18:30:06 +000045
Jakob Stoklund Olesenead3b3d2014-01-26 06:09:59 +000046def UsePopc : SubtargetFeature<"popc", "UsePopc", "true",
47 "Use the popc (population count) instruction">;
48
James Y Knight2cc9da92016-08-12 14:48:09 +000049def FeatureSoftFloat : SubtargetFeature<"soft-float", "UseSoftFloat", "true",
50 "Use software emulation for floating point">;
Chris Dewhurst68388a02016-05-18 09:14:13 +000051
James Y Knight2cc9da92016-08-12 14:48:09 +000052//==== Features added predmoninantly for LEON subtarget support
Chris Dewhurste3b86452016-05-09 11:55:15 +000053include "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
James Y Knight2cc9da92016-08-12 14:48:09 +000066def SparcAsmParser : AsmParser {
67 bit ShouldEmitMatchRegisterName = 0;
68}
Venkatraman Govindarajuc2dee7d2014-01-04 11:30:13 +000069
Chris Lattner158e1f52006-02-05 05:50:24 +000070//===----------------------------------------------------------------------===//
71// SPARC processors supported.
72//===----------------------------------------------------------------------===//
73
74class Proc<string Name, list<SubtargetFeature> Features>
James Y Knight2cc9da92016-08-12 14:48:09 +000075 : Processor<Name, NoItineraries, Features>;
Chris Lattner158e1f52006-02-05 05:50:24 +000076
James Y Knight2cc9da92016-08-12 14:48:09 +000077def : Proc<"generic", []>;
78def : Proc<"v7", []>;
79def : Proc<"v8", []>;
80def : Proc<"supersparc", []>;
81def : Proc<"sparclite", []>;
82def : Proc<"f934", []>;
83def : Proc<"hypersparc", []>;
84def : Proc<"sparclite86x", []>;
85def : Proc<"sparclet", []>;
86def : Proc<"tsc701", []>;
Douglas Katzman8ea02f42016-09-13 17:51:41 +000087def : Proc<"myriad2", [FeatureLeon, LeonCASA]>;
88def : Proc<"myriad2.1", [FeatureLeon, LeonCASA]>;
89def : Proc<"myriad2.2", [FeatureLeon, LeonCASA]>;
90def : Proc<"ma2100", [FeatureLeon, LeonCASA]>;
91def : Proc<"ma2150", [FeatureLeon, LeonCASA]>;
92def : Proc<"ma2450", [FeatureLeon, LeonCASA]>;
James Y Knight2cc9da92016-08-12 14:48:09 +000093def : Proc<"v9", [FeatureV9]>;
94def : Proc<"ultrasparc", [FeatureV9, FeatureV8Deprecated, FeatureVIS]>;
95def : Proc<"ultrasparc3", [FeatureV9, FeatureV8Deprecated, FeatureVIS,
96 FeatureVIS2]>;
97def : Proc<"niagara", [FeatureV9, FeatureV8Deprecated, FeatureVIS,
98 FeatureVIS2]>;
99def : Proc<"niagara2", [FeatureV9, FeatureV8Deprecated, UsePopc,
100 FeatureVIS, FeatureVIS2]>;
101def : Proc<"niagara3", [FeatureV9, FeatureV8Deprecated, UsePopc,
102 FeatureVIS, FeatureVIS2]>;
103def : Proc<"niagara4", [FeatureV9, FeatureV8Deprecated, UsePopc,
104 FeatureVIS, FeatureVIS2, FeatureVIS3]>;
Chris Lattner158e1f52006-02-05 05:50:24 +0000105
Chris Dewhurst60197022016-04-22 08:17:17 +0000106// LEON 2 FT generic
James Y Knight2cc9da92016-08-12 14:48:09 +0000107def : Processor<"leon2", LEON2Itineraries,
108 [FeatureLeon]>;
Chris Dewhurst60197022016-04-22 08:17:17 +0000109
110// LEON 2 FT (AT697E)
James Y Knight2cc9da92016-08-12 14:48:09 +0000111// TO DO: Place-holder: Processor specific features will be added *very* soon here.
112def : Processor<"at697e", LEON2Itineraries,
Chris Dewhurst85013122016-10-10 08:53:06 +0000113 [FeatureLeon, ReplaceSDIV, InsertNOPLoad]>;
Chris Dewhurst60197022016-04-22 08:17:17 +0000114
115// LEON 2 FT (AT697F)
James Y Knight2cc9da92016-08-12 14:48:09 +0000116// TO DO: Place-holder: Processor specific features will be added *very* soon here.
Chris Dewhurst60197022016-04-22 08:17:17 +0000117def : Processor<"at697f", LEON2Itineraries,
James Y Knight2cc9da92016-08-12 14:48:09 +0000118 [FeatureLeon, InsertNOPLoad]>;
119
Chris Dewhurst60197022016-04-22 08:17:17 +0000120
121// LEON 3 FT generic
James Y Knight2cc9da92016-08-12 14:48:09 +0000122def : Processor<"leon3", LEON3Itineraries,
123 [FeatureLeon, UMACSMACSupport]>;
Chris Dewhurst60197022016-04-22 08:17:17 +0000124
Chris Dewhurst7d8412f2016-05-16 11:02:00 +0000125// LEON 3 FT (UT699). Provides features for the UT699 processor
James Y Knight2cc9da92016-08-12 14:48:09 +0000126// - covers all the erratum fixes for LEON3, but does not support the CASA instruction.
127def : Processor<"ut699", LEON3Itineraries,
128 [FeatureLeon, InsertNOPLoad, FixFSMULD, ReplaceFMULS, FixAllFDIVSQRT]>;
Chris Dewhurst60197022016-04-22 08:17:17 +0000129
Chris Dewhurst7d8412f2016-05-16 11:02:00 +0000130// LEON3 FT (GR712RC). Provides features for the GR712RC processor.
James Y Knight2cc9da92016-08-12 14:48:09 +0000131// - covers all the erratum fixed for LEON3 and support for the CASA instruction.
Chris Dewhurst60197022016-04-22 08:17:17 +0000132def : Processor<"gr712rc", LEON3Itineraries,
James Y Knight2cc9da92016-08-12 14:48:09 +0000133 [FeatureLeon, LeonCASA]>;
Chris Dewhurst60197022016-04-22 08:17:17 +0000134
135// LEON 4 FT generic
136def : Processor<"leon4", LEON4Itineraries,
James Y Knight2cc9da92016-08-12 14:48:09 +0000137 [FeatureLeon, UMACSMACSupport, LeonCASA]>;
Chris Dewhurst60197022016-04-22 08:17:17 +0000138
James Y Knight2cc9da92016-08-12 14:48:09 +0000139// LEON 4 FT (GR740)
140// TO DO: Place-holder: Processor specific features will be added *very* soon here.
141def : Processor<"gr740", LEON4Itineraries,
142 [FeatureLeon, UMACSMACSupport, LeonCASA]>;
Chris Lattner158e1f52006-02-05 05:50:24 +0000143
144//===----------------------------------------------------------------------===//
145// Declare the target which we are implementing
146//===----------------------------------------------------------------------===//
147
Akira Hatanaka725657b2015-03-28 04:03:51 +0000148def SparcAsmWriter : AsmWriter {
James Y Knight2cc9da92016-08-12 14:48:09 +0000149 string AsmWriterClassName = "InstPrinter";
Akira Hatanaka725657b2015-03-28 04:03:51 +0000150 int PassSubtarget = 1;
151 int Variant = 0;
152}
153
Chris Lattner158e1f52006-02-05 05:50:24 +0000154def Sparc : Target {
Chris Lattner158e1f52006-02-05 05:50:24 +0000155 // Pull in Instruction Info:
156 let InstructionSet = SparcInstrInfo;
James Y Knight2cc9da92016-08-12 14:48:09 +0000157 let AssemblyParsers = [SparcAsmParser];
158 let AssemblyWriters = [SparcAsmWriter];
Chris Lattner158e1f52006-02-05 05:50:24 +0000159}