void CXXNameMangler::mangleType(const VectorType *T) {
if ((T->getVectorKind() == VectorType::NeonVector ||
T->getVectorKind() == VectorType::NeonPolyVector)) {
- if (getASTContext().getTargetInfo().getTriple().getArch() ==
- llvm::Triple::aarch64)
+ llvm::Triple::ArchType Arch =
+ getASTContext().getTargetInfo().getTriple().getArch();
+ if ((Arch == llvm::Triple::aarch64) ||
+ (Arch == llvm::Triple::aarch64_be))
mangleAArch64NeonVectorType(T);
else
mangleNeonVectorType(T);
namespace {
class AArch64TargetInfo : public TargetInfo {
+ virtual void setDescriptionString() = 0;
static const char * const GCCRegNames[];
static const TargetInfo::GCCRegAlias GCCRegAliases[];
IntMaxType = SignedLong;
UIntMaxType = UnsignedLong;
Int64Type = SignedLong;
- BigEndian = false;
LongWidth = LongAlign = 64;
LongDoubleWidth = LongDoubleAlign = 128;
PointerWidth = PointerAlign = 64;
SuitableAlign = 128;
- DescriptionString = "e-m:e-i64:64-i128:128-n32:64-S128";
WCharType = UnsignedInt;
if (getTriple().getOS() == llvm::Triple::NetBSD)
MacroBuilder &Builder) const {
// GCC defines theses currently
Builder.defineMacro("__aarch64__");
- Builder.defineMacro("__AARCH64EL__");
// ACLE predefines. Many can only have one possible value on v8 AArch64.
Builder.defineMacro("__ARM_ACLE", "200");
if (Features[i] == "+crypto")
Crypto = 1;
}
+
+ setDescriptionString();
+
return true;
}
#include "clang/Basic/BuiltinsAArch64.def"
};
+class AArch64leTargetInfo : public AArch64TargetInfo {
+ virtual void setDescriptionString() {
+ DescriptionString = "e-m:e-i64:64-i128:128-n32:64-S128";
+ }
+
+public:
+ AArch64leTargetInfo(const llvm::Triple &Triple)
+ : AArch64TargetInfo(Triple) {
+ BigEndian = false;
+ }
+ virtual void getTargetDefines(const LangOptions &Opts,
+ MacroBuilder &Builder) const {
+ Builder.defineMacro("__AARCH64EL__");
+ AArch64TargetInfo::getTargetDefines(Opts, Builder);
+ }
+};
+
+class AArch64beTargetInfo : public AArch64TargetInfo {
+ virtual void setDescriptionString() {
+ DescriptionString = "E-m:e-i64:64-i128:128-n32:64-S128";
+ }
+
+public:
+ AArch64beTargetInfo(const llvm::Triple &Triple)
+ : AArch64TargetInfo(Triple) { }
+ virtual void getTargetDefines(const LangOptions &Opts,
+ MacroBuilder &Builder) const {
+ Builder.defineMacro("__AARCH64EB__");
+ AArch64TargetInfo::getTargetDefines(Opts, Builder);
+ }
+};
+
} // end anonymous namespace
namespace {
case llvm::Triple::aarch64:
switch (os) {
case llvm::Triple::Linux:
- return new LinuxTargetInfo<AArch64TargetInfo>(Triple);
+ return new LinuxTargetInfo<AArch64leTargetInfo>(Triple);
+ case llvm::Triple::NetBSD:
+ return new NetBSDTargetInfo<AArch64leTargetInfo>(Triple);
+ default:
+ return new AArch64leTargetInfo(Triple);
+ }
+
+ case llvm::Triple::aarch64_be:
+ switch (os) {
+ case llvm::Triple::Linux:
+ return new LinuxTargetInfo<AArch64beTargetInfo>(Triple);
case llvm::Triple::NetBSD:
- return new NetBSDTargetInfo<AArch64TargetInfo>(Triple);
+ return new NetBSDTargetInfo<AArch64beTargetInfo>(Triple);
default:
- return new AArch64TargetInfo(Triple);
+ return new AArch64beTargetInfo(Triple);
}
case llvm::Triple::arm:
const CallExpr *E) {
switch (getTarget().getTriple().getArch()) {
case llvm::Triple::aarch64:
+ case llvm::Triple::aarch64_be:
return EmitAArch64BuiltinExpr(BuiltinID, E);
case llvm::Triple::arm:
case llvm::Triple::thumb:
return *(TheTargetCodeGenInfo = new MIPSTargetCodeGenInfo(Types, false));
case llvm::Triple::aarch64:
+ case llvm::Triple::aarch64_be:
return *(TheTargetCodeGenInfo = new AArch64TargetCodeGenInfo(Types));
case llvm::Triple::arm:
switch (TargetTriple.getArch()) {
case llvm::Triple::aarch64:
+ case llvm::Triple::aarch64_be:
LibDirs.append(AArch64LibDirs,
AArch64LibDirs + llvm::array_lengthof(AArch64LibDirs));
TripleAliases.append(AArch64Triples,
return getTriple().getArch() == llvm::Triple::x86 ||
getTriple().getArch() == llvm::Triple::x86_64 ||
getTriple().getArch() == llvm::Triple::aarch64 ||
+ getTriple().getArch() == llvm::Triple::aarch64_be ||
getTriple().getArch() == llvm::Triple::arm ||
getTriple().getArch() == llvm::Triple::thumb;
}
const Generic_GCC::GCCVersion &V = GCCInstallation.getVersion();
bool UseInitArrayDefault =
getTriple().getArch() == llvm::Triple::aarch64 ||
+ getTriple().getArch() == llvm::Triple::aarch64_be ||
(getTriple().getOS() == llvm::Triple::Linux && (
!V.isOlderThan(4, 7, 0) ||
getTriple().getEnvironment() == llvm::Triple::Android));
return "x86_64-linux-gnu";
return TargetTriple.str();
case llvm::Triple::aarch64:
+ case llvm::Triple::aarch64_be:
if (llvm::sys::fs::exists(SysRoot + "/lib/aarch64-linux-gnu"))
return "aarch64-linux-gnu";
return TargetTriple.str();
MultiarchIncludeDirs = X86_64MultiarchIncludeDirs;
} else if (getTriple().getArch() == llvm::Triple::x86) {
MultiarchIncludeDirs = X86MultiarchIncludeDirs;
- } else if (getTriple().getArch() == llvm::Triple::aarch64) {
+ } else if ((getTriple().getArch() == llvm::Triple::aarch64) ||
+ (getTriple().getArch() == llvm::Triple::aarch64_be)) {
MultiarchIncludeDirs = AArch64MultiarchIncludeDirs;
} else if (getTriple().getArch() == llvm::Triple::arm) {
if (getTriple().getEnvironment() == llvm::Triple::GNUEABIHF)
return true;
case llvm::Triple::aarch64:
+ case llvm::Triple::aarch64_be:
case llvm::Triple::arm:
case llvm::Triple::ppc:
case llvm::Triple::ppc64:
return "";
case llvm::Triple::aarch64:
+ case llvm::Triple::aarch64_be:
return getAArch64TargetCPU(Args, T);
case llvm::Triple::arm:
getSparcTargetFeatures(Args, Features);
break;
case llvm::Triple::aarch64:
+ case llvm::Triple::aarch64_be:
getAArch64TargetFeatures(D, Args, Features);
break;
case llvm::Triple::x86:
return ExprError();
break;
case llvm::Triple::aarch64:
+ case llvm::Triple::aarch64_be:
if (CheckAArch64BuiltinFunctionCall(BuiltinID, TheCall))
return ExprError();
break;
llvm::Triple::ArchType Arch =
S.Context.getTargetInfo().getTriple().getArch();
if (!isPermittedNeonBaseType(CurType, VecKind,
- Arch == llvm::Triple::aarch64)) {
+ (Arch == llvm::Triple::aarch64) ||
+ (Arch == llvm::Triple::aarch64_be))) {
S.Diag(Attr.getLoc(), diag::err_attribute_invalid_vector_type) << CurType;
Attr.setInvalid();
return;