• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -triple armv7-apple-ios -target-feature +neon  %s -emit-llvm -o - | FileCheck %s
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
4 // RUN: %clang_cc1 -triple arm64-linux-gnu -target-feature +neon -target-feature +bf16 %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-AARCH64-BF16
5 
6 typedef float float32_t;
7 typedef double float64_t;
8 typedef __fp16 float16_t;
9 #if defined(__aarch64__)
10 typedef unsigned char poly8_t;
11 typedef unsigned short poly16_t;
12 #else
13 typedef signed char poly8_t;
14 typedef short poly16_t;
15 #endif
16 typedef unsigned __INT64_TYPE__ uint64_t;
17 
18 #if defined(__ARM_FEATURE_BF16)
19 typedef __bf16 bfloat16_t;
20 #endif
21 
22 typedef __attribute__((neon_vector_type(2))) int int32x2_t;
23 typedef __attribute__((neon_vector_type(4))) int int32x4_t;
24 typedef __attribute__((neon_vector_type(1))) uint64_t uint64x1_t;
25 typedef __attribute__((neon_vector_type(2))) uint64_t uint64x2_t;
26 typedef __attribute__((neon_vector_type(2))) float32_t float32x2_t;
27 typedef __attribute__((neon_vector_type(4))) float32_t float32x4_t;
28 typedef __attribute__((neon_vector_type(4))) float16_t float16x4_t;
29 typedef __attribute__((neon_vector_type(8))) float16_t float16x8_t;
30 #ifdef __aarch64__
31 typedef __attribute__((neon_vector_type(2))) float64_t float64x2_t;
32 #endif
33 typedef __attribute__((neon_polyvector_type(16))) poly8_t  poly8x16_t;
34 typedef __attribute__((neon_polyvector_type(8)))  poly16_t poly16x8_t;
35 
36 #if defined(__ARM_FEATURE_BF16)
37 typedef __attribute__((neon_vector_type(4))) __bf16 bfloat16x4_t;
38 #endif
39 
40 // CHECK: 16__simd64_int32_t
41 // CHECK-AARCH64: 11__Int32x2_t
f1(int32x2_t v)42 void f1(int32x2_t v) { }
43 
44 // CHECK: 17__simd128_int32_t
45 // CHECK-AARCH64: 11__Int32x4_t
f2(int32x4_t v)46 void f2(int32x4_t v) { }
47 
48 // CHECK: 17__simd64_uint64_t
49 // CHECK-AARCH64: 12__Uint64x1_t
f3(uint64x1_t v)50 void f3(uint64x1_t v) { }
51 
52 // CHECK: 18__simd128_uint64_t
53 // CHECK-AARCH64: 12__Uint64x2_t
f4(uint64x2_t v)54 void f4(uint64x2_t v) { }
55 
56 // CHECK: 18__simd64_float32_t
57 // CHECK-AARCH64: 13__Float32x2_t
f5(float32x2_t v)58 void f5(float32x2_t v) { }
59 
60 // CHECK: 19__simd128_float32_t
61 // CHECK-AARCH64: 13__Float32x4_t
f6(float32x4_t v)62 void f6(float32x4_t v) { }
63 
64 // CHECK: 18__simd64_float16_t
65 // CHECK-AARCH64: 13__Float16x4_t
f7(float16x4_t v)66 void f7(float16x4_t v) {}
67 
68 // CHECK: 19__simd128_float16_t
69 // CHECK-AARCH64: 13__Float16x8_t
f8(float16x8_t v)70 void f8(float16x8_t v) {}
71 
72 // CHECK: 17__simd128_poly8_t
73 // CHECK-AARCH64: 12__Poly8x16_t
f9(poly8x16_t v)74 void f9(poly8x16_t v) {}
75 
76 // CHECK: 18__simd128_poly16_t
77 // CHECK-AARCH64: 12__Poly16x8_t
f10(poly16x8_t v)78 void f10(poly16x8_t v) {}
79 
80 #ifdef __aarch64__
81 // CHECK-AARCH64: 13__Float64x2_t
f11(float64x2_t v)82 void f11(float64x2_t v) { }
83 #endif
84 
85 #if defined(__ARM_FEATURE_BF16)
86 // CHECK-AARCH64-BF16: 14__Bfloat16x4_t
f12(bfloat16x4_t v)87 void f12(bfloat16x4_t v) {}
88 #endif
89