1#define FNNAME1(NAME) exec_ ## NAME
2#define FNNAME(NAME) FNNAME1(NAME)
3
4void FNNAME (INSN_NAME) (void)
5{
6#define DECL_VMLX(T, W, N)			\
7  DECL_VARIABLE(vector1, T, W, N);		\
8  DECL_VARIABLE(vector2, T, W, N);		\
9  DECL_VARIABLE(vector3, T, W, N);		\
10  DECL_VARIABLE(vector_res, T, W, N)
11
12  /* vector_res = vmla(vector, vector3, vector4),
13     then store the result.  */
14#define TEST_VMLX1(INSN, Q, T1, T2, W, N)				\
15  VECT_VAR(vector_res, T1, W, N) =                                      \
16    INSN##Q##_##T2##W(VECT_VAR(vector1, T1, W, N),			\
17		      VECT_VAR(vector2, T1, W, N),			\
18		      VECT_VAR(vector3, T1, W, N));			\
19  vst1##Q##_##T2##W(VECT_VAR(result, T1, W, N),                         \
20		    VECT_VAR(vector_res, T1, W, N))
21
22#define TEST_VMLX(INSN, Q, T1, T2, W, N)	\
23  TEST_VMLX1(INSN, Q, T1, T2, W, N)
24
25  DECL_VMLX(int, 8, 8);
26  DECL_VMLX(int, 16, 4);
27  DECL_VMLX(int, 32, 2);
28  DECL_VMLX(uint, 8, 8);
29  DECL_VMLX(uint, 16, 4);
30  DECL_VMLX(uint, 32, 2);
31  DECL_VMLX(float, 32, 2);
32  DECL_VMLX(int, 8, 16);
33  DECL_VMLX(int, 16, 8);
34  DECL_VMLX(int, 32, 4);
35  DECL_VMLX(uint, 8, 16);
36  DECL_VMLX(uint, 16, 8);
37  DECL_VMLX(uint, 32, 4);
38  DECL_VMLX(float, 32, 4);
39
40  clean_results ();
41
42  VLOAD(vector1, buffer, , int, s, 8, 8);
43  VLOAD(vector1, buffer, , int, s, 16, 4);
44  VLOAD(vector1, buffer, , int, s, 32, 2);
45  VLOAD(vector1, buffer, , uint, u, 8, 8);
46  VLOAD(vector1, buffer, , uint, u, 16, 4);
47  VLOAD(vector1, buffer, , uint, u, 32, 2);
48  VLOAD(vector1, buffer, , float, f, 32, 2);
49  VLOAD(vector1, buffer, q, int, s, 8, 16);
50  VLOAD(vector1, buffer, q, int, s, 16, 8);
51  VLOAD(vector1, buffer, q, int, s, 32, 4);
52  VLOAD(vector1, buffer, q, uint, u, 8, 16);
53  VLOAD(vector1, buffer, q, uint, u, 16, 8);
54  VLOAD(vector1, buffer, q, uint, u, 32, 4);
55  VLOAD(vector1, buffer, q, float, f, 32, 4);
56
57  VDUP(vector2, , int, s, 8, 8, 0x11);
58  VDUP(vector2, , int, s, 16, 4, 0x22);
59  VDUP(vector2, , int, s, 32, 2, 0x33);
60  VDUP(vector2, , uint, u, 8, 8, 0x44);
61  VDUP(vector2, , uint, u, 16, 4, 0x55);
62  VDUP(vector2, , uint, u, 32, 2, 0x66);
63  VDUP(vector2, , float, f, 32, 2, 33.1f);
64  VDUP(vector2, q, int, s, 8, 16, 0x77);
65  VDUP(vector2, q, int, s, 16, 8, 0x88);
66  VDUP(vector2, q, int, s, 32, 4, 0x99);
67  VDUP(vector2, q, uint, u, 8, 16, 0xAA);
68  VDUP(vector2, q, uint, u, 16, 8, 0xBB);
69  VDUP(vector2, q, uint, u, 32, 4, 0xCC);
70  VDUP(vector2, q, float, f, 32, 4, 99.2f);
71
72  VDUP(vector3, , int, s, 8, 8, 0xFF);
73  VDUP(vector3, , int, s, 16, 4, 0xEE);
74  VDUP(vector3, , int, s, 32, 2, 0xDD);
75  VDUP(vector3, , uint, u, 8, 8, 0xCC);
76  VDUP(vector3, , uint, u, 16, 4, 0xBB);
77  VDUP(vector3, , uint, u, 32, 2, 0xAA);
78  VDUP(vector3, , float, f, 32, 2, 10.23f);
79  VDUP(vector3, q, int, s, 8, 16, 0x99);
80  VDUP(vector3, q, int, s, 16, 8, 0x88);
81  VDUP(vector3, q, int, s, 32, 4, 0x77);
82  VDUP(vector3, q, uint, u, 8, 16, 0x66);
83  VDUP(vector3, q, uint, u, 16, 8, 0x55);
84  VDUP(vector3, q, uint, u, 32, 4, 0x44);
85  VDUP(vector3, q, float, f, 32, 4, 77.8f);
86
87  TEST_VMLX(INSN_NAME, , int, s, 8, 8);
88  TEST_VMLX(INSN_NAME, , int, s, 16, 4);
89  TEST_VMLX(INSN_NAME, , int, s, 32, 2);
90  TEST_VMLX(INSN_NAME, , uint, u, 8, 8);
91  TEST_VMLX(INSN_NAME, , uint, u, 16, 4);
92  TEST_VMLX(INSN_NAME, , uint, u, 32, 2);
93  TEST_VMLX(INSN_NAME, , float, f, 32, 2);
94  TEST_VMLX(INSN_NAME, q, int, s, 8, 16);
95  TEST_VMLX(INSN_NAME, q, int, s, 16, 8);
96  TEST_VMLX(INSN_NAME, q, int, s, 32, 4);
97  TEST_VMLX(INSN_NAME, q, uint, u, 8, 16);
98  TEST_VMLX(INSN_NAME, q, uint, u, 16, 8);
99  TEST_VMLX(INSN_NAME, q, uint, u, 32, 4);
100  TEST_VMLX(INSN_NAME, q, float, f, 32, 4);
101
102  CHECK(TEST_MSG, int, 8, 8, PRIx8, expected, "");
103  CHECK(TEST_MSG, int, 16, 4, PRIx16, expected, "");
104  CHECK(TEST_MSG, int, 32, 2, PRIx32, expected, "");
105  CHECK(TEST_MSG, uint, 8, 8, PRIx8, expected, "");
106  CHECK(TEST_MSG, uint, 16, 4, PRIx16, expected, "");
107  CHECK(TEST_MSG, uint, 32, 2, PRIx32, expected, "");
108  CHECK_FP(TEST_MSG, float, 32, 2, PRIx32, expected, "");
109  CHECK(TEST_MSG, int, 8, 16, PRIx8, expected, "");
110  CHECK(TEST_MSG, int, 16, 8, PRIx16, expected, "");
111  CHECK(TEST_MSG, int, 32, 4, PRIx32, expected, "");
112  CHECK(TEST_MSG, uint, 8, 16, PRIx8, expected, "");
113  CHECK(TEST_MSG, uint, 16, 8, PRIx16, expected, "");
114  CHECK(TEST_MSG, uint, 32, 4, PRIx32, expected, "");
115  CHECK_FP(TEST_MSG, float, 32, 4, PRIx32, expected, "");
116}
117
118int main (void)
119{
120  FNNAME (INSN_NAME) ();
121  return 0;
122}
123
124