Commit 4b302ce9 authored by Mateja Marjanovic's avatar Mateja Marjanovic Committed by Aleksandar Markovic
Browse files

target/mips: Add tests for a variety of MSA integer multiply instructions



Add tests for a variety of MSA integer multiply instructions.

Signed-off-by: default avatarMateja Marjanovic <mateja.marjanovic@rt-rk.com>
Signed-off-by: default avatarAleksandar Markovic <amarkovic@wavecomp.com>
Reviewed-by: default avatarAleksandar Markovic <amarkovic@wavecomp.com>
Message-Id: <1551964929-17845-5-git-send-email-mateja.marjanovic@rt-rk.com>
parent a8f91dd9
Loading
Loading
Loading
Loading
+151 −0
Original line number Diff line number Diff line
/*
 *  Test program for MSA instruction MUL_Q.H
 *
 *  Copyright (C) 2018  Wave Computing, Inc.
 *  Copyright (C) 2018  Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 */

#include <sys/time.h>
#include <stdint.h>

#include "../../../../include/wrappers_msa.h"
#include "../../../../include/test_inputs.h"
#include "../../../../include/test_utils.h"

#define TEST_COUNT_TOTAL (                                                \
            (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
            (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))


int32_t main(void)
{
    char *instruction_name = "MUL_Q.H";
    int32_t ret;
    uint32_t i, j;
    struct timeval start, end;
    double elapsed_time;

    uint64_t b128_result[TEST_COUNT_TOTAL][2];
    uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },    /*   0  */
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
        { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, },
        { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },    /*   8  */
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },    /*  16  */
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x38e438e438e438e4ULL, 0x38e438e438e438e4ULL, },
        { 0xc71cc71cc71cc71cULL, 0xc71cc71cc71cc71cULL, },
        { 0x2222222222222222ULL, 0x2222222222222222ULL, },
        { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
        { 0x12f6da134bdb12f6ULL, 0xda134bdb12f6da13ULL, },
        { 0xed0925edb425ed09ULL, 0x25edb425ed0925edULL, },
        { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },    /*  24  */
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0xc71cc71cc71cc71cULL, 0xc71cc71cc71cc71cULL, },
        { 0x38e338e338e338e3ULL, 0x38e338e338e338e3ULL, },
        { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
        { 0x2221222122212221ULL, 0x2221222122212221ULL, },
        { 0xed0925ecb425ed09ULL, 0x25ecb425ed0925ecULL, },
        { 0x12f5da124bd912f5ULL, 0xda124bd912f5da12ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },    /*  32  */
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x2222222222222222ULL, 0x2222222222222222ULL, },
        { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
        { 0x147b147b147b147bULL, 0x147b147b147b147bULL, },
        { 0xeb84eb84eb84eb84ULL, 0xeb84eb84eb84eb84ULL, },
        { 0x0b60e93e2d830b60ULL, 0xe93e2d830b60e93eULL, },
        { 0xf49f16c1d27cf49fULL, 0x16c1d27cf49f16c1ULL, },
        { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },    /*  40  */
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
        { 0x2221222122212221ULL, 0x2221222122212221ULL, },
        { 0xeb84eb84eb84eb84ULL, 0xeb84eb84eb84eb84ULL, },
        { 0x147a147a147a147aULL, 0x147a147a147a147aULL, },
        { 0xf49f16c1d27cf49fULL, 0x16c1d27cf49f16c1ULL, },
        { 0x0b60e93e2d820b60ULL, 0xe93e2d820b60e93eULL, },
        { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, },    /*  48  */
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x12f6da134bdb12f6ULL, 0xda134bdb12f6da13ULL, },
        { 0xed0925ecb425ed09ULL, 0x25ecb425ed0925ecULL, },
        { 0x0b60e93e2d830b60ULL, 0xe93e2d830b60e93eULL, },
        { 0xf49f16c1d27cf49fULL, 0x16c1d27cf49f16c1ULL, },
        { 0x0652194865240652ULL, 0x1948652406521948ULL, },
        { 0xf9ade6b79adcf9adULL, 0xe6b79adcf9ade6b7ULL, },
        { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, },    /*  56  */
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0xed0925edb425ed09ULL, 0x25edb425ed0925edULL, },
        { 0x12f5da124bd912f5ULL, 0xda124bd912f5da12ULL, },
        { 0xf49f16c1d27cf49fULL, 0x16c1d27cf49f16c1ULL, },
        { 0x0b60e93e2d820b60ULL, 0xe93e2d820b60e93eULL, },
        { 0xf9ade6b79adcf9adULL, 0xe6b79adcf9ade6b7ULL, },
        { 0x0651194965220651ULL, 0x1949652206511949ULL, },
        { 0x6fb904f60cbd38c7ULL, 0x2c6b0102000431f1ULL, },    /*  64  */
        { 0x03faffec1879da0eULL, 0x0b2bf9e1ffbfcc2aULL, },
        { 0x4e261003e9dab268ULL, 0x1778faf00101e8d6ULL, },
        { 0x9712fb9b1db7ec38ULL, 0xbccff56b01071259ULL, },
        { 0x03faffec1879da0eULL, 0x0b2bf9e1ffbfcc2aULL, },
        { 0x002400002f03195aULL, 0x02cf2515038635ccULL, },
        { 0x02c8ffc1d57533d9ULL, 0x05e71eaef1eb1809ULL, },
        { 0xfc43001139150d37ULL, 0xef194023f19aecf4ULL, },
        { 0x4e261003e9dab268ULL, 0x1778faf00101e8d6ULL, },    /*  72  */
        { 0x02c8ffc1d57533d9ULL, 0x05e71eaef1eb1809ULL, },
        { 0x36aa33af267d6a08ULL, 0x0c67196238380abdULL, },
        { 0xb69bf1d4cc591b07ULL, 0xdc7e3510397df77dULL, },
        { 0x9712fb9b1db7ec38ULL, 0xbccff56b01071259ULL, },
        { 0xfc43001139150d37ULL, 0xef194023f19aecf4ULL, },
};

    gettimeofday(&start, NULL);

    for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
        for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
            do_msa_MUL_Q_H(b128_pattern[i], b128_pattern[j],
                           b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
        }
    }

    for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
        for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
            do_msa_MUL_Q_H(b128_random[i], b128_random[j],
                           b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
                                        (PATTERN_INPUTS_SHORT_COUNT)) +
                                       RANDOM_INPUTS_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(instruction_name, TEST_COUNT_TOTAL, elapsed_time,
                        &b128_result[0][0], &b128_expect[0][0]);

    return ret;
}
+151 −0
Original line number Diff line number Diff line
/*
 *  Test program for MSA instruction MUL_Q.W
 *
 *  Copyright (C) 2018  Wave Computing, Inc.
 *  Copyright (C) 2018  Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 */

