tests/tcg/mips: Group MSA bit-move tests

Build the 11 per-opcode bit-move tests as a single executable,
test_msa_bit_move.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-17-philmd@oss.qualcomm.com>
This commit is contained in:
Philippe Mathieu-Daudé
2026-10-29 11:18:05 +01:00
parent 1410403c82
commit e364bb625f
2 changed files with 94 additions and 11 deletions

View File

@@ -3,6 +3,7 @@ tests = []
# MSA tests shared by the mipsel and mips64 targets
tests_mips_msa_groups = [
'../mips/test_msa_bit_count.c',
'../mips/test_msa_bit_move.c',
]
tests += tcg_tests['multiarch-linux-user']['tests']
@@ -152,17 +153,6 @@ tests_mips_msa = [
'../mips/user/ase/msa/pack/test_msa_pckod_w.c',
'../mips/user/ase/msa/pack/test_msa_vshf_h.c',
'../mips/user/ase/msa/pack/test_msa_pckod_d.c',
'../mips/user/ase/msa/bit-move/test_msa_binsr_w.c',
'../mips/user/ase/msa/bit-move/test_msa_binsr_b.c',
'../mips/user/ase/msa/bit-move/test_msa_binsr_d.c',
'../mips/user/ase/msa/bit-move/test_msa_binsr_h.c',
'../mips/user/ase/msa/bit-move/test_msa_binsl_h.c',
'../mips/user/ase/msa/bit-move/test_msa_binsl_w.c',
'../mips/user/ase/msa/bit-move/test_msa_bmnz_v.c',
'../mips/user/ase/msa/bit-move/test_msa_bsel_v.c',
'../mips/user/ase/msa/bit-move/test_msa_bmz_v.c',
'../mips/user/ase/msa/bit-move/test_msa_binsl_d.c',
'../mips/user/ase/msa/bit-move/test_msa_binsl_b.c',
'../mips/user/ase/msa/shift/test_msa_sra_d.c',
'../mips/user/ase/msa/shift/test_msa_srl_b.c',
'../mips/user/ase/msa/shift/test_msa_srl_d.c',

View File

@@ -0,0 +1,93 @@
/*
* MIPS MSA tests: Bit Move instructions
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "../include/tap.h"
#define main test_msa_binsl_b
#include "user/ase/msa/bit-move/test_msa_binsl_b.c"
#undef main
#undef TEST_COUNT_TOTAL
#define main test_msa_binsl_d
#include "user/ase/msa/bit-move/test_msa_binsl_d.c"
#undef main
#undef TEST_COUNT_TOTAL
#define main test_msa_binsl_h
#include "user/ase/msa/bit-move/test_msa_binsl_h.c"
#undef main
#undef TEST_COUNT_TOTAL
#define main test_msa_binsl_w
#include "user/ase/msa/bit-move/test_msa_binsl_w.c"
#undef main
#undef TEST_COUNT_TOTAL
#define main test_msa_binsr_b
#include "user/ase/msa/bit-move/test_msa_binsr_b.c"
#undef main
#undef TEST_COUNT_TOTAL
#define main test_msa_binsr_d
#include "user/ase/msa/bit-move/test_msa_binsr_d.c"
#undef main
#undef TEST_COUNT_TOTAL
#define main test_msa_binsr_h
#include "user/ase/msa/bit-move/test_msa_binsr_h.c"
#undef main
#undef TEST_COUNT_TOTAL
#define main test_msa_binsr_w
#include "user/ase/msa/bit-move/test_msa_binsr_w.c"
#undef main
#undef TEST_COUNT_TOTAL
#define main test_msa_bmnz_v
#include "user/ase/msa/bit-move/test_msa_bmnz_v.c"
#undef main
#undef TEST_COUNT_TOTAL
#define main test_msa_bmz_v
#include "user/ase/msa/bit-move/test_msa_bmz_v.c"
#undef main
#undef TEST_COUNT_TOTAL
#define main test_msa_bsel_v
#include "user/ase/msa/bit-move/test_msa_bsel_v.c"
#undef main
#undef TEST_COUNT_TOTAL
static const struct {
const char *name;
int32_t (*fn)(void);
} msa_tests[] = {
{ "binsl.b", test_msa_binsl_b },
{ "binsl.d", test_msa_binsl_d },
{ "binsl.h", test_msa_binsl_h },
{ "binsl.w", test_msa_binsl_w },
{ "binsr.b", test_msa_binsr_b },
{ "binsr.d", test_msa_binsr_d },
{ "binsr.h", test_msa_binsr_h },
{ "binsr.w", test_msa_binsr_w },
{ "bmnz.v", test_msa_bmnz_v },
{ "bmz.v", test_msa_bmz_v },
{ "bsel.v", test_msa_bsel_v },
};
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",
"Bit Move", msa_tests[i].name);
}
return tap_done();
}