1//===-- SystemZ.td - SystemZ processors and features ---------*- tblgen -*-===//
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// Feature definitions.
11//
12//===----------------------------------------------------------------------===//
13
14class SystemZFeature<string extname, string intname, string desc>
15  : Predicate<"Subtarget->has"##intname##"()">,
16    AssemblerPredicate<"Feature"##intname, extname>,
17    SubtargetFeature<extname, "Has"##intname, "true", desc>;
18
19class SystemZMissingFeature<string intname>
20  : Predicate<"!Subtarget->has"##intname##"()">;
21
22class SystemZFeatureList<list<SystemZFeature> x> {
23  list<SystemZFeature> List = x;
24}
25
26class SystemZFeatureAdd<list<SystemZFeature> x, list<SystemZFeature> y>
27  : SystemZFeatureList<!listconcat(x, y)>;
28
29//===----------------------------------------------------------------------===//
30//
31// New features added in the Ninth Edition of the z/Architecture
32//
33//===----------------------------------------------------------------------===//
34
35def FeatureDistinctOps : SystemZFeature<
36  "distinct-ops", "DistinctOps",
37  "Assume that the distinct-operands facility is installed"
38>;
39
40def FeatureFastSerialization : SystemZFeature<
41  "fast-serialization", "FastSerialization",
42  "Assume that the fast-serialization facility is installed"
43>;
44
45def FeatureFPExtension : SystemZFeature<
46  "fp-extension", "FPExtension",
47  "Assume that the floating-point extension facility is installed"
48>;
49
50def FeatureHighWord : SystemZFeature<
51  "high-word", "HighWord",
52  "Assume that the high-word facility is installed"
53>;
54
55def FeatureInterlockedAccess1 : SystemZFeature<
56  "interlocked-access1", "InterlockedAccess1",
57  "Assume that interlocked-access facility 1 is installed"
58>;
59def FeatureNoInterlockedAccess1 : SystemZMissingFeature<"InterlockedAccess1">;
60
61def FeatureLoadStoreOnCond : SystemZFeature<
62  "load-store-on-cond", "LoadStoreOnCond",
63  "Assume that the load/store-on-condition facility is installed"
64>;
65def FeatureNoLoadStoreOnCond : SystemZMissingFeature<"LoadStoreOnCond">;
66
67def FeaturePopulationCount : SystemZFeature<
68  "population-count", "PopulationCount",
69  "Assume that the population-count facility is installed"
70>;
71
72def FeatureMessageSecurityAssist3 : SystemZFeature<
73  "message-security-assist-extension3", "MessageSecurityAssist3",
74  "Assume that the message-security-assist extension facility 3 is installed"
75>;
76
77def FeatureMessageSecurityAssist4 : SystemZFeature<
78  "message-security-assist-extension4", "MessageSecurityAssist4",
79  "Assume that the message-security-assist extension facility 4 is installed"
80>;
81
82def FeatureResetReferenceBitsMultiple : SystemZFeature<
83  "reset-reference-bits-multiple", "ResetReferenceBitsMultiple",
84  "Assume that the reset-reference-bits-multiple facility is installed"
85>;
86
87def Arch9NewFeatures : SystemZFeatureList<[
88    FeatureDistinctOps,
89    FeatureFastSerialization,
90    FeatureFPExtension,
91    FeatureHighWord,
92    FeatureInterlockedAccess1,
93    FeatureLoadStoreOnCond,
94    FeaturePopulationCount,
95    FeatureMessageSecurityAssist3,
96    FeatureMessageSecurityAssist4,
97    FeatureResetReferenceBitsMultiple
98]>;
99
100//===----------------------------------------------------------------------===//
101//
102// New features added in the Tenth Edition of the z/Architecture
103//
104//===----------------------------------------------------------------------===//
105
106def FeatureExecutionHint : SystemZFeature<
107  "execution-hint", "ExecutionHint",
108  "Assume that the execution-hint facility is installed"
109>;
110
111def FeatureLoadAndTrap : SystemZFeature<
112  "load-and-trap", "LoadAndTrap",
113  "Assume that the load-and-trap facility is installed"
114>;
115
116def FeatureMiscellaneousExtensions : SystemZFeature<
117  "miscellaneous-extensions", "MiscellaneousExtensions",
118  "Assume that the miscellaneous-extensions facility is installed"
119>;
120
121def FeatureProcessorAssist : SystemZFeature<
122  "processor-assist", "ProcessorAssist",
123  "Assume that the processor-assist facility is installed"
124>;
125
126def FeatureTransactionalExecution : SystemZFeature<
127  "transactional-execution", "TransactionalExecution",
128  "Assume that the transactional-execution facility is installed"
129>;
130
131def FeatureDFPZonedConversion : SystemZFeature<
132  "dfp-zoned-conversion", "DFPZonedConversion",
133  "Assume that the DFP zoned-conversion facility is installed"
134>;
135
136def FeatureEnhancedDAT2 : SystemZFeature<
137  "enhanced-dat-2", "EnhancedDAT2",
138  "Assume that the enhanced-DAT facility 2 is installed"
139>;
140
141def Arch10NewFeatures : SystemZFeatureList<[
142    FeatureExecutionHint,
143    FeatureLoadAndTrap,
144    FeatureMiscellaneousExtensions,
145    FeatureProcessorAssist,
146    FeatureTransactionalExecution,
147    FeatureDFPZonedConversion,
148    FeatureEnhancedDAT2
149]>;
150
151//===----------------------------------------------------------------------===//
152//
153// New features added in the Eleventh Edition of the z/Architecture
154//
155//===----------------------------------------------------------------------===//
156
157def FeatureLoadAndZeroRightmostByte : SystemZFeature<
158  "load-and-zero-rightmost-byte", "LoadAndZeroRightmostByte",
159  "Assume that the load-and-zero-rightmost-byte facility is installed"
160>;
161
162def FeatureLoadStoreOnCond2 : SystemZFeature<
163  "load-store-on-cond-2", "LoadStoreOnCond2",
164  "Assume that the load/store-on-condition facility 2 is installed"
165>;
166
167def FeatureMessageSecurityAssist5 : SystemZFeature<
168  "message-security-assist-extension5", "MessageSecurityAssist5",
169  "Assume that the message-security-assist extension facility 5 is installed"
170>;
171
172def FeatureDFPPackedConversion : SystemZFeature<
173  "dfp-packed-conversion", "DFPPackedConversion",
174  "Assume that the DFP packed-conversion facility is installed"
175>;
176
177def FeatureVector : SystemZFeature<
178  "vector", "Vector",
179  "Assume that the vectory facility is installed"
180>;
181def FeatureNoVector : SystemZMissingFeature<"Vector">;
182
183def Arch11NewFeatures : SystemZFeatureList<[
184    FeatureLoadAndZeroRightmostByte,
185    FeatureLoadStoreOnCond2,
186    FeatureMessageSecurityAssist5,
187    FeatureDFPPackedConversion,
188    FeatureVector
189]>;
190
191//===----------------------------------------------------------------------===//
192//
193// New features added in the Twelvth Edition of the z/Architecture
194//
195//===----------------------------------------------------------------------===//
196
197def FeatureMiscellaneousExtensions2 : SystemZFeature<
198  "miscellaneous-extensions-2", "MiscellaneousExtensions2",
199  "Assume that the miscellaneous-extensions facility 2 is installed"
200>;
201
202def FeatureGuardedStorage : SystemZFeature<
203  "guarded-storage", "GuardedStorage",
204  "Assume that the guarded-storage facility is installed"
205>;
206
207def FeatureMessageSecurityAssist7 : SystemZFeature<
208  "message-security-assist-extension7", "MessageSecurityAssist7",
209  "Assume that the message-security-assist extension facility 7 is installed"
210>;
211
212def FeatureMessageSecurityAssist8 : SystemZFeature<
213  "message-security-assist-extension8", "MessageSecurityAssist8",
214  "Assume that the message-security-assist extension facility 8 is installed"
215>;
216
217def FeatureVectorEnhancements1 : SystemZFeature<
218  "vector-enhancements-1", "VectorEnhancements1",
219  "Assume that the vector enhancements facility 1 is installed"
220>;
221def FeatureNoVectorEnhancements1 : SystemZMissingFeature<"VectorEnhancements1">;
222
223def FeatureVectorPackedDecimal : SystemZFeature<
224  "vector-packed-decimal", "VectorPackedDecimal",
225  "Assume that the vector packed decimal facility is installed"
226>;
227
228def FeatureInsertReferenceBitsMultiple : SystemZFeature<
229  "insert-reference-bits-multiple", "InsertReferenceBitsMultiple",
230  "Assume that the insert-reference-bits-multiple facility is installed"
231>;
232
233def Arch12NewFeatures : SystemZFeatureList<[
234    FeatureMiscellaneousExtensions2,
235    FeatureGuardedStorage,
236    FeatureMessageSecurityAssist7,
237    FeatureMessageSecurityAssist8,
238    FeatureVectorEnhancements1,
239    FeatureVectorPackedDecimal,
240    FeatureInsertReferenceBitsMultiple
241]>;
242
243//===----------------------------------------------------------------------===//
244//
245// Cumulative supported and unsupported feature sets
246//
247//===----------------------------------------------------------------------===//
248
249def Arch8SupportedFeatures
250  : SystemZFeatureList<[]>;
251def Arch9SupportedFeatures
252  : SystemZFeatureAdd<Arch8SupportedFeatures.List,  Arch9NewFeatures.List>;
253def Arch10SupportedFeatures
254  : SystemZFeatureAdd<Arch9SupportedFeatures.List,  Arch10NewFeatures.List>;
255def Arch11SupportedFeatures
256  : SystemZFeatureAdd<Arch10SupportedFeatures.List, Arch11NewFeatures.List>;
257def Arch12SupportedFeatures
258  : SystemZFeatureAdd<Arch11SupportedFeatures.List, Arch12NewFeatures.List>;
259
260def Arch12UnsupportedFeatures
261  : SystemZFeatureList<[]>;
262def Arch11UnsupportedFeatures
263  : SystemZFeatureAdd<Arch12UnsupportedFeatures.List, Arch12NewFeatures.List>;
264def Arch10UnsupportedFeatures
265  : SystemZFeatureAdd<Arch11UnsupportedFeatures.List, Arch11NewFeatures.List>;
266def Arch9UnsupportedFeatures
267  : SystemZFeatureAdd<Arch10UnsupportedFeatures.List, Arch10NewFeatures.List>;
268def Arch8UnsupportedFeatures
269  : SystemZFeatureAdd<Arch9UnsupportedFeatures.List,  Arch9NewFeatures.List>;
270
271