2014-10-24 Christophe Lyon <christophe.lyon@linaro.org>
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / advsimd-intrinsics / vceq.c
blobaa095dfcf0d25cb343d114658868f3dac213ff73
1 #define INSN_NAME vceq
2 #define TEST_MSG "VCEQ/VCEQQ"
4 /* Extra tests for _p8 variants, which exist only for vceq. */
5 void exec_vceq_p8(void);
6 #define EXTRA_TESTS exec_vceq_p8
8 #include "cmp_op.inc"
10 /* Expected results. */
11 VECT_VAR_DECL(expected,int,8,8) [] = { 0x33, 0x33, 0x33, 0x33,
12 0x33, 0x33, 0x33, 0x33 };
13 VECT_VAR_DECL(expected,int,16,4) [] = { 0x333, 0x3333, 0x3333, 0x3333 };
14 VECT_VAR_DECL(expected,int,32,2) [] = { 0x33333333, 0x33333333 };
15 VECT_VAR_DECL(expected,int,64,1) [] = { 0x3333333333333333 };
16 VECT_VAR_DECL(expected,uint,8,8) [] = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0x0 };
17 VECT_VAR_DECL(expected,uint,16,4) [] = { 0x0, 0x0, 0xffff, 0x0 };
18 VECT_VAR_DECL(expected,uint,32,2) [] = { 0xffffffff, 0x0 };
19 VECT_VAR_DECL(expected,uint,64,1) [] = { 0x3333333333333333 };
20 VECT_VAR_DECL(expected,poly,8,8) [] = { 0x33, 0x33, 0x33, 0x33,
21 0x33, 0x33, 0x33, 0x33 };
22 VECT_VAR_DECL(expected,poly,16,4) [] = { 0x3333, 0x3333, 0x3333, 0x3333 };
23 VECT_VAR_DECL(expected,hfloat,32,2) [] = { 0x33333333, 0x33333333 };
24 VECT_VAR_DECL(expected,int,8,16) [] = { 0x33, 0x33, 0x33, 0x33,
25 0x33, 0x33, 0x33, 0x33,
26 0x33, 0x33, 0x33, 0x33,
27 0x33, 0x33, 0x33, 0x33 };
28 VECT_VAR_DECL(expected,int,16,8) [] = { 0x333, 0x3333, 0x3333, 0x3333,
29 0x333, 0x3333, 0x3333, 0x3333 };
30 VECT_VAR_DECL(expected,int,32,4) [] = { 0x33333333, 0x33333333,
31 0x33333333, 0x33333333 };
32 VECT_VAR_DECL(expected,int,64,2) [] = { 0x3333333333333333,
33 0x3333333333333333 };
34 VECT_VAR_DECL(expected,uint,8,16) [] = { 0x0, 0x0, 0x0, 0x0,
35 0x0, 0x0, 0x0, 0x0,
36 0x0, 0x0, 0x0, 0x0,
37 0xff, 0x0, 0x0, 0x0 };
38 VECT_VAR_DECL(expected,uint,16,8) [] = { 0x0, 0x0, 0x0, 0x0,
39 0x0, 0x0, 0xffff, 0x0 };
40 VECT_VAR_DECL(expected,uint,32,4) [] = { 0x0, 0x0, 0xffffffff, 0x0 };
41 VECT_VAR_DECL(expected,uint,64,2) [] = { 0x3333333333333333,
42 0x3333333333333333 };
43 VECT_VAR_DECL(expected,poly,8,16) [] = { 0x33, 0x33, 0x33, 0x33,
44 0x33, 0x33, 0x33, 0x33,
45 0x33, 0x33, 0x33, 0x33,
46 0x33, 0x33, 0x33, 0x33 };
47 VECT_VAR_DECL(expected,poly,16,8) [] = { 0x3333, 0x3333, 0x3333, 0x3333,
48 0x3333, 0x3333, 0x3333, 0x3333 };
49 VECT_VAR_DECL(expected,hfloat,32,4) [] = { 0x33333333, 0x33333333,
50 0x33333333, 0x33333333 };
52 VECT_VAR_DECL(expected_uint,uint,8,8) [] = { 0x0, 0x0, 0x0, 0xff,
53 0x0, 0x0, 0x0, 0x0 };
54 VECT_VAR_DECL(expected_uint,uint,16,4) [] = { 0x0, 0x0, 0xffff, 0x0 };
55 VECT_VAR_DECL(expected_uint,uint,32,2) [] = { 0x0, 0xffffffff };
57 VECT_VAR_DECL(expected_q_uint,uint,8,16) [] = { 0x0, 0x0, 0x0, 0x0,
58 0xff, 0x0, 0x0, 0x0,
59 0, 0x0, 0x0, 0x0,
60 0x0, 0x0, 0x0, 0x0 };
61 VECT_VAR_DECL(expected_q_uint,uint,16,8) [] = { 0x0, 0x0, 0x0, 0x0,
62 0x0, 0x0, 0xffff, 0x0 };
63 VECT_VAR_DECL(expected_q_uint,uint,32,4) [] = { 0x0, 0x0, 0xffffffff, 0x0 };
65 VECT_VAR_DECL(expected_float,uint,32,2) [] = { 0x0, 0xffffffff };
66 VECT_VAR_DECL(expected_q_float,uint,32,4) [] = { 0x0, 0x0, 0xffffffff, 0x0 };
68 VECT_VAR_DECL(expected_uint2,uint,32,2) [] = { 0xffffffff, 0x0 };
69 VECT_VAR_DECL(expected_uint3,uint,32,2) [] = { 0x0, 0xffffffff };
70 VECT_VAR_DECL(expected_uint4,uint,32,2) [] = { 0xffffffff, 0x0 };
72 VECT_VAR_DECL(expected_nan,uint,32,2) [] = { 0x0, 0x0 };
73 VECT_VAR_DECL(expected_mnan,uint,32,2) [] = { 0x0, 0x0 };
74 VECT_VAR_DECL(expected_nan2,uint,32,2) [] = { 0x0, 0x0 };
76 VECT_VAR_DECL(expected_inf,uint,32,2) [] = { 0x0, 0x0 };
77 VECT_VAR_DECL(expected_minf,uint,32,2) [] = { 0x0, 0x0 };
78 VECT_VAR_DECL(expected_inf2,uint,32,2) [] = { 0x0, 0x0 };
80 VECT_VAR_DECL(expected_mzero,uint,32,2) [] = { 0xffffffff, 0xffffffff };
82 VECT_VAR_DECL(expected_p8,uint,8,8) [] = { 0x0, 0x0, 0x0, 0xff,
83 0x0, 0x0, 0x0, 0x0 };
84 VECT_VAR_DECL(expected_q_p8,uint,8,16) [] = { 0x0, 0x0, 0x0, 0x0,
85 0xff, 0x0, 0x0, 0x0,
86 0x0, 0x0, 0x0, 0x0,
87 0x0, 0x0, 0x0, 0x0 };
89 void exec_vceq_p8(void)
91 DECL_VARIABLE(vector, poly, 8, 8);
92 DECL_VARIABLE(vector, poly, 8, 16);
94 DECL_VARIABLE(vector2, poly, 8, 8);
95 DECL_VARIABLE(vector2, poly, 8, 16);
97 DECL_VARIABLE(vector_res, uint, 8, 8);
98 DECL_VARIABLE(vector_res, uint, 8, 16);
100 clean_results ();
102 VLOAD(vector, buffer, , poly, p, 8, 8);
103 VLOAD(vector, buffer, q, poly, p, 8, 16);
105 VDUP(vector2, , poly, p, 8, 8, 0xF3);
106 VDUP(vector2, q, poly, p, 8, 16, 0xF4);
108 TEST_VCOMP(INSN_NAME, , poly, p, uint, 8, 8);
109 TEST_VCOMP(INSN_NAME, q, poly, p, uint, 8, 16);
111 CHECK(TEST_MSG, uint, 8, 8, PRIx8, expected_p8, "p8");
112 CHECK(TEST_MSG, uint, 8, 16, PRIx8, expected_q_p8, "p8");