diff options
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCSubtarget.h')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCSubtarget.h | 95 |
1 files changed, 55 insertions, 40 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCSubtarget.h b/llvm/lib/Target/PowerPC/PPCSubtarget.h index 044e982740e91..ec329022c4572 100644 --- a/llvm/lib/Target/PowerPC/PPCSubtarget.h +++ b/llvm/lib/Target/PowerPC/PPCSubtarget.h @@ -34,36 +34,36 @@ class StringRef; namespace PPC { // -m directive values. - enum { - DIR_NONE, - DIR_32, - DIR_440, - DIR_601, - DIR_602, - DIR_603, - DIR_7400, - DIR_750, - DIR_970, - DIR_A2, - DIR_E500, - DIR_E500mc, - DIR_E5500, - DIR_PWR3, - DIR_PWR4, - DIR_PWR5, - DIR_PWR5X, - DIR_PWR6, - DIR_PWR6X, - DIR_PWR7, - DIR_PWR8, - DIR_PWR9, - DIR_PWR_FUTURE, - DIR_64 - }; +enum { + DIR_NONE, + DIR_32, + DIR_440, + DIR_601, + DIR_602, + DIR_603, + DIR_7400, + DIR_750, + DIR_970, + DIR_A2, + DIR_E500, + DIR_E500mc, + DIR_E5500, + DIR_PWR3, + DIR_PWR4, + DIR_PWR5, + DIR_PWR5X, + DIR_PWR6, + DIR_PWR6X, + DIR_PWR7, + DIR_PWR8, + DIR_PWR9, + DIR_PWR10, + DIR_PWR_FUTURE, + DIR_64 +}; } class GlobalValue; -class TargetMachine; class PPCSubtarget : public PPCGenSubtargetInfo { public: @@ -105,6 +105,9 @@ protected: bool HasP8Crypto; bool HasP9Vector; bool HasP9Altivec; + bool HasP10Vector; + bool HasPrefixInstrs; + bool HasPCRelativeMemops; bool HasFCPSGN; bool HasFSQRT; bool HasFRE, HasFRES, HasFRSQRTE, HasFRSQRTES; @@ -126,7 +129,6 @@ protected: bool FeatureMFTB; bool AllowsUnalignedFPAccess; bool DeprecatedDST; - bool HasLazyResolverStubs; bool IsLittleEndian; bool HasICBT; bool HasInvariantFunctionDescriptors; @@ -134,12 +136,17 @@ protected: bool HasDirectMove; bool HasHTM; bool HasFloat128; + bool HasFusion; + bool HasAddiLoadFusion; + bool HasAddisLoadFusion; bool IsISA3_0; + bool IsISA3_1; bool UseLongCalls; bool SecurePlt; bool VectorsUseTwoUnits; bool UsePPCPreRASchedStrategy; bool UsePPCPostRASchedStrategy; + bool PredictableSelectIsExpensive; POPCNTDKind HasPOPCNTD; @@ -230,11 +237,6 @@ public: /// the individual condition register bits. bool useCRBits() const { return UseCRBits; } - /// hasLazyResolverStub - Return true if accesses to the specified global have - /// to go through a dyld lazy resolution stub. This means that an extra load - /// is required to get the address of the global. - bool hasLazyResolverStub(const GlobalValue *GV) const; - // isLittleEndian - True if generating little-endian code bool isLittleEndian() const { return IsLittleEndian; } @@ -261,6 +263,9 @@ public: bool hasP8Crypto() const { return HasP8Crypto; } bool hasP9Vector() const { return HasP9Vector; } bool hasP9Altivec() const { return HasP9Altivec; } + bool hasP10Vector() const { return HasP10Vector; } + bool hasPrefixInstrs() const { return HasPrefixInstrs; } + bool hasPCRelativeMemops() const { return HasPCRelativeMemops; } bool hasMFOCRF() const { return HasMFOCRF; } bool hasISEL() const { return HasISEL; } bool hasBPERMD() const { return HasBPERMD; } @@ -294,16 +299,24 @@ public: return Align(16); } - // DarwinABI has a 224-byte red zone. PPC32 SVR4ABI(Non-DarwinABI) has no - // red zone and PPC64 SVR4ABI has a 288-byte red zone. unsigned getRedZoneSize() const { - return isDarwinABI() ? 224 : (isPPC64() ? 288 : 0); + if (isPPC64()) + // 288 bytes = 18*8 (FPRs) + 18*8 (GPRs, GPR13 reserved) + return 288; + + // AIX PPC32: 220 bytes = 18*8 (FPRs) + 19*4 (GPRs); + // PPC32 SVR4ABI has no redzone. + return isAIXABI() ? 220 : 0; } bool hasHTM() const { return HasHTM; } bool hasFloat128() const { return HasFloat128; } bool isISA3_0() const { return IsISA3_0; } + bool isISA3_1() const { return IsISA3_1; } bool useLongCalls() const { return UseLongCalls; } + bool hasFusion() const { return HasFusion; } + bool hasAddiLoadFusion() const { return HasAddiLoadFusion; } + bool hasAddisLoadFusion() const { return HasAddisLoadFusion; } bool needsSwapsForVSXMemOps() const { return hasVSX() && isLittleEndian() && !hasP9Vector(); } @@ -312,8 +325,6 @@ public: const Triple &getTargetTriple() const { return TargetTriple; } - /// isDarwin - True if this is any darwin platform. - bool isDarwin() const { return TargetTriple.isMacOSX(); } /// isBGQ - True if this is a BG/Q platform. bool isBGQ() const { return TargetTriple.getVendor() == Triple::BGQ; } @@ -321,13 +332,13 @@ public: bool isTargetMachO() const { return TargetTriple.isOSBinFormatMachO(); } bool isTargetLinux() const { return TargetTriple.isOSLinux(); } - bool isDarwinABI() const { return isTargetMachO() || isDarwin(); } bool isAIXABI() const { return TargetTriple.isOSAIX(); } - bool isSVR4ABI() const { return !isDarwinABI() && !isAIXABI(); } + bool isSVR4ABI() const { return !isAIXABI(); } bool isELFv2ABI() const; bool is64BitELFABI() const { return isSVR4ABI() && isPPC64(); } bool is32BitELFABI() const { return isSVR4ABI() && !isPPC64(); } + bool isUsingPCRelativeCalls() const; /// Originally, this function return hasISEL(). Now we always enable it, /// but may expand the ISEL instruction later. @@ -389,6 +400,10 @@ public: } bool isXRaySupported() const override { return IsPPC64 && IsLittleEndian; } + + bool isPredictableSelectIsExpensive() const { + return PredictableSelectIsExpensive; + } }; } // End llvm namespace |