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é <[email protected]> Reviewed-by: Pierrick Bouvier <[email protected]> --- tests/tcg/mips/test_msa_int_div_mod.c | 123 ++++++++++++++++++++++++++ tests/tcg/mips/meson.build | 17 +--- 2 files changed, 124 insertions(+), 16 deletions(-) create mode 100644 tests/tcg/mips/test_msa_int_div_mod.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 000000000000..764054c2a57f --- /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(); +} diff --git a/tests/tcg/mips/meson.build b/tests/tcg/mips/meson.build index 199b1b934a5e..537de9ea4a2f 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', -- 2.55.0
