1 #define INSN_NAME vceq
2 #define TEST_MSG "VCEQ/VCEQQ"
3 
4 /* Extra tests for _p8 variants, which exist only for vceq.  */
5 void exec_vceq_p8(void);
6 #define EXTRA_TESTS exec_vceq_p8
7 
8 #include "cmp_op.inc"
9 
10 /* Expected results.  */
11 VECT_VAR_DECL(expected,uint,8,8) [] = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0x0 };
12 VECT_VAR_DECL(expected,uint,16,4) [] = { 0x0, 0x0, 0xffff, 0x0 };
13 VECT_VAR_DECL(expected,uint,32,2) [] = { 0xffffffff, 0x0 };
14 VECT_VAR_DECL(expected,uint,8,16) [] = { 0x0, 0x0, 0x0, 0x0,
15 					 0x0, 0x0, 0x0, 0x0,
16 					 0x0, 0x0, 0x0, 0x0,
17 					 0xff, 0x0, 0x0, 0x0 };
18 VECT_VAR_DECL(expected,uint,16,8) [] = { 0x0, 0x0, 0x0, 0x0,
19 					 0x0, 0x0, 0xffff, 0x0 };
20 VECT_VAR_DECL(expected,uint,32,4) [] = { 0x0, 0x0, 0xffffffff, 0x0 };
21 
22 VECT_VAR_DECL(expected_uint,uint,8,8) [] = { 0x0, 0x0, 0x0, 0xff,
23 					     0x0, 0x0, 0x0, 0x0 };
24 VECT_VAR_DECL(expected_uint,uint,16,4) [] = { 0x0, 0x0, 0xffff, 0x0 };
25 VECT_VAR_DECL(expected_uint,uint,32,2) [] = { 0x0, 0xffffffff };
26 
27 VECT_VAR_DECL(expected_q_uint,uint,8,16) [] = { 0x0, 0x0, 0x0, 0x0,
28 						0xff, 0x0, 0x0, 0x0,
29 						0, 0x0, 0x0, 0x0,
30 						0x0, 0x0, 0x0, 0x0 };
31 VECT_VAR_DECL(expected_q_uint,uint,16,8) [] = { 0x0, 0x0, 0x0, 0x0,
32 						0x0, 0x0, 0xffff, 0x0 };
33 VECT_VAR_DECL(expected_q_uint,uint,32,4) [] = { 0x0, 0x0, 0xffffffff, 0x0 };
34 
35 #if defined (__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)
36 VECT_VAR_DECL (expected_float, uint, 16, 4) [] = { 0x0, 0xffff, 0x0, 0x0 };
37 VECT_VAR_DECL (expected_q_float, uint, 16, 8) [] = { 0x0, 0x0, 0xffff, 0x0,
38 						     0x0, 0x0, 0x0, 0x0, };
39 #endif
40 
41 VECT_VAR_DECL(expected_float,uint,32,2) [] = { 0x0, 0xffffffff };
42 VECT_VAR_DECL(expected_q_float,uint,32,4) [] = { 0x0, 0x0, 0xffffffff, 0x0 };
43 
44 VECT_VAR_DECL(expected_uint2,uint,32,2) [] = { 0xffffffff, 0x0 };
45 VECT_VAR_DECL(expected_uint3,uint,32,2) [] = { 0x0, 0xffffffff };
46 VECT_VAR_DECL(expected_uint4,uint,32,2) [] = { 0xffffffff, 0x0 };
47 
48 #if defined (__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)
49 VECT_VAR_DECL (expected_nan, uint, 16, 4) [] = { 0x0, 0x0, 0x0, 0x0  };
50 VECT_VAR_DECL (expected_mnan, uint, 16, 4) [] = { 0x0, 0x0, 0x0, 0x0 };
51 VECT_VAR_DECL (expected_nan2, uint, 16, 4) [] = { 0x0, 0x0, 0x0, 0x0 };
52 
53 VECT_VAR_DECL (expected_inf, uint, 16, 4) [] = { 0x0, 0x0, 0x0, 0x0 };
54 VECT_VAR_DECL (expected_minf, uint, 16, 4) [] = { 0x0, 0x0, 0x0, 0x0 };
55 VECT_VAR_DECL (expected_inf2, uint, 16, 4) [] = { 0x0, 0x0, 0x0, 0x0 };
56 VECT_VAR_DECL (expected_mzero, uint, 16, 4) [] = { 0xffff, 0xffff,
57 						   0xffff, 0xffff };
58 #endif
59 
60 VECT_VAR_DECL(expected_nan,uint,32,2) [] = { 0x0, 0x0 };
61 VECT_VAR_DECL(expected_mnan,uint,32,2) [] = { 0x0, 0x0 };
62 VECT_VAR_DECL(expected_nan2,uint,32,2) [] = { 0x0, 0x0 };
63 
64 VECT_VAR_DECL(expected_inf,uint,32,2) [] = { 0x0, 0x0 };
65 VECT_VAR_DECL(expected_minf,uint,32,2) [] = { 0x0, 0x0 };
66 VECT_VAR_DECL(expected_inf2,uint,32,2) [] = { 0x0, 0x0 };
67 
68 VECT_VAR_DECL(expected_mzero,uint,32,2) [] = { 0xffffffff, 0xffffffff };
69 
70 VECT_VAR_DECL(expected_p8,uint,8,8) [] = { 0x0, 0x0, 0x0, 0xff,
71 					   0x0, 0x0, 0x0, 0x0 };
72 VECT_VAR_DECL(expected_q_p8,uint,8,16) [] = { 0x0, 0x0, 0x0, 0x0,
73 					      0xff, 0x0, 0x0, 0x0,
74 					      0x0, 0x0, 0x0, 0x0,
75 					      0x0, 0x0, 0x0, 0x0 };
76 
exec_vceq_p8(void)77 void exec_vceq_p8(void)
78 {
79   DECL_VARIABLE(vector, poly, 8, 8);
80   DECL_VARIABLE(vector, poly, 8, 16);
81 
82   DECL_VARIABLE(vector2, poly, 8, 8);
83   DECL_VARIABLE(vector2, poly, 8, 16);
84 
85   DECL_VARIABLE(vector_res, uint, 8, 8);
86   DECL_VARIABLE(vector_res, uint, 8, 16);
87 
88   clean_results ();
89 
90   VLOAD(vector, buffer, , poly, p, 8, 8);
91   VLOAD(vector, buffer, q, poly, p, 8, 16);
92 
93   VDUP(vector2, , poly, p, 8, 8, 0xF3);
94   VDUP(vector2, q, poly, p, 8, 16, 0xF4);
95 
96   TEST_VCOMP(INSN_NAME, , poly, p, uint, 8, 8);
97   TEST_VCOMP(INSN_NAME, q, poly, p, uint, 8, 16);
98 
99   CHECK(TEST_MSG, uint, 8, 8, PRIx8, expected_p8, "p8");
100   CHECK(TEST_MSG, uint, 8, 16, PRIx8, expected_q_p8, "p8");
101 }
102