#include <sys/time.h>
#include <stdint.h>

#include "../../../../include/wrappers_msa.h"
#include "../../../../include/test_inputs.h"
#include "../../../../include/test_utils.h"

#define TEST_COUNT_TOTAL (                                                \
            (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
            (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))


int32_t main(void)
{
    char *instruction_name = "MUL_Q.W";
    int32_t ret;
    uint32_t i, j;
    struct timeval start, end;
    double elapsed_time;

    uint64_t b128_result[TEST_COUNT_TOTAL][2];
    uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },    /*   0  */
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
        { 0x0000000000000000ULL, 0xffffffff00000000ULL, },
        { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },    /*   8  */
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },    /*  16  */
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x38e38e3938e38e39ULL, 0x38e38e3938e38e39ULL, },
        { 0xc71c71c6c71c71c6ULL, 0xc71c71c6c71c71c6ULL, },
        { 0x2222222222222222ULL, 0x2222222222222222ULL, },
        { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
        { 0x12f684be4bda12f7ULL, 0xda12f68512f684beULL, },
        { 0xed097b42b425ed09ULL, 0x25ed097bed097b42ULL, },
        { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },    /*  24  */
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0xc71c71c6c71c71c6ULL, 0xc71c71c6c71c71c6ULL, },
        { 0x38e38e3838e38e38ULL, 0x38e38e3838e38e38ULL, },
        { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
        { 0x2222222122222221ULL, 0x2222222122222221ULL, },
        { 0xed097b42b425ed09ULL, 0x25ed097aed097b42ULL, },
        { 0x12f684bd4bda12f5ULL, 0xda12f68412f684bdULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },    /*  32  */
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x2222222222222222ULL, 0x2222222222222222ULL, },
        { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
        { 0x147ae148147ae148ULL, 0x147ae148147ae148ULL, },
        { 0xeb851eb8eb851eb8ULL, 0xeb851eb8eb851eb8ULL, },
        { 0x0b60b60b2d82d82eULL, 0xe93e93e90b60b60bULL, },
        { 0xf49f49f4d27d27d2ULL, 0x16c16c17f49f49f4ULL, },
        { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },    /*  40  */
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
        { 0x2222222122222221ULL, 0x2222222122222221ULL, },
        { 0xeb851eb8eb851eb8ULL, 0xeb851eb8eb851eb8ULL, },
        { 0x147ae147147ae147ULL, 0x147ae147147ae147ULL, },
        { 0xf49f49f4d27d27d2ULL, 0x16c16c16f49f49f4ULL, },
        { 0x0b60b60b2d82d82dULL, 0xe93e93e90b60b60bULL, },
        { 0x0000000000000000ULL, 0xffffffff00000000ULL, },    /*  48  */
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x12f684be4bda12f7ULL, 0xda12f68512f684beULL, },
        { 0xed097b42b425ed09ULL, 0x25ed097aed097b42ULL, },
        { 0x0b60b60b2d82d82eULL, 0xe93e93e90b60b60bULL, },
        { 0xf49f49f4d27d27d2ULL, 0x16c16c16f49f49f4ULL, },
        { 0x06522c3f6522c3f3ULL, 0x1948b0fc06522c3fULL, },
        { 0xf9add3c09add3c0dULL, 0xe6b74f03f9add3c0ULL, },
        { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },    /*  56  */
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0xed097b42b425ed09ULL, 0x25ed097bed097b42ULL, },
        { 0x12f684bd4bda12f5ULL, 0xda12f68412f684bdULL, },
        { 0xf49f49f4d27d27d2ULL, 0x16c16c17f49f49f4ULL, },
        { 0x0b60b60b2d82d82dULL, 0xe93e93e90b60b60bULL, },
        { 0xf9add3c09add3c0dULL, 0xe6b74f03f9add3c0ULL, },
        { 0x06522c3f6522c3f1ULL, 0x1948b0fc06522c3fULL, },
        { 0x6fb7e8890cbdc0d2ULL, 0x2c6b144600049a04ULL, },    /*  64  */
        { 0x03fa514e1879c701ULL, 0x0b2c6ca9ffbf8ac6ULL, },
        { 0x4e252086e9daefbfULL, 0x1779189301015a34ULL, },
        { 0x9713a7171db7f3a5ULL, 0xbccfb4690107236fULL, },
        { 0x03fa514e1879c701ULL, 0x0b2c6ca9ffbf8ac6ULL, },
        { 0x002442012f047611ULL, 0x02cf8c140386e68eULL, },
        { 0x02c84b87d575d121ULL, 0x05e79a8af1eb1c52ULL, },
        { 0xfc439edc3916c1e4ULL, 0xef19389cf19a0fddULL, },
        { 0x4e252086e9daefbfULL, 0x1779189301015a34ULL, },    /*  72  */
        { 0x02c84b87d575d121ULL, 0x05e79a8af1eb1c52ULL, },
        { 0x36a93aff267d11c3ULL, 0x0c6788643838c14cULL, },
        { 0xb69baa39cc590fcdULL, 0xdc7e6df7397c58d9ULL, },
        { 0x9713a7171db7f3a5ULL, 0xbccfb4690107236fULL, },
        { 0xfc439edc3916c1e4ULL, 0xef19389cf19a0fddULL, },
};

    gettimeofday(&start, NULL);

    for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
        for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
            do_msa_MUL_Q_W(b128_pattern[i], b128_pattern[j],
                           b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
        }
    }

    for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
        for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
            do_msa_MUL_Q_W(b128_random[i], b128_random[j],
                           b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
                                        (PATTERN_INPUTS_SHORT_COUNT)) +
                                       RANDOM_INPUTS_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(instruction_name, TEST_COUNT_TOTAL, elapsed_time,
                        &b128_result[0][0], &b128_expect[0][0]);

    return ret;
}
+151 −0
Original line number Diff line number Diff line
/*
 *  Test program for MSA instruction MULR_Q.H
 *
 *  Copyright (C) 2018  Wave Computing, Inc.
 *  Copyright (C) 2018  Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 */

