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 HasFastSerialization;
43 bool HasInterlockedAccess1;
44 bool HasMiscellaneousExtensions;
45 bool HasExecutionHint;
47 bool HasTransactionalExecution;
48 bool HasProcessorAssist;
50 bool HasLoadStoreOnCond2;
51 bool HasLoadAndZeroRightmostByte;
55 SystemZInstrInfo InstrInfo;
56 SystemZTargetLowering TLInfo;
57 SystemZSelectionDAGInfo TSInfo;
58 SystemZFrameLowering FrameLowering;
60 SystemZSubtarget &initializeSubtargetDependencies(StringRef CPU,
63 SystemZSubtarget(const Triple &TT, const std::string &CPU,
64 const std::string &FS, const TargetMachine &TM);
66 const TargetFrameLowering *getFrameLowering() const override {
67 return &FrameLowering;
69 const SystemZInstrInfo *getInstrInfo() const override { return &InstrInfo; }
70 const SystemZRegisterInfo *getRegisterInfo() const override {
71 return &InstrInfo.getRegisterInfo();
73 const SystemZTargetLowering *getTargetLowering() const override {
76 const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {
80 // This is important for reducing register pressure in vector code.
81 bool useAA() const override { return true; }
83 // Always enable the early if-conversion pass.
84 bool enableEarlyIfConversion() const override { return true; }
86 // Automatically generated by tblgen.
87 void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
89 // Return true if the target has the distinct-operands facility.
90 bool hasDistinctOps() const { return HasDistinctOps; }
92 // Return true if the target has the load/store-on-condition facility.
93 bool hasLoadStoreOnCond() const { return HasLoadStoreOnCond; }
95 // Return true if the target has the load/store-on-condition facility 2.
96 bool hasLoadStoreOnCond2() const { return HasLoadStoreOnCond2; }
98 // Return true if the target has the high-word facility.
99 bool hasHighWord() const { return HasHighWord; }
101 // Return true if the target has the floating-point extension facility.
102 bool hasFPExtension() const { return HasFPExtension; }
104 // Return true if the target has the population-count facility.
105 bool hasPopulationCount() const { return HasPopulationCount; }
107 // Return true if the target has the fast-serialization facility.
108 bool hasFastSerialization() const { return HasFastSerialization; }
110 // Return true if the target has interlocked-access facility 1.
111 bool hasInterlockedAccess1() const { return HasInterlockedAccess1; }
113 // Return true if the target has the miscellaneous-extensions facility.
114 bool hasMiscellaneousExtensions() const {
115 return HasMiscellaneousExtensions;
118 // Return true if the target has the execution-hint facility.
119 bool hasExecutionHint() const { return HasExecutionHint; }
121 // Return true if the target has the load-and-trap facility.
122 bool hasLoadAndTrap() const { return HasLoadAndTrap; }
124 // Return true if the target has the transactional-execution facility.
125 bool hasTransactionalExecution() const { return HasTransactionalExecution; }
127 // Return true if the target has the processor-assist facility.
128 bool hasProcessorAssist() const { return HasProcessorAssist; }
130 // Return true if the target has the load-and-zero-rightmost-byte facility.
131 bool hasLoadAndZeroRightmostByte() const {
132 return HasLoadAndZeroRightmostByte;
135 // Return true if the target has the vector facility.
136 bool hasVector() const { return HasVector; }
138 // Return true if GV can be accessed using LARL for reloc model RM
139 // and code model CM.
140 bool isPC32DBLSymbol(const GlobalValue *GV, CodeModel::Model CM) const;
142 bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
144 } // end namespace llvm