[ARM,AArch64][testsuite] AdvSIMD intrinsics tests cleanup: remove useless expected...
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / advsimd-intrinsics / vcombine.c
blob295768a0348185c663994c8361d063454cc8467a
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,16) [] = { 0xf0, 0xf1, 0xf2, 0xf3,
7 0xf4, 0xf5, 0xf6, 0xf7,
8 0x11, 0x11, 0x11, 0x11,
9 0x11, 0x11, 0x11, 0x11 };
10 VECT_VAR_DECL(expected,int,16,8) [] = { 0xfff0, 0xfff1, 0xfff2, 0xfff3,
11 0x22, 0x22, 0x22, 0x22 };
12 VECT_VAR_DECL(expected,int,32,4) [] = { 0xfffffff0, 0xfffffff1, 0x33, 0x33 };
13 VECT_VAR_DECL(expected,int,64,2) [] = { 0xfffffffffffffff0, 0x44 };
14 VECT_VAR_DECL(expected,uint,8,16) [] = { 0xf0, 0xf1, 0xf2, 0xf3,
15 0xf4, 0xf5, 0xf6, 0xf7,
16 0x55, 0x55, 0x55, 0x55,
17 0x55, 0x55, 0x55, 0x55 };
18 VECT_VAR_DECL(expected,uint,16,8) [] = { 0xfff0, 0xfff1, 0xfff2, 0xfff3,
19 0x66, 0x66, 0x66, 0x66 };
20 VECT_VAR_DECL(expected,uint,32,4) [] = { 0xfffffff0, 0xfffffff1, 0x77, 0x77 };
21 VECT_VAR_DECL(expected,uint,64,2) [] = { 0xfffffffffffffff0, 0x88 };
22 VECT_VAR_DECL(expected,poly,8,16) [] = { 0xf0, 0xf1, 0xf2, 0xf3,
23 0xf4, 0xf5, 0xf6, 0xf7,
24 0x55, 0x55, 0x55, 0x55,
25 0x55, 0x55, 0x55, 0x55 };
26 VECT_VAR_DECL(expected,poly,16,8) [] = { 0xfff0, 0xfff1, 0xfff2, 0xfff3,
27 0x66, 0x66, 0x66, 0x66 };
28 VECT_VAR_DECL(expected,hfloat,32,4) [] = { 0xc1800000, 0xc1700000,
29 0x40533333, 0x40533333 };
31 #define TEST_MSG "VCOMBINE"
32 void exec_vcombine (void)
34 /* Basic test: vec128=vcombine(vec64_a, vec64_b), then store the result. */
35 #define TEST_VCOMBINE(T1, T2, W, N, N2) \
36 VECT_VAR(vector128, T1, W, N2) = \
37 vcombine_##T2##W(VECT_VAR(vector64_a, T1, W, N), \
38 VECT_VAR(vector64_b, T1, W, N)); \
39 vst1q_##T2##W(VECT_VAR(result, T1, W, N2), VECT_VAR(vector128, T1, W, N2))
41 DECL_VARIABLE_64BITS_VARIANTS(vector64_a);
42 DECL_VARIABLE_64BITS_VARIANTS(vector64_b);
43 DECL_VARIABLE_128BITS_VARIANTS(vector128);
45 /* Initialize input "vector64_a" from "buffer". */
46 TEST_MACRO_64BITS_VARIANTS_2_5(VLOAD, vector64_a, buffer);
47 VLOAD(vector64_a, buffer, , float, f, 32, 2);
49 /* Choose init value arbitrarily. */
50 VDUP(vector64_b, , int, s, 8, 8, 0x11);
51 VDUP(vector64_b, , int, s, 16, 4, 0x22);
52 VDUP(vector64_b, , int, s, 32, 2, 0x33);
53 VDUP(vector64_b, , int, s, 64, 1, 0x44);
54 VDUP(vector64_b, , uint, u, 8, 8, 0x55);
55 VDUP(vector64_b, , uint, u, 16, 4, 0x66);
56 VDUP(vector64_b, , uint, u, 32, 2, 0x77);
57 VDUP(vector64_b, , uint, u, 64, 1, 0x88);
58 VDUP(vector64_b, , poly, p, 8, 8, 0x55);
59 VDUP(vector64_b, , poly, p, 16, 4, 0x66);
60 VDUP(vector64_b, , float, f, 32, 2, 3.3f);
62 clean_results ();
64 /* Execute the tests. */
65 TEST_VCOMBINE(int, s, 8, 8, 16);
66 TEST_VCOMBINE(int, s, 16, 4, 8);
67 TEST_VCOMBINE(int, s, 32, 2, 4);
68 TEST_VCOMBINE(int, s, 64, 1, 2);
69 TEST_VCOMBINE(uint, u, 8, 8, 16);
70 TEST_VCOMBINE(uint, u, 16, 4, 8);
71 TEST_VCOMBINE(uint, u, 32, 2, 4);
72 TEST_VCOMBINE(uint, u, 64, 1, 2);
73 TEST_VCOMBINE(poly, p, 8, 8, 16);
74 TEST_VCOMBINE(poly, p, 16, 4, 8);
75 TEST_VCOMBINE(float, f, 32, 2, 4);
77 CHECK(TEST_MSG, int, 8, 16, PRIx8, expected, "");
78 CHECK(TEST_MSG, int, 16, 8, PRIx16, expected, "");
79 CHECK(TEST_MSG, int, 32, 4, PRIx32, expected, "");
80 CHECK(TEST_MSG, int, 64, 2, PRIx64, expected, "");
81 CHECK(TEST_MSG, uint, 8, 16, PRIx8, expected, "");
82 CHECK(TEST_MSG, uint, 16, 8, PRIx16, expected, "");
83 CHECK(TEST_MSG, uint, 32, 4, PRIx32, expected, "");
84 CHECK(TEST_MSG, uint, 64, 2, PRIx64, expected, "");
85 CHECK(TEST_MSG, poly, 8, 16, PRIx8, expected, "");
86 CHECK(TEST_MSG, poly, 16, 8, PRIx16, expected, "");
87 CHECK_FP(TEST_MSG, float, 32, 4, PRIx32, expected, "");
90 int main (void)
92 exec_vcombine ();
93 return 0;