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>;
65
66def FeaturePopulationCount : SystemZFeature<
67  "population-count", "PopulationCount",
68  "Assume that the population-count facility is installed"
69>;
70
71def Arch9NewFeatures : SystemZFeatureList<[
72    FeatureDistinctOps,
73    FeatureFastSerialization,
74    FeatureFPExtension,
75    FeatureHighWord,
76    FeatureInterlockedAccess1,
77    FeatureLoadStoreOnCond,
78    FeaturePopulationCount
79]>;
80
81//===----------------------------------------------------------------------===//
82//
83// New features added in the Tenth Edition of the z/Architecture
84//
85//===----------------------------------------------------------------------===//
86
87def FeatureMiscellaneousExtensions : SystemZFeature<
88  "miscellaneous-extensions", "MiscellaneousExtensions",
89  "Assume that the miscellaneous-extensions facility is installed"
90>;
91
92def FeatureProcessorAssist : SystemZFeature<
93  "processor-assist", "ProcessorAssist",
94  "Assume that the processor-assist facility is installed"
95>;
96
97def FeatureTransactionalExecution : SystemZFeature<
98  "transactional-execution", "TransactionalExecution",
99  "Assume that the transactional-execution facility is installed"
100>;
101
102def Arch10NewFeatures : SystemZFeatureList<[
103    FeatureMiscellaneousExtensions,
104    FeatureProcessorAssist,
105    FeatureTransactionalExecution
106]>;
107
108//===----------------------------------------------------------------------===//
109//
110// New features added in the Eleventh Edition of the z/Architecture
111//
112//===----------------------------------------------------------------------===//
113
114def FeatureLoadAndZeroRightmostByte : SystemZFeature<
115  "load-and-zero-rightmost-byte", "LoadAndZeroRightmostByte",
116  "Assume that the load-and-zero-rightmost-byte facility is installed"
117>;
118
119def FeatureLoadStoreOnCond2 : SystemZFeature<
120  "load-store-on-cond-2", "LoadStoreOnCond2",
121  "Assume that the load/store-on-condition facility 2 is installed"
122>;
123
124def FeatureVector : SystemZFeature<
125  "vector", "Vector",
126  "Assume that the vectory facility is installed"
127>;
128def FeatureNoVector : SystemZMissingFeature<"Vector">;
129
130def Arch11NewFeatures : SystemZFeatureList<[
131    FeatureLoadAndZeroRightmostByte,
132    FeatureLoadStoreOnCond2,
133    FeatureVector
134]>;
135
136//===----------------------------------------------------------------------===//
137//
138// Cumulative supported and unsupported feature sets
139//
140//===----------------------------------------------------------------------===//
141
142def Arch8SupportedFeatures
143  : SystemZFeatureList<[]>;
144def Arch9SupportedFeatures
145  : SystemZFeatureAdd<Arch8SupportedFeatures.List,  Arch9NewFeatures.List>;
146def Arch10SupportedFeatures
147  : SystemZFeatureAdd<Arch9SupportedFeatures.List,  Arch10NewFeatures.List>;
148def Arch11SupportedFeatures
149  : SystemZFeatureAdd<Arch10SupportedFeatures.List, Arch11NewFeatures.List>;
150
151def Arch11UnsupportedFeatures
152  : SystemZFeatureList<[]>;
153def Arch10UnsupportedFeatures
154  : SystemZFeatureAdd<Arch11UnsupportedFeatures.List, Arch11NewFeatures.List>;
155def Arch9UnsupportedFeatures
156  : SystemZFeatureAdd<Arch10UnsupportedFeatures.List, Arch10NewFeatures.List>;
157def Arch8UnsupportedFeatures
158  : SystemZFeatureAdd<Arch9UnsupportedFeatures.List,  Arch9NewFeatures.List>;
159
160