16#include "llvm/ADT/StringRef.h"
17#include "llvm/ADT/StringSwitch.h"
18#include "llvm/TargetParser/TargetParser.h"
55 CPU = llvm::StringSwitch<CPUKind>(Name)
56 .Case(
"generic", CK_68000)
57 .Case(
"M68000", CK_68000)
58 .Case(
"M68010", CK_68010)
59 .Case(
"M68020", CK_68020)
60 .Case(
"M68030", CK_68030)
61 .Case(
"M68040", CK_68040)
62 .Case(
"M68060", CK_68060)
64 return CPU != CK_Unknown;
71 Builder.defineMacro(
"__m68k__");
96 if (CPU >= CK_68020) {
97 Builder.defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1");
98 Builder.defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2");
99 Builder.defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4");
103 if (TargetOpts.FeatureMap.lookup(
"isa-68881") ||
104 TargetOpts.FeatureMap.lookup(
"isa-68882"))
105 Builder.defineMacro(
"__HAVE_68881__");
119const char *
const M68kTargetInfo::GCCRegNames[] = {
120 "d0",
"d1",
"d2",
"d3",
"d4",
"d5",
"d6",
"d7",
121 "a0",
"a1",
"a2",
"a3",
"a4",
"a5",
"a6",
"sp",
131 {{
"usp",
"ssp",
"isp",
"a7"},
"sp"},
143 info.setAllowsRegister();
146 info.setRequiresImmediate(1, 8);
149 info.setRequiresImmediate(std::numeric_limits<int16_t>::min(),
150 std::numeric_limits<int16_t>::max());
153 info.setRequiresImmediate();
156 info.setRequiresImmediate(-8, -1);
159 info.setRequiresImmediate();
162 info.setRequiresImmediate(24, 31);
165 info.setRequiresImmediate(16);
168 info.setRequiresImmediate(8, 15);
174 info.setRequiresImmediate(0);
178 info.setRequiresImmediate();
188 info.setAllowsMemory();
196std::optional<std::string>
217 return std::string(1,
C);
221 if (*Constraint ==
'C')
223 return std::string(
"^") + std::string(Constraint++, 2);
225 return std::string(1, *Constraint);
Defines the Diagnostic-related interfaces.
Defines enum values for all the target-independent builtin functions.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
TargetInfo(const llvm::Triple &T)
const llvm::Triple & getTriple() const
Returns the target triple of the primary target.
BuiltinVaListKind
The different kinds of __builtin_va_list types defined by the target implementation.
@ VoidPtrBuiltinVaList
typedef void* __builtin_va_list;
virtual CallingConvCheckResult checkCallingConvention(CallingConv CC) const
Determines whether a given calling convention is valid for the target.
void resetDataLayout()
Set the data layout based on current triple and ABI.
Options for controlling the target.
std::string convertConstraint(const char *&Constraint) const override
bool hasFeature(StringRef Feature) const override
Determine whether the given target has the given feature.
std::optional< std::string > handleAsmEscapedChar(char EscChar) const override
Replace some escaped characters with another string based on target-specific rules.
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
M68kTargetInfo(const llvm::Triple &Triple, const TargetOptions &)
CallingConvCheckResult checkCallingConvention(CallingConv CC) const override
Determines whether a given calling convention is valid for the target.
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
===-— Other target property query methods -----------------------—===//
bool setCPU(StringRef Name) override
Target the specified CPU.
std::string_view getClobbers() const override
Returns a string of target-specific clobbers, in LLVM format.
ArrayRef< TargetInfo::GCCRegAlias > getGCCRegAliases() const override
ArrayRef< const char * > getGCCRegNames() const override
bool validateAsmConstraint(const char *&Name, TargetInfo::ConstraintInfo &info) const override
llvm::SmallVector< Builtin::InfosShard > getTargetBuiltins() const override
Return information about target-specific builtins for the current primary target, and info about whic...
LLVM_LIBRARY_VISIBILITY void DefineStd(clang::MacroBuilder &Builder, llvm::StringRef MacroName, const clang::LangOptions &Opts)
Define a macro name and standard variants.
Top level wrappers for InstallAPI frontend operations.
CallingConv
CallingConv - Specifies the calling convention that a function uses.
unsigned char PointerAlign