Jia Liu | b22310f | 2012-02-18 12:03:15 +0000 | [diff] [blame] | 1 | //===-- PPCSubtarget.h - Define Subtarget for the PPC ----------*- C++ -*--===// |
Nate Begeman | 3bcfcd9 | 2005-08-04 07:12:09 +0000 | [diff] [blame] | 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | f3ebc3f | 2007-12-29 20:36:04 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Nate Begeman | 3bcfcd9 | 2005-08-04 07:12:09 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
Evan Cheng | 0d639a2 | 2011-07-01 21:01:15 +0000 | [diff] [blame] | 10 | // This file declares the PowerPC specific subclass of TargetSubtargetInfo. |
Nate Begeman | 3bcfcd9 | 2005-08-04 07:12:09 +0000 | [diff] [blame] | 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 14 | #ifndef LLVM_LIB_TARGET_POWERPC_PPCSUBTARGET_H |
| 15 | #define LLVM_LIB_TARGET_POWERPC_PPCSUBTARGET_H |
Nate Begeman | 3bcfcd9 | 2005-08-04 07:12:09 +0000 | [diff] [blame] | 16 | |
Eric Christopher | d104c31 | 2014-06-12 20:54:11 +0000 | [diff] [blame] | 17 | #include "PPCFrameLowering.h" |
Eric Christopher | f8c031f | 2014-06-12 22:50:10 +0000 | [diff] [blame] | 18 | #include "PPCISelLowering.h" |
Chandler Carruth | d990388 | 2015-01-14 11:23:27 +0000 | [diff] [blame] | 19 | #include "PPCInstrInfo.h" |
Eric Christopher | 02ae690 | 2014-06-12 23:02:32 +0000 | [diff] [blame] | 20 | #include "PPCSelectionDAGInfo.h" |
Evan Cheng | 8264e27 | 2011-06-29 01:14:12 +0000 | [diff] [blame] | 21 | #include "llvm/ADT/Triple.h" |
Eric Christopher | 49628bc | 2014-06-12 21:08:06 +0000 | [diff] [blame] | 22 | #include "llvm/IR/DataLayout.h" |
Chandler Carruth | 802d755 | 2012-12-04 07:12:27 +0000 | [diff] [blame] | 23 | #include "llvm/MC/MCInstrItineraries.h" |
| 24 | #include "llvm/Target/TargetSubtargetInfo.h" |
Jim Laskey | 19058c3 | 2005-09-01 21:38:21 +0000 | [diff] [blame] | 25 | #include <string> |
| 26 | |
Evan Cheng | 54b68e3 | 2011-07-01 20:45:01 +0000 | [diff] [blame] | 27 | #define GET_SUBTARGETINFO_HEADER |
Evan Cheng | c9c090d | 2011-07-01 22:36:09 +0000 | [diff] [blame] | 28 | #include "PPCGenSubtargetInfo.inc" |
Evan Cheng | 54b68e3 | 2011-07-01 20:45:01 +0000 | [diff] [blame] | 29 | |
Nick Lewycky | 28c5b86 | 2007-01-19 04:36:02 +0000 | [diff] [blame] | 30 | // GCC #defines PPC on Linux but we use it as our namespace name |
| 31 | #undef PPC |
| 32 | |
Nate Begeman | 3bcfcd9 | 2005-08-04 07:12:09 +0000 | [diff] [blame] | 33 | namespace llvm { |
Evan Cheng | 1a72add6 | 2011-07-07 07:07:08 +0000 | [diff] [blame] | 34 | class StringRef; |
Jim Laskey | 59e7a77 | 2006-12-12 20:57:08 +0000 | [diff] [blame] | 35 | |
| 36 | namespace PPC { |
| 37 | // -m directive values. |
| 38 | enum { |
Dale Johannesen | 6ca3ccf | 2008-02-14 23:35:16 +0000 | [diff] [blame] | 39 | DIR_NONE, |
Jim Laskey | 59e7a77 | 2006-12-12 20:57:08 +0000 | [diff] [blame] | 40 | DIR_32, |
NAKAMURA Takumi | 70b25de | 2012-10-29 15:51:35 +0000 | [diff] [blame] | 41 | DIR_440, |
| 42 | DIR_601, |
| 43 | DIR_602, |
| 44 | DIR_603, |
Jim Laskey | 59e7a77 | 2006-12-12 20:57:08 +0000 | [diff] [blame] | 45 | DIR_7400, |
NAKAMURA Takumi | 70b25de | 2012-10-29 15:51:35 +0000 | [diff] [blame] | 46 | DIR_750, |
| 47 | DIR_970, |
Hal Finkel | 9f9f892 | 2012-04-01 19:22:40 +0000 | [diff] [blame] | 48 | DIR_A2, |
Hal Finkel | 742b535 | 2012-08-28 16:12:39 +0000 | [diff] [blame] | 49 | DIR_E500mc, |
| 50 | DIR_E5500, |
Bill Schmidt | 52742c2 | 2013-02-01 22:59:51 +0000 | [diff] [blame] | 51 | DIR_PWR3, |
| 52 | DIR_PWR4, |
| 53 | DIR_PWR5, |
| 54 | DIR_PWR5X, |
Hal Finkel | f2b9c38 | 2012-06-11 15:43:08 +0000 | [diff] [blame] | 55 | DIR_PWR6, |
Bill Schmidt | 52742c2 | 2013-02-01 22:59:51 +0000 | [diff] [blame] | 56 | DIR_PWR6X, |
Hal Finkel | f2b9c38 | 2012-06-11 15:43:08 +0000 | [diff] [blame] | 57 | DIR_PWR7, |
Will Schmidt | 970ff64 | 2014-06-26 13:36:19 +0000 | [diff] [blame] | 58 | DIR_PWR8, |
NAKAMURA Takumi | 70b25de | 2012-10-29 15:51:35 +0000 | [diff] [blame] | 59 | DIR_64 |
Jim Laskey | 59e7a77 | 2006-12-12 20:57:08 +0000 | [diff] [blame] | 60 | }; |
| 61 | } |
| 62 | |
Chris Lattner | f4646a7 | 2006-12-11 23:22:45 +0000 | [diff] [blame] | 63 | class GlobalValue; |
| 64 | class TargetMachine; |
NAKAMURA Takumi | 70b25de | 2012-10-29 15:51:35 +0000 | [diff] [blame] | 65 | |
Evan Cheng | 54b68e3 | 2011-07-01 20:45:01 +0000 | [diff] [blame] | 66 | class PPCSubtarget : public PPCGenSubtargetInfo { |
Nate Begeman | 3bcfcd9 | 2005-08-04 07:12:09 +0000 | [diff] [blame] | 67 | protected: |
Eric Christopher | 3770cf5 | 2014-08-09 04:38:56 +0000 | [diff] [blame] | 68 | /// TargetTriple - What processor and OS we're targeting. |
| 69 | Triple TargetTriple; |
| 70 | |
Nate Begeman | 3bcfcd9 | 2005-08-04 07:12:09 +0000 | [diff] [blame] | 71 | /// stackAlignment - The minimum alignment known to hold of the stack frame on |
| 72 | /// entry to the function and which must be maintained by every function. |
Chris Lattner | 983a415 | 2005-08-05 22:05:03 +0000 | [diff] [blame] | 73 | unsigned StackAlignment; |
NAKAMURA Takumi | 70b25de | 2012-10-29 15:51:35 +0000 | [diff] [blame] | 74 | |
Jim Laskey | 802748c | 2005-11-01 20:06:59 +0000 | [diff] [blame] | 75 | /// Selected instruction itineraries (one entry per itinerary class.) |
| 76 | InstrItineraryData InstrItins; |
NAKAMURA Takumi | 70b25de | 2012-10-29 15:51:35 +0000 | [diff] [blame] | 77 | |
Jim Laskey | 59e7a77 | 2006-12-12 20:57:08 +0000 | [diff] [blame] | 78 | /// Which cpu directive was used. |
| 79 | unsigned DarwinDirective; |
Nate Begeman | 3bcfcd9 | 2005-08-04 07:12:09 +0000 | [diff] [blame] | 80 | |
| 81 | /// Used by the ISel to turn in optimizations for POWER4-derived architectures |
Hal Finkel | bfd3d08 | 2012-06-11 19:57:01 +0000 | [diff] [blame] | 82 | bool HasMFOCRF; |
Chris Lattner | a35f306 | 2006-06-16 17:34:12 +0000 | [diff] [blame] | 83 | bool Has64BitSupport; |
| 84 | bool Use64BitRegs; |
Hal Finkel | 940ab93 | 2014-02-28 00:27:01 +0000 | [diff] [blame] | 85 | bool UseCRBits; |
Chris Lattner | 16682ff | 2006-06-16 17:50:12 +0000 | [diff] [blame] | 86 | bool IsPPC64; |
Jim Laskey | a2b5235 | 2005-10-26 17:30:34 +0000 | [diff] [blame] | 87 | bool HasAltivec; |
Joerg Sonnenberger | 39f095a | 2014-08-07 12:18:21 +0000 | [diff] [blame] | 88 | bool HasSPE; |
Hal Finkel | efb305e | 2013-01-30 21:17:42 +0000 | [diff] [blame] | 89 | bool HasQPX; |
Eric Christopher | 081efcc | 2013-10-16 20:38:58 +0000 | [diff] [blame] | 90 | bool HasVSX; |
Bill Schmidt | dcce023 | 2014-10-10 17:21:15 +0000 | [diff] [blame] | 91 | bool HasP8Vector; |
Bill Schmidt | fe88b18 | 2015-02-03 21:58:23 +0000 | [diff] [blame] | 92 | bool HasP8Altivec; |
Hal Finkel | dbc78e1 | 2013-08-19 05:01:02 +0000 | [diff] [blame] | 93 | bool HasFCPSGN; |
Chris Lattner | aa3b1fc | 2005-09-02 18:33:05 +0000 | [diff] [blame] | 94 | bool HasFSQRT; |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 95 | bool HasFRE, HasFRES, HasFRSQRTE, HasFRSQRTES; |
| 96 | bool HasRecipPrec; |
Chris Lattner | b9f35f0 | 2006-02-28 07:08:22 +0000 | [diff] [blame] | 97 | bool HasSTFIWX; |
Hal Finkel | beb296b | 2013-03-31 10:12:51 +0000 | [diff] [blame] | 98 | bool HasLFIWAX; |
Hal Finkel | c20a08d | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 99 | bool HasFPRND; |
Hal Finkel | f6d45f2 | 2013-04-01 17:52:07 +0000 | [diff] [blame] | 100 | bool HasFPCVT; |
Hal Finkel | 460e94d | 2012-06-22 23:10:08 +0000 | [diff] [blame] | 101 | bool HasISEL; |
Hal Finkel | a4d0748 | 2013-03-28 13:29:47 +0000 | [diff] [blame] | 102 | bool HasPOPCNTD; |
Hal Finkel | 4edc66b | 2015-01-03 01:16:37 +0000 | [diff] [blame] | 103 | bool HasCMPB; |
Hal Finkel | 31d2956 | 2013-03-28 19:25:55 +0000 | [diff] [blame] | 104 | bool HasLDBRX; |
Hal Finkel | 6fa5697 | 2011-10-17 04:03:49 +0000 | [diff] [blame] | 105 | bool IsBookE; |
Hal Finkel | fe3368c | 2014-10-02 22:34:22 +0000 | [diff] [blame] | 106 | bool HasOnlyMSYNC; |
Joerg Sonnenberger | 0b2ebcb | 2014-08-04 15:47:38 +0000 | [diff] [blame] | 107 | bool IsE500; |
| 108 | bool IsPPC4xx; |
Joerg Sonnenberger | 7405210 | 2014-08-04 17:07:41 +0000 | [diff] [blame] | 109 | bool IsPPC6xx; |
Hal Finkel | 0096dbd | 2013-09-12 14:40:06 +0000 | [diff] [blame] | 110 | bool DeprecatedMFTB; |
| 111 | bool DeprecatedDST; |
Chris Lattner | f4646a7 | 2006-12-11 23:22:45 +0000 | [diff] [blame] | 112 | bool HasLazyResolverStubs; |
Bill Schmidt | 0a9170d | 2013-07-26 01:35:43 +0000 | [diff] [blame] | 113 | bool IsLittleEndian; |
Bill Schmidt | 082cfc0 | 2015-01-14 20:17:10 +0000 | [diff] [blame] | 114 | bool HasICBT; |
Hal Finkel | e2ab0f1 | 2015-01-15 21:17:34 +0000 | [diff] [blame] | 115 | bool HasInvariantFunctionDescriptors; |
NAKAMURA Takumi | 70b25de | 2012-10-29 15:51:35 +0000 | [diff] [blame] | 116 | |
Ulrich Weigand | 90a5de8 | 2014-07-28 13:09:28 +0000 | [diff] [blame] | 117 | enum { |
| 118 | PPC_ABI_UNKNOWN, |
| 119 | PPC_ABI_ELFv1, |
| 120 | PPC_ABI_ELFv2 |
| 121 | } TargetABI; |
| 122 | |
Eric Christopher | f55a224 | 2014-06-12 22:28:06 +0000 | [diff] [blame] | 123 | PPCFrameLowering FrameLowering; |
Eric Christopher | bd14dc5 | 2014-06-12 22:05:46 +0000 | [diff] [blame] | 124 | PPCInstrInfo InstrInfo; |
Eric Christopher | f8c031f | 2014-06-12 22:50:10 +0000 | [diff] [blame] | 125 | PPCTargetLowering TLInfo; |
Eric Christopher | 02ae690 | 2014-06-12 23:02:32 +0000 | [diff] [blame] | 126 | PPCSelectionDAGInfo TSInfo; |
Eric Christopher | e8dbfe1 | 2015-02-13 22:23:04 +0000 | [diff] [blame^] | 127 | const PPCTargetMachine &TM; |
Eric Christopher | 49628bc | 2014-06-12 21:08:06 +0000 | [diff] [blame] | 128 | |
Nate Begeman | 3bcfcd9 | 2005-08-04 07:12:09 +0000 | [diff] [blame] | 129 | public: |
| 130 | /// This constructor initializes the data members to match that |
Daniel Dunbar | 31b44e8 | 2009-08-02 22:11:08 +0000 | [diff] [blame] | 131 | /// of the specified triple. |
Nate Begeman | 3bcfcd9 | 2005-08-04 07:12:09 +0000 | [diff] [blame] | 132 | /// |
Evan Cheng | fe6e405 | 2011-06-30 01:53:36 +0000 | [diff] [blame] | 133 | PPCSubtarget(const std::string &TT, const std::string &CPU, |
Eric Christopher | f6ed33e | 2014-10-01 21:36:28 +0000 | [diff] [blame] | 134 | const std::string &FS, const PPCTargetMachine &TM); |
NAKAMURA Takumi | 70b25de | 2012-10-29 15:51:35 +0000 | [diff] [blame] | 135 | |
| 136 | /// ParseSubtargetFeatures - Parses features string setting specified |
Jim Laskey | 75eab3c | 2005-10-26 18:07:50 +0000 | [diff] [blame] | 137 | /// subtarget options. Definition of function is auto generated by tblgen. |
Evan Cheng | 1a72add6 | 2011-07-07 07:07:08 +0000 | [diff] [blame] | 138 | void ParseSubtargetFeatures(StringRef CPU, StringRef FS); |
NAKAMURA Takumi | 70b25de | 2012-10-29 15:51:35 +0000 | [diff] [blame] | 139 | |
Nate Begeman | 3bcfcd9 | 2005-08-04 07:12:09 +0000 | [diff] [blame] | 140 | /// getStackAlignment - Returns the minimum alignment known to hold of the |
| 141 | /// stack frame on entry to the function and which must be maintained by every |
| 142 | /// function for this subtarget. |
Chris Lattner | 983a415 | 2005-08-05 22:05:03 +0000 | [diff] [blame] | 143 | unsigned getStackAlignment() const { return StackAlignment; } |
NAKAMURA Takumi | 70b25de | 2012-10-29 15:51:35 +0000 | [diff] [blame] | 144 | |
Jim Laskey | 59e7a77 | 2006-12-12 20:57:08 +0000 | [diff] [blame] | 145 | /// getDarwinDirective - Returns the -m directive specified for the cpu. |
| 146 | /// |
| 147 | unsigned getDarwinDirective() const { return DarwinDirective; } |
NAKAMURA Takumi | 70b25de | 2012-10-29 15:51:35 +0000 | [diff] [blame] | 148 | |
Eric Christopher | 170ebcf | 2014-06-13 22:38:48 +0000 | [diff] [blame] | 149 | /// getInstrItins - Return the instruction itineraries based on subtarget |
Jim Laskey | 802748c | 2005-11-01 20:06:59 +0000 | [diff] [blame] | 150 | /// selection. |
Eric Christopher | d913448 | 2014-08-04 21:25:23 +0000 | [diff] [blame] | 151 | const InstrItineraryData *getInstrItineraryData() const override { |
| 152 | return &InstrItins; |
| 153 | } |
Chris Lattner | 16682ff | 2006-06-16 17:50:12 +0000 | [diff] [blame] | 154 | |
Eric Christopher | d913448 | 2014-08-04 21:25:23 +0000 | [diff] [blame] | 155 | const PPCFrameLowering *getFrameLowering() const override { |
| 156 | return &FrameLowering; |
| 157 | } |
Eric Christopher | d913448 | 2014-08-04 21:25:23 +0000 | [diff] [blame] | 158 | const PPCInstrInfo *getInstrInfo() const override { return &InstrInfo; } |
Eric Christopher | d913448 | 2014-08-04 21:25:23 +0000 | [diff] [blame] | 159 | const PPCTargetLowering *getTargetLowering() const override { |
| 160 | return &TLInfo; |
| 161 | } |
| 162 | const PPCSelectionDAGInfo *getSelectionDAGInfo() const override { |
| 163 | return &TSInfo; |
| 164 | } |
| 165 | const PPCRegisterInfo *getRegisterInfo() const override { |
| 166 | return &getInstrInfo()->getRegisterInfo(); |
| 167 | } |
Eric Christopher | e8dbfe1 | 2015-02-13 22:23:04 +0000 | [diff] [blame^] | 168 | const PPCTargetMachine &getTargetMachine() const { return TM; } |
Eric Christopher | d104c31 | 2014-06-12 20:54:11 +0000 | [diff] [blame] | 169 | |
| 170 | /// initializeSubtargetDependencies - Initializes using a CPU and feature string |
| 171 | /// so that we can use initializer lists for subtarget initialization. |
| 172 | PPCSubtarget &initializeSubtargetDependencies(StringRef CPU, StringRef FS); |
| 173 | |
Hal Finkel | a0014a5 | 2013-07-15 22:29:40 +0000 | [diff] [blame] | 174 | private: |
| 175 | void initializeEnvironment(); |
Eric Christopher | b68e253 | 2014-09-03 20:36:31 +0000 | [diff] [blame] | 176 | void initSubtargetFeatures(StringRef CPU, StringRef FS); |
Hal Finkel | a0014a5 | 2013-07-15 22:29:40 +0000 | [diff] [blame] | 177 | |
| 178 | public: |
Chris Lattner | 16682ff | 2006-06-16 17:50:12 +0000 | [diff] [blame] | 179 | /// isPPC64 - Return true if we are generating code for 64-bit pointer mode. |
| 180 | /// |
| 181 | bool isPPC64() const { return IsPPC64; } |
NAKAMURA Takumi | 70b25de | 2012-10-29 15:51:35 +0000 | [diff] [blame] | 182 | |
Chris Lattner | 16682ff | 2006-06-16 17:50:12 +0000 | [diff] [blame] | 183 | /// has64BitSupport - Return true if the selected CPU supports 64-bit |
| 184 | /// instructions, regardless of whether we are in 32-bit or 64-bit mode. |
| 185 | bool has64BitSupport() const { return Has64BitSupport; } |
NAKAMURA Takumi | 70b25de | 2012-10-29 15:51:35 +0000 | [diff] [blame] | 186 | |
Chris Lattner | 16682ff | 2006-06-16 17:50:12 +0000 | [diff] [blame] | 187 | /// use64BitRegs - Return true if in 64-bit mode or if we should use 64-bit |
| 188 | /// registers in 32-bit mode when possible. This can only true if |
| 189 | /// has64BitSupport() returns true. |
| 190 | bool use64BitRegs() const { return Use64BitRegs; } |
NAKAMURA Takumi | 70b25de | 2012-10-29 15:51:35 +0000 | [diff] [blame] | 191 | |
Hal Finkel | 940ab93 | 2014-02-28 00:27:01 +0000 | [diff] [blame] | 192 | /// useCRBits - Return true if we should store and manipulate i1 values in |
| 193 | /// the individual condition register bits. |
| 194 | bool useCRBits() const { return UseCRBits; } |
| 195 | |
Chris Lattner | f4646a7 | 2006-12-11 23:22:45 +0000 | [diff] [blame] | 196 | /// hasLazyResolverStub - Return true if accesses to the specified global have |
| 197 | /// to go through a dyld lazy resolution stub. This means that an extra load |
| 198 | /// is required to get the address of the global. |
Eric Christopher | e8dbfe1 | 2015-02-13 22:23:04 +0000 | [diff] [blame^] | 199 | bool hasLazyResolverStub(const GlobalValue *GV) const; |
NAKAMURA Takumi | 70b25de | 2012-10-29 15:51:35 +0000 | [diff] [blame] | 200 | |
Bill Schmidt | 0a9170d | 2013-07-26 01:35:43 +0000 | [diff] [blame] | 201 | // isLittleEndian - True if generating little-endian code |
| 202 | bool isLittleEndian() const { return IsLittleEndian; } |
| 203 | |
Chris Lattner | 16682ff | 2006-06-16 17:50:12 +0000 | [diff] [blame] | 204 | // Specific obvious features. |
Hal Finkel | dbc78e1 | 2013-08-19 05:01:02 +0000 | [diff] [blame] | 205 | bool hasFCPSGN() const { return HasFCPSGN; } |
Chris Lattner | aa3b1fc | 2005-09-02 18:33:05 +0000 | [diff] [blame] | 206 | bool hasFSQRT() const { return HasFSQRT; } |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 207 | bool hasFRE() const { return HasFRE; } |
| 208 | bool hasFRES() const { return HasFRES; } |
| 209 | bool hasFRSQRTE() const { return HasFRSQRTE; } |
| 210 | bool hasFRSQRTES() const { return HasFRSQRTES; } |
| 211 | bool hasRecipPrec() const { return HasRecipPrec; } |
Chris Lattner | b9f35f0 | 2006-02-28 07:08:22 +0000 | [diff] [blame] | 212 | bool hasSTFIWX() const { return HasSTFIWX; } |
Hal Finkel | beb296b | 2013-03-31 10:12:51 +0000 | [diff] [blame] | 213 | bool hasLFIWAX() const { return HasLFIWAX; } |
Hal Finkel | c20a08d | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 214 | bool hasFPRND() const { return HasFPRND; } |
Hal Finkel | f6d45f2 | 2013-04-01 17:52:07 +0000 | [diff] [blame] | 215 | bool hasFPCVT() const { return HasFPCVT; } |
Jim Laskey | a2b5235 | 2005-10-26 17:30:34 +0000 | [diff] [blame] | 216 | bool hasAltivec() const { return HasAltivec; } |
Joerg Sonnenberger | 39f095a | 2014-08-07 12:18:21 +0000 | [diff] [blame] | 217 | bool hasSPE() const { return HasSPE; } |
Hal Finkel | efb305e | 2013-01-30 21:17:42 +0000 | [diff] [blame] | 218 | bool hasQPX() const { return HasQPX; } |
Hal Finkel | 27774d9 | 2014-03-13 07:58:58 +0000 | [diff] [blame] | 219 | bool hasVSX() const { return HasVSX; } |
Bill Schmidt | dcce023 | 2014-10-10 17:21:15 +0000 | [diff] [blame] | 220 | bool hasP8Vector() const { return HasP8Vector; } |
Bill Schmidt | fe88b18 | 2015-02-03 21:58:23 +0000 | [diff] [blame] | 221 | bool hasP8Altivec() const { return HasP8Altivec; } |
Hal Finkel | bfd3d08 | 2012-06-11 19:57:01 +0000 | [diff] [blame] | 222 | bool hasMFOCRF() const { return HasMFOCRF; } |
Hal Finkel | 460e94d | 2012-06-22 23:10:08 +0000 | [diff] [blame] | 223 | bool hasISEL() const { return HasISEL; } |
Hal Finkel | a4d0748 | 2013-03-28 13:29:47 +0000 | [diff] [blame] | 224 | bool hasPOPCNTD() const { return HasPOPCNTD; } |
Hal Finkel | 4edc66b | 2015-01-03 01:16:37 +0000 | [diff] [blame] | 225 | bool hasCMPB() const { return HasCMPB; } |
Hal Finkel | 31d2956 | 2013-03-28 19:25:55 +0000 | [diff] [blame] | 226 | bool hasLDBRX() const { return HasLDBRX; } |
Hal Finkel | 6fa5697 | 2011-10-17 04:03:49 +0000 | [diff] [blame] | 227 | bool isBookE() const { return IsBookE; } |
Hal Finkel | fe3368c | 2014-10-02 22:34:22 +0000 | [diff] [blame] | 228 | bool hasOnlyMSYNC() const { return HasOnlyMSYNC; } |
Joerg Sonnenberger | 0b2ebcb | 2014-08-04 15:47:38 +0000 | [diff] [blame] | 229 | bool isPPC4xx() const { return IsPPC4xx; } |
Joerg Sonnenberger | 7405210 | 2014-08-04 17:07:41 +0000 | [diff] [blame] | 230 | bool isPPC6xx() const { return IsPPC6xx; } |
Joerg Sonnenberger | 0b2ebcb | 2014-08-04 15:47:38 +0000 | [diff] [blame] | 231 | bool isE500() const { return IsE500; } |
Hal Finkel | 0096dbd | 2013-09-12 14:40:06 +0000 | [diff] [blame] | 232 | bool isDeprecatedMFTB() const { return DeprecatedMFTB; } |
| 233 | bool isDeprecatedDST() const { return DeprecatedDST; } |
Bill Schmidt | 082cfc0 | 2015-01-14 20:17:10 +0000 | [diff] [blame] | 234 | bool hasICBT() const { return HasICBT; } |
Hal Finkel | e2ab0f1 | 2015-01-15 21:17:34 +0000 | [diff] [blame] | 235 | bool hasInvariantFunctionDescriptors() const { |
| 236 | return HasInvariantFunctionDescriptors; |
| 237 | } |
Bill Wendling | c7b2ab9 | 2007-01-16 09:29:17 +0000 | [diff] [blame] | 238 | |
Daniel Dunbar | a37aab2 | 2011-04-19 20:54:28 +0000 | [diff] [blame] | 239 | const Triple &getTargetTriple() const { return TargetTriple; } |
| 240 | |
Chris Lattner | dcbc0f3 | 2008-01-02 19:35:16 +0000 | [diff] [blame] | 241 | /// isDarwin - True if this is any darwin platform. |
Daniel Dunbar | cd01ed5 | 2011-04-20 00:14:25 +0000 | [diff] [blame] | 242 | bool isDarwin() const { return TargetTriple.isMacOSX(); } |
Hal Finkel | 7f9e8d3 | 2013-01-29 00:22:47 +0000 | [diff] [blame] | 243 | /// isBGQ - True if this is a BG/Q platform. |
| 244 | bool isBGQ() const { return TargetTriple.getVendor() == Triple::BGQ; } |
Rafael Espindola | 770b4b8 | 2008-12-19 10:55:56 +0000 | [diff] [blame] | 245 | |
Hal Finkel | 3ee2af7 | 2014-07-18 23:29:49 +0000 | [diff] [blame] | 246 | bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); } |
| 247 | bool isTargetMachO() const { return TargetTriple.isOSBinFormatMachO(); } |
| 248 | |
Tilmann Scheller | d1aaa32 | 2009-08-15 11:54:46 +0000 | [diff] [blame] | 249 | bool isDarwinABI() const { return isDarwin(); } |
| 250 | bool isSVR4ABI() const { return !isDarwin(); } |
Ulrich Weigand | 90a5de8 | 2014-07-28 13:09:28 +0000 | [diff] [blame] | 251 | bool isELFv2ABI() const { return TargetABI == PPC_ABI_ELFv2; } |
Tilmann Scheller | d1aaa32 | 2009-08-15 11:54:46 +0000 | [diff] [blame] | 252 | |
Eric Christopher | 6b0fcfe | 2014-05-21 23:40:26 +0000 | [diff] [blame] | 253 | bool enableEarlyIfConversion() const override { return hasISEL(); } |
| 254 | |
Hal Finkel | 21442b2 | 2013-09-11 23:05:25 +0000 | [diff] [blame] | 255 | // Scheduling customization. |
Craig Topper | 0d3fa92 | 2014-04-29 07:57:37 +0000 | [diff] [blame] | 256 | bool enableMachineScheduler() const override; |
Sanjay Patel | a2f658d | 2014-07-15 22:39:58 +0000 | [diff] [blame] | 257 | // This overrides the PostRAScheduler bit in the SchedModel for each CPU. |
| 258 | bool enablePostMachineScheduler() const override; |
| 259 | AntiDepBreakMode getAntiDepBreakMode() const override; |
| 260 | void getCriticalPathRCs(RegClassVector &CriticalPathRCs) const override; |
| 261 | |
Hal Finkel | 21442b2 | 2013-09-11 23:05:25 +0000 | [diff] [blame] | 262 | void overrideSchedPolicy(MachineSchedPolicy &Policy, |
| 263 | MachineInstr *begin, |
| 264 | MachineInstr *end, |
Craig Topper | 0d3fa92 | 2014-04-29 07:57:37 +0000 | [diff] [blame] | 265 | unsigned NumRegionInstrs) const override; |
| 266 | bool useAA() const override; |
Hal Finkel | 5ff00b4 | 2015-01-09 02:03:11 +0000 | [diff] [blame] | 267 | |
| 268 | bool enableSubRegLiveness() const override; |
Nate Begeman | 3bcfcd9 | 2005-08-04 07:12:09 +0000 | [diff] [blame] | 269 | }; |
| 270 | } // End llvm namespace |
| 271 | |
| 272 | #endif |