Commit 5e6e5bc1fa for qemu.org
commit 5e6e5bc1fae21abc79885f1ccc9a47bee71ae294
Author: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Date: Thu Oct 29 11:18:06 2026 +0100
tests/tcg/mips: Group MSA int-div-mod tests
Build the 16 per-opcode int-div-mod tests as a single executable,
test_msa_int_div_mod.c, to reduce the number of test binaries.
Each opcode reports one TAP line.
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Message-ID: <20261030175357.99684-24-philmd@oss.qualcomm.com>
diff --git a/tests/tcg/mips/meson.build b/tests/tcg/mips/meson.build
index 199b1b934a..537de9ea4a 100644
--- a/tests/tcg/mips/meson.build
+++ b/tests/tcg/mips/meson.build
@@ -10,6 +10,7 @@ tests_mips_msa_groups = [
'../mips/test_msa_int_add.c',
'../mips/test_msa_int_average.c',
'../mips/test_msa_int_compare.c',
+ '../mips/test_msa_int_div_mod.c',
]
tests += tcg_tests['multiarch-linux-user']['tests']
@@ -35,14 +36,6 @@ if 'qemu-mips' in emulators
endif
tests_mips_msa = [
- '../mips/user/ase/msa/int-modulo/test_msa_mod_s_b.c',
- '../mips/user/ase/msa/int-modulo/test_msa_mod_u_d.c',
- '../mips/user/ase/msa/int-modulo/test_msa_mod_s_d.c',
- '../mips/user/ase/msa/int-modulo/test_msa_mod_s_w.c',
- '../mips/user/ase/msa/int-modulo/test_msa_mod_s_h.c',
- '../mips/user/ase/msa/int-modulo/test_msa_mod_u_b.c',
- '../mips/user/ase/msa/int-modulo/test_msa_mod_u_h.c',
- '../mips/user/ase/msa/int-modulo/test_msa_mod_u_w.c',
'../mips/user/ase/msa/int-subtract/test_msa_asub_s_w.c',
'../mips/user/ase/msa/int-subtract/test_msa_hsub_u_d.c',
'../mips/user/ase/msa/int-subtract/test_msa_hsub_s_w.c',
@@ -89,14 +82,6 @@ tests_mips_msa = [
'../mips/user/ase/msa/int-multiply/test_msa_mulv_h.c',
'../mips/user/ase/msa/int-multiply/test_msa_mulv_d.c',
'../mips/user/ase/msa/int-multiply/test_msa_maddv_h.c',
- '../mips/user/ase/msa/int-divide/test_msa_div_s_b.c',
- '../mips/user/ase/msa/int-divide/test_msa_div_u_b.c',
- '../mips/user/ase/msa/int-divide/test_msa_div_s_d.c',
- '../mips/user/ase/msa/int-divide/test_msa_div_s_h.c',
- '../mips/user/ase/msa/int-divide/test_msa_div_s_w.c',
- '../mips/user/ase/msa/int-divide/test_msa_div_u_w.c',
- '../mips/user/ase/msa/int-divide/test_msa_div_u_h.c',
- '../mips/user/ase/msa/int-divide/test_msa_div_u_d.c',
'../mips/user/ase/msa/interleave/test_msa_ilvr_b.c',
'../mips/user/ase/msa/interleave/test_msa_ilvr_d.c',
'../mips/user/ase/msa/interleave/test_msa_ilvod_b.c',
diff --git a/tests/tcg/mips/test_msa_int_div_mod.c b/tests/tcg/mips/test_msa_int_div_mod.c
new file mode 100644
index 0000000000..764054c2a5
--- /dev/null
+++ b/tests/tcg/mips/test_msa_int_div_mod.c
@@ -0,0 +1,123 @@
+/*
+ * MIPS MSA tests: Int Divide and Modulo instructions
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "../include/tap.h"
+
+#define main test_msa_div_s_b
+#include "user/ase/msa/int-divide/test_msa_div_s_b.c"
+#undef main
+#undef TEST_COUNT_TOTAL
+
+#define main test_msa_div_s_d
+#include "user/ase/msa/int-divide/test_msa_div_s_d.c"
+#undef main
+#undef TEST_COUNT_TOTAL
+
+#define main test_msa_div_s_h
+#include "user/ase/msa/int-divide/test_msa_div_s_h.c"
+#undef main
+#undef TEST_COUNT_TOTAL
+
+#define main test_msa_div_s_w
+#include "user/ase/msa/int-divide/test_msa_div_s_w.c"
+#undef main
+#undef TEST_COUNT_TOTAL
+
+#define main test_msa_div_u_b
+#include "user/ase/msa/int-divide/test_msa_div_u_b.c"
+#undef main
+#undef TEST_COUNT_TOTAL
+
+#define main test_msa_div_u_d
+#include "user/ase/msa/int-divide/test_msa_div_u_d.c"
+#undef main
+#undef TEST_COUNT_TOTAL
+
+#define main test_msa_div_u_h
+#include "user/ase/msa/int-divide/test_msa_div_u_h.c"
+#undef main
+#undef TEST_COUNT_TOTAL
+
+#define main test_msa_div_u_w
+#include "user/ase/msa/int-divide/test_msa_div_u_w.c"
+#undef main
+#undef TEST_COUNT_TOTAL
+
+#define main test_msa_mod_s_b
+#include "user/ase/msa/int-modulo/test_msa_mod_s_b.c"
+#undef main
+#undef TEST_COUNT_TOTAL
+
+#define main test_msa_mod_s_d
+#include "user/ase/msa/int-modulo/test_msa_mod_s_d.c"
+#undef main
+#undef TEST_COUNT_TOTAL
+
+#define main test_msa_mod_s_h
+#include "user/ase/msa/int-modulo/test_msa_mod_s_h.c"
+#undef main
+#undef TEST_COUNT_TOTAL
+
+#define main test_msa_mod_s_w
+#include "user/ase/msa/int-modulo/test_msa_mod_s_w.c"
+#undef main
+#undef TEST_COUNT_TOTAL
+
+#define main test_msa_mod_u_b
+#include "user/ase/msa/int-modulo/test_msa_mod_u_b.c"
+#undef main
+#undef TEST_COUNT_TOTAL
+
+#define main test_msa_mod_u_d
+#include "user/ase/msa/int-modulo/test_msa_mod_u_d.c"
+#undef main
+#undef TEST_COUNT_TOTAL
+
+#define main test_msa_mod_u_h
+#include "user/ase/msa/int-modulo/test_msa_mod_u_h.c"
+#undef main
+#undef TEST_COUNT_TOTAL
+
+#define main test_msa_mod_u_w
+#include "user/ase/msa/int-modulo/test_msa_mod_u_w.c"
+#undef main
+#undef TEST_COUNT_TOTAL
+
+
+static const struct {
+ const char *name;
+ int32_t (*fn)(void);
+} msa_tests[] = {
+ { "div.s.b", test_msa_div_s_b },
+ { "div.s.d", test_msa_div_s_d },
+ { "div.s.h", test_msa_div_s_h },
+ { "div.s.w", test_msa_div_s_w },
+ { "div.u.b", test_msa_div_u_b },
+ { "div.u.d", test_msa_div_u_d },
+ { "div.u.h", test_msa_div_u_h },
+ { "div.u.w", test_msa_div_u_w },
+ { "mod.s.b", test_msa_mod_s_b },
+ { "mod.s.d", test_msa_mod_s_d },
+ { "mod.s.h", test_msa_mod_s_h },
+ { "mod.s.w", test_msa_mod_s_w },
+ { "mod.u.b", test_msa_mod_u_b },
+ { "mod.u.d", test_msa_mod_u_d },
+ { "mod.u.h", test_msa_mod_u_h },
+ { "mod.u.w", test_msa_mod_u_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",
+ "Int Divide and Modulo", msa_tests[i].name);
+ }
+
+ return tap_done();
+}