13#ifndef LLVM_CLANG_LIB_BASIC_TARGETS_SPARC_H
14#define LLVM_CLANG_LIB_BASIC_TARGETS_SPARC_H
17#include "llvm/Support/Compiler.h"
18#include "llvm/TargetParser/Triple.h"
24 static const char *
const GCCRegNames[];
42 if (llvm::is_contained(Features,
"+soft-float"))
49 bool hasFeature(StringRef Feature)
const override;
56 return TargetInfo::VoidPtrBuiltinVaList;
129 CPUGeneration getCPUGeneration(CPUKind Kind)
const;
131 CPUKind getCPUKind(StringRef Name)
const;
134 return getCPUKind(Name) != CK_GENERIC;
139 bool setCPU(
const std::string &Name)
override {
140 CPU = getCPUKind(Name);
141 return CPU != CK_GENERIC;
150 resetDataLayout(
"E-m:e-p:32:32-i64:64-f128:64-n32-S64");
152 switch (getTriple().getOS()) {
154 SizeType = UnsignedInt;
155 IntPtrType = SignedInt;
156 PtrDiffType = SignedInt;
158 case llvm::Triple::NetBSD:
159 case llvm::Triple::OpenBSD:
160 SizeType = UnsignedLong;
161 IntPtrType = SignedLong;
162 PtrDiffType = SignedLong;
167 MaxAtomicPromoteWidth = 64;
168 if (getCPUGeneration(CPU) == CG_V9)
169 MaxAtomicInlineWidth = 64;
173 MaxAtomicInlineWidth = 32;
187 resetDataLayout(
"e-m:e-p:32:32-i64:64-f128:64-n32-S64");
197 resetDataLayout(
"E-m:e-i64:64-n32:64-S128");
199 LongWidth = LongAlign = PointerWidth = PointerAlign = 64;
202 if (getTriple().isOSOpenBSD())
203 IntMaxType = SignedLongLong;
205 IntMaxType = SignedLong;
206 Int64Type = IntMaxType;
210 LongDoubleWidth = 128;
211 LongDoubleAlign = 128;
213 LongDoubleFormat = &llvm::APFloat::IEEEquad();
214 MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
221 return getCPUGeneration(SparcTargetInfo::getCPUKind(Name)) == CG_V9;
226 bool setCPU(
const std::string &Name)
override {
227 if (!SparcTargetInfo::setCPU(Name))
229 return getCPUGeneration(CPU) == CG_V9;
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.
Defines the clang::TargetOptions class.
Concrete class used by the front-end to report problems and issues.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Exposes information about the current target.
BuiltinVaListKind
The different kinds of __builtin_va_list types defined by the target implementation.
Options for controlling the target.
bool isValidCPUName(StringRef Name) const override
brief Determine whether this TargetInfo supports the given CPU name.
ArrayRef< Builtin::Info > getTargetBuiltins() const override
Return information about target-specific builtins for the current primary target, and info about whic...
int getEHDataRegisterNumber(unsigned RegNo) const override
Return the register number that __builtin_eh_return_regno would return with the specified argument.
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
bool setCPU(const std::string &Name) override
Target the specified CPU.
bool handleTargetFeatures(std::vector< std::string > &Features, DiagnosticsEngine &Diags) override
Perform initialization based on the user configured set of features (e.g., +sse4).
std::string_view getClobbers() const override
Returns a string of target-specific clobbers, in LLVM format.
bool validateAsmConstraint(const char *&Name, TargetInfo::ConstraintInfo &info) const override
SparcTargetInfo(const llvm::Triple &Triple, const TargetOptions &)
bool hasBitIntType() const override
Determine whether the _BitInt type is supported on this target.
SparcV8TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
SparcV8elTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
SparcV9TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
bool isValidCPUName(StringRef Name) const override
brief Determine whether this TargetInfo supports the given CPU name.
bool hasBitIntType() const override
Determine whether the _BitInt type is supported on this target.
bool setCPU(const std::string &Name) override
Target the specified CPU.
Defines the clang::TargetInfo interface.