Commit 8e6fe6b8 authored by Aleksandar Markovic's avatar Aleksandar Markovic
Browse files

tests/tcg: target/mips: Include isa/ase and group name in test output



For better appearance and usefullnes, include ISA/ASE name and
instruction group name in the output of tests. For example, all
this data will be displayed for FMAX_A.W test:

| MSA       | Float Max Min       | FMAX_A.W    |
| PASS:  80 | FAIL:   0 | elapsed time: 0.16 ms |

(the data will be displayed in one row; they are presented here in two
rows not to exceed the width of the commit message)

Signed-off-by: default avatarAleksandar Markovic <amarkovic@wavecomp.com>
Reviewed-by: default avatarAleksandar Rikalo <arikalo@wavecomp.com>
Message-Id: <1561031359-6727-2-git-send-email-aleksandar.markovic@rt-rk.com>
parent 1f8929d2
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -30,7 +30,9 @@
#define PRINT_RESULTS 0


static inline int32_t check_results(const char *instruction_name,
static inline int32_t check_results_128(const char *isa_ase_name,
                                        const char *group_name,
                                        const char *instruction_name,
                                        const uint32_t test_count,
                                        const double elapsed_time,
                                        const uint64_t *b128_result,
@@ -56,7 +58,8 @@ static inline int32_t check_results(const char *instruction_name,
    uint32_t pass_count = 0;
    uint32_t fail_count = 0;

    printf("%s:   ", instruction_name);
    printf("| %-10s \t| %-20s\t| %-16s \t|",
           isa_ase_name, group_name, instruction_name);
    for (i = 0; i < test_count; i++) {
        if ((b128_result[2 * i] == b128_expect[2 * i]) &&
            (b128_result[2 * i + 1] == b128_expect[2 * i + 1])) {
@@ -66,7 +69,7 @@ static inline int32_t check_results(const char *instruction_name,
        }
    }

    printf("\tPASS: %3d \tFAIL: %3d \telapsed time: %5.2f ms\n",
    printf(" PASS: %3d \t| FAIL: %3d \t| elapsed time: %5.2f ms \t|\n",
           pass_count, fail_count, elapsed_time);

    if (fail_count > 0) {
+6 −3
Original line number Diff line number Diff line
@@ -30,7 +30,9 @@
#define PRINT_RESULTS 0


static inline int32_t check_results_64(const char *instruction_name,
static inline int32_t check_results_64(const char *isa_ase_name,
                                       const char *group_name,
                                       const char *instruction_name,
                                       const uint32_t test_count,
                                       const double elapsed_time,
                                       const uint64_t *b64_result,
@@ -55,7 +57,8 @@ static inline int32_t check_results_64(const char *instruction_name,
    uint32_t pass_count = 0;
    uint32_t fail_count = 0;

    printf("%s:   ", instruction_name);
    printf("| %-10s \t| %-20s\t| %-16s \t|",
           isa_ase_name, group_name, instruction_name);
    for (i = 0; i < test_count; i++) {
        if (b64_result[i] == b64_expect[i]) {
            pass_count++;
@@ -64,7 +67,7 @@ static inline int32_t check_results_64(const char *instruction_name,
        }
    }

    printf("PASS: %3d   FAIL: %3d   elapsed time: %5.2f ms\n",
    printf(" PASS: %3d \t| FAIL: %3d \t| elapsed time: %5.2f ms \t|\n",
           pass_count, fail_count, elapsed_time);

    if (fail_count > 0) {
+6 −3
Original line number Diff line number Diff line
@@ -31,6 +31,8 @@

int32_t main(void)
{
    char *isa_ase_name = "MSA";
    char *group_name = "Bit Count";
    char *instruction_name =  "NLOC.B";
    int32_t ret;
    uint32_t i;
@@ -139,7 +141,8 @@ int32_t main(void)
    elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
    elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;

    ret = check_results(instruction_name, TEST_COUNT_TOTAL, elapsed_time,
    ret = check_results_128(isa_ase_name, group_name, instruction_name,
                            TEST_COUNT_TOTAL, elapsed_time,
                            &b128_result[0][0], &b128_expect[0][0]);

    return ret;
+6 −3
Original line number Diff line number Diff line
@@ -31,6 +31,8 @@

int32_t main(void)
{
    char *isa_ase_name = "MSA";
    char *group_name = "Bit Count";
    char *instruction_name =  "NLOC.D";
    int32_t ret;
    uint32_t i;
@@ -139,7 +141,8 @@ int32_t main(void)
    elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
    elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;

    ret = check_results(instruction_name, TEST_COUNT_TOTAL, elapsed_time,
    ret = check_results_128(isa_ase_name, group_name, instruction_name,
                            TEST_COUNT_TOTAL, elapsed_time,
                            &b128_result[0][0], &b128_expect[0][0]);

    return ret;
+6 −3
Original line number Diff line number Diff line
@@ -31,6 +31,8 @@

int32_t main(void)
{
    char *isa_ase_name = "MSA";
    char *group_name = "Bit Count";
    char *instruction_name =  "NLOC.H";
    int32_t ret;
    uint32_t i;
@@ -139,7 +141,8 @@ int32_t main(void)
    elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
    elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;

    ret = check_results(instruction_name, TEST_COUNT_TOTAL, elapsed_time,
    ret = check_results_128(isa_ase_name, group_name, instruction_name,
                            TEST_COUNT_TOTAL, elapsed_time,
                            &b128_result[0][0], &b128_expect[0][0]);

    return ret;
Loading