qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v8 06/14] tests/tcg: target/mips: Fix test utilities


From: Aleksandar Markovic
Subject: [Qemu-devel] [PATCH v8 06/14] tests/tcg: target/mips: Fix test utilities for 128-bit tests
Date: Tue, 5 Mar 2019 16:34:28 +0100

From: Aleksandar Markovic <address@hidden>

Add "static" and "const" modifiers where appropriate, and fix other
minor issues.

Signed-off-by: Aleksandar Markovic <address@hidden>
Reviewed-by: Aleksandar Rikalo <address@hidden>
---
 tests/tcg/mips/include/test_inputs.h |  4 ++--
 tests/tcg/mips/include/test_utils.h  | 15 ++++++++-------
 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++;
-- 
2.7.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]