1 extern void abort (void);
2 
3 int8x16_t
test_vextq_s8_1(int8x16_t a,int8x16_t b)4 test_vextq_s8_1 (int8x16_t a, int8x16_t b)
5 {
6   return vextq_s8 (a, b, 1);
7 }
8 
9 int8x16_t
test_vextq_s8_2(int8x16_t a,int8x16_t b)10 test_vextq_s8_2 (int8x16_t a, int8x16_t b)
11 {
12   return vextq_s8 (a, b, 2);
13 }
14 
15 int8x16_t
test_vextq_s8_3(int8x16_t a,int8x16_t b)16 test_vextq_s8_3 (int8x16_t a, int8x16_t b)
17 {
18   return vextq_s8 (a, b, 3);
19 }
20 
21 int8x16_t
test_vextq_s8_4(int8x16_t a,int8x16_t b)22 test_vextq_s8_4 (int8x16_t a, int8x16_t b)
23 {
24   return vextq_s8 (a, b, 4);
25 }
26 
27 int8x16_t
test_vextq_s8_5(int8x16_t a,int8x16_t b)28 test_vextq_s8_5 (int8x16_t a, int8x16_t b)
29 {
30   return vextq_s8 (a, b, 5);
31 }
32 
33 int8x16_t
test_vextq_s8_6(int8x16_t a,int8x16_t b)34 test_vextq_s8_6 (int8x16_t a, int8x16_t b)
35 {
36   return vextq_s8 (a, b, 6);
37 }
38 
39 int8x16_t
test_vextq_s8_7(int8x16_t a,int8x16_t b)40 test_vextq_s8_7 (int8x16_t a, int8x16_t b)
41 {
42   return vextq_s8 (a, b, 7);
43 }
44 
45 int8x16_t
test_vextq_s8_8(int8x16_t a,int8x16_t b)46 test_vextq_s8_8 (int8x16_t a, int8x16_t b)
47 {
48   return vextq_s8 (a, b, 8);
49 }
50 
51 int8x16_t
test_vextq_s8_9(int8x16_t a,int8x16_t b)52 test_vextq_s8_9 (int8x16_t a, int8x16_t b)
53 {
54   return vextq_s8 (a, b, 9);
55 }
56 
57 int8x16_t
test_vextq_s8_10(int8x16_t a,int8x16_t b)58 test_vextq_s8_10 (int8x16_t a, int8x16_t b)
59 {
60   return vextq_s8 (a, b, 10);
61 }
62 
63 int8x16_t
test_vextq_s8_11(int8x16_t a,int8x16_t b)64 test_vextq_s8_11 (int8x16_t a, int8x16_t b)
65 {
66   return vextq_s8 (a, b, 11);
67 }
68 
69 int8x16_t
test_vextq_s8_12(int8x16_t a,int8x16_t b)70 test_vextq_s8_12 (int8x16_t a, int8x16_t b)
71 {
72   return vextq_s8 (a, b, 12);
73 }
74 
75 int8x16_t
test_vextq_s8_13(int8x16_t a,int8x16_t b)76 test_vextq_s8_13 (int8x16_t a, int8x16_t b)
77 {
78   return vextq_s8 (a, b, 13);
79 }
80 
81 int8x16_t
test_vextq_s8_14(int8x16_t a,int8x16_t b)82 test_vextq_s8_14 (int8x16_t a, int8x16_t b)
83 {
84   return vextq_s8 (a, b, 14);
85 }
86 
87 int8x16_t
test_vextq_s8_15(int8x16_t a,int8x16_t b)88 test_vextq_s8_15 (int8x16_t a, int8x16_t b)
89 {
90   return vextq_s8 (a, b, 15);
91 }
92 
93 int
main(int argc,char ** argv)94 main (int argc, char **argv)
95 {
96   int i;
97   int8_t arr1[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
98   int8x16_t in1 = vld1q_s8 (arr1);
99   int8_t arr2[] =
100       {16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31};
101   int8x16_t in2 = vld1q_s8 (arr2);
102   int8_t exp[16];
103   int8x16_t expected;
104   int8x16_t actual = test_vextq_s8_1 (in1, in2);
105 
106   for (i = 0; i < 16; i++)
107     exp[i] = i + 1;
108   expected = vld1q_s8 (exp);
109   for (i = 0; i < 16; i++)
110     if (actual[i] != expected[i])
111       abort ();
112 
113   actual = test_vextq_s8_2 (in1, in2);
114   for (i = 0; i < 16; i++)
115     exp[i] = i + 2;
116   expected = vld1q_s8 (exp);
117   for (i = 0; i < 16; i++)
118     if (actual[i] != expected[i])
119       abort ();
120 
121   actual = test_vextq_s8_3 (in1, in2);
122   for (i = 0; i < 16; i++)
123     exp[i] = i + 3;
124   expected = vld1q_s8 (exp);
125   for (i = 0; i < 16; i++)
126     if (actual[i] != expected[i])
127       abort ();
128 
129   actual = test_vextq_s8_4 (in1, in2);
130   for (i = 0; i < 16; i++)
131     exp[i] = i + 4;
132   expected = vld1q_s8 (exp);
133   for (i = 0; i < 16; i++)
134     if (actual[i] != expected[i])
135       abort ();
136 
137   actual = test_vextq_s8_5 (in1, in2);
138   for (i = 0; i < 16; i++)
139     exp[i] = i + 5;
140   expected = vld1q_s8 (exp);
141   for (i = 0; i < 16; i++)
142     if (actual[i] != expected[i])
143       abort ();
144 
145   actual = test_vextq_s8_6 (in1, in2);
146   for (i = 0; i < 16; i++)
147     exp[i] = i + 6;
148   expected = vld1q_s8 (exp);
149   for (i = 0; i < 16; i++)
150     if (actual[i] != expected[i])
151       abort ();
152 
153   actual = test_vextq_s8_7 (in1, in2);
154   for (i = 0; i < 16; i++)
155     exp[i] = i + 7;
156   expected = vld1q_s8 (exp);
157   for (i = 0; i < 16; i++)
158     if (actual[i] != expected[i])
159       abort ();
160 
161   actual = test_vextq_s8_8 (in1, in2);
162   for (i = 0; i < 16; i++)
163     exp[i] = i + 8;
164   expected = vld1q_s8 (exp);
165   for (i = 0; i < 16; i++)
166     if (actual[i] != expected[i])
167       abort ();
168 
169   actual = test_vextq_s8_9 (in1, in2);
170   for (i = 0; i < 16; i++)
171     exp[i] = i + 9;
172   expected = vld1q_s8 (exp);
173   for (i = 0; i < 16; i++)
174     if (actual[i] != expected[i])
175       abort ();
176 
177   actual = test_vextq_s8_10 (in1, in2);
178   for (i = 0; i < 16; i++)
179     exp[i] = i + 10;
180   expected = vld1q_s8 (exp);
181   for (i = 0; i < 16; i++)
182     if (actual[i] != expected[i])
183       abort ();
184 
185   actual = test_vextq_s8_11 (in1, in2);
186   for (i = 0; i < 16; i++)
187     exp[i] = i + 11;
188   expected = vld1q_s8 (exp);
189   for (i = 0; i < 16; i++)
190     if (actual[i] != expected[i])
191       abort ();
192 
193   actual = test_vextq_s8_12 (in1, in2);
194   for (i = 0; i < 16; i++)
195     exp[i] = i + 12;
196   expected = vld1q_s8 (exp);
197   for (i = 0; i < 16; i++)
198     if (actual[i] != expected[i])
199       abort ();
200 
201   actual = test_vextq_s8_13 (in1, in2);
202   for (i = 0; i < 16; i++)
203     exp[i] = i + 13;
204   expected = vld1q_s8 (exp);
205   for (i = 0; i < 16; i++)
206     if (actual[i] != expected[i])
207       abort ();
208 
209   actual = test_vextq_s8_14 (in1, in2);
210   for (i = 0; i < 16; i++)
211     exp[i] = i + 14;
212   expected = vld1q_s8 (exp);
213   for (i = 0; i < 16; i++)
214     if (actual[i] != expected[i])
215       abort ();
216 
217   actual = test_vextq_s8_15 (in1, in2);
218   for (i = 0; i < 16; i++)
219     exp[i] = i + 15;
220   expected = vld1q_s8 (exp);
221   for (i = 0; i < 16; i++)
222     if (actual[i] != expected[i])
223       abort ();
224 
225   return 0;
226 }
227 
228