[ARM,AArch64][testsuite] AdvSIMD intrinsics tests cleanup: remove useless expected...
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / advsimd-intrinsics / vcreate.c
blobb2289d3a628245835f8359c8770d83b15b13e931
1 #include <arm_neon.h>
2 #include "arm-neon-ref.h"
3 #include "compute-ref-data.h"
5 /* Expected results. */
6 VECT_VAR_DECL(expected,int,8,8) [] = { 0xf0, 0xde, 0xbc, 0x9a,
7 0x78, 0x56, 0x34, 0x12 };
8 VECT_VAR_DECL(expected,int,16,4) [] = { 0xdef0, 0x9abc, 0x5678, 0x1234 };
9 VECT_VAR_DECL(expected,int,32,2) [] = { 0x9abcdef0, 0x12345678 };
10 VECT_VAR_DECL(expected,int,64,1) [] = { 0x123456789abcdef0 };
11 VECT_VAR_DECL(expected,uint,8,8) [] = { 0xf0, 0xde, 0xbc, 0x9a,
12 0x78, 0x56, 0x34, 0x12 };
13 VECT_VAR_DECL(expected,uint,16,4) [] = { 0xdef0, 0x9abc, 0x5678, 0x1234 };
14 VECT_VAR_DECL(expected,uint,32,2) [] = { 0x9abcdef0, 0x12345678 };
15 VECT_VAR_DECL(expected,uint,64,1) [] = { 0x123456789abcdef0 };
16 VECT_VAR_DECL(expected,poly,8,8) [] = { 0xf0, 0xde, 0xbc, 0x9a,
17 0x78, 0x56, 0x34, 0x12 };
18 VECT_VAR_DECL(expected,poly,16,4) [] = { 0xdef0, 0x9abc, 0x5678, 0x1234 };
19 VECT_VAR_DECL(expected,hfloat,32,2) [] = { 0x9abcdef0, 0x12345678 };
21 #define INSN_NAME vcreate
22 #define TEST_MSG "VCREATE"
24 #define FNNAME1(NAME) void exec_ ## NAME (void)
25 #define FNNAME(NAME) FNNAME1(NAME)
27 FNNAME (INSN_NAME)
29 /* Basic test: y=vcreate(x), then store the result. */
30 #define TEST_VCREATE(T1, T2, W, N) \
31 VECT_VAR(vector_res, T1, W, N) = vcreate_##T2##W(VECT_VAR(val, T1, W, N)); \
32 vst1_##T2##W(VECT_VAR(result, T1, W, N), VECT_VAR(vector_res, T1, W, N))
34 #define DECL_VAL(VAR, T1, W, N) \
35 uint64_t VECT_VAR(VAR, T1, W, N)
37 DECL_VAL(val, int, 8, 8);
38 DECL_VAL(val, int, 16, 4);
39 DECL_VAL(val, int, 32, 2);
40 DECL_VAL(val, int, 64, 1);
41 DECL_VAL(val, float, 32, 2);
42 DECL_VAL(val, uint, 8, 8);
43 DECL_VAL(val, uint, 16, 4);
44 DECL_VAL(val, uint, 32, 2);
45 DECL_VAL(val, uint, 64, 1);
46 DECL_VAL(val, poly, 8, 8);
47 DECL_VAL(val, poly, 16, 4);
49 DECL_VARIABLE(vector_res, int, 8, 8);
50 DECL_VARIABLE(vector_res, int, 16, 4);
51 DECL_VARIABLE(vector_res, int, 32, 2);
52 DECL_VARIABLE(vector_res, int, 64, 1);
53 DECL_VARIABLE(vector_res, float, 32, 2);
54 DECL_VARIABLE(vector_res, uint, 8, 8);
55 DECL_VARIABLE(vector_res, uint, 16, 4);
56 DECL_VARIABLE(vector_res, uint, 32, 2);
57 DECL_VARIABLE(vector_res, uint, 64, 1);
58 DECL_VARIABLE(vector_res, poly, 8, 8);
59 DECL_VARIABLE(vector_res, poly, 16, 4);
61 clean_results ();
63 /* Initialize input values arbitrarily. */
64 VECT_VAR(val, int, 8, 8) = 0x123456789abcdef0LL;
65 VECT_VAR(val, int, 16, 4) = 0x123456789abcdef0LL;
66 VECT_VAR(val, int, 32, 2) = 0x123456789abcdef0LL;
67 VECT_VAR(val, int, 64, 1) = 0x123456789abcdef0LL;
68 VECT_VAR(val, float, 32, 2) = 0x123456789abcdef0LL;
69 VECT_VAR(val, uint, 8, 8) = 0x123456789abcdef0ULL;
70 VECT_VAR(val, uint, 16, 4) = 0x123456789abcdef0ULL;
71 VECT_VAR(val, uint, 32, 2) = 0x123456789abcdef0ULL;
72 VECT_VAR(val, uint, 64, 1) = 0x123456789abcdef0ULL;
73 VECT_VAR(val, poly, 8, 8) = 0x123456789abcdef0ULL;
74 VECT_VAR(val, poly, 16, 4) = 0x123456789abcdef0ULL;
76 TEST_VCREATE(int, s, 8, 8);
77 TEST_VCREATE(int, s, 16, 4);
78 TEST_VCREATE(int, s, 32, 2);
79 TEST_VCREATE(float, f, 32, 2);
80 TEST_VCREATE(int, s, 64, 1);
81 TEST_VCREATE(uint, u, 8, 8);
82 TEST_VCREATE(uint, u, 16, 4);
83 TEST_VCREATE(uint, u, 32, 2);
84 TEST_VCREATE(uint, u, 64, 1);
85 TEST_VCREATE(poly, p, 8, 8);
86 TEST_VCREATE(poly, p, 16, 4);
88 CHECK(TEST_MSG, int, 8, 8, PRIx8, expected, "");
89 CHECK(TEST_MSG, int, 16, 4, PRIx16, expected, "");
90 CHECK(TEST_MSG, int, 32, 2, PRIx32, expected, "");
91 CHECK(TEST_MSG, int, 64, 1, PRIx64, expected, "");
92 CHECK(TEST_MSG, uint, 8, 8, PRIx8, expected, "");
93 CHECK(TEST_MSG, uint, 16, 4, PRIx16, expected, "");
94 CHECK(TEST_MSG, uint, 32, 2, PRIx32, expected, "");
95 CHECK(TEST_MSG, uint, 64, 1, PRIx64, expected, "");
96 CHECK(TEST_MSG, poly, 8, 8, PRIx8, expected, "");
97 CHECK(TEST_MSG, poly, 16, 4, PRIx16, expected, "");
98 CHECK_FP(TEST_MSG, float, 32, 2, PRIx32, expected, "");
101 int main (void)
103 exec_vcreate ();
104 return 0;