xref: /aosp_15_r20/external/llvm/lib/Target/SystemZ/SystemZSubtarget.h (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker //===-- SystemZSubtarget.h - SystemZ subtarget information -----*- C++ -*--===//
2*9880d681SAndroid Build Coastguard Worker //
3*9880d681SAndroid Build Coastguard Worker //                     The LLVM Compiler Infrastructure
4*9880d681SAndroid Build Coastguard Worker //
5*9880d681SAndroid Build Coastguard Worker // This file is distributed under the University of Illinois Open Source
6*9880d681SAndroid Build Coastguard Worker // License. See LICENSE.TXT for details.
7*9880d681SAndroid Build Coastguard Worker //
8*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
9*9880d681SAndroid Build Coastguard Worker //
10*9880d681SAndroid Build Coastguard Worker // This file declares the SystemZ specific subclass of TargetSubtargetInfo.
11*9880d681SAndroid Build Coastguard Worker //
12*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
13*9880d681SAndroid Build Coastguard Worker 
14*9880d681SAndroid Build Coastguard Worker #ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZSUBTARGET_H
15*9880d681SAndroid Build Coastguard Worker #define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZSUBTARGET_H
16*9880d681SAndroid Build Coastguard Worker 
17*9880d681SAndroid Build Coastguard Worker #include "SystemZFrameLowering.h"
18*9880d681SAndroid Build Coastguard Worker #include "SystemZISelLowering.h"
19*9880d681SAndroid Build Coastguard Worker #include "SystemZInstrInfo.h"
20*9880d681SAndroid Build Coastguard Worker #include "SystemZRegisterInfo.h"
21*9880d681SAndroid Build Coastguard Worker #include "SystemZSelectionDAGInfo.h"
22*9880d681SAndroid Build Coastguard Worker #include "llvm/IR/DataLayout.h"
23*9880d681SAndroid Build Coastguard Worker #include "llvm/ADT/Triple.h"
24*9880d681SAndroid Build Coastguard Worker #include "llvm/Target/TargetSubtargetInfo.h"
25*9880d681SAndroid Build Coastguard Worker #include <string>
26*9880d681SAndroid Build Coastguard Worker 
27*9880d681SAndroid Build Coastguard Worker #define GET_SUBTARGETINFO_HEADER
28*9880d681SAndroid Build Coastguard Worker #include "SystemZGenSubtargetInfo.inc"
29*9880d681SAndroid Build Coastguard Worker 
30*9880d681SAndroid Build Coastguard Worker namespace llvm {
31*9880d681SAndroid Build Coastguard Worker class GlobalValue;
32*9880d681SAndroid Build Coastguard Worker class StringRef;
33*9880d681SAndroid Build Coastguard Worker 
34*9880d681SAndroid Build Coastguard Worker class SystemZSubtarget : public SystemZGenSubtargetInfo {
35*9880d681SAndroid Build Coastguard Worker   virtual void anchor();
36*9880d681SAndroid Build Coastguard Worker protected:
37*9880d681SAndroid Build Coastguard Worker   bool HasDistinctOps;
38*9880d681SAndroid Build Coastguard Worker   bool HasLoadStoreOnCond;
39*9880d681SAndroid Build Coastguard Worker   bool HasHighWord;
40*9880d681SAndroid Build Coastguard Worker   bool HasFPExtension;
41*9880d681SAndroid Build Coastguard Worker   bool HasPopulationCount;
42*9880d681SAndroid Build Coastguard Worker   bool HasFastSerialization;
43*9880d681SAndroid Build Coastguard Worker   bool HasInterlockedAccess1;
44*9880d681SAndroid Build Coastguard Worker   bool HasMiscellaneousExtensions;
45*9880d681SAndroid Build Coastguard Worker   bool HasTransactionalExecution;
46*9880d681SAndroid Build Coastguard Worker   bool HasProcessorAssist;
47*9880d681SAndroid Build Coastguard Worker   bool HasVector;
48*9880d681SAndroid Build Coastguard Worker   bool HasLoadStoreOnCond2;
49*9880d681SAndroid Build Coastguard Worker 
50*9880d681SAndroid Build Coastguard Worker private:
51*9880d681SAndroid Build Coastguard Worker   Triple TargetTriple;
52*9880d681SAndroid Build Coastguard Worker   SystemZInstrInfo InstrInfo;
53*9880d681SAndroid Build Coastguard Worker   SystemZTargetLowering TLInfo;
54*9880d681SAndroid Build Coastguard Worker   SystemZSelectionDAGInfo TSInfo;
55*9880d681SAndroid Build Coastguard Worker   SystemZFrameLowering FrameLowering;
56*9880d681SAndroid Build Coastguard Worker 
57*9880d681SAndroid Build Coastguard Worker   SystemZSubtarget &initializeSubtargetDependencies(StringRef CPU,
58*9880d681SAndroid Build Coastguard Worker                                                     StringRef FS);
59*9880d681SAndroid Build Coastguard Worker public:
60*9880d681SAndroid Build Coastguard Worker   SystemZSubtarget(const Triple &TT, const std::string &CPU,
61*9880d681SAndroid Build Coastguard Worker                    const std::string &FS, const TargetMachine &TM);
62*9880d681SAndroid Build Coastguard Worker 
getFrameLowering()63*9880d681SAndroid Build Coastguard Worker   const TargetFrameLowering *getFrameLowering() const override {
64*9880d681SAndroid Build Coastguard Worker     return &FrameLowering;
65*9880d681SAndroid Build Coastguard Worker   }
getInstrInfo()66*9880d681SAndroid Build Coastguard Worker   const SystemZInstrInfo *getInstrInfo() const override { return &InstrInfo; }
getRegisterInfo()67*9880d681SAndroid Build Coastguard Worker   const SystemZRegisterInfo *getRegisterInfo() const override {
68*9880d681SAndroid Build Coastguard Worker     return &InstrInfo.getRegisterInfo();
69*9880d681SAndroid Build Coastguard Worker   }
getTargetLowering()70*9880d681SAndroid Build Coastguard Worker   const SystemZTargetLowering *getTargetLowering() const override {
71*9880d681SAndroid Build Coastguard Worker     return &TLInfo;
72*9880d681SAndroid Build Coastguard Worker   }
getSelectionDAGInfo()73*9880d681SAndroid Build Coastguard Worker   const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {
74*9880d681SAndroid Build Coastguard Worker     return &TSInfo;
75*9880d681SAndroid Build Coastguard Worker   }
76*9880d681SAndroid Build Coastguard Worker 
77*9880d681SAndroid Build Coastguard Worker   // This is important for reducing register pressure in vector code.
useAA()78*9880d681SAndroid Build Coastguard Worker   bool useAA() const override { return true; }
79*9880d681SAndroid Build Coastguard Worker 
80*9880d681SAndroid Build Coastguard Worker   // Automatically generated by tblgen.
81*9880d681SAndroid Build Coastguard Worker   void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
82*9880d681SAndroid Build Coastguard Worker 
83*9880d681SAndroid Build Coastguard Worker   // Return true if the target has the distinct-operands facility.
hasDistinctOps()84*9880d681SAndroid Build Coastguard Worker   bool hasDistinctOps() const { return HasDistinctOps; }
85*9880d681SAndroid Build Coastguard Worker 
86*9880d681SAndroid Build Coastguard Worker   // Return true if the target has the load/store-on-condition facility.
hasLoadStoreOnCond()87*9880d681SAndroid Build Coastguard Worker   bool hasLoadStoreOnCond() const { return HasLoadStoreOnCond; }
88*9880d681SAndroid Build Coastguard Worker 
89*9880d681SAndroid Build Coastguard Worker   // Return true if the target has the load/store-on-condition facility 2.
hasLoadStoreOnCond2()90*9880d681SAndroid Build Coastguard Worker   bool hasLoadStoreOnCond2() const { return HasLoadStoreOnCond2; }
91*9880d681SAndroid Build Coastguard Worker 
92*9880d681SAndroid Build Coastguard Worker   // Return true if the target has the high-word facility.
hasHighWord()93*9880d681SAndroid Build Coastguard Worker   bool hasHighWord() const { return HasHighWord; }
94*9880d681SAndroid Build Coastguard Worker 
95*9880d681SAndroid Build Coastguard Worker   // Return true if the target has the floating-point extension facility.
hasFPExtension()96*9880d681SAndroid Build Coastguard Worker   bool hasFPExtension() const { return HasFPExtension; }
97*9880d681SAndroid Build Coastguard Worker 
98*9880d681SAndroid Build Coastguard Worker   // Return true if the target has the population-count facility.
hasPopulationCount()99*9880d681SAndroid Build Coastguard Worker   bool hasPopulationCount() const { return HasPopulationCount; }
100*9880d681SAndroid Build Coastguard Worker 
101*9880d681SAndroid Build Coastguard Worker   // Return true if the target has the fast-serialization facility.
hasFastSerialization()102*9880d681SAndroid Build Coastguard Worker   bool hasFastSerialization() const { return HasFastSerialization; }
103*9880d681SAndroid Build Coastguard Worker 
104*9880d681SAndroid Build Coastguard Worker   // Return true if the target has interlocked-access facility 1.
hasInterlockedAccess1()105*9880d681SAndroid Build Coastguard Worker   bool hasInterlockedAccess1() const { return HasInterlockedAccess1; }
106*9880d681SAndroid Build Coastguard Worker 
107*9880d681SAndroid Build Coastguard Worker   // Return true if the target has the miscellaneous-extensions facility.
hasMiscellaneousExtensions()108*9880d681SAndroid Build Coastguard Worker   bool hasMiscellaneousExtensions() const {
109*9880d681SAndroid Build Coastguard Worker     return HasMiscellaneousExtensions;
110*9880d681SAndroid Build Coastguard Worker   }
111*9880d681SAndroid Build Coastguard Worker 
112*9880d681SAndroid Build Coastguard Worker   // Return true if the target has the transactional-execution facility.
hasTransactionalExecution()113*9880d681SAndroid Build Coastguard Worker   bool hasTransactionalExecution() const { return HasTransactionalExecution; }
114*9880d681SAndroid Build Coastguard Worker 
115*9880d681SAndroid Build Coastguard Worker   // Return true if the target has the processor-assist facility.
hasProcessorAssist()116*9880d681SAndroid Build Coastguard Worker   bool hasProcessorAssist() const { return HasProcessorAssist; }
117*9880d681SAndroid Build Coastguard Worker 
118*9880d681SAndroid Build Coastguard Worker   // Return true if the target has the vector facility.
hasVector()119*9880d681SAndroid Build Coastguard Worker   bool hasVector() const { return HasVector; }
120*9880d681SAndroid Build Coastguard Worker 
121*9880d681SAndroid Build Coastguard Worker   // Return true if GV can be accessed using LARL for reloc model RM
122*9880d681SAndroid Build Coastguard Worker   // and code model CM.
123*9880d681SAndroid Build Coastguard Worker   bool isPC32DBLSymbol(const GlobalValue *GV, CodeModel::Model CM) const;
124*9880d681SAndroid Build Coastguard Worker 
isTargetELF()125*9880d681SAndroid Build Coastguard Worker   bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
126*9880d681SAndroid Build Coastguard Worker };
127*9880d681SAndroid Build Coastguard Worker } // end namespace llvm
128*9880d681SAndroid Build Coastguard Worker 
129*9880d681SAndroid Build Coastguard Worker #endif
130