aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAleksandar Markovic <amarkovic@wavecomp.com>2019-03-05 16:34:28 +0100
committerAleksandar Markovic <amarkovic@wavecomp.com>2019-03-05 17:02:30 +0100
commitdd3ba7036f3df8e42703704cbdc55be0d0d19f45 (patch)
tree55d9e649f4d766b08efa8492f21b5154cfba1542 /tests
parentace4458466f228fc5dabfe7ab0d01c20ca7001ff (diff)
downloadqemu-dd3ba7036f3df8e42703704cbdc55be0d0d19f45.zip
qemu-dd3ba7036f3df8e42703704cbdc55be0d0d19f45.tar.gz
qemu-dd3ba7036f3df8e42703704cbdc55be0d0d19f45.tar.bz2
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 <amarkovic@wavecomp.com> Reviewed-by: Aleksandar Rikalo <arikalo@wavecomp.com> Message-Id: <1551800076-8104-7-git-send-email-aleksandar.markovic@rt-rk.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/tcg/mips/include/test_inputs.h4
-rw-r--r--tests/tcg/mips/include/test_utils.h15
2 files changed, 10 insertions, 9 deletions
diff --git a/tests/tcg/mips/include/test_inputs.h b/tests/tcg/mips/include/test_inputs.h
index c173d58..5406e4e 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 82f4b5b..9672903 100644
--- a/tests/tcg/mips/include/test_utils.h
+++ b/tests/tcg/mips/include/test_utils.h
@@ -27,14 +27,14 @@
#include <inttypes.h>
#include <string.h>
-#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++;