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