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 HasTransactionalExecution;
46 bool HasProcessorAssist;
51 SystemZInstrInfo InstrInfo;
52 SystemZTargetLowering TLInfo;
53 SystemZSelectionDAGInfo TSInfo;
54 SystemZFrameLowering FrameLowering;
56 SystemZSubtarget &initializeSubtargetDependencies(StringRef CPU,
59 SystemZSubtarget(const std::string &TT, const std::string &CPU,
60 const std::string &FS, const TargetMachine &TM);
62 const TargetFrameLowering *getFrameLowering() const override {
63 return &FrameLowering;
65 const SystemZInstrInfo *getInstrInfo() const override { return &InstrInfo; }
66 const SystemZRegisterInfo *getRegisterInfo() const override {
67 return &InstrInfo.getRegisterInfo();
69 const SystemZTargetLowering *getTargetLowering() const override {
72 const TargetSelectionDAGInfo *getSelectionDAGInfo() const override {
76 // This is important for reducing register pressure in vector code.
77 bool useAA() const override { return true; }
79 // Automatically generated by tblgen.
80 void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
82 // Return true if the target has the distinct-operands facility.
83 bool hasDistinctOps() const { return HasDistinctOps; }
85 // Return true if the target has the load/store-on-condition facility.
86 bool hasLoadStoreOnCond() const { return HasLoadStoreOnCond; }
88 // Return true if the target has the high-word facility.
89 bool hasHighWord() const { return HasHighWord; }
91 // Return true if the target has the floating-point extension facility.
92 bool hasFPExtension() const { return HasFPExtension; }
94 // Return true if the target has the population-count facility.
95 bool hasPopulationCount() const { return HasPopulationCount; }
97 // Return true if the target has the fast-serialization facility.
98 bool hasFastSerialization() const { return HasFastSerialization; }
100 // Return true if the target has interlocked-access facility 1.
101 bool hasInterlockedAccess1() const { return HasInterlockedAccess1; }
103 // Return true if the target has the miscellaneous-extensions facility.
104 bool hasMiscellaneousExtensions() const {
105 return HasMiscellaneousExtensions;
108 // Return true if the target has the transactional-execution facility.
109 bool hasTransactionalExecution() const { return HasTransactionalExecution; }
111 // Return true if the target has the processor-assist facility.
112 bool hasProcessorAssist() const { return HasProcessorAssist; }
114 // Return true if the target has the vector facility.
115 bool hasVector() const { return HasVector; }
117 // Return true if GV can be accessed using LARL for reloc model RM
118 // and code model CM.
119 bool isPC32DBLSymbol(const GlobalValue *GV, Reloc::Model RM,
120 CodeModel::Model CM) const;
122 bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
124 } // end namespace llvm