Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/simd/ext_p8.x

raw
1 extern void abort (void);
2
3 poly8x8_t
4 test_vext_p8_1 (poly8x8_t a, poly8x8_t b)
5 {
6 return vext_p8 (a, b, 1);
7 }
8
9 poly8x8_t
10 test_vext_p8_2 (poly8x8_t a, poly8x8_t b)
11 {
12 return vext_p8 (a, b, 2);
13 }
14
15 poly8x8_t
16 test_vext_p8_3 (poly8x8_t a, poly8x8_t b)
17 {
18 return vext_p8 (a, b, 3);
19 }
20
21 poly8x8_t
22 test_vext_p8_4 (poly8x8_t a, poly8x8_t b)
23 {
24 return vext_p8 (a, b, 4);
25 }
26
27 poly8x8_t
28 test_vext_p8_5 (poly8x8_t a, poly8x8_t b)
29 {
30 return vext_p8 (a, b, 5);
31 }
32
33 poly8x8_t
34 test_vext_p8_6 (poly8x8_t a, poly8x8_t b)
35 {
36 return vext_p8 (a, b, 6);
37 }
38
39 poly8x8_t
40 test_vext_p8_7 (poly8x8_t a, poly8x8_t b)
41 {
42 return vext_p8 (a, b, 7);
43 }
44
45 int
46 main (int argc, char **argv)
47 {
48 int i, off;
49 poly8_t arr1[] = {0, 1, 2, 3, 4, 5, 6, 7};
50 poly8x8_t in1 = vld1_p8 (arr1);
51 poly8_t arr2[] = {8, 9, 10, 11, 12, 13, 14, 15};
52 poly8x8_t in2 = vld1_p8 (arr2);
53 poly8_t exp[8];
54 poly8x8_t expected;
55 poly8x8_t actual = test_vext_p8_1 (in1, in2);
56
57 for (i = 0; i < 8; i++)
58 exp[i] = i + 1;
59 expected = vld1_p8 (exp);
60 for (i = 0; i < 8; i++)
61 if (actual[i] != expected[i])
62 abort ();
63
64 actual = test_vext_p8_2 (in1, in2);
65 for (i = 0; i < 8; i++)
66 exp[i] = i + 2;
67 expected = vld1_p8 (exp);
68 for (i = 0; i < 8; i++)
69 if (actual[i] != expected[i])
70 abort ();
71
72 actual = test_vext_p8_3 (in1, in2);
73 for (i = 0; i < 8; i++)
74 exp[i] = i + 3;
75 expected = vld1_p8 (exp);
76 for (i = 0; i < 8; i++)
77 if (actual[i] != expected[i])
78 abort ();
79
80 actual = test_vext_p8_4 (in1, in2);
81 for (i = 0; i < 8; i++)
82 exp[i] = i + 4;
83 expected = vld1_p8 (exp);
84 for (i = 0; i < 8; i++)
85 if (actual[i] != expected[i])
86 abort ();
87
88 actual = test_vext_p8_5 (in1, in2);
89 for (i = 0; i < 8; i++)
90 exp[i] = i + 5;
91 expected = vld1_p8 (exp);
92 for (i = 0; i < 8; i++)
93 if (actual[i] != expected[i])
94 abort ();
95
96 actual = test_vext_p8_6 (in1, in2);
97 for (i = 0; i < 8; i++)
98 exp[i] = i + 6;
99 expected = vld1_p8 (exp);
100 for (i = 0; i < 8; i++)
101 if (actual[i] != expected[i])
102 abort ();
103
104 actual = test_vext_p8_7 (in1, in2);
105 for (i = 0; i < 8; i++)
106 exp[i] = i + 7;
107 expected = vld1_p8 (exp);
108 for (i = 0; i < 8; i++)
109 if (actual[i] != expected[i])
110 abort ();
111
112 return 0;
113 }
114