14 #ifndef LLVM_CLANG_LIB_BASIC_TARGETS_PPC_H 15 #define LLVM_CLANG_LIB_BASIC_TARGETS_PPC_H 20 #include "llvm/ADT/Triple.h" 21 #include "llvm/Support/Compiler.h" 55 SimdDefaultAlign = 128;
56 LongDoubleWidth = LongDoubleAlign = 128;
57 LongDoubleFormat = &llvm::APFloat::PPCDoubleDouble();
63 ArchDefineName = 1 << 0,
64 ArchDefinePpcgr = 1 << 1,
65 ArchDefinePpcsq = 1 << 2,
66 ArchDefine440 = 1 << 3,
67 ArchDefine603 = 1 << 4,
68 ArchDefine604 = 1 << 5,
69 ArchDefinePwr4 = 1 << 6,
70 ArchDefinePwr5 = 1 << 7,
71 ArchDefinePwr5x = 1 << 8,
72 ArchDefinePwr6 = 1 << 9,
73 ArchDefinePwr6x = 1 << 10,
74 ArchDefinePwr7 = 1 << 11,
75 ArchDefinePwr8 = 1 << 12,
76 ArchDefinePwr9 = 1 << 13,
77 ArchDefineA2 = 1 << 14,
78 ArchDefineA2q = 1 << 15
88 bool isValidCPUName(StringRef Name)
const override;
90 bool setCPU(
const std::string &Name)
override {
91 bool CPUKnown = isValidCPUName(Name);
97 StringRef
getABI()
const override {
return ABI; }
109 const std::vector<std::string> &FeaturesVec)
const override;
111 bool handleTargetFeatures(std::vector<std::string> &Features,
114 bool hasFeature(StringRef Feature)
const override;
116 void setFeatureEnabled(llvm::StringMap<bool> &Features, StringRef Name,
117 bool Enabled)
const override;
226 switch (*Constraint) {
230 R = std::string(
"^") + std::string(Constraint, 2);
251 return LongDoubleWidth == 128 &&
252 LongDoubleFormat == &llvm::APFloat::PPCDoubleDouble() &&
253 getTriple().isOSBinFormatELF();
261 resetDataLayout(
"E-m:e-p:32:32-i64:64-n32");
263 switch (getTriple().getOS()) {
264 case llvm::Triple::Linux:
265 case llvm::Triple::FreeBSD:
266 case llvm::Triple::NetBSD:
267 SizeType = UnsignedInt;
268 PtrDiffType = SignedInt;
269 IntPtrType = SignedInt;
275 if (getTriple().getOS() == llvm::Triple::FreeBSD) {
276 LongDoubleWidth = LongDoubleAlign = 64;
277 LongDoubleFormat = &llvm::APFloat::IEEEdouble();
281 MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 32;
296 LongWidth = LongAlign = PointerWidth = PointerAlign = 64;
297 IntMaxType = SignedLong;
298 Int64Type = SignedLong;
300 if ((Triple.getArch() == llvm::Triple::ppc64le)) {
301 resetDataLayout(
"e-m:e-i64:64-n32:64");
304 resetDataLayout(
"E-m:e-i64:64-n32:64");
308 switch (getTriple().getOS()) {
309 case llvm::Triple::FreeBSD:
310 LongDoubleWidth = LongDoubleAlign = 64;
311 LongDoubleFormat = &llvm::APFloat::IEEEdouble();
313 case llvm::Triple::NetBSD:
314 IntMaxType = SignedLongLong;
315 Int64Type = SignedLongLong;
322 MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
330 bool setABI(
const std::string &Name)
override {
331 if (Name ==
"elfv1" || Name ==
"elfv1-qpx" || Name ==
"elfv2") {
344 HasAlignMac68kSupport =
true;
345 BoolWidth = BoolAlign = 32;
346 PtrDiffType = SignedInt;
348 resetDataLayout(
"E-m:o-p:32:32-f64:32:64-n32");
361 HasAlignMac68kSupport =
true;
362 resetDataLayout(
"E-m:o-i64:64-n32:64");
368 #endif // LLVM_CLANG_LIB_BASIC_TARGETS_PPC_H
PPC32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
DarwinPPC64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
static const Builtin::Info BuiltinInfo[]
static bool hasFeature(StringRef Feature, const LangOptions &LangOpts, const TargetInfo &Target)
Determine whether a translation unit built using the current language options has the given feature...
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
Options for controlling the target.
PPC64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
bool useFloat128ManglingForLongDouble() const override
Return true if the 'long double' type should be mangled like __float128.
Concrete class used by the front-end to report problems and issues.
StringRef getABI() const override
Get the ABI currently in use.
ArchDefineTypes
Flags for architecture specific defines.
static const char *const GCCRegNames[]
DarwinPPC32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
Exposes information about the current target.
bool setABI(const std::string &Name) override
Use the specified ABI.
bool setCPU(const std::string &Name) override
Target the specified CPU.
int getEHDataRegisterNumber(unsigned RegNo) const override
Return the register number that __builtin_eh_return_regno would return with the specified argument...
Defines the clang::TargetOptions class.
__builtin_va_list as defined by the Power ABI: https://www.power.org /resources/downloads/Power-Arch-...
bool isCLZForZeroUndef() const override
The __builtin_clz* and __builtin_ctz* built-in functions are specified to have undefined results for ...
Dataflow Directional Tag Classes.
typedef char* __builtin_va_list;
BuiltinVaListKind
The different kinds of __builtin_va_list types defined by the target implementation.
bool hasSjLjLowering() const override
Controls if __builtin_longjmp / __builtin_setjmp can be lowered to llvm.eh.sjlj.longjmp / llvm...
Defines the clang::TargetInfo interface.
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
PPCTargetInfo(const llvm::Triple &Triple, const TargetOptions &)
std::string convertConstraint(const char *&Constraint) const override
bool validateAsmConstraint(const char *&Name, TargetInfo::ConstraintInfo &Info) const override
const char * getClobbers() const override
Returns a string of target-specific clobbers, in LLVM format.
virtual std::string convertConstraint(const char *&Constraint) const