Commit 99d423e5 authored by Aleksandar Markovic's avatar Aleksandar Markovic
Browse files

tests/tcg: target/mips: Add tests for MSA shift instructions



Add tests for MSA shift instructions. This includes following
instructions:

  * SLL.B - shift left logical (bytes)
  * SLL.H - shift left logical (halfwords)
  * SLL.W - shift left logical (words)
  * SLL.D - shift left logical (doublewords)
  * SRA.B - shift right arithmetic (bytes)
  * SRA.H - shift right arithmetic (halfwords)
  * SRA.W - shift right arithmetic (words)
  * SRA.D - shift right arithmetic (doublewords)
  * SRAR.B - shift right arithmetic rounded (bytes)
  * SRAR.H - shift right arithmetic rounded (halfwords)
  * SRAR.W - shift right arithmetic rounded (words)
  * SRAR.D - shift right arithmetic rounded (doublewords)
  * SRL.B - shift right logical (bytes)
  * SRL.H - shift right logical (halfwords)
  * SRL.W - shift right logical (words)
  * SRL.D - shift right logical (doublewords)
  * SRLR.B - shift right logical rounded (bytes)
  * SRLR.H - shift right logical rounded (halfwords)
  * SRLR.W - shift right logical rounded (words)
  * SRLR.D - shift right logical rounded (doublewords)

