From: Kevin Qin Date: Thu, 14 May 2015 08:18:05 +0000 (+0000) Subject: [AArch64 ACLE] Allow to define poly64_t as 'unsigned long long' on LLP64 system. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d13c501b4c9d9b7d4cbf1dabc452f945b917c860;p=clang [AArch64 ACLE] Allow to define poly64_t as 'unsigned long long' on LLP64 system. This fixes PR23414 as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237348 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ItaniumMangle.cpp b/lib/AST/ItaniumMangle.cpp index 6e55655d85..7acaf098bc 100644 --- a/lib/AST/ItaniumMangle.cpp +++ b/lib/AST/ItaniumMangle.cpp @@ -2311,6 +2311,7 @@ void CXXNameMangler::mangleAArch64NeonVectorType(const VectorType *T) { EltName = "Poly16"; break; case BuiltinType::ULong: + case BuiltinType::ULongLong: EltName = "Poly64"; break; default: diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index 48c276eb09..a64932b1c7 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -623,7 +623,10 @@ static QualType getNeonEltType(NeonTypeFlags Flags, ASTContext &Context, case NeonTypeFlags::Poly16: return IsPolyUnsigned ? Context.UnsignedShortTy : Context.ShortTy; case NeonTypeFlags::Poly64: - return Context.UnsignedLongTy; + if (IsInt64Long) + return Context.UnsignedLongTy; + else + return Context.UnsignedLongLongTy; case NeonTypeFlags::Poly128: break; case NeonTypeFlags::Float16: diff --git a/test/CodeGenCXX/aarch64-neon.cpp b/test/CodeGenCXX/aarch64-neon.cpp index d6f6b0e894..fc8642df25 100644 --- a/test/CodeGenCXX/aarch64-neon.cpp +++ b/test/CodeGenCXX/aarch64-neon.cpp @@ -1,6 +1,8 @@ // REQUIRES: aarch64-registered-target // RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon \ // RUN: -ffp-contract=fast -S -O3 -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple arm64-none-netbsd-gnu -target-feature +neon \ +// RUN: -ffp-contract=fast -S -O3 -o - %s | FileCheck %s // Test whether arm_neon.h works as expected in C++.