1 #define FNNAME1(NAME) exec_ ## NAME ##_n
2 #define FNNAME(NAME) FNNAME1(NAME)
4 void FNNAME (INSN_NAME) (void)
6 /* vector_res = vsxi_n(vector, vector2, val),
7 then store the result. */
8 #define TEST_VSXI_N1(INSN, Q, T1, T2, W, N, V) \
9 VECT_VAR(vector_res, T1, W, N) = \
10 INSN##Q##_n_##T2##W(VECT_VAR(vector, T1, W, N), \
11 VECT_VAR(vector2, T1, W, N), \
13 vst1##Q##_##T2##W(VECT_VAR(result, T1, W, N), VECT_VAR(vector_res, T1, W, N))
15 #define TEST_VSXI_N(INSN, Q, T1, T2, W, N, V) \
16 TEST_VSXI_N1(INSN, Q, T1, T2, W, N, V)
18 DECL_VARIABLE_ALL_VARIANTS(vector);
19 DECL_VARIABLE_ALL_VARIANTS(vector2);
20 DECL_VARIABLE_ALL_VARIANTS(vector_res);
24 /* Initialize input "vector" from "buffer". */
25 TEST_MACRO_ALL_VARIANTS_2_5(VLOAD, vector, buffer);
27 /* Fill input vector2 with arbitrary values. */
28 VDUP(vector2, , int, s, 8, 8, 2);
29 VDUP(vector2, , int, s, 16, 4, -4);
30 VDUP(vector2, , int, s, 32, 2, 3);
31 VDUP(vector2, , int, s, 64, 1, 100);
32 VDUP(vector2, , uint, u, 8, 8, 20);
33 VDUP(vector2, , uint, u, 16, 4, 30);
34 VDUP(vector2, , uint, u, 32, 2, 40);
35 VDUP(vector2, , uint, u, 64, 1, 2);
36 VDUP(vector2, , poly, p, 8, 8, 20);
37 VDUP(vector2, , poly, p, 16, 4, 30);
38 VDUP(vector2, q, int, s, 8, 16, -10);
39 VDUP(vector2, q, int, s, 16, 8, -20);
40 VDUP(vector2, q, int, s, 32, 4, -30);
41 VDUP(vector2, q, int, s, 64, 2, 24);
42 VDUP(vector2, q, uint, u, 8, 16, 12);
43 VDUP(vector2, q, uint, u, 16, 8, 3);
44 VDUP(vector2, q, uint, u, 32, 4, 55);
45 VDUP(vector2, q, uint, u, 64, 2, 3);
46 VDUP(vector2, q, poly, p, 8, 16, 12);
47 VDUP(vector2, q, poly, p, 16, 8, 3);
49 /* Choose shift amount arbitrarily. */
50 TEST_VSXI_N(INSN_NAME, , int, s, 8, 8, 4);
51 TEST_VSXI_N(INSN_NAME, , int, s, 16, 4, 3);
52 TEST_VSXI_N(INSN_NAME, , int, s, 32, 2, 1);
53 TEST_VSXI_N(INSN_NAME, , int, s, 64, 1, 32);
54 TEST_VSXI_N(INSN_NAME, , uint, u, 8, 8, 2);
55 TEST_VSXI_N(INSN_NAME, , uint, u, 16, 4, 10);
56 TEST_VSXI_N(INSN_NAME, , uint, u, 32, 2, 30);
57 TEST_VSXI_N(INSN_NAME, , uint, u, 64, 1, 3);
58 TEST_VSXI_N(INSN_NAME, , poly, p, 8, 8, 2);
59 TEST_VSXI_N(INSN_NAME, , poly, p, 16, 4, 10);
60 TEST_VSXI_N(INSN_NAME, q, int, s, 8, 16, 5);
61 TEST_VSXI_N(INSN_NAME, q, int, s, 16, 8, 3);
62 TEST_VSXI_N(INSN_NAME, q, int, s, 32, 4, 20);
63 TEST_VSXI_N(INSN_NAME, q, int, s, 64, 2, 16);
64 TEST_VSXI_N(INSN_NAME, q, uint, u, 8, 16, 3);
65 TEST_VSXI_N(INSN_NAME, q, uint, u, 16, 8, 12);
66 TEST_VSXI_N(INSN_NAME, q, uint, u, 32, 4, 23);
67 TEST_VSXI_N(INSN_NAME, q, uint, u, 64, 2, 53);
68 TEST_VSXI_N(INSN_NAME, q, poly, p, 8, 16, 3);
69 TEST_VSXI_N(INSN_NAME, q, poly, p, 16, 8, 12);
71 CHECK(TEST_MSG, int, 8, 8, PRIx8, expected, "");
72 CHECK(TEST_MSG, int, 16, 4, PRIx16, expected, "");
73 CHECK(TEST_MSG, int, 32, 2, PRIx32, expected, "");
74 CHECK(TEST_MSG, int, 64, 1, PRIx64, expected, "");
75 CHECK(TEST_MSG, uint, 8, 8, PRIx8, expected, "");
76 CHECK(TEST_MSG, uint, 16, 4, PRIx16, expected, "");
77 CHECK(TEST_MSG, uint, 32, 2, PRIx32, expected, "");
78 CHECK(TEST_MSG, uint, 64, 1, PRIx64, expected, "");
79 CHECK(TEST_MSG, poly, 8, 8, PRIx8, expected, "");
80 CHECK(TEST_MSG, poly, 16, 4, PRIx16, expected, "");
81 CHECK(TEST_MSG, int, 8, 16, PRIx8, expected, "");
82 CHECK(TEST_MSG, int, 16, 8, PRIx16, expected, "");
83 CHECK(TEST_MSG, int, 32, 4, PRIx32, expected, "");
84 CHECK(TEST_MSG, uint, 8, 16, PRIx8, expected, "");
85 CHECK(TEST_MSG, uint, 16, 8, PRIx16, expected, "");
86 CHECK(TEST_MSG, uint, 32, 4, PRIx32, expected, "");
87 CHECK(TEST_MSG, poly, 8, 16, PRIx8, expected, "");
88 CHECK(TEST_MSG, poly, 16, 8, PRIx16, expected, "");
97 FNNAME (INSN_NAME) ();