summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorJiangning Liu <jiangning.liu@arm.com>2014-01-08 07:51:48 +0000
committerJiangning Liu <jiangning.liu@arm.com>2014-01-08 07:51:48 +0000
commitca88f8833050831a2f6613f6c58271a9d446365d (patch)
treea7e7cb3c71c3f0207ad56f3ec19392f3f950edcc /clang
parentb7c6965b19b41ac23418248660262590bd168d21 (diff)
downloadbcm5719-llvm-ca88f8833050831a2f6613f6c58271a9d446365d.tar.gz
bcm5719-llvm-ca88f8833050831a2f6613f6c58271a9d446365d.zip
For AArch64, support builtin neon vector type with 'long' as base element type.
llvm-svn: 198741
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Sema/SemaType.cpp3
-rw-r--r--clang/test/Sema/aarch64-neon-vector-types.c15
2 files changed, 18 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp
index 1f8b1eba41e..7423a4d0f18 100644
--- a/clang/lib/Sema/SemaType.cpp
+++ b/clang/lib/Sema/SemaType.cpp
@@ -4747,6 +4747,7 @@ static bool isPermittedNeonBaseType(QualType &Ty,
// AArch64 polynomial vectors are unsigned and support poly64.
return BTy->getKind() == BuiltinType::UChar ||
BTy->getKind() == BuiltinType::UShort ||
+ BTy->getKind() == BuiltinType::ULong ||
BTy->getKind() == BuiltinType::ULongLong;
} else {
// AArch32 polynomial vector are signed.
@@ -4766,6 +4767,8 @@ static bool isPermittedNeonBaseType(QualType &Ty,
BTy->getKind() == BuiltinType::UShort ||
BTy->getKind() == BuiltinType::Int ||
BTy->getKind() == BuiltinType::UInt ||
+ BTy->getKind() == BuiltinType::Long ||
+ BTy->getKind() == BuiltinType::ULong ||
BTy->getKind() == BuiltinType::LongLong ||
BTy->getKind() == BuiltinType::ULongLong ||
BTy->getKind() == BuiltinType::Float ||
diff --git a/clang/test/Sema/aarch64-neon-vector-types.c b/clang/test/Sema/aarch64-neon-vector-types.c
index 894cf6de1b0..b733e3c276c 100644
--- a/clang/test/Sema/aarch64-neon-vector-types.c
+++ b/clang/test/Sema/aarch64-neon-vector-types.c
@@ -1,19 +1,34 @@
// RUN: %clang_cc1 %s -triple aarch64-none-linux-gnu -target-feature +neon -fsyntax-only -verify
+// RUN: %clang_cc1 %s -triple aarch64-none-linux-gnu -target-feature +neon -DUSE_LONG -fsyntax-only -verify
typedef float float32_t;
typedef unsigned char poly8_t;
typedef unsigned short poly16_t;
+
+// Both "long" and "long long" should work for 64-bit arch like aarch64.
+// stdint.h in gnu libc is using "long" for 64-bit arch.
+#if USE_LONG
+typedef long int64_t;
+typedef unsigned long uint64_t;
+#else
+typedef long long int64_t;
typedef unsigned long long uint64_t;
+#endif
+typedef uint64_t poly64_t;
// Define some valid Neon types.
typedef __attribute__((neon_vector_type(2))) int int32x2_t;
typedef __attribute__((neon_vector_type(4))) int int32x4_t;
+typedef __attribute__((neon_vector_type(1))) int64_t int64x1_t;
+typedef __attribute__((neon_vector_type(2))) int64_t int64x2_t;
typedef __attribute__((neon_vector_type(1))) uint64_t uint64x1_t;
typedef __attribute__((neon_vector_type(2))) uint64_t uint64x2_t;
typedef __attribute__((neon_vector_type(2))) float32_t float32x2_t;
typedef __attribute__((neon_vector_type(4))) float32_t float32x4_t;
typedef __attribute__((neon_polyvector_type(16))) poly8_t poly8x16_t;
typedef __attribute__((neon_polyvector_type(8))) poly16_t poly16x8_t;
+typedef __attribute__((neon_polyvector_type(1))) poly64_t poly64x1_t;
+typedef __attribute__((neon_polyvector_type(2))) poly64_t poly64x2_t;
// The attributes must have a single argument.
typedef __attribute__((neon_vector_type(2, 4))) int only_one_arg; // expected-error{{attribute takes one argument}}
OpenPOWER on IntegriCloud