From: Aleksandar Markovic Date: Tue, 5 Mar 2019 15:34:28 +0000 (+0100) Subject: tests/tcg: target/mips: Fix test utilities for 128-bit tests X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=dd3ba7036f3df8e42703704cbdc55be0d0d19f45;p=qmiga%2Fqemu.git tests/tcg: target/mips: Fix test utilities for 128-bit tests Add "static" and "const" modifiers where appropriate, and fix other minor issues. Signed-off-by: Aleksandar Markovic Reviewed-by: Aleksandar Rikalo Message-Id: <1551800076-8104-7-git-send-email-aleksandar.markovic@rt-rk.com> --- diff --git a/tests/tcg/mips/include/test_inputs.h b/tests/tcg/mips/include/test_inputs.h index c173d589ff..5406e4e2df 100644 --- a/tests/tcg/mips/include/test_inputs.h +++ b/tests/tcg/mips/include/test_inputs.h @@ -28,7 +28,7 @@ #define PATTERN_INPUTS_COUNT 64 #define PATTERN_INPUTS_SHORT_COUNT 8 -uint64_t b128_pattern[PATTERN_INPUTS_COUNT][2] = { +static const uint64_t b128_pattern[PATTERN_INPUTS_COUNT][2] = { { 0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL, }, /* 0 */ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, { 0xAAAAAAAAAAAAAAAAULL, 0xAAAAAAAAAAAAAAAAULL, }, @@ -99,7 +99,7 @@ uint64_t b128_pattern[PATTERN_INPUTS_COUNT][2] = { #define RANDOM_INPUTS_COUNT 16 #define RANDOM_INPUTS_SHORT_COUNT 4 -uint64_t b128_random[RANDOM_INPUTS_COUNT][2] = { +static const uint64_t b128_random[RANDOM_INPUTS_COUNT][2] = { { 0x886AE6CC28625540ULL, 0x4B670B5EFE7BB00CULL, }, /* 0 */ { 0xFBBE00634D93C708ULL, 0x12F7BB1A153F52FCULL, }, { 0xAC5AAEAAB9CF8B80ULL, 0x27D8C6FFAB2B2514ULL, }, diff --git a/tests/tcg/mips/include/test_utils.h b/tests/tcg/mips/include/test_utils.h index 82f4b5b1ef..9672903eb5 100644 --- a/tests/tcg/mips/include/test_utils.h +++ b/tests/tcg/mips/include/test_utils.h @@ -27,14 +27,14 @@ #include #include -#define PRINT_RESULTS 1 +#define PRINT_RESULTS 0 -static inline int32_t check_results(char *instruction_name, - uint32_t test_count, - double elapsed_time, - uint64_t *b128_result, - uint64_t *b128_expect) +static inline int32_t check_results(const char *instruction_name, + const uint32_t test_count, + const double elapsed_time, + const uint64_t *b128_result, + const uint64_t *b128_expect) { #if PRINT_RESULTS uint32_t ii; @@ -58,7 +58,8 @@ static inline int32_t check_results(char *instruction_name, printf("%s: ", instruction_name); for (i = 0; i < test_count; i++) { - if (b128_result[i] == b128_expect[i]) { + if ((b128_result[2 * i] == b128_expect[2 * i]) && + (b128_result[2 * i + 1] == b128_expect[2 * i + 1])) { pass_count++; } else { fail_count++;