xref: /freebsd/contrib/llvm-project/llvm/lib/Target/SystemZ/SystemZFeatures.td (revision fe75646a0234a261c0013bf1840fdac4acaf0cec)
1//===-- SystemZ.td - SystemZ processors and features ---------*- tblgen -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// Feature definitions.
10//
11//===----------------------------------------------------------------------===//
12
13class SystemZFeature<string extname, string intname, dag featdag, string desc>
14  : Predicate<"Subtarget->has"#intname#"()">,
15    AssemblerPredicate<featdag, extname>,
16    SubtargetFeature<extname, "Has"#intname, "true", desc>;
17
18class SystemZMissingFeature<string intname>
19  : Predicate<"!Subtarget->has"#intname#"()">;
20
21class SystemZFeatureList<list<SystemZFeature> x> {
22  list<SystemZFeature> List = x;
23}
24
25class SystemZFeatureAdd<list<SystemZFeature> x, list<SystemZFeature> y>
26  : SystemZFeatureList<!listconcat(x, y)>;
27
28// This feature is added as a subtarget feature whenever the function is
29// compiled to use soft-float.
30def FeatureSoftFloat : SystemZFeature<
31  "soft-float", "SoftFloat", (all_of FeatureSoftFloat),
32  "Use software emulation for floating point"
33>;
34
35//===----------------------------------------------------------------------===//
36//
37// New features added in the Ninth Edition of the z/Architecture
38//
39//===----------------------------------------------------------------------===//
40
41def FeatureDistinctOps : SystemZFeature<
42  "distinct-ops", "DistinctOps", (all_of FeatureDistinctOps),
43  "Assume that the distinct-operands facility is installed"
44>;
45
46def FeatureFastSerialization : SystemZFeature<
47  "fast-serialization", "FastSerialization", (all_of FeatureFastSerialization),
48  "Assume that the fast-serialization facility is installed"
49>;
50
51def FeatureFPExtension : SystemZFeature<
52  "fp-extension", "FPExtension", (all_of FeatureFPExtension),
53  "Assume that the floating-point extension facility is installed"
54>;
55
56def FeatureHighWord : SystemZFeature<
57  "high-word", "HighWord", (all_of FeatureHighWord),
58  "Assume that the high-word facility is installed"
59>;
60
61def FeatureInterlockedAccess1 : SystemZFeature<
62  "interlocked-access1", "InterlockedAccess1", (all_of FeatureInterlockedAccess1),
63  "Assume that interlocked-access facility 1 is installed"
64>;
65def FeatureNoInterlockedAccess1 : SystemZMissingFeature<"InterlockedAccess1">;
66
67def FeatureLoadStoreOnCond : SystemZFeature<
68  "load-store-on-cond", "LoadStoreOnCond", (all_of FeatureLoadStoreOnCond),
69  "Assume that the load/store-on-condition facility is installed"
70>;
71def FeatureNoLoadStoreOnCond : SystemZMissingFeature<"LoadStoreOnCond">;
72
73def FeaturePopulationCount : SystemZFeature<
74  "population-count", "PopulationCount", (all_of FeaturePopulationCount),
75  "Assume that the population-count facility is installed"
76>;
77
78def FeatureMessageSecurityAssist3 : SystemZFeature<
79  "message-security-assist-extension3", "MessageSecurityAssist3", (all_of FeatureMessageSecurityAssist3),
80  "Assume that the message-security-assist extension facility 3 is installed"
81>;
82
83def FeatureMessageSecurityAssist4 : SystemZFeature<
84  "message-security-assist-extension4", "MessageSecurityAssist4", (all_of FeatureMessageSecurityAssist4),
85  "Assume that the message-security-assist extension facility 4 is installed"
86>;
87
88def FeatureResetReferenceBitsMultiple : SystemZFeature<
89  "reset-reference-bits-multiple", "ResetReferenceBitsMultiple", (all_of FeatureResetReferenceBitsMultiple),
90  "Assume that the reset-reference-bits-multiple facility is installed"
91>;
92
93def Arch9NewFeatures : SystemZFeatureList<[
94    FeatureDistinctOps,
95    FeatureFastSerialization,
96    FeatureFPExtension,
97    FeatureHighWord,
98    FeatureInterlockedAccess1,
99    FeatureLoadStoreOnCond,
100    FeaturePopulationCount,
101    FeatureMessageSecurityAssist3,
102    FeatureMessageSecurityAssist4,
103    FeatureResetReferenceBitsMultiple
104]>;
105
106//===----------------------------------------------------------------------===//
107//
108// New features added in the Tenth Edition of the z/Architecture
109//
110//===----------------------------------------------------------------------===//
111
112def FeatureExecutionHint : SystemZFeature<
113  "execution-hint", "ExecutionHint", (all_of FeatureExecutionHint),
114  "Assume that the execution-hint facility is installed"
115>;
116
117def FeatureLoadAndTrap : SystemZFeature<
118  "load-and-trap", "LoadAndTrap", (all_of FeatureLoadAndTrap),
119  "Assume that the load-and-trap facility is installed"
120>;
121
122def FeatureMiscellaneousExtensions : SystemZFeature<
123  "miscellaneous-extensions", "MiscellaneousExtensions", (all_of FeatureMiscellaneousExtensions),
124  "Assume that the miscellaneous-extensions facility is installed"
125>;
126
127def FeatureProcessorAssist : SystemZFeature<
128  "processor-assist", "ProcessorAssist", (all_of FeatureProcessorAssist),
129  "Assume that the processor-assist facility is installed"
130>;
131
132def FeatureTransactionalExecution : SystemZFeature<
133  "transactional-execution", "TransactionalExecution", (all_of FeatureTransactionalExecution),
134  "Assume that the transactional-execution facility is installed"
135>;
136
137def FeatureDFPZonedConversion : SystemZFeature<
138  "dfp-zoned-conversion", "DFPZonedConversion", (all_of FeatureDFPZonedConversion),
139  "Assume that the DFP zoned-conversion facility is installed"
140>;
141
142def FeatureEnhancedDAT2 : SystemZFeature<
143  "enhanced-dat-2", "EnhancedDAT2", (all_of FeatureEnhancedDAT2),
144  "Assume that the enhanced-DAT facility 2 is installed"
145>;
146
147def Arch10NewFeatures : SystemZFeatureList<[
148    FeatureExecutionHint,
149    FeatureLoadAndTrap,
150    FeatureMiscellaneousExtensions,
151    FeatureProcessorAssist,
152    FeatureTransactionalExecution,
153    FeatureDFPZonedConversion,
154    FeatureEnhancedDAT2
155]>;
156
157//===----------------------------------------------------------------------===//
158//
159// New features added in the Eleventh Edition of the z/Architecture
160//
161//===----------------------------------------------------------------------===//
162
163def FeatureLoadAndZeroRightmostByte : SystemZFeature<
164  "load-and-zero-rightmost-byte", "LoadAndZeroRightmostByte", (all_of FeatureLoadAndZeroRightmostByte),
165  "Assume that the load-and-zero-rightmost-byte facility is installed"
166>;
167
168def FeatureLoadStoreOnCond2 : SystemZFeature<
169  "load-store-on-cond-2", "LoadStoreOnCond2", (all_of FeatureLoadStoreOnCond2),
170  "Assume that the load/store-on-condition facility 2 is installed"
171>;
172
173def FeatureMessageSecurityAssist5 : SystemZFeature<
174  "message-security-assist-extension5", "MessageSecurityAssist5", (all_of FeatureMessageSecurityAssist5),
175  "Assume that the message-security-assist extension facility 5 is installed"
176>;
177
178def FeatureDFPPackedConversion : SystemZFeature<
179  "dfp-packed-conversion", "DFPPackedConversion", (all_of FeatureDFPPackedConversion),
180  "Assume that the DFP packed-conversion facility is installed"
181>;
182
183def FeatureVector : SystemZFeature<
184  "vector", "Vector", (all_of FeatureVector),
185  "Assume that the vectory facility is installed"
186>;
187def FeatureNoVector : SystemZMissingFeature<"Vector">;
188
189def Arch11NewFeatures : SystemZFeatureList<[
190    FeatureLoadAndZeroRightmostByte,
191    FeatureLoadStoreOnCond2,
192    FeatureMessageSecurityAssist5,
193    FeatureDFPPackedConversion,
194    FeatureVector
195]>;
196
197//===----------------------------------------------------------------------===//
198//
199// New features added in the Twelfth Edition of the z/Architecture
200//
201//===----------------------------------------------------------------------===//
202
203def FeatureMiscellaneousExtensions2 : SystemZFeature<
204  "miscellaneous-extensions-2", "MiscellaneousExtensions2", (all_of FeatureMiscellaneousExtensions2),
205  "Assume that the miscellaneous-extensions facility 2 is installed"
206>;
207
208def FeatureGuardedStorage : SystemZFeature<
209  "guarded-storage", "GuardedStorage", (all_of FeatureGuardedStorage),
210  "Assume that the guarded-storage facility is installed"
211>;
212
213def FeatureMessageSecurityAssist7 : SystemZFeature<
214  "message-security-assist-extension7", "MessageSecurityAssist7", (all_of FeatureMessageSecurityAssist7),
215  "Assume that the message-security-assist extension facility 7 is installed"
216>;
217
218def FeatureMessageSecurityAssist8 : SystemZFeature<
219  "message-security-assist-extension8", "MessageSecurityAssist8", (all_of FeatureMessageSecurityAssist8),
220  "Assume that the message-security-assist extension facility 8 is installed"
221>;
222
223def FeatureVectorEnhancements1 : SystemZFeature<
224  "vector-enhancements-1", "VectorEnhancements1", (all_of FeatureVectorEnhancements1),
225  "Assume that the vector enhancements facility 1 is installed"
226>;
227def FeatureNoVectorEnhancements1 : SystemZMissingFeature<"VectorEnhancements1">;
228
229def FeatureVectorPackedDecimal : SystemZFeature<
230  "vector-packed-decimal", "VectorPackedDecimal", (all_of FeatureVectorPackedDecimal),
231  "Assume that the vector packed decimal facility is installed"
232>;
233
234def FeatureInsertReferenceBitsMultiple : SystemZFeature<
235  "insert-reference-bits-multiple", "InsertReferenceBitsMultiple", (all_of FeatureInsertReferenceBitsMultiple),
236  "Assume that the insert-reference-bits-multiple facility is installed"
237>;
238
239def Arch12NewFeatures : SystemZFeatureList<[
240    FeatureMiscellaneousExtensions2,
241    FeatureGuardedStorage,
242    FeatureMessageSecurityAssist7,
243    FeatureMessageSecurityAssist8,
244    FeatureVectorEnhancements1,
245    FeatureVectorPackedDecimal,
246    FeatureInsertReferenceBitsMultiple
247]>;
248
249//===----------------------------------------------------------------------===//
250//
251// New features added in the Thirteenth Edition of the z/Architecture
252//
253//===----------------------------------------------------------------------===//
254
255def FeatureMiscellaneousExtensions3 : SystemZFeature<
256  "miscellaneous-extensions-3", "MiscellaneousExtensions3", (all_of FeatureMiscellaneousExtensions3),
257  "Assume that the miscellaneous-extensions facility 3 is installed"
258>;
259
260def FeatureMessageSecurityAssist9 : SystemZFeature<
261  "message-security-assist-extension9", "MessageSecurityAssist9", (all_of FeatureMessageSecurityAssist9),
262  "Assume that the message-security-assist extension facility 9 is installed"
263>;
264
265def FeatureVectorEnhancements2 : SystemZFeature<
266  "vector-enhancements-2", "VectorEnhancements2", (all_of FeatureVectorEnhancements2),
267  "Assume that the vector enhancements facility 2 is installed"
268>;
269
270def FeatureVectorPackedDecimalEnhancement : SystemZFeature<
271  "vector-packed-decimal-enhancement", "VectorPackedDecimalEnhancement", (all_of FeatureVectorPackedDecimalEnhancement),
272  "Assume that the vector packed decimal enhancement facility is installed"
273>;
274
275def FeatureEnhancedSort : SystemZFeature<
276  "enhanced-sort", "EnhancedSort", (all_of FeatureEnhancedSort),
277  "Assume that the enhanced-sort facility is installed"
278>;
279
280def FeatureDeflateConversion : SystemZFeature<
281  "deflate-conversion", "DeflateConversion", (all_of FeatureDeflateConversion),
282  "Assume that the deflate-conversion facility is installed"
283>;
284
285def Arch13NewFeatures : SystemZFeatureList<[
286    FeatureMiscellaneousExtensions3,
287    FeatureMessageSecurityAssist9,
288    FeatureVectorEnhancements2,
289    FeatureVectorPackedDecimalEnhancement,
290    FeatureEnhancedSort,
291    FeatureDeflateConversion
292]>;
293
294//===----------------------------------------------------------------------===//
295//
296// New features added in the Fourteenth Edition of the z/Architecture
297//
298//===----------------------------------------------------------------------===//
299
300def FeatureVectorPackedDecimalEnhancement2 : SystemZFeature<
301  "vector-packed-decimal-enhancement-2", "VectorPackedDecimalEnhancement2", (all_of FeatureVectorPackedDecimalEnhancement2),
302  "Assume that the vector packed decimal enhancement facility 2 is installed"
303>;
304
305def FeatureNNPAssist : SystemZFeature<
306  "nnp-assist", "NNPAssist", (all_of FeatureNNPAssist),
307  "Assume that the NNP-assist facility is installed"
308>;
309
310def FeatureBEAREnhancement : SystemZFeature<
311  "bear-enhancement", "BEAREnhancement", (all_of FeatureBEAREnhancement),
312  "Assume that the BEAR-enhancement facility is installed"
313>;
314
315def FeatureResetDATProtection : SystemZFeature<
316  "reset-dat-protection", "ResetDATProtection", (all_of FeatureResetDATProtection),
317  "Assume that the reset-DAT-protection facility is installed"
318>;
319
320def FeatureProcessorActivityInstrumentation : SystemZFeature<
321  "processor-activity-instrumentation", "ProcessorActivityInstrumentation", (all_of FeatureProcessorActivityInstrumentation),
322  "Assume that the processor-activity-instrumentation facility is installed"
323>;
324
325def Arch14NewFeatures : SystemZFeatureList<[
326    FeatureVectorPackedDecimalEnhancement2,
327    FeatureNNPAssist,
328    FeatureBEAREnhancement,
329    FeatureResetDATProtection,
330    FeatureProcessorActivityInstrumentation
331]>;
332
333//===----------------------------------------------------------------------===//
334//
335// Cumulative supported and unsupported feature sets
336//
337//===----------------------------------------------------------------------===//
338
339def Arch8SupportedFeatures
340  : SystemZFeatureList<[]>;
341def Arch9SupportedFeatures
342  : SystemZFeatureAdd<Arch8SupportedFeatures.List,  Arch9NewFeatures.List>;
343def Arch10SupportedFeatures
344  : SystemZFeatureAdd<Arch9SupportedFeatures.List,  Arch10NewFeatures.List>;
345def Arch11SupportedFeatures
346  : SystemZFeatureAdd<Arch10SupportedFeatures.List, Arch11NewFeatures.List>;
347def Arch12SupportedFeatures
348  : SystemZFeatureAdd<Arch11SupportedFeatures.List, Arch12NewFeatures.List>;
349def Arch13SupportedFeatures
350  : SystemZFeatureAdd<Arch12SupportedFeatures.List, Arch13NewFeatures.List>;
351def Arch14SupportedFeatures
352  : SystemZFeatureAdd<Arch13SupportedFeatures.List, Arch14NewFeatures.List>;
353
354def Arch14UnsupportedFeatures
355  : SystemZFeatureList<[]>;
356def Arch13UnsupportedFeatures
357  : SystemZFeatureAdd<Arch14UnsupportedFeatures.List, Arch14NewFeatures.List>;
358def Arch12UnsupportedFeatures
359  : SystemZFeatureAdd<Arch13UnsupportedFeatures.List, Arch13NewFeatures.List>;
360def Arch11UnsupportedFeatures
361  : SystemZFeatureAdd<Arch12UnsupportedFeatures.List, Arch12NewFeatures.List>;
362def Arch10UnsupportedFeatures
363  : SystemZFeatureAdd<Arch11UnsupportedFeatures.List, Arch11NewFeatures.List>;
364def Arch9UnsupportedFeatures
365  : SystemZFeatureAdd<Arch10UnsupportedFeatures.List, Arch10NewFeatures.List>;
366def Arch8UnsupportedFeatures
367  : SystemZFeatureAdd<Arch9UnsupportedFeatures.List,  Arch9NewFeatures.List>;
368
369