blob: 6faf6226efd2e306ce702a366b0533a2f28a87af [file] [log] [blame]
Tim Northovera2ee4332014-03-29 15:09:45 +00001// RUN: %clang_cc1 -triple armv7-apple-ios -target-feature +neon %s -emit-llvm -o - | FileCheck %s
James Molloy75f5f9e2014-04-16 15:33:48 +00002// RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +neon %s -emit-llvm -o - | FileCheck %s
3// RUN: %clang_cc1 -triple arm64-linux-gnu -target-feature +neon %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-AARCH64
Bob Wilsonbafdb732010-11-16 00:32:31 +00004
5typedef float float32_t;
Tim Northovera2ee4332014-03-29 15:09:45 +00006typedef double float64_t;
Tim Northover2fe823a2013-08-01 09:23:19 +00007typedef __fp16 float16_t;
Tim Northovera2ee4332014-03-29 15:09:45 +00008#if defined(__aarch64__)
9typedef unsigned char poly8_t;
10typedef unsigned short poly16_t;
11#else
Bob Wilsonbafdb732010-11-16 00:32:31 +000012typedef signed char poly8_t;
13typedef short poly16_t;
Tim Northovera2ee4332014-03-29 15:09:45 +000014#endif
15typedef unsigned __INT64_TYPE__ uint64_t;
Bob Wilsonbafdb732010-11-16 00:32:31 +000016
17typedef __attribute__((neon_vector_type(2))) int int32x2_t;
18typedef __attribute__((neon_vector_type(4))) int int32x4_t;
19typedef __attribute__((neon_vector_type(1))) uint64_t uint64x1_t;
20typedef __attribute__((neon_vector_type(2))) uint64_t uint64x2_t;
21typedef __attribute__((neon_vector_type(2))) float32_t float32x2_t;
22typedef __attribute__((neon_vector_type(4))) float32_t float32x4_t;
Tim Northover2fe823a2013-08-01 09:23:19 +000023typedef __attribute__((neon_vector_type(4))) float16_t float16x4_t;
24typedef __attribute__((neon_vector_type(8))) float16_t float16x8_t;
Tim Northovera2ee4332014-03-29 15:09:45 +000025#ifdef __aarch64__
26typedef __attribute__((neon_vector_type(2))) float64_t float64x2_t;
27#endif
28typedef __attribute__((neon_polyvector_type(16))) poly8_t poly8x16_t;
29typedef __attribute__((neon_polyvector_type(8))) poly16_t poly16x8_t;
Bob Wilsonbafdb732010-11-16 00:32:31 +000030
31// CHECK: 16__simd64_int32_t
Tim Northovera2ee4332014-03-29 15:09:45 +000032// CHECK-AARCH64: 11__Int32x2_t
Bob Wilsonbafdb732010-11-16 00:32:31 +000033void f1(int32x2_t v) { }
Tim Northovera2ee4332014-03-29 15:09:45 +000034
Bob Wilsonbafdb732010-11-16 00:32:31 +000035// CHECK: 17__simd128_int32_t
Tim Northovera2ee4332014-03-29 15:09:45 +000036// CHECK-AARCH64: 11__Int32x4_t
Bob Wilsonbafdb732010-11-16 00:32:31 +000037void f2(int32x4_t v) { }
Tim Northovera2ee4332014-03-29 15:09:45 +000038
Bob Wilsonbafdb732010-11-16 00:32:31 +000039// CHECK: 17__simd64_uint64_t
Tim Northovera2ee4332014-03-29 15:09:45 +000040// CHECK-AARCH64: 12__Uint64x1_t
Bob Wilsonbafdb732010-11-16 00:32:31 +000041void f3(uint64x1_t v) { }
Tim Northovera2ee4332014-03-29 15:09:45 +000042
Bob Wilsonbafdb732010-11-16 00:32:31 +000043// CHECK: 18__simd128_uint64_t
Tim Northovera2ee4332014-03-29 15:09:45 +000044// CHECK-AARCH64: 12__Uint64x2_t
Bob Wilsonbafdb732010-11-16 00:32:31 +000045void f4(uint64x2_t v) { }
Tim Northovera2ee4332014-03-29 15:09:45 +000046
Bob Wilsonbafdb732010-11-16 00:32:31 +000047// CHECK: 18__simd64_float32_t
Tim Northovera2ee4332014-03-29 15:09:45 +000048// CHECK-AARCH64: 13__Float32x2_t
Bob Wilsonbafdb732010-11-16 00:32:31 +000049void f5(float32x2_t v) { }
Tim Northovera2ee4332014-03-29 15:09:45 +000050
Bob Wilsonbafdb732010-11-16 00:32:31 +000051// CHECK: 19__simd128_float32_t
Tim Northovera2ee4332014-03-29 15:09:45 +000052// CHECK-AARCH64: 13__Float32x4_t
Bob Wilsonbafdb732010-11-16 00:32:31 +000053void f6(float32x4_t v) { }
Tim Northovera2ee4332014-03-29 15:09:45 +000054
Tim Northover2fe823a2013-08-01 09:23:19 +000055// CHECK: 18__simd64_float16_t
Tim Northovera2ee4332014-03-29 15:09:45 +000056// CHECK-AARCH64: 13__Float16x4_t
Tim Northover2fe823a2013-08-01 09:23:19 +000057void f7(float16x4_t v) {}
Tim Northovera2ee4332014-03-29 15:09:45 +000058
Tim Northover2fe823a2013-08-01 09:23:19 +000059// CHECK: 19__simd128_float16_t
Tim Northovera2ee4332014-03-29 15:09:45 +000060// CHECK-AARCH64: 13__Float16x8_t
Tim Northover2fe823a2013-08-01 09:23:19 +000061void f8(float16x8_t v) {}
Tim Northovera2ee4332014-03-29 15:09:45 +000062
Bob Wilsonbafdb732010-11-16 00:32:31 +000063// CHECK: 17__simd128_poly8_t
Tim Northovera2ee4332014-03-29 15:09:45 +000064// CHECK-AARCH64: 12__Poly8x16_t
Tim Northover2fe823a2013-08-01 09:23:19 +000065void f9(poly8x16_t v) {}
Tim Northovera2ee4332014-03-29 15:09:45 +000066
Bob Wilsonbafdb732010-11-16 00:32:31 +000067// CHECK: 18__simd128_poly16_t
Tim Northovera2ee4332014-03-29 15:09:45 +000068// CHECK-AARCH64: 12__Poly16x8_t
Tim Northover2fe823a2013-08-01 09:23:19 +000069void f10(poly16x8_t v) {}
Tim Northovera2ee4332014-03-29 15:09:45 +000070
71#ifdef __aarch64__
72// CHECK-AARCH64: 13__Float64x2_t
73void f11(float64x2_t v) { }
74#endif