diff options
Diffstat (limited to 'contrib/llvm-project/clang/lib/Basic/Targets/PPC.h')
-rw-r--r-- | contrib/llvm-project/clang/lib/Basic/Targets/PPC.h | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h b/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h index bda6cb7dc89f..56c8f33ef221 100644 --- a/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h +++ b/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h @@ -46,7 +46,6 @@ class LLVM_LIBRARY_VISIBILITY PPCTargetInfo : public TargetInfo { ArchDefinePwr10 = 1 << 14, ArchDefineFuture = 1 << 15, ArchDefineA2 = 1 << 16, - ArchDefineA2q = 1 << 17, ArchDefineE500 = 1 << 18 } ArchDefineTypes; @@ -59,16 +58,17 @@ class LLVM_LIBRARY_VISIBILITY PPCTargetInfo : public TargetInfo { // Target cpu features. bool HasAltivec = false; + bool HasMMA = false; bool HasVSX = false; bool HasP8Vector = false; bool HasP8Crypto = false; bool HasDirectMove = false; - bool HasQPX = false; bool HasHTM = false; bool HasBPERMD = false; bool HasExtDiv = false; bool HasP9Vector = false; bool HasSPE = false; + bool PairedVectorMemops = false; bool HasP10Vector = false; bool HasPCRelativeMemops = false; @@ -82,6 +82,7 @@ public: SimdDefaultAlign = 128; LongDoubleWidth = LongDoubleAlign = 128; LongDoubleFormat = &llvm::APFloat::PPCDoubleDouble(); + HasStrictFP = true; } // Set the language option for altivec based on our value. @@ -118,7 +119,6 @@ public: .Case("970", ArchDefineName | ArchDefinePwr4 | ArchDefinePpcgr | ArchDefinePpcsq) .Case("a2", ArchDefineA2) - .Case("a2q", ArchDefineName | ArchDefineA2 | ArchDefineA2q) .Cases("power3", "pwr3", ArchDefinePpcgr) .Cases("power4", "pwr4", ArchDefinePwr4 | ArchDefinePpcgr | ArchDefinePpcsq) @@ -355,6 +355,8 @@ public: : PPCTargetInfo(Triple, Opts) { if (Triple.isOSAIX()) resetDataLayout("E-m:a-p:32:32-i64:64-n32"); + else if (Triple.getArch() == llvm::Triple::ppcle) + resetDataLayout("e-m:e-p:32:32-i64:64-n32"); else resetDataLayout("E-m:e-p:32:32-i64:64-n32"); @@ -370,14 +372,16 @@ public: SizeType = UnsignedLong; PtrDiffType = SignedLong; IntPtrType = SignedLong; - SuitableAlign = 64; + LongDoubleWidth = 64; + LongDoubleAlign = DoubleAlign = 32; + LongDoubleFormat = &llvm::APFloat::IEEEdouble(); break; default: break; } if (Triple.isOSFreeBSD() || Triple.isOSNetBSD() || Triple.isOSOpenBSD() || - Triple.getOS() == llvm::Triple::AIX || Triple.isMusl()) { + Triple.isMusl()) { LongDoubleWidth = LongDoubleAlign = 64; LongDoubleFormat = &llvm::APFloat::IEEEdouble(); } @@ -401,25 +405,31 @@ public: LongWidth = LongAlign = PointerWidth = PointerAlign = 64; IntMaxType = SignedLong; Int64Type = SignedLong; + std::string DataLayout = ""; if (Triple.isOSAIX()) { // TODO: Set appropriate ABI for AIX platform. - resetDataLayout("E-m:a-i64:64-n32:64"); - SuitableAlign = 64; + DataLayout = "E-m:a-i64:64-n32:64"; + LongDoubleWidth = 64; + LongDoubleAlign = DoubleAlign = 32; + LongDoubleFormat = &llvm::APFloat::IEEEdouble(); } else if ((Triple.getArch() == llvm::Triple::ppc64le)) { - resetDataLayout("e-m:e-i64:64-n32:64"); + DataLayout = "e-m:e-i64:64-n32:64"; ABI = "elfv2"; } else { - resetDataLayout("E-m:e-i64:64-n32:64"); + DataLayout = "E-m:e-i64:64-n32:64"; ABI = "elfv1"; } - if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || - Triple.getOS() == llvm::Triple::AIX || Triple.isMusl()) { + if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) { LongDoubleWidth = LongDoubleAlign = 64; LongDoubleFormat = &llvm::APFloat::IEEEdouble(); } + if (Triple.isOSAIX() || Triple.isOSLinux()) + DataLayout += "-v256:256:256-v512:512:512"; + resetDataLayout(DataLayout); + // PPC64 supports atomics up to 8 bytes. MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64; } @@ -430,7 +440,7 @@ public: // PPC64 Linux-specific ABI options. bool setABI(const std::string &Name) override { - if (Name == "elfv1" || Name == "elfv1-qpx" || Name == "elfv2") { + if (Name == "elfv1" || Name == "elfv2") { ABI = Name; return true; } |