Signed-off-by: default avatarAleksandar Markovic <amarkovic@wavecomp.com>
Reviewed-by: default avatarAleksandar Rikalo <arikalo@wavecomp.com>
Message-Id: <1559838440-9866-7-git-send-email-aleksandar.markovic@rt-rk.com>
parent 6ec12d4f
Loading
Loading
Loading
Loading
+153 −0
Original line number Diff line number Diff line
/*
 *  Test program for MSA instruction SLL.B
 *
 *  Copyright (C) 2019  Wave Computing, Inc.
 *  Copyright (C) 2019  Aleksandar Markovic <amarkovic@wavecomp.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_128.h"
#include "../../../../include/test_utils_128.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 = "SLL.B";
    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] = {
        { 0x8080808080808080ULL, 0x8080808080808080ULL, },    /*   0  */
        { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
        { 0xfcfcfcfcfcfcfcfcULL, 0xfcfcfcfcfcfcfcfcULL, },
        { 0xe0e0e0e0e0e0e0e0ULL, 0xe0e0e0e0e0e0e0e0ULL, },
        { 0xf0f0f0f0f0f0f0f0ULL, 0xf0f0f0f0f0f0f0f0ULL, },
        { 0xf8f8f8f8f8f8f8f8ULL, 0xf8f8f8f8f8f8f8f8ULL, },
        { 0xf8c0fff8c0fff8c0ULL, 0xfff8c0fff8c0fff8ULL, },
        { 0xf0fe80f0fe80f0feULL, 0x80f0fe80f0fe80f0ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },    /*   8  */
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },    /*  16  */
        { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
        { 0xa8a8a8a8a8a8a8a8ULL, 0xa8a8a8a8a8a8a8a8ULL, },
        { 0x4040404040404040ULL, 0x4040404040404040ULL, },
        { 0xa0a0a0a0a0a0a0a0ULL, 0xa0a0a0a0a0a0a0a0ULL, },
        { 0x5050505050505050ULL, 0x5050505050505050ULL, },
        { 0x5080aa5080aa5080ULL, 0xaa5080aa5080aa50ULL, },
        { 0xa05400a05400a054ULL, 0x00a05400a05400a0ULL, },
        { 0x8080808080808080ULL, 0x8080808080808080ULL, },    /*  24  */
        { 0x5555555555555555ULL, 0x5555555555555555ULL, },
        { 0x5454545454545454ULL, 0x5454545454545454ULL, },
        { 0xa0a0a0a0a0a0a0a0ULL, 0xa0a0a0a0a0a0a0a0ULL, },
        { 0x5050505050505050ULL, 0x5050505050505050ULL, },
        { 0xa8a8a8a8a8a8a8a8ULL, 0xa8a8a8a8a8a8a8a8ULL, },
        { 0xa84055a84055a840ULL, 0x55a84055a84055a8ULL, },
        { 0x50aa8050aa8050aaULL, 0x8050aa8050aa8050ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },    /*  32  */
        { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
        { 0x3030303030303030ULL, 0x3030303030303030ULL, },
        { 0x8080808080808080ULL, 0x8080808080808080ULL, },
        { 0xc0c0c0c0c0c0c0c0ULL, 0xc0c0c0c0c0c0c0c0ULL, },
        { 0x6060606060606060ULL, 0x6060606060606060ULL, },
        { 0x6000cc6000cc6000ULL, 0xcc6000cc6000cc60ULL, },
        { 0xc09800c09800c098ULL, 0x00c09800c09800c0ULL, },
        { 0x8080808080808080ULL, 0x8080808080808080ULL, },    /*  40  */
        { 0x3333333333333333ULL, 0x3333333333333333ULL, },
        { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
        { 0x6060606060606060ULL, 0x6060606060606060ULL, },
        { 0x3030303030303030ULL, 0x3030303030303030ULL, },
        { 0x9898989898989898ULL, 0x9898989898989898ULL, },
        { 0x98c03398c03398c0ULL, 0x3398c03398c03398ULL, },
        { 0x3066803066803066ULL, 0x8030668030668030ULL, },
        { 0x8000008000008000ULL, 0x0080000080000080ULL, },    /*  48  */
        { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
        { 0x8c38e08c38e08c38ULL, 0xe08c38e08c38e08cULL, },
        { 0x60c00060c00060c0ULL, 0x0060c00060c00060ULL, },
        { 0x30e08030e08030e0ULL, 0x8030e08030e08030ULL, },
        { 0x1870c01870c01870ULL, 0xc01870c01870c018ULL, },
        { 0x1880381880381880ULL, 0x3818803818803818ULL, },
        { 0x301c00301c00301cULL, 0x00301c00301c0030ULL, },
        { 0x0080800080800080ULL, 0x8000808000808000ULL, },    /*  56  */
        { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
        { 0x70c41c70c41c70c4ULL, 0x1c70c41c70c41c70ULL, },
        { 0x8020e08020e08020ULL, 0xe08020e08020e080ULL, },
        { 0xc01070c01070c010ULL, 0x70c01070c01070c0ULL, },
        { 0xe08838e08838e088ULL, 0x38e08838e08838e0ULL, },
        { 0xe040c7e040c7e040ULL, 0xc7e040c7e040c7e0ULL, },
        { 0xc0e280c0e280c0e2ULL, 0x80c0e280c0e280c0ULL, },
        { 0x88a880c02888a040ULL, 0x5880588080d8b0c0ULL, },    /*  64  */
        { 0x4080e66000108040ULL, 0x2c805878c080c0c0ULL, },
        { 0x80a880305000a840ULL, 0x8067c000f0d800c0ULL, },
        { 0x8800808000c45400ULL, 0x60ce0b5efcecc00cULL, },
        { 0xfbf800304d4ce008ULL, 0x9080d88040f852c0ULL, },
        { 0xd8800018a0988008ULL, 0x4880d868a08048c0ULL, },
        { 0xb0f8008c9a803808ULL, 0x00f7c000a8f840c0ULL, },
        { 0xfb00006040261c00ULL, 0x40eebb1a2afc48fcULL, },
        { 0xac6880a0b93c6080ULL, 0x380030c0c0582540ULL, },    /*  72  */
        { 0x6080ae5020788080ULL, 0x9c0030fc60809440ULL, },
        { 0xc06880a872805880ULL, 0x80d880805858a040ULL, },
        { 0xac008040409e2c00ULL, 0xe0b0c6ff56ac9414ULL, },
        { 0x703c80d05ec4404eULL, 0x688040004010e200ULL, },
        { 0x80c01668c088004eULL, 0x3480406020008800ULL, },
        { 0x003c8034bc80104eULL, 0x80f1000048104000ULL, },
        { 0x708080a080628880ULL, 0xa0e288d8520888a0ULL, },
    };

    gettimeofday(&start, NULL);

    for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
        for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
            do_msa_SLL_B(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_SLL_B(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;
}
+153 −0
Original line number Diff line number Diff line
/*
 *  Test program for MSA instruction SLL.D
 *
 *  Copyright (C) 2019  Wave Computing, Inc.
 *  Copyright (C) 2019  Aleksandar Markovic <amarkovic@wavecomp.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_128.h"
#include "../../../../include/test_utils_128.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 = "SLL.D";
    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] = {
        { 0x8000000000000000ULL, 0x8000000000000000ULL, },    /*   0  */
        { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
        { 0xfffffc0000000000ULL, 0xfffffc0000000000ULL, },
        { 0xffffffffffe00000ULL, 0xffffffffffe00000ULL, },
        { 0xfffffffffffff000ULL, 0xfffffffffffff000ULL, },
        { 0xfff8000000000000ULL, 0xfff8000000000000ULL, },
        { 0xffffffffffffc000ULL, 0xfffffff800000000ULL, },
        { 0xfffe000000000000ULL, 0xfffffffff0000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },    /*   8  */
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },    /*  16  */
        { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
        { 0xaaaaa80000000000ULL, 0xaaaaa80000000000ULL, },
        { 0x5555555555400000ULL, 0x5555555555400000ULL, },
        { 0xaaaaaaaaaaaaa000ULL, 0xaaaaaaaaaaaaa000ULL, },
        { 0x5550000000000000ULL, 0x5550000000000000ULL, },
        { 0xaaaaaaaaaaaa8000ULL, 0x5555555000000000ULL, },
        { 0x5554000000000000ULL, 0xaaaaaaaaa0000000ULL, },
        { 0x8000000000000000ULL, 0x8000000000000000ULL, },    /*  24  */
        { 0x5555555555555555ULL, 0x5555555555555555ULL, },
        { 0x5555540000000000ULL, 0x5555540000000000ULL, },
        { 0xaaaaaaaaaaa00000ULL, 0xaaaaaaaaaaa00000ULL, },
        { 0x5555555555555000ULL, 0x5555555555555000ULL, },
        { 0xaaa8000000000000ULL, 0xaaa8000000000000ULL, },
        { 0x5555555555554000ULL, 0xaaaaaaa800000000ULL, },
        { 0xaaaa000000000000ULL, 0x5555555550000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },    /*  32  */
        { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
        { 0x3333300000000000ULL, 0x3333300000000000ULL, },
        { 0x9999999999800000ULL, 0x9999999999800000ULL, },
        { 0xccccccccccccc000ULL, 0xccccccccccccc000ULL, },
        { 0x6660000000000000ULL, 0x6660000000000000ULL, },
        { 0x3333333333330000ULL, 0x6666666000000000ULL, },
        { 0x9998000000000000ULL, 0xccccccccc0000000ULL, },
        { 0x8000000000000000ULL, 0x8000000000000000ULL, },    /*  40  */
        { 0x3333333333333333ULL, 0x3333333333333333ULL, },
        { 0xcccccc0000000000ULL, 0xcccccc0000000000ULL, },
        { 0x6666666666600000ULL, 0x6666666666600000ULL, },
        { 0x3333333333333000ULL, 0x3333333333333000ULL, },
        { 0x9998000000000000ULL, 0x9998000000000000ULL, },
        { 0xccccccccccccc000ULL, 0x9999999800000000ULL, },
        { 0x6666000000000000ULL, 0x3333333330000000ULL, },
        { 0x0000000000000000ULL, 0x8000000000000000ULL, },    /*  48  */
        { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
        { 0xe38e380000000000ULL, 0x38e38c0000000000ULL, },
        { 0x1c71c71c71c00000ULL, 0xc71c71c71c600000ULL, },
        { 0xe38e38e38e38e000ULL, 0x38e38e38e38e3000ULL, },
        { 0x1c70000000000000ULL, 0xc718000000000000ULL, },
        { 0x8e38e38e38e38000ULL, 0x1c71c71800000000ULL, },
        { 0xc71c000000000000ULL, 0x8e38e38e30000000ULL, },
        { 0x8000000000000000ULL, 0x0000000000000000ULL, },    /*  56  */
        { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
        { 0x1c71c40000000000ULL, 0xc71c700000000000ULL, },
        { 0xe38e38e38e200000ULL, 0x38e38e38e3800000ULL, },
        { 0x1c71c71c71c71000ULL, 0xc71c71c71c71c000ULL, },
        { 0xe388000000000000ULL, 0x38e0000000000000ULL, },
        { 0x71c71c71c71c4000ULL, 0xe38e38e000000000ULL, },
        { 0x38e2000000000000ULL, 0x71c71c71c0000000ULL, },
        { 0x886ae6cc28625540ULL, 0x70b5efe7bb00c000ULL, },    /*  64  */
        { 0x6ae6cc2862554000ULL, 0xc000000000000000ULL, },
        { 0x886ae6cc28625540ULL, 0xb5efe7bb00c00000ULL, },
        { 0xb9b30a1895500000ULL, 0xfe7bb00c00000000ULL, },
        { 0xfbbe00634d93c708ULL, 0x7bb1a153f52fc000ULL, },
        { 0xbe00634d93c70800ULL, 0xc000000000000000ULL, },
        { 0xfbbe00634d93c708ULL, 0xb1a153f52fc00000ULL, },
        { 0x8018d364f1c20000ULL, 0x153f52fc00000000ULL, },
        { 0xac5aaeaab9cf8b80ULL, 0x8c6ffab2b2514000ULL, },    /*  72  */
        { 0x5aaeaab9cf8b8000ULL, 0x4000000000000000ULL, },
        { 0xac5aaeaab9cf8b80ULL, 0x6ffab2b251400000ULL, },
        { 0xabaaae73e2e00000ULL, 0xab2b251400000000ULL, },
        { 0x704f164d5e31e24eULL, 0x188d8a942e2a0000ULL, },
        { 0x4f164d5e31e24e00ULL, 0x0000000000000000ULL, },
        { 0x704f164d5e31e24eULL, 0x8d8a942e2a000000ULL, },
        { 0xc593578c78938000ULL, 0xa942e2a000000000ULL, },
    };

    gettimeofday(&start, NULL);

    for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
        for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
            do_msa_SLL_D(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_SLL_D(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;
}
+153 −0
Original line number Diff line number Diff line
/*
 *  Test program for MSA instruction SLL.H
 *
 *  Copyright (C) 2019  Wave Computing, Inc.
 *  Copyright (C) 2019  Aleksandar Markovic <amarkovic@wavecomp.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_128.h"
#include "../../../../include/test_utils_128.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 = "SLL.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] = {
        { 0x8000800080008000ULL, 0x8000800080008000ULL, },    /*   0  */
        { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
        { 0xfc00fc00fc00fc00ULL, 0xfc00fc00fc00fc00ULL, },
        { 0xffe0ffe0ffe0ffe0ULL, 0xffe0ffe0ffe0ffe0ULL, },
        { 0xf000f000f000f000ULL, 0xf000f000f000f000ULL, },
        { 0xfff8fff8fff8fff8ULL, 0xfff8fff8fff8fff8ULL, },
        { 0xc000fff8ff00c000ULL, 0xfff8ff00c000fff8ULL, },
        { 0xfffef000ff80fffeULL, 0xf000ff80fffef000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },    /*   8  */
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },    /*  16  */
        { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
        { 0xa800a800a800a800ULL, 0xa800a800a800a800ULL, },
        { 0x5540554055405540ULL, 0x5540554055405540ULL, },
        { 0xa000a000a000a000ULL, 0xa000a000a000a000ULL, },
        { 0x5550555055505550ULL, 0x5550555055505550ULL, },
        { 0x80005550aa008000ULL, 0x5550aa0080005550ULL, },
        { 0x5554a00055005554ULL, 0xa00055005554a000ULL, },
        { 0x8000800080008000ULL, 0x8000800080008000ULL, },    /*  24  */
        { 0x5555555555555555ULL, 0x5555555555555555ULL, },
        { 0x5400540054005400ULL, 0x5400540054005400ULL, },
        { 0xaaa0aaa0aaa0aaa0ULL, 0xaaa0aaa0aaa0aaa0ULL, },
        { 0x5000500050005000ULL, 0x5000500050005000ULL, },
        { 0xaaa8aaa8aaa8aaa8ULL, 0xaaa8aaa8aaa8aaa8ULL, },
        { 0x4000aaa855004000ULL, 0xaaa855004000aaa8ULL, },
        { 0xaaaa5000aa80aaaaULL, 0x5000aa80aaaa5000ULL, },
        { 0x0000000000000000ULL, 0x0000000000000000ULL, },    /*  32  */
        { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
        { 0x3000300030003000ULL, 0x3000300030003000ULL, },
        { 0x9980998099809980ULL, 0x9980998099809980ULL, },
        { 0xc000c000c000c000ULL, 0xc000c000c000c000ULL, },
        { 0x6660666066606660ULL, 0x6660666066606660ULL, },
        { 0x00006660cc000000ULL, 0x6660cc0000006660ULL, },
        { 0x9998c00066009998ULL, 0xc00066009998c000ULL, },
        { 0x8000800080008000ULL, 0x8000800080008000ULL, },    /*  40  */
        { 0x3333333333333333ULL, 0x3333333333333333ULL, },
        { 0xcc00cc00cc00cc00ULL, 0xcc00cc00cc00cc00ULL, },
        { 0x6660666066606660ULL, 0x6660666066606660ULL, },
        { 0x3000300030003000ULL, 0x3000300030003000ULL, },
        { 0x9998999899989998ULL, 0x9998999899989998ULL, },
        { 0xc00099983300c000ULL, 0x99983300c0009998ULL, },
        { 0x6666300099806666ULL, 0x3000998066663000ULL, },
        { 0x0000800000000000ULL, 0x8000000000008000ULL, },    /*  48  */
        { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
        { 0x38008c00e0003800ULL, 0x8c00e00038008c00ULL, },
        { 0x71c01c60c70071c0ULL, 0x1c60c70071c01c60ULL, },
        { 0xe00030008000e000ULL, 0x30008000e0003000ULL, },
        { 0x1c70c71871c01c70ULL, 0xc71871c01c70c718ULL, },
        { 0x8000c71838008000ULL, 0xc71838008000c718ULL, },
        { 0xc71c30001c00c71cULL, 0x30001c00c71c3000ULL, },
        { 0x8000000080008000ULL, 0x0000800080000000ULL, },    /*  56  */
        { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
        { 0xc40070001c00c400ULL, 0x70001c00c4007000ULL, },
        { 0x8e20e38038e08e20ULL, 0xe38038e08e20e380ULL, },
        { 0x1000c00070001000ULL, 0xc00070001000c000ULL, },
        { 0xe38838e08e38e388ULL, 0x38e08e38e38838e0ULL, },
        { 0x400038e0c7004000ULL, 0x38e0c700400038e0ULL, },
        { 0x38e2c000e38038e2ULL, 0xc000e38038e2c000ULL, },
        { 0xa800c000a1885540ULL, 0xb3808000d800c000ULL, },    /*  64  */
        { 0x8000366043104000ULL, 0xb38078008000c000ULL, },
        { 0xa800300000005540ULL, 0x67000000d80000c0ULL, },
        { 0x0000800050c40000ULL, 0x96ce5e00f9ecb00cULL, },
        { 0xf8003000364cc708ULL, 0x7b808000f800c000ULL, },
        { 0x800003186c980800ULL, 0x7b8068008000c000ULL, },
        { 0xf8008c008000c708ULL, 0xf7000000f8002fc0ULL, },
        { 0x000060009b260000ULL, 0x25ee1a0054fc52fcULL, },
        { 0x6800a000e73c8b80ULL, 0xec00c00058004000ULL, },    /*  72  */
        { 0x80007550ce788000ULL, 0xec00fc0080004000ULL, },
        { 0x6800a80080008b80ULL, 0xd800800058005140ULL, },
        { 0x00004000739e0000ULL, 0x4fb0ff00acac2514ULL, },
        { 0x3c00d00078c4e24eULL, 0xf880000010000000ULL, },
        { 0xc000b268f1884e00ULL, 0xf880600000000000ULL, },
        { 0x3c0034008000e24eULL, 0xf100000010002a00ULL, },
        { 0x8000a000bc628000ULL, 0x1be2d800a508e2a0ULL, },
    };

    gettimeofday(&start, NULL);

    for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
        for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
            do_msa_SLL_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_SLL_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;
}
+153 −0

File added.

Preview size limit exceeded, changes collapsed.

+153 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading