Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple armv7-apple-ios -target-feature +neon %s -emit-llvm -o - | FileCheck %s |
James Molloy | 75f5f9e | 2014-04-16 15:33:48 +0000 | [diff] [blame] | 2 | // 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 Wilson | bafdb73 | 2010-11-16 00:32:31 +0000 | [diff] [blame] | 4 | |
| 5 | typedef float float32_t; |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 6 | typedef double float64_t; |
Tim Northover | 2fe823a | 2013-08-01 09:23:19 +0000 | [diff] [blame] | 7 | typedef __fp16 float16_t; |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 8 | #if defined(__aarch64__) |
| 9 | typedef unsigned char poly8_t; |
| 10 | typedef unsigned short poly16_t; |
| 11 | #else |
Bob Wilson | bafdb73 | 2010-11-16 00:32:31 +0000 | [diff] [blame] | 12 | typedef signed char poly8_t; |
| 13 | typedef short poly16_t; |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 14 | #endif |
| 15 | typedef unsigned __INT64_TYPE__ uint64_t; |
Bob Wilson | bafdb73 | 2010-11-16 00:32:31 +0000 | [diff] [blame] | 16 | |
| 17 | typedef __attribute__((neon_vector_type(2))) int int32x2_t; |
| 18 | typedef __attribute__((neon_vector_type(4))) int int32x4_t; |
| 19 | typedef __attribute__((neon_vector_type(1))) uint64_t uint64x1_t; |
| 20 | typedef __attribute__((neon_vector_type(2))) uint64_t uint64x2_t; |
| 21 | typedef __attribute__((neon_vector_type(2))) float32_t float32x2_t; |
| 22 | typedef __attribute__((neon_vector_type(4))) float32_t float32x4_t; |
Tim Northover | 2fe823a | 2013-08-01 09:23:19 +0000 | [diff] [blame] | 23 | typedef __attribute__((neon_vector_type(4))) float16_t float16x4_t; |
| 24 | typedef __attribute__((neon_vector_type(8))) float16_t float16x8_t; |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 25 | #ifdef __aarch64__ |
| 26 | typedef __attribute__((neon_vector_type(2))) float64_t float64x2_t; |
| 27 | #endif |
| 28 | typedef __attribute__((neon_polyvector_type(16))) poly8_t poly8x16_t; |
| 29 | typedef __attribute__((neon_polyvector_type(8))) poly16_t poly16x8_t; |
Bob Wilson | bafdb73 | 2010-11-16 00:32:31 +0000 | [diff] [blame] | 30 | |
| 31 | // CHECK: 16__simd64_int32_t |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 32 | // CHECK-AARCH64: 11__Int32x2_t |
Bob Wilson | bafdb73 | 2010-11-16 00:32:31 +0000 | [diff] [blame] | 33 | void f1(int32x2_t v) { } |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 34 | |
Bob Wilson | bafdb73 | 2010-11-16 00:32:31 +0000 | [diff] [blame] | 35 | // CHECK: 17__simd128_int32_t |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 36 | // CHECK-AARCH64: 11__Int32x4_t |
Bob Wilson | bafdb73 | 2010-11-16 00:32:31 +0000 | [diff] [blame] | 37 | void f2(int32x4_t v) { } |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 38 | |
Bob Wilson | bafdb73 | 2010-11-16 00:32:31 +0000 | [diff] [blame] | 39 | // CHECK: 17__simd64_uint64_t |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 40 | // CHECK-AARCH64: 12__Uint64x1_t |
Bob Wilson | bafdb73 | 2010-11-16 00:32:31 +0000 | [diff] [blame] | 41 | void f3(uint64x1_t v) { } |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 42 | |
Bob Wilson | bafdb73 | 2010-11-16 00:32:31 +0000 | [diff] [blame] | 43 | // CHECK: 18__simd128_uint64_t |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 44 | // CHECK-AARCH64: 12__Uint64x2_t |
Bob Wilson | bafdb73 | 2010-11-16 00:32:31 +0000 | [diff] [blame] | 45 | void f4(uint64x2_t v) { } |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 46 | |
Bob Wilson | bafdb73 | 2010-11-16 00:32:31 +0000 | [diff] [blame] | 47 | // CHECK: 18__simd64_float32_t |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 48 | // CHECK-AARCH64: 13__Float32x2_t |
Bob Wilson | bafdb73 | 2010-11-16 00:32:31 +0000 | [diff] [blame] | 49 | void f5(float32x2_t v) { } |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 50 | |
Bob Wilson | bafdb73 | 2010-11-16 00:32:31 +0000 | [diff] [blame] | 51 | // CHECK: 19__simd128_float32_t |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 52 | // CHECK-AARCH64: 13__Float32x4_t |
Bob Wilson | bafdb73 | 2010-11-16 00:32:31 +0000 | [diff] [blame] | 53 | void f6(float32x4_t v) { } |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 54 | |
Tim Northover | 2fe823a | 2013-08-01 09:23:19 +0000 | [diff] [blame] | 55 | // CHECK: 18__simd64_float16_t |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 56 | // CHECK-AARCH64: 13__Float16x4_t |
Tim Northover | 2fe823a | 2013-08-01 09:23:19 +0000 | [diff] [blame] | 57 | void f7(float16x4_t v) {} |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 58 | |
Tim Northover | 2fe823a | 2013-08-01 09:23:19 +0000 | [diff] [blame] | 59 | // CHECK: 19__simd128_float16_t |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 60 | // CHECK-AARCH64: 13__Float16x8_t |
Tim Northover | 2fe823a | 2013-08-01 09:23:19 +0000 | [diff] [blame] | 61 | void f8(float16x8_t v) {} |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 62 | |
Bob Wilson | bafdb73 | 2010-11-16 00:32:31 +0000 | [diff] [blame] | 63 | // CHECK: 17__simd128_poly8_t |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 64 | // CHECK-AARCH64: 12__Poly8x16_t |
Tim Northover | 2fe823a | 2013-08-01 09:23:19 +0000 | [diff] [blame] | 65 | void f9(poly8x16_t v) {} |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 66 | |
Bob Wilson | bafdb73 | 2010-11-16 00:32:31 +0000 | [diff] [blame] | 67 | // CHECK: 18__simd128_poly16_t |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 68 | // CHECK-AARCH64: 12__Poly16x8_t |
Tim Northover | 2fe823a | 2013-08-01 09:23:19 +0000 | [diff] [blame] | 69 | void f10(poly16x8_t v) {} |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 70 | |
| 71 | #ifdef __aarch64__ |
| 72 | // CHECK-AARCH64: 13__Float64x2_t |
| 73 | void f11(float64x2_t v) { } |
| 74 | #endif |