Debian Codegraph @

clang/test/Sema/aarch64-neon-immediate-ranges/extract-vector-from-vectors.c

raw
1 // RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -ffreestanding -fsyntax-only -verify %s
2
3 #include <arm_neon.h>
4 // REQUIRES: aarch64-registered-target
5
6 void test_extract_vector_from_a_pair_of_vectors_s8(int8x8_t arg_i8x8, int8x16_t arg_i8x16) {
7 vext_s8(arg_i8x8, arg_i8x8, 0);
8 vext_s8(arg_i8x8, arg_i8x8, 7);
9 vext_s8(arg_i8x8, arg_i8x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
10 vext_s8(arg_i8x8, arg_i8x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}
11
12 vextq_s8(arg_i8x16, arg_i8x16, 0);
13 vextq_s8(arg_i8x16, arg_i8x16, 15);
14 vextq_s8(arg_i8x16, arg_i8x16, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
15 vextq_s8(arg_i8x16, arg_i8x16, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}
16
17 }
18
19 void test_extract_vector_from_a_pair_of_vectors_s16(int16x8_t arg_i16x8, int16x4_t arg_i16x4) {
20 vext_s16(arg_i16x4, arg_i16x4, 0);
21 vext_s16(arg_i16x4, arg_i16x4, 3);
22 vext_s16(arg_i16x4, arg_i16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
23 vext_s16(arg_i16x4, arg_i16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}
24
25 vextq_s16(arg_i16x8, arg_i16x8, 0);
26 vextq_s16(arg_i16x8, arg_i16x8, 7);
27 vextq_s16(arg_i16x8, arg_i16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
28 vextq_s16(arg_i16x8, arg_i16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}
29
30 }
31
32 void test_extract_vector_from_a_pair_of_vectors_s32(int32x2_t arg_i32x2, int32x4_t arg_i32x4) {
33 vext_s32(arg_i32x2, arg_i32x2, 0);
34 vext_s32(arg_i32x2, arg_i32x2, 1);
35 vext_s32(arg_i32x2, arg_i32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
36 vext_s32(arg_i32x2, arg_i32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}
37
38 vextq_s32(arg_i32x4, arg_i32x4, 0);
39 vextq_s32(arg_i32x4, arg_i32x4, 3);
40 vextq_s32(arg_i32x4, arg_i32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
41 vextq_s32(arg_i32x4, arg_i32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}
42
43 }
44
45 void test_extract_vector_from_a_pair_of_vectors_s64(int64x2_t arg_i64x2, int64x1_t arg_i64x1) {
46 vext_s64(arg_i64x1, arg_i64x1, 0);
47 vext_s64(arg_i64x1, arg_i64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
48 vext_s64(arg_i64x1, arg_i64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
49
50 vextq_s64(arg_i64x2, arg_i64x2, 0);
51 vextq_s64(arg_i64x2, arg_i64x2, 1);
52 vextq_s64(arg_i64x2, arg_i64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
53 vextq_s64(arg_i64x2, arg_i64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}
54
55 }
56
57 void test_extract_vector_from_a_pair_of_vectors_u8(uint8x8_t arg_u8x8, uint8x16_t arg_u8x16) {
58 vext_u8(arg_u8x8, arg_u8x8, 0);
59 vext_u8(arg_u8x8, arg_u8x8, 7);
60 vext_u8(arg_u8x8, arg_u8x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
61 vext_u8(arg_u8x8, arg_u8x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}
62
63 vextq_u8(arg_u8x16, arg_u8x16, 0);
64 vextq_u8(arg_u8x16, arg_u8x16, 15);
65 vextq_u8(arg_u8x16, arg_u8x16, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
66 vextq_u8(arg_u8x16, arg_u8x16, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}
67
68 }
69
70 void test_extract_vector_from_a_pair_of_vectors_u16(uint16x4_t arg_u16x4, uint16x8_t arg_u16x8) {
71 vext_u16(arg_u16x4, arg_u16x4, 0);
72 vext_u16(arg_u16x4, arg_u16x4, 3);
73 vext_u16(arg_u16x4, arg_u16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
74 vext_u16(arg_u16x4, arg_u16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}
75
76 vextq_u16(arg_u16x8, arg_u16x8, 0);
77 vextq_u16(arg_u16x8, arg_u16x8, 7);
78 vextq_u16(arg_u16x8, arg_u16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
79 vextq_u16(arg_u16x8, arg_u16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}
80
81 }
82
83 void test_extract_vector_from_a_pair_of_vectors_u32(uint32x2_t arg_u32x2, uint32x4_t arg_u32x4) {
84 vext_u32(arg_u32x2, arg_u32x2, 0);
85 vext_u32(arg_u32x2, arg_u32x2, 1);
86 vext_u32(arg_u32x2, arg_u32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
87 vext_u32(arg_u32x2, arg_u32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}
88
89 vextq_u32(arg_u32x4, arg_u32x4, 0);
90 vextq_u32(arg_u32x4, arg_u32x4, 3);
91 vextq_u32(arg_u32x4, arg_u32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
92 vextq_u32(arg_u32x4, arg_u32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}
93
94 }
95
96 void test_extract_vector_from_a_pair_of_vectors_u64(uint64x1_t arg_u64x1, uint64x2_t arg_u64x2) {
97 vext_u64(arg_u64x1, arg_u64x1, 0);
98 vext_u64(arg_u64x1, arg_u64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
99 vext_u64(arg_u64x1, arg_u64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
100
101 vextq_u64(arg_u64x2, arg_u64x2, 0);
102 vextq_u64(arg_u64x2, arg_u64x2, 1);
103 vextq_u64(arg_u64x2, arg_u64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
104 vextq_u64(arg_u64x2, arg_u64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}
105
106 }
107
108 void test_extract_vector_from_a_pair_of_vectors_p64(poly64x2_t arg_p64x2, poly64x1_t arg_p64x1) {
109 vext_p64(arg_p64x1, arg_p64x1, 0);
110 vext_p64(arg_p64x1, arg_p64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
111 vext_p64(arg_p64x1, arg_p64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
112
113 vextq_p64(arg_p64x2, arg_p64x2, 0);
114 vextq_p64(arg_p64x2, arg_p64x2, 1);
115 vextq_p64(arg_p64x2, arg_p64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
116 vextq_p64(arg_p64x2, arg_p64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}
117
118 }
119
120 void test_extract_vector_from_a_pair_of_vectors_f32(float32x2_t arg_f32x2, float32x4_t arg_f32x4) {
121 vext_f32(arg_f32x2, arg_f32x2, 0);
122 vext_f32(arg_f32x2, arg_f32x2, 1);
123 vext_f32(arg_f32x2, arg_f32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
124 vext_f32(arg_f32x2, arg_f32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}
125
126 vextq_f32(arg_f32x4, arg_f32x4, 0);
127 vextq_f32(arg_f32x4, arg_f32x4, 3);
128 vextq_f32(arg_f32x4, arg_f32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
129 vextq_f32(arg_f32x4, arg_f32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}
130
131 }
132
133 void test_extract_vector_from_a_pair_of_vectors_f64(float64x2_t arg_f64x2, float64x1_t arg_f64x1) {
134 vext_f64(arg_f64x1, arg_f64x1, 0);
135 vext_f64(arg_f64x1, arg_f64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
136 vext_f64(arg_f64x1, arg_f64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
137
138 vextq_f64(arg_f64x2, arg_f64x2, 0);
139 vextq_f64(arg_f64x2, arg_f64x2, 1);
140 vextq_f64(arg_f64x2, arg_f64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
141 vextq_f64(arg_f64x2, arg_f64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}
142
143 }
144
145 void test_extract_vector_from_a_pair_of_vectors_p8(poly8x8_t arg_p8x8, poly8x16_t arg_p8x16) {
146 vext_p8(arg_p8x8, arg_p8x8, 0);
147 vext_p8(arg_p8x8, arg_p8x8, 7);
148 vext_p8(arg_p8x8, arg_p8x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
149 vext_p8(arg_p8x8, arg_p8x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}
150
151 vextq_p8(arg_p8x16, arg_p8x16, 0);
152 vextq_p8(arg_p8x16, arg_p8x16, 15);
153 vextq_p8(arg_p8x16, arg_p8x16, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
154 vextq_p8(arg_p8x16, arg_p8x16, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}
155
156 }
157
158 void test_extract_vector_from_a_pair_of_vectors_p16(poly16x8_t arg_p16x8, poly16x4_t arg_p16x4) {
159 vext_p16(arg_p16x4, arg_p16x4, 0);
160 vext_p16(arg_p16x4, arg_p16x4, 3);
161 vext_p16(arg_p16x4, arg_p16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
162 vext_p16(arg_p16x4, arg_p16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}
163
164 vextq_p16(arg_p16x8, arg_p16x8, 0);
165 vextq_p16(arg_p16x8, arg_p16x8, 7);
166 vextq_p16(arg_p16x8, arg_p16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
167 vextq_p16(arg_p16x8, arg_p16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}
168
169 }
170