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/IR/DataLayout.h"
23 #include "llvm/ADT/Triple.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 HasMessageSecurityAssist4;
43 bool HasFastSerialization;
44 bool HasInterlockedAccess1;
45 bool HasMiscellaneousExtensions;
46 bool HasExecutionHint;
48 bool HasTransactionalExecution;
49 bool HasProcessorAssist;
50 bool HasDFPZonedConversion;
52 bool HasLoadStoreOnCond2;
53 bool HasLoadAndZeroRightmostByte;
54 bool HasMessageSecurityAssist5;
55 bool HasDFPPackedConversion;
59 SystemZInstrInfo InstrInfo;
60 SystemZTargetLowering TLInfo;
61 SystemZSelectionDAGInfo TSInfo;
62 SystemZFrameLowering FrameLowering;
64 SystemZSubtarget &initializeSubtargetDependencies(StringRef CPU,
67 SystemZSubtarget(const Triple &TT, const std::string &CPU,
68 const std::string &FS, const TargetMachine &TM);
70 const TargetFrameLowering *getFrameLowering() const override {
71 return &FrameLowering;
73 const SystemZInstrInfo *getInstrInfo() const override { return &InstrInfo; }
74 const SystemZRegisterInfo *getRegisterInfo() const override {
75 return &InstrInfo.getRegisterInfo();
77 const SystemZTargetLowering *getTargetLowering() const override {
80 const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {
84 // This is important for reducing register pressure in vector code.
85 bool useAA() const override { return true; }
87 // Always enable the early if-conversion pass.
88 bool enableEarlyIfConversion() const override { return true; }
90 // Automatically generated by tblgen.
91 void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
93 // Return true if the target has the distinct-operands facility.
94 bool hasDistinctOps() const { return HasDistinctOps; }
96 // Return true if the target has the load/store-on-condition facility.
97 bool hasLoadStoreOnCond() const { return HasLoadStoreOnCond; }
99 // Return true if the target has the load/store-on-condition facility 2.
100 bool hasLoadStoreOnCond2() const { return HasLoadStoreOnCond2; }
102 // Return true if the target has the high-word facility.
103 bool hasHighWord() const { return HasHighWord; }
105 // Return true if the target has the floating-point extension facility.
106 bool hasFPExtension() const { return HasFPExtension; }
108 // Return true if the target has the population-count facility.
109 bool hasPopulationCount() const { return HasPopulationCount; }
111 // Return true if the target has the message-security-assist
112 // extension facility 4.
113 bool hasMessageSecurityAssist4() const { return HasMessageSecurityAssist4; }
115 // Return true if the target has the fast-serialization facility.
116 bool hasFastSerialization() const { return HasFastSerialization; }
118 // Return true if the target has interlocked-access facility 1.
119 bool hasInterlockedAccess1() const { return HasInterlockedAccess1; }
121 // Return true if the target has the miscellaneous-extensions facility.
122 bool hasMiscellaneousExtensions() const {
123 return HasMiscellaneousExtensions;
126 // Return true if the target has the execution-hint facility.
127 bool hasExecutionHint() const { return HasExecutionHint; }
129 // Return true if the target has the load-and-trap facility.
130 bool hasLoadAndTrap() const { return HasLoadAndTrap; }
132 // Return true if the target has the transactional-execution facility.
133 bool hasTransactionalExecution() const { return HasTransactionalExecution; }
135 // Return true if the target has the processor-assist facility.
136 bool hasProcessorAssist() const { return HasProcessorAssist; }
138 // Return true if the target has the DFP zoned-conversion facility.
139 bool hasDFPZonedConversion() const { return HasDFPZonedConversion; }
141 // Return true if the target has the load-and-zero-rightmost-byte facility.
142 bool hasLoadAndZeroRightmostByte() const {
143 return HasLoadAndZeroRightmostByte;
146 // Return true if the target has the message-security-assist
147 // extension facility 5.
148 bool hasMessageSecurityAssist5() const { return HasMessageSecurityAssist5; }
150 // Return true if the target has the DFP packed-conversion facility.
151 bool hasDFPPackedConversion() const { return HasDFPPackedConversion; }
153 // Return true if the target has the vector facility.
154 bool hasVector() const { return HasVector; }
156 // Return true if GV can be accessed using LARL for reloc model RM
157 // and code model CM.
158 bool isPC32DBLSymbol(const GlobalValue *GV, CodeModel::Model CM) const;
160 bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
162 } // end namespace llvm