Build the 12 per-opcode fixed-multiply tests as a single executable,
test_msa_fixed_multiply.c, to reduce the number of test binaries.
Each opcode reports one TAP line.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Pierrick Bouvier <[email protected]>
---
 tests/tcg/mips/test_msa_fixed_multiply.c | 99 ++++++++++++++++++++++++
 tests/tcg/mips/meson.build               | 13 +---
 2 files changed, 100 insertions(+), 12 deletions(-)
 create mode 100644 tests/tcg/mips/test_msa_fixed_multiply.c

diff --git a/tests/tcg/mips/test_msa_fixed_multiply.c 
b/tests/tcg/mips/test_msa_fixed_multiply.c
new file mode 100644
index 000000000000..7eb5bfe1b539
--- /dev/null
+++ b/tests/tcg/mips/test_msa_fixed_multiply.c
@@ -0,0 +1,99 @@
+/*
+ * MIPS MSA tests: Fixed Multiply instructions
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "../include/tap.h"
+
+#define main test_msa_madd_q_h
+#include "user/ase/msa/fixed-multiply/test_msa_madd_q_h.c"
+#undef main
+#undef TEST_COUNT_TOTAL
+
+#define main test_msa_madd_q_w
+#include "user/ase/msa/fixed-multiply/test_msa_madd_q_w.c"
+#undef main
+#undef TEST_COUNT_TOTAL
+
+#define main test_msa_maddr_q_h
+#include "user/ase/msa/fixed-multiply/test_msa_maddr_q_h.c"
+#undef main
+#undef TEST_COUNT_TOTAL
+
+#define main test_msa_maddr_q_w
+#include "user/ase/msa/fixed-multiply/test_msa_maddr_q_w.c"
+#undef main
+#undef TEST_COUNT_TOTAL
+
+#define main test_msa_msub_q_h
+#include "user/ase/msa/fixed-multiply/test_msa_msub_q_h.c"
+#undef main
+#undef TEST_COUNT_TOTAL
+
+#define main test_msa_msub_q_w
+#include "user/ase/msa/fixed-multiply/test_msa_msub_q_w.c"
+#undef main
+#undef TEST_COUNT_TOTAL
+
+#define main test_msa_msubr_q_h
+#include "user/ase/msa/fixed-multiply/test_msa_msubr_q_h.c"
+#undef main
+#undef TEST_COUNT_TOTAL
+
+#define main test_msa_msubr_q_w
+#include "user/ase/msa/fixed-multiply/test_msa_msubr_q_w.c"
+#undef main
+#undef TEST_COUNT_TOTAL
+
+#define main test_msa_mul_q_h
+#include "user/ase/msa/fixed-multiply/test_msa_mul_q_h.c"
+#undef main
+#undef TEST_COUNT_TOTAL
+
+#define main test_msa_mul_q_w
+#include "user/ase/msa/fixed-multiply/test_msa_mul_q_w.c"
+#undef main
+#undef TEST_COUNT_TOTAL
+
+#define main test_msa_mulr_q_h
+#include "user/ase/msa/fixed-multiply/test_msa_mulr_q_h.c"
+#undef main
+#undef TEST_COUNT_TOTAL
+
+#define main test_msa_mulr_q_w
+#include "user/ase/msa/fixed-multiply/test_msa_mulr_q_w.c"
+#undef main
+#undef TEST_COUNT_TOTAL
+
+
+static const struct {
+    const char *name;
+    int32_t (*fn)(void);
+} msa_tests[] = {
+    { "madd.q.h", test_msa_madd_q_h },
+    { "madd.q.w", test_msa_madd_q_w },
+    { "maddr.q.h", test_msa_maddr_q_h },
+    { "maddr.q.w", test_msa_maddr_q_w },
+    { "msub.q.h", test_msa_msub_q_h },
+    { "msub.q.w", test_msa_msub_q_w },
+    { "msubr.q.h", test_msa_msubr_q_h },
+    { "msubr.q.w", test_msa_msubr_q_w },
+    { "mul.q.h", test_msa_mul_q_h },
+    { "mul.q.w", test_msa_mul_q_w },
+    { "mulr.q.h", test_msa_mulr_q_h },
+    { "mulr.q.w", test_msa_mulr_q_w },
+};
+
+int main(void)
+{
+    unsigned i;
+
+    TAP_START();
+    for (i = 0; i < sizeof(msa_tests) / sizeof(msa_tests[0]); i++) {
+        tap_report(!msa_tests[i].fn(), "MSA %s %s",
+                   "Fixed Multiply", msa_tests[i].name);
+    }
+
+    return tap_done();
+}
diff --git a/tests/tcg/mips/meson.build b/tests/tcg/mips/meson.build
index 03f3ce57d3cf..17e3fe3e55ae 100644
--- a/tests/tcg/mips/meson.build
+++ b/tests/tcg/mips/meson.build
@@ -5,6 +5,7 @@ tests_mips_msa_groups = [
   '../mips/test_msa_bit_count.c',
   '../mips/test_msa_bit_move.c',
   '../mips/test_msa_bit_set.c',
+  '../mips/test_msa_fixed_multiply.c',
 ]
 
 tests += tcg_tests['multiarch-linux-user']['tests']
@@ -199,18 +200,6 @@ tests_mips_msa = [
   '../mips/user/ase/msa/logic/test_msa_and_v.c',
   '../mips/user/ase/msa/logic/test_msa_xor_v.c',
   '../mips/user/ase/msa/move/test_msa_move_v.c',
-  '../mips/user/ase/msa/fixed-multiply/test_msa_mulr_q_h.c',
-  '../mips/user/ase/msa/fixed-multiply/test_msa_mul_q_w.c',
-  '../mips/user/ase/msa/fixed-multiply/test_msa_msubr_q_w.c',
-  '../mips/user/ase/msa/fixed-multiply/test_msa_maddr_q_h.c',
-  '../mips/user/ase/msa/fixed-multiply/test_msa_maddr_q_w.c',
-  '../mips/user/ase/msa/fixed-multiply/test_msa_msub_q_w.c',
-  '../mips/user/ase/msa/fixed-multiply/test_msa_msub_q_h.c',
-  '../mips/user/ase/msa/fixed-multiply/test_msa_madd_q_h.c',
-  '../mips/user/ase/msa/fixed-multiply/test_msa_mul_q_h.c',
-  '../mips/user/ase/msa/fixed-multiply/test_msa_mulr_q_w.c',
-  '../mips/user/ase/msa/fixed-multiply/test_msa_madd_q_w.c',
-  '../mips/user/ase/msa/fixed-multiply/test_msa_msubr_q_h.c',
   '../mips/user/ase/msa/int-max-min/test_msa_min_u_h.c',
   '../mips/user/ase/msa/int-max-min/test_msa_max_a_b.c',
   '../mips/user/ase/msa/int-max-min/test_msa_max_s_b.c',
-- 
2.55.0


Reply via email to