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