1 //===-- SystemZSubtarget.h - SystemZ subtarget information -----*- C++ -*--===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares the SystemZ specific subclass of TargetSubtargetInfo.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZSUBTARGET_H
15 #define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZSUBTARGET_H
17 #include "SystemZFrameLowering.h"
18 #include "SystemZISelLowering.h"
19 #include "SystemZInstrInfo.h"
20 #include "SystemZRegisterInfo.h"
21 #include "SystemZSelectionDAGInfo.h"
22 #include "llvm/ADT/Triple.h"
23 #include "llvm/IR/DataLayout.h"
24 #include "llvm/Target/TargetSubtargetInfo.h"
27 #define GET_SUBTARGETINFO_HEADER
28 #include "SystemZGenSubtargetInfo.inc"
34 class SystemZSubtarget : public SystemZGenSubtargetInfo {
35 virtual void anchor();
38 bool HasLoadStoreOnCond;
41 bool HasPopulationCount;
42 bool HasMessageSecurityAssist3;
43 bool HasMessageSecurityAssist4;
44 bool HasResetReferenceBitsMultiple;
45 bool HasFastSerialization;
46 bool HasInterlockedAccess1;
47 bool HasMiscellaneousExtensions;
48 bool HasExecutionHint;
50 bool HasTransactionalExecution;
51 bool HasProcessorAssist;
52 bool HasDFPZonedConversion;
55 bool HasLoadStoreOnCond2;
56 bool HasLoadAndZeroRightmostByte;
57 bool HasMessageSecurityAssist5;
58 bool HasDFPPackedConversion;
59 bool HasMiscellaneousExtensions2;
60 bool HasGuardedStorage;
61 bool HasMessageSecurityAssist7;
62 bool HasMessageSecurityAssist8;
63 bool HasVectorEnhancements1;
64 bool HasVectorPackedDecimal;
65 bool HasInsertReferenceBitsMultiple;
69 SystemZInstrInfo InstrInfo;
70 SystemZTargetLowering TLInfo;
71 SystemZSelectionDAGInfo TSInfo;
72 SystemZFrameLowering FrameLowering;
74 SystemZSubtarget &initializeSubtargetDependencies(StringRef CPU,
77 SystemZSubtarget(const Triple &TT, const std::string &CPU,
78 const std::string &FS, const TargetMachine &TM);
80 const TargetFrameLowering *getFrameLowering() const override {
81 return &FrameLowering;
83 const SystemZInstrInfo *getInstrInfo() const override { return &InstrInfo; }
84 const SystemZRegisterInfo *getRegisterInfo() const override {
85 return &InstrInfo.getRegisterInfo();
87 const SystemZTargetLowering *getTargetLowering() const override {
90 const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {
94 // This is important for reducing register pressure in vector code.
95 bool useAA() const override { return true; }
97 // Always enable the early if-conversion pass.
98 bool enableEarlyIfConversion() const override { return true; }
100 // Automatically generated by tblgen.
101 void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
103 // Return true if the target has the distinct-operands facility.
104 bool hasDistinctOps() const { return HasDistinctOps; }
106 // Return true if the target has the load/store-on-condition facility.
107 bool hasLoadStoreOnCond() const { return HasLoadStoreOnCond; }
109 // Return true if the target has the load/store-on-condition facility 2.
110 bool hasLoadStoreOnCond2() const { return HasLoadStoreOnCond2; }
112 // Return true if the target has the high-word facility.
113 bool hasHighWord() const { return HasHighWord; }
115 // Return true if the target has the floating-point extension facility.
116 bool hasFPExtension() const { return HasFPExtension; }
118 // Return true if the target has the population-count facility.
119 bool hasPopulationCount() const { return HasPopulationCount; }
121 // Return true if the target has the message-security-assist
122 // extension facility 3.
123 bool hasMessageSecurityAssist3() const { return HasMessageSecurityAssist3; }
125 // Return true if the target has the message-security-assist
126 // extension facility 4.
127 bool hasMessageSecurityAssist4() const { return HasMessageSecurityAssist4; }
129 // Return true if the target has the reset-reference-bits-multiple facility.
130 bool hasResetReferenceBitsMultiple() const {
131 return HasResetReferenceBitsMultiple;
134 // Return true if the target has the fast-serialization facility.
135 bool hasFastSerialization() const { return HasFastSerialization; }
137 // Return true if the target has interlocked-access facility 1.
138 bool hasInterlockedAccess1() const { return HasInterlockedAccess1; }
140 // Return true if the target has the miscellaneous-extensions facility.
141 bool hasMiscellaneousExtensions() const {
142 return HasMiscellaneousExtensions;
145 // Return true if the target has the execution-hint facility.
146 bool hasExecutionHint() const { return HasExecutionHint; }
148 // Return true if the target has the load-and-trap facility.
149 bool hasLoadAndTrap() const { return HasLoadAndTrap; }
151 // Return true if the target has the transactional-execution facility.
152 bool hasTransactionalExecution() const { return HasTransactionalExecution; }
154 // Return true if the target has the processor-assist facility.
155 bool hasProcessorAssist() const { return HasProcessorAssist; }
157 // Return true if the target has the DFP zoned-conversion facility.
158 bool hasDFPZonedConversion() const { return HasDFPZonedConversion; }
160 // Return true if the target has the enhanced-DAT facility 2.
161 bool hasEnhancedDAT2() const { return HasEnhancedDAT2; }
163 // Return true if the target has the load-and-zero-rightmost-byte facility.
164 bool hasLoadAndZeroRightmostByte() const {
165 return HasLoadAndZeroRightmostByte;
168 // Return true if the target has the message-security-assist
169 // extension facility 5.
170 bool hasMessageSecurityAssist5() const { return HasMessageSecurityAssist5; }
172 // Return true if the target has the DFP packed-conversion facility.
173 bool hasDFPPackedConversion() const { return HasDFPPackedConversion; }
175 // Return true if the target has the vector facility.
176 bool hasVector() const { return HasVector; }
178 // Return true if the target has the miscellaneous-extensions facility 2.
179 bool hasMiscellaneousExtensions2() const {
180 return HasMiscellaneousExtensions2;
183 // Return true if the target has the guarded-storage facility.
184 bool hasGuardedStorage() const { return HasGuardedStorage; }
186 // Return true if the target has the message-security-assist
187 // extension facility 7.
188 bool hasMessageSecurityAssist7() const { return HasMessageSecurityAssist7; }
190 // Return true if the target has the message-security-assist
191 // extension facility 8.
192 bool hasMessageSecurityAssist8() const { return HasMessageSecurityAssist8; }
194 // Return true if the target has the vector-enhancements facility 1.
195 bool hasVectorEnhancements1() const { return HasVectorEnhancements1; }
197 // Return true if the target has the vector-packed-decimal facility.
198 bool hasVectorPackedDecimal() const { return HasVectorPackedDecimal; }
200 // Return true if the target has the insert-reference-bits-multiple facility.
201 bool hasInsertReferenceBitsMultiple() const {
202 return HasInsertReferenceBitsMultiple;
205 // Return true if GV can be accessed using LARL for reloc model RM
206 // and code model CM.
207 bool isPC32DBLSymbol(const GlobalValue *GV, CodeModel::Model CM) const;
209 bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
211 } // end namespace llvm