1 /* Template file for the validation of comparison operator with
2 floating-point support.
4 This file is meant to be included by the relevant test files, which
5 have to define the intrinsic family to test. If a given intrinsic
6 supports variants which are not supported by all the other
7 operators, these can be tested by providing a definition for
11 #include "arm-neon-ref.h"
12 #include "compute-ref-data.h"
14 /* Additional expected results declaration, they are initialized in
16 extern ARRAY(expected2, uint, 32, 2);
17 extern ARRAY(expected2, uint, 32, 4);
19 #define FNNAME1(NAME) exec_ ## NAME
20 #define FNNAME(NAME) FNNAME1(NAME)
22 void FNNAME (INSN_NAME) (void)
24 /* Basic test: y=vcomp(x1,x2), then store the result. */
25 #define TEST_VCOMP1(INSN, Q, T1, T2, T3, W, N) \
26 VECT_VAR(vector_res, T3, W, N) = \
27 INSN##Q##_##T2##W(VECT_VAR(vector, T1, W, N), \
28 VECT_VAR(vector2, T1, W, N)); \
29 vst1##Q##_u##W(VECT_VAR(result, T3, W, N), VECT_VAR(vector_res, T3, W, N))
31 #define TEST_VCOMP(INSN, Q, T1, T2, T3, W, N) \
32 TEST_VCOMP1(INSN, Q, T1, T2, T3, W, N)
34 DECL_VARIABLE(vector, float, 32, 2);
35 DECL_VARIABLE(vector, float, 32, 4);
36 DECL_VARIABLE(vector2, float, 32, 2);
37 DECL_VARIABLE(vector2, float, 32, 4);
38 DECL_VARIABLE(vector_res, uint, 32, 2);
39 DECL_VARIABLE(vector_res, uint, 32, 4);
43 /* Initialize input "vector" from "buffer". */
44 VLOAD(vector, buffer, , float, f, 32, 2);
45 VLOAD(vector, buffer, q, float, f, 32, 4);
47 /* Choose init value arbitrarily, will be used for vector
49 VDUP(vector2, , float, f, 32, 2, -16.0f);
50 VDUP(vector2, q, float, f, 32, 4, -14.0f);
52 /* Apply operator named INSN_NAME. */
53 TEST_VCOMP(INSN_NAME, , float, f, uint, 32, 2);
54 CHECK(TEST_MSG, uint, 32, 2, PRIx32, expected, "");
56 TEST_VCOMP(INSN_NAME, q, float, f, uint, 32, 4);
57 CHECK(TEST_MSG, uint, 32, 4, PRIx32, expected, "");
59 /* Test again, with different input values. */
60 VDUP(vector2, , float, f, 32, 2, -10.0f);
61 VDUP(vector2, q, float, f, 32, 4, 10.0f);
63 TEST_VCOMP(INSN_NAME, , float, f, uint, 32, 2);
64 CHECK(TEST_MSG, uint, 32, 2, PRIx32, expected2, "");
66 TEST_VCOMP(INSN_NAME, q, float, f, uint, 32, 4);
67 CHECK(TEST_MSG, uint, 32, 4, PRIx32, expected2,"");
72 FNNAME (INSN_NAME) ();