#include <sys/time.h>
#include <stdint.h>

#include "../../../../include/wrappers_msa.h"
#include "../../../../include/test_inputs.h"
#include "../../../../include/test_utils.h"

#define TEST_COUNT_TOTAL (                                                \
            (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
            (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))


int32_t main(void)
{
    char *instruction_name = "MULR_Q.H";
    int32_t ret;
    uint32_t i, j;
    struct timeval start, end;
    double elapsed_time;

    uint64_t b128_result[TEST_COUNT_TOTAL][2];
    uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },    /*   0  */
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0001000100010001ULL, 0x0001000100010001ULL, },
        { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000010000ULL, 0x0000000100000000ULL, },
        { 0x00000000ffff0000ULL, 0x0000ffff00000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },    /*   8  */
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0001000100010001ULL, 0x0001000100010001ULL, },    /*  16  */
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x38e438e438e438e4ULL, 0x38e438e438e438e4ULL, },
        { 0xc71cc71cc71cc71cULL, 0xc71cc71cc71cc71cULL, },
        { 0x2223222322232223ULL, 0x2223222322232223ULL, },
        { 0xdddedddedddedddeULL, 0xdddedddedddedddeULL, },
        { 0x12f7da134bdb12f7ULL, 0xda134bdb12f7da13ULL, },
        { 0xed0a25eeb425ed0aULL, 0x25eeb425ed0a25eeULL, },
        { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },    /*  24  */
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0xc71cc71cc71cc71cULL, 0xc71cc71cc71cc71cULL, },
        { 0x38e338e338e338e3ULL, 0x38e338e338e338e3ULL, },
        { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
        { 0x2222222222222222ULL, 0x2222222222222222ULL, },
        { 0xed0925edb426ed09ULL, 0x25edb426ed0925edULL, },
        { 0x12f6da134bda12f6ULL, 0xda134bda12f6da13ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },    /*  32  */
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x2223222322232223ULL, 0x2223222322232223ULL, },
        { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
        { 0x147c147c147c147cULL, 0x147c147c147c147cULL, },
        { 0xeb85eb85eb85eb85ULL, 0xeb85eb85eb85eb85ULL, },
        { 0x0b61e93e2d840b61ULL, 0xe93e2d840b61e93eULL, },
        { 0xf49f16c2d27cf49fULL, 0x16c2d27cf49f16c2ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },    /*  40  */
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0xdddedddedddedddeULL, 0xdddedddedddedddeULL, },
        { 0x2222222222222222ULL, 0x2222222222222222ULL, },
        { 0xeb85eb85eb85eb85ULL, 0xeb85eb85eb85eb85ULL, },
        { 0x147b147b147b147bULL, 0x147b147b147b147bULL, },
        { 0xf49f16c1d27df49fULL, 0x16c1d27df49f16c1ULL, },
        { 0x0b60e93e2d830b60ULL, 0xe93e2d830b60e93eULL, },
        { 0x0000000000010000ULL, 0x0000000100000000ULL, },    /*  48  */
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x12f7da134bdb12f7ULL, 0xda134bdb12f7da13ULL, },
        { 0xed0925edb426ed09ULL, 0x25edb426ed0925edULL, },
        { 0x0b61e93e2d840b61ULL, 0xe93e2d840b61e93eULL, },
        { 0xf49f16c1d27df49fULL, 0x16c1d27df49f16c1ULL, },
        { 0x0652194865240652ULL, 0x1948652406521948ULL, },
        { 0xf9aee6b79addf9aeULL, 0xe6b79addf9aee6b7ULL, },
        { 0x00000000ffff0000ULL, 0x0000ffff00000000ULL, },    /*  56  */
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0xed0a25eeb425ed0aULL, 0x25eeb425ed0a25eeULL, },
        { 0x12f6da134bda12f6ULL, 0xda134bda12f6da13ULL, },
        { 0xf49f16c2d27cf49fULL, 0x16c2d27cf49f16c2ULL, },
        { 0x0b60e93e2d830b60ULL, 0xe93e2d830b60e93eULL, },
        { 0xf9aee6b79addf9aeULL, 0xe6b79addf9aee6b7ULL, },
        { 0x0652194965230652ULL, 0x1949652306521949ULL, },
        { 0x6fba04f60cbe38c7ULL, 0x2c6b0102000531f1ULL, },    /*  64  */
        { 0x03faffed1879da0fULL, 0x0b2cf9e2ffbfcc2aULL, },
        { 0x4e261004e9dbb269ULL, 0x1779faf00102e8d7ULL, },
        { 0x9713fb9c1db7ec39ULL, 0xbccff56b01081259ULL, },
        { 0x03faffed1879da0fULL, 0x0b2cf9e2ffbfcc2aULL, },
        { 0x002400002f04195bULL, 0x02cf2516038735cdULL, },
        { 0x02c8ffc1d57633daULL, 0x05e71eaff1eb180aULL, },
        { 0xfc44001139160d37ULL, 0xef1a4023f19aecf5ULL, },
        { 0x4e261004e9dbb269ULL, 0x1779faf00102e8d7ULL, },    /*  72  */
        { 0x02c8ffc1d57633daULL, 0x05e71eaff1eb180aULL, },
        { 0x36aa33af267e6a09ULL, 0x0c67196338390abeULL, },
        { 0xb69bf1d4cc591b07ULL, 0xdc7f3511397df77eULL, },
        { 0x9713fb9c1db7ec39ULL, 0xbccff56b01081259ULL, },
        { 0xfc44001139160d37ULL, 0xef1a4023f19aecf5ULL, },
};

    gettimeofday(&start, NULL);

    for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
        for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
            do_msa_MULR_Q_H(b128_pattern[i], b128_pattern[j],
                           b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
        }
    }

    for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
        for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
            do_msa_MULR_Q_H(b128_random[i], b128_random[j],
                           b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
                                        (PATTERN_INPUTS_SHORT_COUNT)) +
                                       RANDOM_INPUTS_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(instruction_name, TEST_COUNT_TOTAL, elapsed_time,
                        &b128_result[0][0], &b128_expect[0][0]);

    return ret;
}
+151 −0

File added.

Preview size limit exceeded, changes collapsed.

+151 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading