Commit a2b65df7a4 for qemu.org

commit a2b65df7a4f83f270b1657c78403406055dd5818
Author: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Date:   Tue Sep 29 21:24:31 2026 +0000

    tests/tcg/mips64/mips64r6: update failing tests to use check_binary_op_64

    We can now benefit from a proper trace to update their reference.

    Acked-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
    Tested-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
    Link: https://lore.kernel.org/qemu-devel/20260929212439.110454-17-pierrick.bouvier@oss.qualcomm.com
    Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>

diff --git a/tests/tcg/mips64/test_mips64r6_and.c b/tests/tcg/mips64/test_mips64r6_and.c
index 3a3d8e6883..f83359107b 100644
--- a/tests/tcg/mips64/test_mips64r6_and.c
+++ b/tests/tcg/mips64/test_mips64r6_and.c
@@ -31,15 +31,6 @@

 int32_t main(void)
 {
-    char *isa_ase_name = "mips64r6";
-    char *group_name = "Logic";
-    char *instruction_name =   "AND";
-    int32_t ret;
-    uint32_t i, j;
-    struct timeval start, end;
-    double elapsed_time;
-
-    uint64_t b64_result[TEST_COUNT_TOTAL];
     uint64_t b64_expect[TEST_COUNT_TOTAL] = {
         0x8000000000000000ULL,                    /*   0  */
         0xffffffffffffffffULL,
@@ -123,32 +114,5 @@ int32_t main(void)
         0xc593578c78938000ULL,
     };

-    gettimeofday(&start, NULL);
-
-    for (i = 0; i < PATTERN_INPUTS_64_SHORT_COUNT; i++) {
-        for (j = 0; j < PATTERN_INPUTS_64_SHORT_COUNT; j++) {
-            do_mips64r6_AND(b64_pattern + i, b64_pattern + j,
-                b64_result + (PATTERN_INPUTS_64_SHORT_COUNT * i + j));
-        }
-    }
-
-    for (i = 0; i < RANDOM_INPUTS_64_SHORT_COUNT; i++) {
-        for (j = 0; j < RANDOM_INPUTS_64_SHORT_COUNT; j++) {
-            do_mips64r6_AND(b64_random + i, b64_random + j,
-                b64_result + (((PATTERN_INPUTS_64_SHORT_COUNT) *
-                               (PATTERN_INPUTS_64_SHORT_COUNT)) +
-                              RANDOM_INPUTS_64_SHORT_COUNT * i + j));
-        }
-    }
-
-    gettimeofday(&end, NULL);
-
-    elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
-    elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
-
-    ret = check_results_64(isa_ase_name, group_name,
-                           instruction_name, TEST_COUNT_TOTAL, elapsed_time,
-                           b64_result, b64_expect);
-
-    return ret;
+    return !check_binary_op_64(do_mips64r6_AND, "and", b64_expect);
 }
diff --git a/tests/tcg/mips64/test_mips64r6_nor.c b/tests/tcg/mips64/test_mips64r6_nor.c
index 6edcc1e394..13a5149018 100644
--- a/tests/tcg/mips64/test_mips64r6_nor.c
+++ b/tests/tcg/mips64/test_mips64r6_nor.c
@@ -31,15 +31,6 @@

 int32_t main(void)
 {
-    char *isa_ase_name = "mips64r6";
-    char *group_name = "Logic";
-    char *instruction_name =   "NOR";
-    int32_t ret;
-    uint32_t i, j;
-    struct timeval start, end;
-    double elapsed_time;
-
-    uint64_t b64_result[TEST_COUNT_TOTAL];
     uint64_t b64_expect[TEST_COUNT_TOTAL] = {
         0x8000000000000000ULL,                    /*   0  */
         0xffffffffffffffffULL,
@@ -123,32 +114,5 @@ int32_t main(void)
         0xc593578c78938000ULL,
     };

-    gettimeofday(&start, NULL);
-
-    for (i = 0; i < PATTERN_INPUTS_64_SHORT_COUNT; i++) {
-        for (j = 0; j < PATTERN_INPUTS_64_SHORT_COUNT; j++) {
-            do_mips64r6_NOR(b64_pattern + i, b64_pattern + j,
-                b64_result + (PATTERN_INPUTS_64_SHORT_COUNT * i + j));
-        }
-    }
-
-    for (i = 0; i < RANDOM_INPUTS_64_SHORT_COUNT; i++) {
-        for (j = 0; j < RANDOM_INPUTS_64_SHORT_COUNT; j++) {
-            do_mips64r6_NOR(b64_random + i, b64_random + j,
-                b64_result + (((PATTERN_INPUTS_64_SHORT_COUNT) *
-                               (PATTERN_INPUTS_64_SHORT_COUNT)) +
-                              RANDOM_INPUTS_64_SHORT_COUNT * i + j));
-        }
-    }
-
-    gettimeofday(&end, NULL);
-
-    elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
-    elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
-
-    ret = check_results_64(isa_ase_name, group_name,
-                           instruction_name, TEST_COUNT_TOTAL, elapsed_time,
-                           b64_result, b64_expect);
-
-    return ret;
+    return !check_binary_op_64(do_mips64r6_NOR, "nor", b64_expect);
 }
diff --git a/tests/tcg/mips64/test_mips64r6_or.c b/tests/tcg/mips64/test_mips64r6_or.c
index e6b07cd4bf..e4d7a95d37 100644
--- a/tests/tcg/mips64/test_mips64r6_or.c
+++ b/tests/tcg/mips64/test_mips64r6_or.c
@@ -31,15 +31,6 @@

 int32_t main(void)
 {
-    char *isa_ase_name = "mips64r6";
-    char *group_name = "Logic";
-    char *instruction_name =   "OR";
-    int32_t ret;
-    uint32_t i, j;
-    struct timeval start, end;
-    double elapsed_time;
-
-    uint64_t b64_result[TEST_COUNT_TOTAL];
     uint64_t b64_expect[TEST_COUNT_TOTAL] = {
         0x8000000000000000ULL,                    /*   0  */
         0xffffffffffffffffULL,
@@ -123,32 +114,5 @@ int32_t main(void)
         0xc593578c78938000ULL,
     };

-    gettimeofday(&start, NULL);
-
-    for (i = 0; i < PATTERN_INPUTS_64_SHORT_COUNT; i++) {
-        for (j = 0; j < PATTERN_INPUTS_64_SHORT_COUNT; j++) {
-            do_mips64r6_OR(b64_pattern + i, b64_pattern + j,
-                b64_result + (PATTERN_INPUTS_64_SHORT_COUNT * i + j));
-        }
-    }
-
-    for (i = 0; i < RANDOM_INPUTS_64_SHORT_COUNT; i++) {
-        for (j = 0; j < RANDOM_INPUTS_64_SHORT_COUNT; j++) {
-            do_mips64r6_OR(b64_random + i, b64_random + j,
-                b64_result + (((PATTERN_INPUTS_64_SHORT_COUNT) *
-                               (PATTERN_INPUTS_64_SHORT_COUNT)) +
-                              RANDOM_INPUTS_64_SHORT_COUNT * i + j));
-        }
-    }
-
-    gettimeofday(&end, NULL);
-
-    elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
-    elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
-
-    ret = check_results_64(isa_ase_name, group_name,
-                           instruction_name, TEST_COUNT_TOTAL, elapsed_time,
-                           b64_result, b64_expect);
-
-    return ret;
+    return !check_binary_op_64(do_mips64r6_OR, "or", b64_expect);
 }
diff --git a/tests/tcg/mips64/test_mips64r6_srav.c b/tests/tcg/mips64/test_mips64r6_srav.c
index 951bd7826d..e98bb9b90e 100644
--- a/tests/tcg/mips64/test_mips64r6_srav.c
+++ b/tests/tcg/mips64/test_mips64r6_srav.c
@@ -31,15 +31,6 @@

 int32_t main(void)
 {
-    char *isa_ase_name = "mips64r6";
-    char *group_name = "Shift";
-    char *instruction_name =   "SRAV";
-    int32_t ret;
-    uint32_t i, j;
-    struct timeval start, end;
-    double elapsed_time;
-
-    uint64_t b64_result[TEST_COUNT_TOTAL];
     uint64_t b64_expect[TEST_COUNT_TOTAL] = {
         0xffffffffffffffffULL,                    /*   0  */
         0xffffffffffffffffULL,
@@ -123,32 +114,5 @@ int32_t main(void)
         0x00000000000178c7ULL,
     };

-    gettimeofday(&start, NULL);
-
-    for (i = 0; i < PATTERN_INPUTS_64_SHORT_COUNT; i++) {
-        for (j = 0; j < PATTERN_INPUTS_64_SHORT_COUNT; j++) {
-            do_mips64r6_SRAV(b64_pattern + i, b64_pattern + j,
-                b64_result + (PATTERN_INPUTS_64_SHORT_COUNT * i + j));
-        }
-    }
-
-    for (i = 0; i < RANDOM_INPUTS_64_SHORT_COUNT; i++) {
-        for (j = 0; j < RANDOM_INPUTS_64_SHORT_COUNT; j++) {
-            do_mips64r6_SRAV(b64_random + i, b64_random + j,
-                b64_result + (((PATTERN_INPUTS_64_SHORT_COUNT) *
-                               (PATTERN_INPUTS_64_SHORT_COUNT)) +
-                              RANDOM_INPUTS_64_SHORT_COUNT * i + j));
-        }
-    }
-
-    gettimeofday(&end, NULL);
-
-    elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
-    elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
-
-    ret = check_results_64(isa_ase_name, group_name,
-                           instruction_name, TEST_COUNT_TOTAL, elapsed_time,
-                           b64_result, b64_expect);
-
-    return ret;
+    return !check_binary_op_64(do_mips64r6_SRAV, "srav", b64_expect);
 }
diff --git a/tests/tcg/mips64/test_mips64r6_xor.c b/tests/tcg/mips64/test_mips64r6_xor.c
index 52981f7357..6aab6fc1d4 100644
--- a/tests/tcg/mips64/test_mips64r6_xor.c
+++ b/tests/tcg/mips64/test_mips64r6_xor.c
@@ -31,15 +31,6 @@

 int32_t main(void)
 {
-    char *isa_ase_name = "mips64r6";
-    char *group_name = "Logic";
-    char *instruction_name =   "XOR";
-    int32_t ret;
-    uint32_t i, j;
-    struct timeval start, end;
-    double elapsed_time;
-
-    uint64_t b64_result[TEST_COUNT_TOTAL];
     uint64_t b64_expect[TEST_COUNT_TOTAL] = {
         0x8000000000000000ULL,                    /*   0  */
         0xffffffffffffffffULL,
@@ -123,32 +114,5 @@ int32_t main(void)
         0xc593578c78938000ULL,
     };

-    gettimeofday(&start, NULL);
-
-    for (i = 0; i < PATTERN_INPUTS_64_SHORT_COUNT; i++) {
-        for (j = 0; j < PATTERN_INPUTS_64_SHORT_COUNT; j++) {
-            do_mips64r6_XOR(b64_pattern + i, b64_pattern + j,
-                b64_result + (PATTERN_INPUTS_64_SHORT_COUNT * i + j));
-        }
-    }
-
-    for (i = 0; i < RANDOM_INPUTS_64_SHORT_COUNT; i++) {
-        for (j = 0; j < RANDOM_INPUTS_64_SHORT_COUNT; j++) {
-            do_mips64r6_XOR(b64_random + i, b64_random + j,
-                b64_result + (((PATTERN_INPUTS_64_SHORT_COUNT) *
-                               (PATTERN_INPUTS_64_SHORT_COUNT)) +
-                              RANDOM_INPUTS_64_SHORT_COUNT * i + j));
-        }
-    }
-
-    gettimeofday(&end, NULL);
-
-    elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
-    elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
-
-    ret = check_results_64(isa_ase_name, group_name,
-                           instruction_name, TEST_COUNT_TOTAL, elapsed_time,
-                           b64_result, b64_expect);
-
-    return ret;
+    return !check_binary_op_64(do_mips64r6_XOR, "xor", b64_expect);
 }