]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/lib/Target/Sparc/Sparc.td
Merge llvm, clang, lld, lldb, compiler-rt and libc++ r308421, and update
[FreeBSD/FreeBSD.git] / contrib / llvm / lib / Target / Sparc / Sparc.td
1 //===-- Sparc.td - Describe the Sparc Target Machine -------*- tablegen -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 //
11 //===----------------------------------------------------------------------===//
12
13 //===----------------------------------------------------------------------===//
14 // Target-independent interfaces which we are implementing
15 //===----------------------------------------------------------------------===//
16
17 include "llvm/Target/Target.td"
18
19 //===----------------------------------------------------------------------===//
20 // SPARC Subtarget features.
21 //
22
23 def FeatureSoftMulDiv
24   : SubtargetFeature<"soft-mul-div", "UseSoftMulDiv", "true",
25                      "Use software emulation for integer multiply and divide">;
26
27 def FeatureV9
28   : SubtargetFeature<"v9", "IsV9", "true",
29                      "Enable SPARC-V9 instructions">;
30 def FeatureV8Deprecated
31   : SubtargetFeature<"deprecated-v8", "V8DeprecatedInsts", "true",
32                      "Enable deprecated V8 instructions in V9 mode">;
33 def FeatureVIS
34   : SubtargetFeature<"vis", "IsVIS", "true",
35                      "Enable UltraSPARC Visual Instruction Set extensions">;
36 def FeatureVIS2
37   : SubtargetFeature<"vis2", "IsVIS2", "true",
38                      "Enable Visual Instruction Set extensions II">;
39 def FeatureVIS3
40   : SubtargetFeature<"vis3", "IsVIS3", "true",
41                      "Enable Visual Instruction Set extensions III">;
42 def FeatureLeon
43   : SubtargetFeature<"leon", "IsLeon", "true",
44                      "Enable LEON extensions">;
45
46 def FeatureHardQuad
47   : SubtargetFeature<"hard-quad-float", "HasHardQuad", "true",
48                      "Enable quad-word floating point instructions">;
49
50 def UsePopc : SubtargetFeature<"popc", "UsePopc", "true",
51                                "Use the popc (population count) instruction">;
52
53 def FeatureSoftFloat : SubtargetFeature<"soft-float", "UseSoftFloat", "true",
54                               "Use software emulation for floating point">;  
55
56 //==== Features added predmoninantly for LEON subtarget support                               
57 include "LeonFeatures.td"
58
59 //===----------------------------------------------------------------------===//
60 // Register File, Calling Conv, Instruction Descriptions
61 //===----------------------------------------------------------------------===//
62
63 include "SparcRegisterInfo.td"
64 include "SparcCallingConv.td"
65 include "SparcSchedule.td"
66 include "SparcInstrInfo.td"
67
68 def SparcInstrInfo : InstrInfo;
69
70 def SparcAsmParser : AsmParser {
71   bit ShouldEmitMatchRegisterName = 0;
72 }
73
74 //===----------------------------------------------------------------------===//
75 // SPARC processors supported.
76 //===----------------------------------------------------------------------===//
77
78 class Proc<string Name, list<SubtargetFeature> Features>
79  : Processor<Name, NoItineraries, Features>;
80
81 def : Proc<"generic",         []>;
82 def : Proc<"v7",              [FeatureSoftMulDiv]>;
83 def : Proc<"v8",              []>;
84 def : Proc<"supersparc",      []>;
85 def : Proc<"sparclite",       []>;
86 def : Proc<"f934",            []>;
87 def : Proc<"hypersparc",      []>;
88 def : Proc<"sparclite86x",    []>;
89 def : Proc<"sparclet",        []>;
90 def : Proc<"tsc701",          []>;
91 def : Proc<"myriad2",         [FeatureLeon, LeonCASA]>;
92 def : Proc<"myriad2.1",       [FeatureLeon, LeonCASA]>;
93 def : Proc<"myriad2.2",       [FeatureLeon, LeonCASA]>;
94 def : Proc<"ma2100",          [FeatureLeon, LeonCASA]>;
95 def : Proc<"ma2150",          [FeatureLeon, LeonCASA]>;
96 def : Proc<"ma2450",          [FeatureLeon, LeonCASA]>;
97 def : Proc<"v9",              [FeatureV9]>;
98 def : Proc<"ultrasparc",      [FeatureV9, FeatureV8Deprecated, FeatureVIS]>;
99 def : Proc<"ultrasparc3",     [FeatureV9, FeatureV8Deprecated, FeatureVIS,
100                                FeatureVIS2]>;
101 def : Proc<"niagara",         [FeatureV9, FeatureV8Deprecated, FeatureVIS,
102                                FeatureVIS2]>;
103 def : Proc<"niagara2",        [FeatureV9, FeatureV8Deprecated, UsePopc,
104                                FeatureVIS, FeatureVIS2]>;
105 def : Proc<"niagara3",        [FeatureV9, FeatureV8Deprecated, UsePopc,
106                                FeatureVIS, FeatureVIS2]>;
107 def : Proc<"niagara4",        [FeatureV9, FeatureV8Deprecated, UsePopc,
108                                FeatureVIS, FeatureVIS2, FeatureVIS3]>;
109
110 // LEON 2 FT generic
111 def : Processor<"leon2", LEON2Itineraries,
112                 [FeatureLeon]>;
113
114 // LEON 2 FT (AT697E)
115 // TO DO: Place-holder: Processor specific features will be added *very* soon here.
116 def : Processor<"at697e", LEON2Itineraries,
117                 [FeatureLeon, ReplaceSDIV, InsertNOPLoad]>;
118
119 // LEON 2 FT (AT697F)
120 // TO DO: Place-holder: Processor specific features will be added *very* soon here.
121 def : Processor<"at697f", LEON2Itineraries,
122                 [FeatureLeon, InsertNOPLoad]>;
123
124
125 // LEON 3 FT generic
126 def : Processor<"leon3", LEON3Itineraries,
127                 [FeatureLeon, UMACSMACSupport]>;
128
129 // LEON 3 FT (UT699). Provides features for the UT699 processor
130 // - covers all the erratum fixes for LEON3, but does not support the CASA instruction.
131 def : Processor<"ut699", LEON3Itineraries, 
132                 [FeatureLeon, InsertNOPLoad, FixFSMULD, ReplaceFMULS, FixAllFDIVSQRT]>;
133
134 // LEON3 FT (GR712RC). Provides features for the GR712RC processor.
135 // - covers all the erratum fixed for LEON3 and support for the CASA instruction. 
136 def : Processor<"gr712rc", LEON3Itineraries,
137                 [FeatureLeon, LeonCASA]>;
138
139 // LEON 4 FT generic
140 def : Processor<"leon4", LEON4Itineraries,
141                 [FeatureLeon, UMACSMACSupport, LeonCASA]>;
142
143 // LEON 4 FT (GR740) 
144 // TO DO: Place-holder: Processor specific features will be added *very* soon here.
145 def : Processor<"gr740", LEON4Itineraries, 
146                 [FeatureLeon, UMACSMACSupport, LeonCASA]>;
147
148 //===----------------------------------------------------------------------===//
149 // Declare the target which we are implementing
150 //===----------------------------------------------------------------------===//
151
152 def SparcAsmWriter : AsmWriter {
153   string AsmWriterClassName  = "InstPrinter";
154   int PassSubtarget = 1;
155   int Variant = 0;
156 }
157
158 def Sparc : Target {
159   // Pull in Instruction Info:
160   let InstructionSet = SparcInstrInfo;
161   let AssemblyParsers  = [SparcAsmParser];
162   let AssemblyWriters = [SparcAsmWriter];
163 }