diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2019-03-11 17:16:38 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2019-03-11 17:16:38 +0000 |
commit | c8761809385db04513b87af321c5feec82475421 (patch) | |
tree | 2d381041b034d701dc240487acc029e0e7ed9018 | |
parent | 208d92df447bde0f1f810fae8a2c523cdeb7a28f (diff) | |
parent | 53e116fed6dde572003aebf3bc32e25663eeb446 (diff) | |
download | qemu-c8761809385db04513b87af321c5feec82475421.zip |
Merge remote-tracking branch 'remotes/amarkovic/tags/mips-queue-mar-11-2019' into staging
MIPS queue for March 11th, 2019
# gpg: Signature made Mon 11 Mar 2019 14:16:09 GMT
# gpg: using RSA key D4972A8967F75A65
# gpg: Good signature from "Aleksandar Markovic <amarkovic@wavecomp.com>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg: There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 8526 FBF1 5DA3 811F 4A01 DD75 D497 2A89 67F7 5A65
* remotes/amarkovic/tags/mips-queue-mar-11-2019:
target/mips: Add tests for a variety of MSA integer subtract instructions
target/mips: Add tests for a variety of MSA integer multiply instructions
target/mips: Add tests for a variety of MSA integer dot product instructions
target/mips: Add tests for a variety of MSA integer divide instructions
target/mips: Add tests for a variety of MSA integer average instructions
tests/tcg: target/mips: Rename two header files for consistency
tests/tcg: target/mips: Correct preambles of test source files
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
175 files changed, 9200 insertions, 440 deletions
diff --git a/tests/tcg/mips/include/test_inputs.h b/tests/tcg/mips/include/test_inputs_128.h index 5406e4e2df..e4c22dde6e 100644 --- a/tests/tcg/mips/include/test_inputs.h +++ b/tests/tcg/mips/include/test_inputs_128.h @@ -1,8 +1,8 @@ /* * Header file for pattern and random test inputs * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -19,8 +19,8 @@ * */ -#ifndef TEST_INPUTS_H -#define TEST_INPUTS_H +#ifndef TEST_INPUTS_128_H +#define TEST_INPUTS_128_H #include <stdint.h> diff --git a/tests/tcg/mips/include/test_utils.h b/tests/tcg/mips/include/test_utils_128.h index 9672903eb5..cfd7ad3188 100644 --- a/tests/tcg/mips/include/test_utils.h +++ b/tests/tcg/mips/include/test_utils_128.h @@ -1,8 +1,8 @@ /* * Header file for test utilities * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -19,8 +19,8 @@ * */ -#ifndef TEST_UTILS_H -#define TEST_UTILS_H +#ifndef TEST_UTILS_128_H +#define TEST_UTILS_128_H #include <stdio.h> #include <stdint.h> diff --git a/tests/tcg/mips/include/wrappers_msa.h b/tests/tcg/mips/include/wrappers_msa.h index 9cffd55591..254e215b8a 100644 --- a/tests/tcg/mips/include/wrappers_msa.h +++ b/tests/tcg/mips/include/wrappers_msa.h @@ -1,8 +1,8 @@ /* * Header file for wrappers around MSA instructions assembler invocations * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 diff --git a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_b.c b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_b.c index d62943123e..c73ed2464e 100644 --- a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_b.c +++ b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_b.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction NLOC.B * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.h" +#include "../../../../include/test_inputs_128.h" +#include "../../../../include/test_utils_128.h" #define TEST_COUNT_TOTAL (PATTERN_INPUTS_COUNT + RANDOM_INPUTS_COUNT) diff --git a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_d.c b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_d.c index fad220ce0f..b10fb23e88 100644 --- a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_d.c +++ b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_d.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction NLOC.D * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.h" +#include "../../../../include/test_inputs_128.h" +#include "../../../../include/test_utils_128.h" #define TEST_COUNT_TOTAL (PATTERN_INPUTS_COUNT + RANDOM_INPUTS_COUNT) diff --git a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_h.c b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_h.c index 84cf974635..c1dc0754e6 100644 --- a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_h.c +++ b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_h.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction NLOC.H * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.h" +#include "../../../../include/test_inputs_128.h" +#include "../../../../include/test_utils_128.h" #define TEST_COUNT_TOTAL (PATTERN_INPUTS_COUNT + RANDOM_INPUTS_COUNT) diff --git a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_w.c b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_w.c index a0ed2020d6..4f7a556dec 100644 --- a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_w.c +++ b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_w.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction NLOC.W * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.h" +#include "../../../../include/test_inputs_128.h" +#include "../../../../include/test_utils_128.h" #define TEST_COUNT_TOTAL (PATTERN_INPUTS_COUNT + RANDOM_INPUTS_COUNT) diff --git a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_b.c b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_b.c index 9906eae987..c202ba4856 100644 --- a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_b.c +++ b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_b.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction NLZC.B * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.h" +#include "../../../../include/test_inputs_128.h" +#include "../../../../include/test_utils_128.h" #define TEST_COUNT_TOTAL (PATTERN_INPUTS_COUNT + RANDOM_INPUTS_COUNT) diff --git a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_d.c b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_d.c index 21222e30e8..1edead2860 100644 --- a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_d.c +++ b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_d.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction NLZC.D * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.h" +#include "../../../../include/test_inputs_128.h" +#include "../../../../include/test_utils_128.h" #define TEST_COUNT_TOTAL (PATTERN_INPUTS_COUNT + RANDOM_INPUTS_COUNT) diff --git a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_h.c b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_h.c index fbab9c3f3a..b2724c532e 100644 --- a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_h.c +++ b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_h.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction NLZC.H * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.h" +#include "../../../../include/test_inputs_128.h" +#include "../../../../include/test_utils_128.h" #define TEST_COUNT_TOTAL (PATTERN_INPUTS_COUNT + RANDOM_INPUTS_COUNT) diff --git a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_w.c b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_w.c index dc33366d9e..b547c73621 100644 --- a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_w.c +++ b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_w.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction NLZC.W * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.h" +#include "../../../../include/test_inputs_128.h" +#include "../../../../include/test_utils_128.h" #define TEST_COUNT_TOTAL (PATTERN_INPUTS_COUNT + RANDOM_INPUTS_COUNT) diff --git a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_b.c b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_b.c index f9033c7ee1..5918e7fcf3 100644 --- a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_b.c +++ b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_b.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction PCNT.B * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.h" +#include "../../../../include/test_inputs_128.h" +#include "../../../../include/test_utils_128.h" #define TEST_COUNT_TOTAL (PATTERN_INPUTS_COUNT + RANDOM_INPUTS_COUNT) diff --git a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_d.c b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_d.c index 132b4d0f4d..667ca3112a 100644 --- a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_d.c +++ b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_d.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction PCNT.D * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.h" +#include "../../../../include/test_inputs_128.h" +#include "../../../../include/test_utils_128.h" #define TEST_COUNT_TOTAL (PATTERN_INPUTS_COUNT + RANDOM_INPUTS_COUNT) diff --git a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_h.c b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_h.c index f469c09e17..2951f86983 100644 --- a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_h.c +++ b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_h.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction PCNT.H * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.h" +#include "../../../../include/test_inputs_128.h" +#include "../../../../include/test_utils_128.h" #define TEST_COUNT_TOTAL (PATTERN_INPUTS_COUNT + RANDOM_INPUTS_COUNT) diff --git a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_w.c b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_w.c index d73eff7a88..ab43ea92cd 100644 --- a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_w.c +++ b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_w.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction PCNT.W * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.h" +#include "../../../../include/test_inputs_128.h" +#include "../../../../include/test_utils_128.h" #define TEST_COUNT_TOTAL (PATTERN_INPUTS_COUNT + RANDOM_INPUTS_COUNT) diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_b.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_b.c index 9dca167638..d2ea54f43d 100644 --- a/tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_b.c +++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_b.c @@ -1,7 +1,7 @@ /* * Test program for MSA instruction ADD_A.B * - * Copyright (C) 2019 Wave Computing, Inc. + * Copyright (C) 2019 RT-RK Computer Based Systems LLC * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com> * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_d.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_d.c index 06a7a502a0..56b81f9090 100644 --- a/tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_d.c +++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_d.c @@ -1,7 +1,7 @@ /* * Test program for MSA instruction ADD_A.D * - * Copyright (C) 2019 Wave Computing, Inc. + * Copyright (C) 2019 RT-RK Computer Based Systems LLC * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com> * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_h.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_h.c index 5e591425aa..fe3c664997 100644 --- a/tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_h.c +++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_h.c @@ -1,7 +1,7 @@ /* * Test program for MSA instruction ADD_A.H * - * Copyright (C) 2019 Wave Computing, Inc. + * Copyright (C) 2019 RT-RK Computer Based Systems LLC * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com> * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_w.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_w.c index a12f9b9ac7..205117ea95 100644 --- a/tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_w.c +++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_w.c @@ -1,7 +1,7 @@ /* * Test program for MSA instruction ADD_A.W * - * Copyright (C) 2019 Wave Computing, Inc. + * Copyright (C) 2019 RT-RK Computer Based Systems LLC * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com> * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_b.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_b.c index 61b8e6e768..6939e91fe4 100644 --- a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_b.c +++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_b.c @@ -1,7 +1,7 @@ /* * Test program for MSA instruction ADDS_A.B * - * Copyright (C) 2019 Wave Computing, Inc. + * Copyright (C) 2019 RT-RK Computer Based Systems LLC * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com> * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_d.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_d.c index 8350f8f266..af0f3d3700 100644 --- a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_d.c +++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_d.c @@ -1,7 +1,7 @@ /* * Test program for MSA instruction ADDS_A.D * - * Copyright (C) 2019 Wave Computing, Inc. + * Copyright (C) 2019 RT-RK Computer Based Systems LLC * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com> * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_h.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_h.c index 952f9f892c..4d3774fef2 100644 --- a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_h.c +++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_h.c @@ -1,7 +1,7 @@ /* * Test program for MSA instruction ADDS_A.H * - * Copyright (C) 2019 Wave Computing, Inc. + * Copyright (C) 2019 RT-RK Computer Based Systems LLC * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com> * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_w.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_w.c index d058c64cc4..6f06fdc7cd 100644 --- a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_w.c +++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_w.c @@ -1,7 +1,7 @@ /* * Test program for MSA instruction ADDS_A.W * - * Copyright (C) 2019 Wave Computing, Inc. + * Copyright (C) 2019 RT-RK Computer Based Systems LLC * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com> * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_b.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_b.c index 63e27da626..e6cb9871f5 100644 --- a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_b.c +++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_b.c @@ -1,7 +1,7 @@ /* * Test program for MSA instruction ADDS_S.B * - * Copyright (C) 2019 Wave Computing, Inc. + * Copyright (C) 2019 RT-RK Computer Based Systems LLC * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com> * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_d.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_d.c index 2719cee6d6..2cda5d9661 100644 --- a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_d.c +++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_d.c @@ -1,7 +1,7 @@ /* * Test program for MSA instruction ADDS_S.D * - * Copyright (C) 2019 Wave Computing, Inc. + * Copyright (C) 2019 RT-RK Computer Based Systems LLC * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com> * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_h.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_h.c index 52740964a9..5539322423 100644 --- a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_h.c +++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_h.c @@ -1,7 +1,7 @@ /* * Test program for MSA instruction ADDS_S.H * - * Copyright (C) 2019 Wave Computing, Inc. + * Copyright (C) 2019 RT-RK Computer Based Systems LLC * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com> * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_w.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_w.c index c3a6292d89..4f2cc3862e 100644 --- a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_w.c +++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_w.c @@ -1,7 +1,7 @@ /* * Test program for MSA instruction ADDS_S.W * - * Copyright (C) 2019 Wave Computing, Inc. + * Copyright (C) 2019 RT-RK Computer Based Systems LLC * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com> * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_b.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_b.c index df5d85f2e9..e2d9be38e7 100644 --- a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_b.c +++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_b.c @@ -1,7 +1,7 @@ /* * Test program for MSA instruction ADDS_U.B * - * Copyright (C) 2019 Wave Computing, Inc. + * Copyright (C) 2019 RT-RK Computer Based Systems LLC * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com> * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_d.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_d.c index 10c665bcd7..8418c636b6 100644 --- a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_d.c +++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_d.c @@ -1,7 +1,7 @@ /* * Test program for MSA instruction ADDS_U.D * - * Copyright (C) 2019 Wave Computing, Inc. + * Copyright (C) 2019 RT-RK Computer Based Systems LLC * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com> * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_h.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_h.c index 1e32f000a8..8a3b5c5cf5 100644 --- a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_h.c +++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_h.c @@ -1,7 +1,7 @@ /* * Test program for MSA instruction ADDS_U.H * - * Copyright (C) 2019 Wave Computing, Inc. + * Copyright (C) 2019 RT-RK Computer Based Systems LLC * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com> * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_w.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_w.c index 938d2da8f4..b18bdc3ea0 100644 --- a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_w.c +++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_w.c @@ -1,7 +1,7 @@ /* * Test program for MSA instruction ADDS_U.W * - * Copyright (C) 2019 Wave Computing, Inc. + * Copyright (C) 2019 RT-RK Computer Based Systems LLC * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com> * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_b.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_b.c index 5dba38661d..c86c99291e 100644 --- a/tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_b.c +++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_b.c @@ -1,7 +1,7 @@ /* * Test program for MSA instruction ADDV.B * - * Copyright (C) 2019 Wave Computing, Inc. + * Copyright (C) 2019 RT-RK Computer Based Systems LLC * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com> * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_d.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_d.c index 339878c608..0f301515b3 100644 --- a/tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_d.c +++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_d.c @@ -1,7 +1,7 @@ /* * Test program for MSA instruction ADDV.D * - * Copyright (C) 2019 Wave Computing, Inc. + * Copyright (C) 2019 RT-RK Computer Based Systems LLC * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com> * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_h.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_h.c index 3add379f19..c6b4cf697b 100644 --- a/tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_h.c +++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_h.c @@ -1,7 +1,7 @@ /* * Test program for MSA instruction ADDV.H * - * Copyright (C) 2019 Wave Computing, Inc. + * Copyright (C) 2019 RT-RK Computer Based Systems LLC * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com> * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_w.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_w.c index 41f86abb18..2a565e8ed4 100644 --- a/tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_w.c +++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_w.c @@ -1,7 +1,7 @@ /* * Test program for MSA instruction ADDV.W * - * Copyright (C) 2019 Wave Computing, Inc. + * Copyright (C) 2019 RT-RK Computer Based Systems LLC * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com> * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_s_d.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_s_d.c index a6975e7931..7845dc0218 100644 --- a/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_s_d.c +++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_s_d.c @@ -1,7 +1,7 @@ /* * Test program for MSA instruction HADD_S.D * - * Copyright (C) 2019 Wave Computing, Inc. + * Copyright (C) 2019 RT-RK Computer Based Systems LLC * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com> * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_s_h.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_s_h.c index 3b95551d4d..ddc2de3ff2 100644 --- a/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_s_h.c +++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_s_h.c @@ -1,7 +1,7 @@ /* * Test program for MSA instruction HADD_S.H * - * Copyright (C) 2019 Wave Computing, Inc. + * Copyright (C) 2019 RT-RK Computer Based Systems LLC * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com> * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_s_w.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_s_w.c index 7a940b23cf..887cd1cd5c 100644 --- a/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_s_w.c +++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_s_w.c @@ -1,7 +1,7 @@ /* * Test program for MSA instruction HADD_S.W * - * Copyright (C) 2019 Wave Computing, Inc. + * Copyright (C) 2019 RT-RK Computer Based Systems LLC * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com> * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_u_d.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_u_d.c index d4cbe44dfd..f0710f15de 100644 --- a/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_u_d.c +++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_u_d.c @@ -1,7 +1,7 @@ /* * Test program for MSA instruction HADD_U.D * - * Copyright (C) 2019 Wave Computing, Inc. + * Copyright (C) 2019 RT-RK Computer Based Systems LLC * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com> * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_u_h.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_u_h.c index ca250575ed..fe55d3eaee 100644 --- a/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_u_h.c +++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_u_h.c @@ -1,7 +1,7 @@ /* * Test program for MSA instruction HADD_U.H * - * Copyright (C) 2019 Wave Computing, Inc. + * Copyright (C) 2019 RT-RK Computer Based Systems LLC * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com> * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_u_w.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_u_w.c index b302727f29..babe04d586 100644 --- a/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_u_w.c +++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_u_w.c @@ -1,7 +1,7 @@ /* * Test program for MSA instruction HADD_U.W * - * Copyright (C) 2019 Wave Computing, Inc. + * Copyright (C) 2019 RT-RK Computer Based Systems LLC * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com> * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_b.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_b.c new file mode 100644 index 0000000000..675fb90c72 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_b.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction AVE_S.B + * + * 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 = "AVE_S.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] = { + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0xd4d4d4d4d4d4d4d4ULL, 0xd4d4d4d4d4d4d4d4ULL, }, + { 0x2a2a2a2a2a2a2a2aULL, 0x2a2a2a2a2a2a2a2aULL, }, + { 0xe5e5e5e5e5e5e5e5ULL, 0xe5e5e5e5e5e5e5e5ULL, }, + { 0x1919191919191919ULL, 0x1919191919191919ULL, }, + { 0xf1c61bf1c61bf1c6ULL, 0x1bf1c61bf1c61bf1ULL, }, + { 0x0d38e30d38e30d38ULL, 0xe30d38e30d38e30dULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xd5d5d5d5d5d5d5d5ULL, 0xd5d5d5d5d5d5d5d5ULL, }, + { 0x2a2a2a2a2a2a2a2aULL, 0x2a2a2a2a2a2a2a2aULL, }, + { 0xe6e6e6e6e6e6e6e6ULL, 0xe6e6e6e6e6e6e6e6ULL, }, + { 0x1919191919191919ULL, 0x1919191919191919ULL, }, + { 0xf1c71cf1c71cf1c7ULL, 0x1cf1c71cf1c71cf1ULL, }, + { 0x0e38e30e38e30e38ULL, 0xe30e38e30e38e30eULL, }, + { 0xd4d4d4d4d4d4d4d4ULL, 0xd4d4d4d4d4d4d4d4ULL, }, /* 16 */ + { 0xd5d5d5d5d5d5d5d5ULL, 0xd5d5d5d5d5d5d5d5ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0xeeeeeeeeeeeeeeeeULL, 0xeeeeeeeeeeeeeeeeULL, }, + { 0xc69cf1c69cf1c69cULL, 0xf1c69cf1c69cf1c6ULL, }, + { 0xe30db8e30db8e30dULL, 0xb8e30db8e30db8e3ULL, }, + { 0x2a2a2a2a2a2a2a2aULL, 0x2a2a2a2a2a2a2a2aULL, }, /* 24 */ + { 0x2a2a2a2a2a2a2a2aULL, 0x2a2a2a2a2a2a2a2aULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x1010101010101010ULL, 0x1010101010101010ULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0x1cf1461cf1461cf1ULL, 0x461cf1461cf1461cULL, }, + { 0x38630e38630e3863ULL, 0x0e38630e38630e38ULL, }, + { 0xe5e5e5e5e5e5e5e5ULL, 0xe5e5e5e5e5e5e5e5ULL, }, /* 32 */ + { 0xe6e6e6e6e6e6e6e6ULL, 0xe6e6e6e6e6e6e6e6ULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0x1010101010101010ULL, 0x1010101010101010ULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0xd7ad02d7ad02d7adULL, 0x02d7ad02d7ad02d7ULL, }, + { 0xf41ec9f41ec9f41eULL, 0xc9f41ec9f41ec9f4ULL, }, + { 0x1919191919191919ULL, 0x1919191919191919ULL, }, /* 40 */ + { 0x1919191919191919ULL, 0x1919191919191919ULL, }, + { 0xeeeeeeeeeeeeeeeeULL, 0xeeeeeeeeeeeeeeeeULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x0be0350be0350be0ULL, 0x350be0350be0350bULL, }, + { 0x2752fd2752fd2752ULL, 0xfd2752fd2752fd27ULL, }, + { 0xf1c61bf1c61bf1c6ULL, 0x1bf1c61bf1c61bf1ULL, }, /* 48 */ + { 0xf1c71cf1c71cf1c7ULL, 0x1cf1c71cf1c71cf1ULL, }, + { 0xc69cf1c69cf1c69cULL, 0xf1c69cf1c69cf1c6ULL, }, + { 0x1cf1461cf1461cf1ULL, 0x461cf1461cf1461cULL, }, + { 0xd7ad02d7ad02d7adULL, 0x02d7ad02d7ad02d7ULL, }, + { 0x0be0350be0350be0ULL, 0x350be0350be0350bULL, }, + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0d38e30d38e30d38ULL, 0xe30d38e30d38e30dULL, }, /* 56 */ + { 0x0e38e30e38e30e38ULL, 0xe30e38e30e38e30eULL, }, + { 0xe30db8e30db8e30dULL, 0xb8e30db8e30db8e3ULL, }, + { 0x38630e38630e3863ULL, 0x0e38630e38630e38ULL, }, + { 0xf41ec9f41ec9f41eULL, 0xc9f41ec9f41ec9f4ULL, }, + { 0x2752fd2752fd2752ULL, 0xfd2752fd2752fd27ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */ + { 0xc114f3173afa0e24ULL, 0x2e2fe33c095d0104ULL, }, + { 0x9a62cabbf018f0e0ULL, 0x391fe82ed453ea10ULL, }, + { 0xfc5cfe0c43491b47ULL, 0xec2cc91bd35ec9d6ULL, }, + { 0xc114f3173afa0e24ULL, 0x2e2fe33c095d0104ULL, }, + { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, }, + { 0xd30cd70603b1a9c4ULL, 0x1ce7c00ce0353b08ULL, }, + { 0x35060b5855e2d42bULL, 0xcff4a1f9df401aceULL, }, + { 0x9a62cabbf018f0e0ULL, 0x391fe82ed453ea10ULL, }, /* 72 */ + { 0xd30cd70603b1a9c4ULL, 0x1ce7c00ce0353b08ULL, }, + { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, }, + { 0x0e54e2fb0b00b6e7ULL, 0xdae4a7ebaa3603daULL, }, + { 0xfc5cfe0c43491b47ULL, 0xec2cc91bd35ec9d6ULL, }, + { 0x35060b5855e2d42bULL, 0xcff4a1f9df401aceULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_AVE_S_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_AVE_S_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_d.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_d.c new file mode 100644 index 0000000000..e87d414b5f --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_d.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction AVE_S.D + * + * 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 = "AVE_S.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] = { + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0xd555555555555554ULL, 0xd555555555555554ULL, }, + { 0x2aaaaaaaaaaaaaaaULL, 0x2aaaaaaaaaaaaaaaULL, }, + { 0xe666666666666665ULL, 0xe666666666666665ULL, }, + { 0x1999999999999999ULL, 0x1999999999999999ULL, }, + { 0xf1c71c71c71c71c6ULL, 0x1c71c71c71c71c71ULL, }, + { 0x0e38e38e38e38e38ULL, 0xe38e38e38e38e38dULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xd555555555555555ULL, 0xd555555555555555ULL, }, + { 0x2aaaaaaaaaaaaaaaULL, 0x2aaaaaaaaaaaaaaaULL, }, + { 0xe666666666666666ULL, 0xe666666666666666ULL, }, + { 0x1999999999999999ULL, 0x1999999999999999ULL, }, + { 0xf1c71c71c71c71c7ULL, 0x1c71c71c71c71c71ULL, }, + { 0x0e38e38e38e38e38ULL, 0xe38e38e38e38e38eULL, }, + { 0xd555555555555554ULL, 0xd555555555555554ULL, }, /* 16 */ + { 0xd555555555555555ULL, 0xd555555555555555ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0xeeeeeeeeeeeeeeeeULL, 0xeeeeeeeeeeeeeeeeULL, }, + { 0xc71c71c71c71c71cULL, 0xf1c71c71c71c71c6ULL, }, + { 0xe38e38e38e38e38dULL, 0xb8e38e38e38e38e3ULL, }, + { 0x2aaaaaaaaaaaaaaaULL, 0x2aaaaaaaaaaaaaaaULL, }, /* 24 */ + { 0x2aaaaaaaaaaaaaaaULL, 0x2aaaaaaaaaaaaaaaULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x1111111111111110ULL, 0x1111111111111110ULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0x1c71c71c71c71c71ULL, 0x471c71c71c71c71cULL, }, + { 0x38e38e38e38e38e3ULL, 0x0e38e38e38e38e38ULL, }, + { 0xe666666666666665ULL, 0xe666666666666665ULL, }, /* 32 */ + { 0xe666666666666666ULL, 0xe666666666666666ULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0x1111111111111110ULL, 0x1111111111111110ULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0xd82d82d82d82d82dULL, 0x02d82d82d82d82d7ULL, }, + { 0xf49f49f49f49f49eULL, 0xc9f49f49f49f49f4ULL, }, + { 0x1999999999999999ULL, 0x1999999999999999ULL, }, /* 40 */ + { 0x1999999999999999ULL, 0x1999999999999999ULL, }, + { 0xeeeeeeeeeeeeeeeeULL, 0xeeeeeeeeeeeeeeeeULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x0b60b60b60b60b60ULL, 0x360b60b60b60b60bULL, }, + { 0x27d27d27d27d27d2ULL, 0xfd27d27d27d27d27ULL, }, + { 0xf1c71c71c71c71c6ULL, 0x1c71c71c71c71c71ULL, }, /* 48 */ + { 0xf1c71c71c71c71c7ULL, 0x1c71c71c71c71c71ULL, }, + { 0xc71c71c71c71c71cULL, 0xf1c71c71c71c71c6ULL, }, + { 0x1c71c71c71c71c71ULL, 0x471c71c71c71c71cULL, }, + { 0xd82d82d82d82d82dULL, 0x02d82d82d82d82d7ULL, }, + { 0x0b60b60b60b60b60ULL, 0x360b60b60b60b60bULL, }, + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0e38e38e38e38e38ULL, 0xe38e38e38e38e38dULL, }, /* 56 */ + { 0x0e38e38e38e38e38ULL, 0xe38e38e38e38e38eULL, }, + { 0xe38e38e38e38e38dULL, 0xb8e38e38e38e38e3ULL, }, + { 0x38e38e38e38e38e3ULL, 0x0e38e38e38e38e38ULL, }, + { 0xf49f49f49f49f49eULL, 0xc9f49f49f49f49f4ULL, }, + { 0x27d27d27d27d27d2ULL, 0xfd27d27d27d27d27ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */ + { 0xc2147397bafb0e24ULL, 0x2f2f633c89dd8184ULL, }, + { 0x9a62cabb7118f060ULL, 0x399fe92f54d36a90ULL, }, + { 0xfc5cfe8cc34a1bc7ULL, 0xecac4a1bd3df4956ULL, }, + { 0xc2147397bafb0e24ULL, 0x2f2f633c89dd8184ULL, }, + { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, }, + { 0xd40c578703b1a944ULL, 0x1d68410ce0353c08ULL, }, + { 0x36068b5855e2d4abULL, 0xd074a1f95f411aceULL, }, + { 0x9a62cabb7118f060ULL, 0x399fe92f54d36a90ULL, }, /* 72 */ + { 0xd40c578703b1a944ULL, 0x1d68410ce0353c08ULL, }, + { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, }, + { 0x0e54e27c0c00b6e7ULL, 0xdae527ec2a3703daULL, }, + { 0xfc5cfe8cc34a1bc7ULL, 0xecac4a1bd3df4956ULL, }, + { 0x36068b5855e2d4abULL, 0xd074a1f95f411aceULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_AVE_S_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_AVE_S_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_h.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_h.c new file mode 100644 index 0000000000..c850543587 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_h.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction AVE_S.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 = "AVE_S.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] = { + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0xd554d554d554d554ULL, 0xd554d554d554d554ULL, }, + { 0x2aaa2aaa2aaa2aaaULL, 0x2aaa2aaa2aaa2aaaULL, }, + { 0xe665e665e665e665ULL, 0xe665e665e665e665ULL, }, + { 0x1999199919991999ULL, 0x1999199919991999ULL, }, + { 0xf1c61c71c71bf1c6ULL, 0x1c71c71bf1c61c71ULL, }, + { 0x0e38e38d38e30e38ULL, 0xe38d38e30e38e38dULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xd555d555d555d555ULL, 0xd555d555d555d555ULL, }, + { 0x2aaa2aaa2aaa2aaaULL, 0x2aaa2aaa2aaa2aaaULL, }, + { 0xe666e666e666e666ULL, 0xe666e666e666e666ULL, }, + { 0x1999199919991999ULL, 0x1999199919991999ULL, }, + { 0xf1c71c71c71cf1c7ULL, 0x1c71c71cf1c71c71ULL, }, + { 0x0e38e38e38e30e38ULL, 0xe38e38e30e38e38eULL, }, + { 0xd554d554d554d554ULL, 0xd554d554d554d554ULL, }, /* 16 */ + { 0xd555d555d555d555ULL, 0xd555d555d555d555ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0xeeeeeeeeeeeeeeeeULL, 0xeeeeeeeeeeeeeeeeULL, }, + { 0xc71cf1c69c71c71cULL, 0xf1c69c71c71cf1c6ULL, }, + { 0xe38db8e30e38e38dULL, 0xb8e30e38e38db8e3ULL, }, + { 0x2aaa2aaa2aaa2aaaULL, 0x2aaa2aaa2aaa2aaaULL, }, /* 24 */ + { 0x2aaa2aaa2aaa2aaaULL, 0x2aaa2aaa2aaa2aaaULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x1110111011101110ULL, 0x1110111011101110ULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0x1c71471cf1c61c71ULL, 0x471cf1c61c71471cULL, }, + { 0x38e30e38638e38e3ULL, 0x0e38638e38e30e38ULL, }, + { 0xe665e665e665e665ULL, 0xe665e665e665e665ULL, }, /* 32 */ + { 0xe666e666e666e666ULL, 0xe666e666e666e666ULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0x1110111011101110ULL, 0x1110111011101110ULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0xd82d02d7ad82d82dULL, 0x02d7ad82d82d02d7ULL, }, + { 0xf49ec9f41f49f49eULL, 0xc9f41f49f49ec9f4ULL, }, + { 0x1999199919991999ULL, 0x1999199919991999ULL, }, /* 40 */ + { 0x1999199919991999ULL, 0x1999199919991999ULL, }, + { 0xeeeeeeeeeeeeeeeeULL, 0xeeeeeeeeeeeeeeeeULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x0b60360be0b50b60ULL, 0x360be0b50b60360bULL, }, + { 0x27d2fd27527d27d2ULL, 0xfd27527d27d2fd27ULL, }, + { 0xf1c61c71c71bf1c6ULL, 0x1c71c71bf1c61c71ULL, }, /* 48 */ + { 0xf1c71c71c71cf1c7ULL, 0x1c71c71cf1c71c71ULL, }, + { 0xc71cf1c69c71c71cULL, 0xf1c69c71c71cf1c6ULL, }, + { 0x1c71471cf1c61c71ULL, 0x471cf1c61c71471cULL, }, + { 0xd82d02d7ad82d82dULL, 0x02d7ad82d82d02d7ULL, }, + { 0x0b60360be0b50b60ULL, 0x360be0b50b60360bULL, }, + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0e38e38d38e30e38ULL, 0xe38d38e30e38e38dULL, }, /* 56 */ + { 0x0e38e38e38e30e38ULL, 0xe38e38e30e38e38eULL, }, + { 0xe38db8e30e38e38dULL, 0xb8e30e38e38db8e3ULL, }, + { 0x38e30e38638e38e3ULL, 0x0e38638e38e30e38ULL, }, + { 0xf49ec9f41f49f49eULL, 0xc9f41f49f49ec9f4ULL, }, + { 0x27d2fd27527d27d2ULL, 0xfd27527d27d2fd27ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */ + { 0xc214f3973afa0e24ULL, 0x2f2fe33c09dd0184ULL, }, + { 0x9a62cabbf118f060ULL, 0x399fe92ed4d3ea90ULL, }, + { 0xfc5cfe8c43491bc7ULL, 0xecacca1bd3dec956ULL, }, + { 0xc214f3973afa0e24ULL, 0x2f2fe33c09dd0184ULL, }, + { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, }, + { 0xd40cd78603b1a944ULL, 0x1d67c10ce0353c08ULL, }, + { 0x36060b5855e2d4abULL, 0xd074a1f9df401aceULL, }, + { 0x9a62cabbf118f060ULL, 0x399fe92ed4d3ea90ULL, }, /* 72 */ + { 0xd40cd78603b1a944ULL, 0x1d67c10ce0353c08ULL, }, + { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, }, + { 0x0e54e27b0c00b6e7ULL, 0xdae4a7ebaa3603daULL, }, + { 0xfc5cfe8c43491bc7ULL, 0xecacca1bd3dec956ULL, }, + { 0x36060b5855e2d4abULL, 0xd074a1f9df401aceULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_AVE_S_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_AVE_S_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_w.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_w.c new file mode 100644 index 0000000000..3220574ca0 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_w.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction AVE_S.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 = "AVE_S.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] = { + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0xd5555554d5555554ULL, 0xd5555554d5555554ULL, }, + { 0x2aaaaaaa2aaaaaaaULL, 0x2aaaaaaa2aaaaaaaULL, }, + { 0xe6666665e6666665ULL, 0xe6666665e6666665ULL, }, + { 0x1999999919999999ULL, 0x1999999919999999ULL, }, + { 0xf1c71c71c71c71c6ULL, 0x1c71c71bf1c71c71ULL, }, + { 0x0e38e38d38e38e38ULL, 0xe38e38e30e38e38dULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xd5555555d5555555ULL, 0xd5555555d5555555ULL, }, + { 0x2aaaaaaa2aaaaaaaULL, 0x2aaaaaaa2aaaaaaaULL, }, + { 0xe6666666e6666666ULL, 0xe6666666e6666666ULL, }, + { 0x1999999919999999ULL, 0x1999999919999999ULL, }, + { 0xf1c71c71c71c71c7ULL, 0x1c71c71cf1c71c71ULL, }, + { 0x0e38e38e38e38e38ULL, 0xe38e38e30e38e38eULL, }, + { 0xd5555554d5555554ULL, 0xd5555554d5555554ULL, }, /* 16 */ + { 0xd5555555d5555555ULL, 0xd5555555d5555555ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0xeeeeeeeeeeeeeeeeULL, 0xeeeeeeeeeeeeeeeeULL, }, + { 0xc71c71c69c71c71cULL, 0xf1c71c71c71c71c6ULL, }, + { 0xe38e38e30e38e38dULL, 0xb8e38e38e38e38e3ULL, }, + { 0x2aaaaaaa2aaaaaaaULL, 0x2aaaaaaa2aaaaaaaULL, }, /* 24 */ + { 0x2aaaaaaa2aaaaaaaULL, 0x2aaaaaaa2aaaaaaaULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x1111111011111110ULL, 0x1111111011111110ULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0x1c71c71cf1c71c71ULL, 0x471c71c61c71c71cULL, }, + { 0x38e38e38638e38e3ULL, 0x0e38e38e38e38e38ULL, }, + { 0xe6666665e6666665ULL, 0xe6666665e6666665ULL, }, /* 32 */ + { 0xe6666666e6666666ULL, 0xe6666666e6666666ULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0x1111111011111110ULL, 0x1111111011111110ULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0xd82d82d7ad82d82dULL, 0x02d82d82d82d82d7ULL, }, + { 0xf49f49f41f49f49eULL, 0xc9f49f49f49f49f4ULL, }, + { 0x1999999919999999ULL, 0x1999999919999999ULL, }, /* 40 */ + { 0x1999999919999999ULL, 0x1999999919999999ULL, }, + { 0xeeeeeeeeeeeeeeeeULL, 0xeeeeeeeeeeeeeeeeULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x0b60b60be0b60b60ULL, 0x360b60b50b60b60bULL, }, + { 0x27d27d27527d27d2ULL, 0xfd27d27d27d27d27ULL, }, + { 0xf1c71c71c71c71c6ULL, 0x1c71c71bf1c71c71ULL, }, /* 48 */ + { 0xf1c71c71c71c71c7ULL, 0x1c71c71cf1c71c71ULL, }, + { 0xc71c71c69c71c71cULL, 0xf1c71c71c71c71c6ULL, }, + { 0x1c71c71cf1c71c71ULL, 0x471c71c61c71c71cULL, }, + { 0xd82d82d7ad82d82dULL, 0x02d82d82d82d82d7ULL, }, + { 0x0b60b60be0b60b60ULL, 0x360b60b50b60b60bULL, }, + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0e38e38d38e38e38ULL, 0xe38e38e30e38e38dULL, }, /* 56 */ + { 0x0e38e38e38e38e38ULL, 0xe38e38e30e38e38eULL, }, + { 0xe38e38e30e38e38dULL, 0xb8e38e38e38e38e3ULL, }, + { 0x38e38e38638e38e3ULL, 0x0e38e38e38e38e38ULL, }, + { 0xf49f49f41f49f49eULL, 0xc9f49f49f49f49f4ULL, }, + { 0x27d27d27527d27d2ULL, 0xfd27d27d27d27d27ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */ + { 0xc21473973afb0e24ULL, 0x2f2f633c09dd8184ULL, }, + { 0x9a62cabbf118f060ULL, 0x399fe92ed4d36a90ULL, }, + { 0xfc5cfe8c434a1bc7ULL, 0xecac4a1bd3df4956ULL, }, + { 0xc21473973afb0e24ULL, 0x2f2f633c09dd8184ULL, }, + { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, }, + { 0xd40c578603b1a944ULL, 0x1d68410ce0353c08ULL, }, + { 0x36068b5855e2d4abULL, 0xd074a1f9df411aceULL, }, + { 0x9a62cabbf118f060ULL, 0x399fe92ed4d36a90ULL, }, /* 72 */ + { 0xd40c578603b1a944ULL, 0x1d68410ce0353c08ULL, }, + { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, }, + { 0x0e54e27b0c00b6e7ULL, 0xdae527ebaa3703daULL, }, + { 0xfc5cfe8c434a1bc7ULL, 0xecac4a1bd3df4956ULL, }, + { 0x36068b5855e2d4abULL, 0xd074a1f9df411aceULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_AVE_S_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_AVE_S_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_b.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_b.c new file mode 100644 index 0000000000..c3f96a6a5f --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_b.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction AVE_U.B + * + * 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 = "AVE_U.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] = { + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */ + { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, }, + { 0xd4d4d4d4d4d4d4d4ULL, 0xd4d4d4d4d4d4d4d4ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0xe5e5e5e5e5e5e5e5ULL, 0xe5e5e5e5e5e5e5e5ULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, + { 0xf1c69bf1c69bf1c6ULL, 0x9bf1c69bf1c69bf1ULL, }, + { 0x8db8e38db8e38db8ULL, 0xe38db8e38db8e38dULL, }, + { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x2a2a2a2a2a2a2a2aULL, 0x2a2a2a2a2a2a2a2aULL, }, + { 0x6666666666666666ULL, 0x6666666666666666ULL, }, + { 0x1919191919191919ULL, 0x1919191919191919ULL, }, + { 0x71471c71471c7147ULL, 0x1c71471c71471c71ULL, }, + { 0x0e38630e38630e38ULL, 0x630e38630e38630eULL, }, + { 0xd4d4d4d4d4d4d4d4ULL, 0xd4d4d4d4d4d4d4d4ULL, }, /* 16 */ + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0x6e6e6e6e6e6e6e6eULL, 0x6e6e6e6e6e6e6e6eULL, }, + { 0xc69c71c69c71c69cULL, 0x71c69c71c69c71c6ULL, }, + { 0x638db8638db8638dULL, 0xb8638db8638db863ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 24 */ + { 0x2a2a2a2a2a2a2a2aULL, 0x2a2a2a2a2a2a2a2aULL, }, + { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x9090909090909090ULL, 0x9090909090909090ULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0x9c71469c71469c71ULL, 0x469c71469c71469cULL, }, + { 0x38638e38638e3863ULL, 0x8e38638e38638e38ULL, }, + { 0xe5e5e5e5e5e5e5e5ULL, 0xe5e5e5e5e5e5e5e5ULL, }, /* 32 */ + { 0x6666666666666666ULL, 0x6666666666666666ULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0x9090909090909090ULL, 0x9090909090909090ULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, }, + { 0xd7ad82d7ad82d7adULL, 0x82d7ad82d7ad82d7ULL, }, + { 0x749ec9749ec9749eULL, 0xc9749ec9749ec974ULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, /* 40 */ + { 0x1919191919191919ULL, 0x1919191919191919ULL, }, + { 0x6e6e6e6e6e6e6e6eULL, 0x6e6e6e6e6e6e6e6eULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x8b60358b60358b60ULL, 0x358b60358b60358bULL, }, + { 0x27527d27527d2752ULL, 0x7d27527d27527d27ULL, }, + { 0xf1c69bf1c69bf1c6ULL, 0x9bf1c69bf1c69bf1ULL, }, /* 48 */ + { 0x71471c71471c7147ULL, 0x1c71471c71471c71ULL, }, + { 0xc69c71c69c71c69cULL, 0x71c69c71c69c71c6ULL, }, + { 0x9c71469c71469c71ULL, 0x469c71469c71469cULL, }, + { 0xd7ad82d7ad82d7adULL, 0x82d7ad82d7ad82d7ULL, }, + { 0x8b60358b60358b60ULL, 0x358b60358b60358bULL, }, + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, }, + { 0x8db8e38db8e38db8ULL, 0xe38db8e38db8e38dULL, }, /* 56 */ + { 0x0e38630e38630e38ULL, 0x630e38630e38630eULL, }, + { 0x638db8638db8638dULL, 0xb8638db8638db863ULL, }, + { 0x38638e38638e3863ULL, 0x8e38638e38638e38ULL, }, + { 0x749ec9749ec9749eULL, 0xc9749ec9749ec974ULL, }, + { 0x27527d27527d2752ULL, 0x7d27527d27527d27ULL, }, + { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, }, + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */ + { 0xc19473973a7a8e24ULL, 0x2eaf633c895d8184ULL, }, + { 0x9a62cabb70987060ULL, 0x399f68aed4536a10ULL, }, + { 0x7c5c7e8c43499b47ULL, 0x6cac499bd35ec956ULL, }, + { 0xc19473973a7a8e24ULL, 0x2eaf633c895d8184ULL, }, + { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, }, + { 0xd38c578683b1a944ULL, 0x1ce7c08c60353b88ULL, }, + { 0xb5860b585562d42bULL, 0x4ff4a1795f409aceULL, }, + { 0x9a62cabb70987060ULL, 0x399f68aed4536a10ULL, }, /* 72 */ + { 0xd38c578683b1a944ULL, 0x1ce7c08c60353b88ULL, }, + { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, }, + { 0x8e54627b8b80b667ULL, 0x5ae4a7ebaa36835aULL, }, + { 0x7c5c7e8c43499b47ULL, 0x6cac499bd35ec956ULL, }, + { 0xb5860b585562d42bULL, 0x4ff4a1795f409aceULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_AVE_U_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_AVE_U_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_d.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_d.c new file mode 100644 index 0000000000..3a78629cd8 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_d.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction AVE_U.D + * + * 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 = "AVE_U.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] = { + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */ + { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, }, + { 0xd555555555555554ULL, 0xd555555555555554ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0xe666666666666665ULL, 0xe666666666666665ULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, + { 0xf1c71c71c71c71c6ULL, 0x9c71c71c71c71c71ULL, }, + { 0x8e38e38e38e38e38ULL, 0xe38e38e38e38e38dULL, }, + { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x2aaaaaaaaaaaaaaaULL, 0x2aaaaaaaaaaaaaaaULL, }, + { 0x6666666666666666ULL, 0x6666666666666666ULL, }, + { 0x1999999999999999ULL, 0x1999999999999999ULL, }, + { 0x71c71c71c71c71c7ULL, 0x1c71c71c71c71c71ULL, }, + { 0x0e38e38e38e38e38ULL, 0x638e38e38e38e38eULL, }, + { 0xd555555555555554ULL, 0xd555555555555554ULL, }, /* 16 */ + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0x6eeeeeeeeeeeeeeeULL, 0x6eeeeeeeeeeeeeeeULL, }, + { 0xc71c71c71c71c71cULL, 0x71c71c71c71c71c6ULL, }, + { 0x638e38e38e38e38dULL, 0xb8e38e38e38e38e3ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 24 */ + { 0x2aaaaaaaaaaaaaaaULL, 0x2aaaaaaaaaaaaaaaULL, }, + { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x9111111111111110ULL, 0x9111111111111110ULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0x9c71c71c71c71c71ULL, 0x471c71c71c71c71cULL, }, + { 0x38e38e38e38e38e3ULL, 0x8e38e38e38e38e38ULL, }, + { 0xe666666666666665ULL, 0xe666666666666665ULL, }, /* 32 */ + { 0x6666666666666666ULL, 0x6666666666666666ULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0x9111111111111110ULL, 0x9111111111111110ULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, }, + { 0xd82d82d82d82d82dULL, 0x82d82d82d82d82d7ULL, }, + { 0x749f49f49f49f49eULL, 0xc9f49f49f49f49f4ULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, /* 40 */ + { 0x1999999999999999ULL, 0x1999999999999999ULL, }, + { 0x6eeeeeeeeeeeeeeeULL, 0x6eeeeeeeeeeeeeeeULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x8b60b60b60b60b60ULL, 0x360b60b60b60b60bULL, }, + { 0x27d27d27d27d27d2ULL, 0x7d27d27d27d27d27ULL, }, + { 0xf1c71c71c71c71c6ULL, 0x9c71c71c71c71c71ULL, }, /* 48 */ + { 0x71c71c71c71c71c7ULL, 0x1c71c71c71c71c71ULL, }, + { 0xc71c71c71c71c71cULL, 0x71c71c71c71c71c6ULL, }, + { 0x9c71c71c71c71c71ULL, 0x471c71c71c71c71cULL, }, + { 0xd82d82d82d82d82dULL, 0x82d82d82d82d82d7ULL, }, + { 0x8b60b60b60b60b60ULL, 0x360b60b60b60b60bULL, }, + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, }, + { 0x8e38e38e38e38e38ULL, 0xe38e38e38e38e38dULL, }, /* 56 */ + { 0x0e38e38e38e38e38ULL, 0x638e38e38e38e38eULL, }, + { 0x638e38e38e38e38dULL, 0xb8e38e38e38e38e3ULL, }, + { 0x38e38e38e38e38e3ULL, 0x8e38e38e38e38e38ULL, }, + { 0x749f49f49f49f49eULL, 0xc9f49f49f49f49f4ULL, }, + { 0x27d27d27d27d27d2ULL, 0x7d27d27d27d27d27ULL, }, + { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, }, + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */ + { 0xc2147397bafb0e24ULL, 0x2f2f633c89dd8184ULL, }, + { 0x9a62cabb7118f060ULL, 0x399fe92f54d36a90ULL, }, + { 0x7c5cfe8cc34a1bc7ULL, 0x6cac4a1bd3df4956ULL, }, + { 0xc2147397bafb0e24ULL, 0x2f2f633c89dd8184ULL, }, + { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, }, + { 0xd40c578703b1a944ULL, 0x1d68410ce0353c08ULL, }, + { 0xb6068b5855e2d4abULL, 0x5074a1f95f411aceULL, }, + { 0x9a62cabb7118f060ULL, 0x399fe92f54d36a90ULL, }, /* 72 */ + { 0xd40c578703b1a944ULL, 0x1d68410ce0353c08ULL, }, + { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, }, + { 0x8e54e27c0c00b6e7ULL, 0x5ae527ec2a3703daULL, }, + { 0x7c5cfe8cc34a1bc7ULL, 0x6cac4a1bd3df4956ULL, }, + { 0xb6068b5855e2d4abULL, 0x5074a1f95f411aceULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_AVE_U_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_AVE_U_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_h.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_h.c new file mode 100644 index 0000000000..b7db518afb --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_h.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction AVE_U.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 = "AVE_U.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] = { + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */ + { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, }, + { 0xd554d554d554d554ULL, 0xd554d554d554d554ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0xe665e665e665e665ULL, 0xe665e665e665e665ULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, + { 0xf1c69c71c71bf1c6ULL, 0x9c71c71bf1c69c71ULL, }, + { 0x8e38e38db8e38e38ULL, 0xe38db8e38e38e38dULL, }, + { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x2aaa2aaa2aaa2aaaULL, 0x2aaa2aaa2aaa2aaaULL, }, + { 0x6666666666666666ULL, 0x6666666666666666ULL, }, + { 0x1999199919991999ULL, 0x1999199919991999ULL, }, + { 0x71c71c71471c71c7ULL, 0x1c71471c71c71c71ULL, }, + { 0x0e38638e38e30e38ULL, 0x638e38e30e38638eULL, }, + { 0xd554d554d554d554ULL, 0xd554d554d554d554ULL, }, /* 16 */ + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0x6eee6eee6eee6eeeULL, 0x6eee6eee6eee6eeeULL, }, + { 0xc71c71c69c71c71cULL, 0x71c69c71c71c71c6ULL, }, + { 0x638db8e38e38638dULL, 0xb8e38e38638db8e3ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 24 */ + { 0x2aaa2aaa2aaa2aaaULL, 0x2aaa2aaa2aaa2aaaULL, }, + { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x9110911091109110ULL, 0x9110911091109110ULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0x9c71471c71c69c71ULL, 0x471c71c69c71471cULL, }, + { 0x38e38e38638e38e3ULL, 0x8e38638e38e38e38ULL, }, + { 0xe665e665e665e665ULL, 0xe665e665e665e665ULL, }, /* 32 */ + { 0x6666666666666666ULL, 0x6666666666666666ULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0x9110911091109110ULL, 0x9110911091109110ULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, }, + { 0xd82d82d7ad82d82dULL, 0x82d7ad82d82d82d7ULL, }, + { 0x749ec9f49f49749eULL, 0xc9f49f49749ec9f4ULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, /* 40 */ + { 0x1999199919991999ULL, 0x1999199919991999ULL, }, + { 0x6eee6eee6eee6eeeULL, 0x6eee6eee6eee6eeeULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x8b60360b60b58b60ULL, 0x360b60b58b60360bULL, }, + { 0x27d27d27527d27d2ULL, 0x7d27527d27d27d27ULL, }, + { 0xf1c69c71c71bf1c6ULL, 0x9c71c71bf1c69c71ULL, }, /* 48 */ + { 0x71c71c71471c71c7ULL, 0x1c71471c71c71c71ULL, }, + { 0xc71c71c69c71c71cULL, 0x71c69c71c71c71c6ULL, }, + { 0x9c71471c71c69c71ULL, 0x471c71c69c71471cULL, }, + { 0xd82d82d7ad82d82dULL, 0x82d7ad82d82d82d7ULL, }, + { 0x8b60360b60b58b60ULL, 0x360b60b58b60360bULL, }, + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, }, + { 0x8e38e38db8e38e38ULL, 0xe38db8e38e38e38dULL, }, /* 56 */ + { 0x0e38638e38e30e38ULL, 0x638e38e30e38638eULL, }, + { 0x638db8e38e38638dULL, 0xb8e38e38638db8e3ULL, }, + { 0x38e38e38638e38e3ULL, 0x8e38638e38e38e38ULL, }, + { 0x749ec9f49f49749eULL, 0xc9f49f49749ec9f4ULL, }, + { 0x27d27d27527d27d2ULL, 0x7d27527d27d27d27ULL, }, + { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, }, + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */ + { 0xc21473973afa8e24ULL, 0x2f2f633c89dd8184ULL, }, + { 0x9a62cabb71187060ULL, 0x399f692ed4d36a90ULL, }, + { 0x7c5c7e8c43499bc7ULL, 0x6cac4a1bd3dec956ULL, }, + { 0xc21473973afa8e24ULL, 0x2f2f633c89dd8184ULL, }, + { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, }, + { 0xd40c578683b1a944ULL, 0x1d67c10c60353c08ULL, }, + { 0xb6060b5855e2d4abULL, 0x5074a1f95f409aceULL, }, + { 0x9a62cabb71187060ULL, 0x399f692ed4d36a90ULL, }, /* 72 */ + { 0xd40c578683b1a944ULL, 0x1d67c10c60353c08ULL, }, + { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, }, + { 0x8e54627b8c00b6e7ULL, 0x5ae4a7ebaa3683daULL, }, + { 0x7c5c7e8c43499bc7ULL, 0x6cac4a1bd3dec956ULL, }, + { 0xb6060b5855e2d4abULL, 0x5074a1f95f409aceULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_AVE_U_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_AVE_U_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_w.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_w.c new file mode 100644 index 0000000000..75e2409f1f --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_w.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction AVE_U.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 = "AVE_U.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] = { + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */ + { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, }, + { 0xd5555554d5555554ULL, 0xd5555554d5555554ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0xe6666665e6666665ULL, 0xe6666665e6666665ULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, + { 0xf1c71c71c71c71c6ULL, 0x9c71c71bf1c71c71ULL, }, + { 0x8e38e38db8e38e38ULL, 0xe38e38e38e38e38dULL, }, + { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x2aaaaaaa2aaaaaaaULL, 0x2aaaaaaa2aaaaaaaULL, }, + { 0x6666666666666666ULL, 0x6666666666666666ULL, }, + { 0x1999999919999999ULL, 0x1999999919999999ULL, }, + { 0x71c71c71471c71c7ULL, 0x1c71c71c71c71c71ULL, }, + { 0x0e38e38e38e38e38ULL, 0x638e38e30e38e38eULL, }, + { 0xd5555554d5555554ULL, 0xd5555554d5555554ULL, }, /* 16 */ + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0x6eeeeeee6eeeeeeeULL, 0x6eeeeeee6eeeeeeeULL, }, + { 0xc71c71c69c71c71cULL, 0x71c71c71c71c71c6ULL, }, + { 0x638e38e38e38e38dULL, 0xb8e38e38638e38e3ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 24 */ + { 0x2aaaaaaa2aaaaaaaULL, 0x2aaaaaaa2aaaaaaaULL, }, + { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x9111111091111110ULL, 0x9111111091111110ULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0x9c71c71c71c71c71ULL, 0x471c71c69c71c71cULL, }, + { 0x38e38e38638e38e3ULL, 0x8e38e38e38e38e38ULL, }, + { 0xe6666665e6666665ULL, 0xe6666665e6666665ULL, }, /* 32 */ + { 0x6666666666666666ULL, 0x6666666666666666ULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0x9111111091111110ULL, 0x9111111091111110ULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, }, + { 0xd82d82d7ad82d82dULL, 0x82d82d82d82d82d7ULL, }, + { 0x749f49f49f49f49eULL, 0xc9f49f49749f49f4ULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, /* 40 */ + { 0x1999999919999999ULL, 0x1999999919999999ULL, }, + { 0x6eeeeeee6eeeeeeeULL, 0x6eeeeeee6eeeeeeeULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x8b60b60b60b60b60ULL, 0x360b60b58b60b60bULL, }, + { 0x27d27d27527d27d2ULL, 0x7d27d27d27d27d27ULL, }, + { 0xf1c71c71c71c71c6ULL, 0x9c71c71bf1c71c71ULL, }, /* 48 */ + { 0x71c71c71471c71c7ULL, 0x1c71c71c71c71c71ULL, }, + { 0xc71c71c69c71c71cULL, 0x71c71c71c71c71c6ULL, }, + { 0x9c71c71c71c71c71ULL, 0x471c71c69c71c71cULL, }, + { 0xd82d82d7ad82d82dULL, 0x82d82d82d82d82d7ULL, }, + { 0x8b60b60b60b60b60ULL, 0x360b60b58b60b60bULL, }, + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, }, + { 0x8e38e38db8e38e38ULL, 0xe38e38e38e38e38dULL, }, /* 56 */ + { 0x0e38e38e38e38e38ULL, 0x638e38e30e38e38eULL, }, + { 0x638e38e38e38e38dULL, 0xb8e38e38638e38e3ULL, }, + { 0x38e38e38638e38e3ULL, 0x8e38e38e38e38e38ULL, }, + { 0x749f49f49f49f49eULL, 0xc9f49f49749f49f4ULL, }, + { 0x27d27d27527d27d2ULL, 0x7d27d27d27d27d27ULL, }, + { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, }, + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */ + { 0xc21473973afb0e24ULL, 0x2f2f633c89dd8184ULL, }, + { 0x9a62cabb7118f060ULL, 0x399fe92ed4d36a90ULL, }, + { 0x7c5cfe8c434a1bc7ULL, 0x6cac4a1bd3df4956ULL, }, + { 0xc21473973afb0e24ULL, 0x2f2f633c89dd8184ULL, }, + { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, }, + { 0xd40c578683b1a944ULL, 0x1d68410c60353c08ULL, }, + { 0xb6068b5855e2d4abULL, 0x5074a1f95f411aceULL, }, + { 0x9a62cabb7118f060ULL, 0x399fe92ed4d36a90ULL, }, /* 72 */ + { 0xd40c578683b1a944ULL, 0x1d68410c60353c08ULL, }, + { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, }, + { 0x8e54e27b8c00b6e7ULL, 0x5ae527ebaa3703daULL, }, + { 0x7c5cfe8c434a1bc7ULL, 0x6cac4a1bd3df4956ULL, }, + { 0xb6068b5855e2d4abULL, 0x5074a1f95f411aceULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_AVE_U_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_AVE_U_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_b.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_b.c new file mode 100644 index 0000000000..59bba28d2e --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_b.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction AVER_S.B + * + * 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 = "AVER_S.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] = { + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xd5d5d5d5d5d5d5d5ULL, 0xd5d5d5d5d5d5d5d5ULL, }, + { 0x2a2a2a2a2a2a2a2aULL, 0x2a2a2a2a2a2a2a2aULL, }, + { 0xe6e6e6e6e6e6e6e6ULL, 0xe6e6e6e6e6e6e6e6ULL, }, + { 0x1919191919191919ULL, 0x1919191919191919ULL, }, + { 0xf1c71cf1c71cf1c7ULL, 0x1cf1c71cf1c71cf1ULL, }, + { 0x0e38e30e38e30e38ULL, 0xe30e38e30e38e30eULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xd5d5d5d5d5d5d5d5ULL, 0xd5d5d5d5d5d5d5d5ULL, }, + { 0x2b2b2b2b2b2b2b2bULL, 0x2b2b2b2b2b2b2b2bULL, }, + { 0xe6e6e6e6e6e6e6e6ULL, 0xe6e6e6e6e6e6e6e6ULL, }, + { 0x1a1a1a1a1a1a1a1aULL, 0x1a1a1a1a1a1a1a1aULL, }, + { 0xf2c71cf2c71cf2c7ULL, 0x1cf2c71cf2c71cf2ULL, }, + { 0x0e39e40e39e40e39ULL, 0xe40e39e40e39e40eULL, }, + { 0xd5d5d5d5d5d5d5d5ULL, 0xd5d5d5d5d5d5d5d5ULL, }, /* 16 */ + { 0xd5d5d5d5d5d5d5d5ULL, 0xd5d5d5d5d5d5d5d5ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0xefefefefefefefefULL, 0xefefefefefefefefULL, }, + { 0xc79cf1c79cf1c79cULL, 0xf1c79cf1c79cf1c7ULL, }, + { 0xe30eb9e30eb9e30eULL, 0xb9e30eb9e30eb9e3ULL, }, + { 0x2a2a2a2a2a2a2a2aULL, 0x2a2a2a2a2a2a2a2aULL, }, /* 24 */ + { 0x2b2b2b2b2b2b2b2bULL, 0x2b2b2b2b2b2b2b2bULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x1111111111111111ULL, 0x1111111111111111ULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0x1cf2471cf2471cf2ULL, 0x471cf2471cf2471cULL, }, + { 0x39630e39630e3963ULL, 0x0e39630e39630e39ULL, }, + { 0xe6e6e6e6e6e6e6e6ULL, 0xe6e6e6e6e6e6e6e6ULL, }, /* 32 */ + { 0xe6e6e6e6e6e6e6e6ULL, 0xe6e6e6e6e6e6e6e6ULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0x1111111111111111ULL, 0x1111111111111111ULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xd8ad02d8ad02d8adULL, 0x02d8ad02d8ad02d8ULL, }, + { 0xf41fcaf41fcaf41fULL, 0xcaf41fcaf41fcaf4ULL, }, + { 0x1919191919191919ULL, 0x1919191919191919ULL, }, /* 40 */ + { 0x1a1a1a1a1a1a1a1aULL, 0x1a1a1a1a1a1a1a1aULL, }, + { 0xefefefefefefefefULL, 0xefefefefefefefefULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x0be1360be1360be1ULL, 0x360be1360be1360bULL, }, + { 0x2852fd2852fd2852ULL, 0xfd2852fd2852fd28ULL, }, + { 0xf1c71cf1c71cf1c7ULL, 0x1cf1c71cf1c71cf1ULL, }, /* 48 */ + { 0xf2c71cf2c71cf2c7ULL, 0x1cf2c71cf2c71cf2ULL, }, + { 0xc79cf1c79cf1c79cULL, 0xf1c79cf1c79cf1c7ULL, }, + { 0x1cf2471cf2471cf2ULL, 0x471cf2471cf2471cULL, }, + { 0xd8ad02d8ad02d8adULL, 0x02d8ad02d8ad02d8ULL, }, + { 0x0be1360be1360be1ULL, 0x360be1360be1360bULL, }, + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0e38e30e38e30e38ULL, 0xe30e38e30e38e30eULL, }, /* 56 */ + { 0x0e39e40e39e40e39ULL, 0xe40e39e40e39e40eULL, }, + { 0xe30eb9e30eb9e30eULL, 0xb9e30eb9e30eb9e3ULL, }, + { 0x39630e39630e3963ULL, 0x0e39630e39630e39ULL, }, + { 0xf41fcaf41fcaf41fULL, 0xcaf41fcaf41fcaf4ULL, }, + { 0x2852fd2852fd2852ULL, 0xfd2852fd2852fd28ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */ + { 0xc214f3183bfb0e24ULL, 0x2f2fe33c0a5d0104ULL, }, + { 0x9a62cabbf119f0e0ULL, 0x3920e92fd553eb10ULL, }, + { 0xfc5dfe0d434a1c47ULL, 0xec2cca1bd45fc9d6ULL, }, + { 0xc214f3183bfb0e24ULL, 0x2f2fe33c0a5d0104ULL, }, + { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, }, + { 0xd40cd70703b1a9c4ULL, 0x1de8c10de0353c08ULL, }, + { 0x36070b5856e2d52bULL, 0xd0f4a2f9df411aceULL, }, + { 0x9a62cabbf119f0e0ULL, 0x3920e92fd553eb10ULL, }, /* 72 */ + { 0xd40cd70703b1a9c4ULL, 0x1de8c10de0353c08ULL, }, + { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, }, + { 0x0e55e2fc0c00b7e7ULL, 0xdae5a7ecaa3704daULL, }, + { 0xfc5dfe0d434a1c47ULL, 0xec2cca1bd45fc9d6ULL, }, + { 0x36070b5856e2d52bULL, 0xd0f4a2f9df411aceULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_AVER_S_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_AVER_S_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_d.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_d.c new file mode 100644 index 0000000000..435c09f9bf --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_d.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction AVER_S.D + * + * 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 = "AVER_S.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] = { + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xd555555555555555ULL, 0xd555555555555555ULL, }, + { 0x2aaaaaaaaaaaaaaaULL, 0x2aaaaaaaaaaaaaaaULL, }, + { 0xe666666666666666ULL, 0xe666666666666666ULL, }, + { 0x1999999999999999ULL, 0x1999999999999999ULL, }, + { 0xf1c71c71c71c71c7ULL, 0x1c71c71c71c71c71ULL, }, + { 0x0e38e38e38e38e38ULL, 0xe38e38e38e38e38eULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xd555555555555555ULL, 0xd555555555555555ULL, }, + { 0x2aaaaaaaaaaaaaabULL, 0x2aaaaaaaaaaaaaabULL, }, + { 0xe666666666666666ULL, 0xe666666666666666ULL, }, + { 0x199999999999999aULL, 0x199999999999999aULL, }, + { 0xf1c71c71c71c71c7ULL, 0x1c71c71c71c71c72ULL, }, + { 0x0e38e38e38e38e39ULL, 0xe38e38e38e38e38eULL, }, + { 0xd555555555555555ULL, 0xd555555555555555ULL, }, /* 16 */ + { 0xd555555555555555ULL, 0xd555555555555555ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0xeeeeeeeeeeeeeeefULL, 0xeeeeeeeeeeeeeeefULL, }, + { 0xc71c71c71c71c71cULL, 0xf1c71c71c71c71c7ULL, }, + { 0xe38e38e38e38e38eULL, 0xb8e38e38e38e38e3ULL, }, + { 0x2aaaaaaaaaaaaaaaULL, 0x2aaaaaaaaaaaaaaaULL, }, /* 24 */ + { 0x2aaaaaaaaaaaaaabULL, 0x2aaaaaaaaaaaaaabULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x1111111111111111ULL, 0x1111111111111111ULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0x1c71c71c71c71c72ULL, 0x471c71c71c71c71cULL, }, + { 0x38e38e38e38e38e3ULL, 0x0e38e38e38e38e39ULL, }, + { 0xe666666666666666ULL, 0xe666666666666666ULL, }, /* 32 */ + { 0xe666666666666666ULL, 0xe666666666666666ULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0x1111111111111111ULL, 0x1111111111111111ULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xd82d82d82d82d82dULL, 0x02d82d82d82d82d8ULL, }, + { 0xf49f49f49f49f49fULL, 0xc9f49f49f49f49f4ULL, }, + { 0x1999999999999999ULL, 0x1999999999999999ULL, }, /* 40 */ + { 0x199999999999999aULL, 0x199999999999999aULL, }, + { 0xeeeeeeeeeeeeeeefULL, 0xeeeeeeeeeeeeeeefULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x0b60b60b60b60b61ULL, 0x360b60b60b60b60bULL, }, + { 0x27d27d27d27d27d2ULL, 0xfd27d27d27d27d28ULL, }, + { 0xf1c71c71c71c71c7ULL, 0x1c71c71c71c71c71ULL, }, /* 48 */ + { 0xf1c71c71c71c71c7ULL, 0x1c71c71c71c71c72ULL, }, + { 0xc71c71c71c71c71cULL, 0xf1c71c71c71c71c7ULL, }, + { 0x1c71c71c71c71c72ULL, 0x471c71c71c71c71cULL, }, + { 0xd82d82d82d82d82dULL, 0x02d82d82d82d82d8ULL, }, + { 0x0b60b60b60b60b61ULL, 0x360b60b60b60b60bULL, }, + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0e38e38e38e38e38ULL, 0xe38e38e38e38e38eULL, }, /* 56 */ + { 0x0e38e38e38e38e39ULL, 0xe38e38e38e38e38eULL, }, + { 0xe38e38e38e38e38eULL, 0xb8e38e38e38e38e3ULL, }, + { 0x38e38e38e38e38e3ULL, 0x0e38e38e38e38e39ULL, }, + { 0xf49f49f49f49f49fULL, 0xc9f49f49f49f49f4ULL, }, + { 0x27d27d27d27d27d2ULL, 0xfd27d27d27d27d28ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */ + { 0xc2147397bafb0e24ULL, 0x2f2f633c89dd8184ULL, }, + { 0x9a62cabb7118f060ULL, 0x399fe92f54d36a90ULL, }, + { 0xfc5cfe8cc34a1bc7ULL, 0xecac4a1bd3df4956ULL, }, + { 0xc2147397bafb0e24ULL, 0x2f2f633c89dd8184ULL, }, + { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, }, + { 0xd40c578703b1a944ULL, 0x1d68410ce0353c08ULL, }, + { 0x36068b5855e2d4abULL, 0xd074a1f95f411aceULL, }, + { 0x9a62cabb7118f060ULL, 0x399fe92f54d36a90ULL, }, /* 72 */ + { 0xd40c578703b1a944ULL, 0x1d68410ce0353c08ULL, }, + { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, }, + { 0x0e54e27c0c00b6e7ULL, 0xdae527ec2a3703daULL, }, + { 0xfc5cfe8cc34a1bc7ULL, 0xecac4a1bd3df4956ULL, }, + { 0x36068b5855e2d4abULL, 0xd074a1f95f411aceULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_AVER_S_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_AVER_S_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_h.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_h.c new file mode 100644 index 0000000000..0902e508ec --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_h.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction AVER_S.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 = "AVER_S.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] = { + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xd555d555d555d555ULL, 0xd555d555d555d555ULL, }, + { 0x2aaa2aaa2aaa2aaaULL, 0x2aaa2aaa2aaa2aaaULL, }, + { 0xe666e666e666e666ULL, 0xe666e666e666e666ULL, }, + { 0x1999199919991999ULL, 0x1999199919991999ULL, }, + { 0xf1c71c71c71cf1c7ULL, 0x1c71c71cf1c71c71ULL, }, + { 0x0e38e38e38e30e38ULL, 0xe38e38e30e38e38eULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xd555d555d555d555ULL, 0xd555d555d555d555ULL, }, + { 0x2aab2aab2aab2aabULL, 0x2aab2aab2aab2aabULL, }, + { 0xe666e666e666e666ULL, 0xe666e666e666e666ULL, }, + { 0x199a199a199a199aULL, 0x199a199a199a199aULL, }, + { 0xf1c71c72c71cf1c7ULL, 0x1c72c71cf1c71c72ULL, }, + { 0x0e39e38e38e40e39ULL, 0xe38e38e40e39e38eULL, }, + { 0xd555d555d555d555ULL, 0xd555d555d555d555ULL, }, /* 16 */ + { 0xd555d555d555d555ULL, 0xd555d555d555d555ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0xeeefeeefeeefeeefULL, 0xeeefeeefeeefeeefULL, }, + { 0xc71cf1c79c71c71cULL, 0xf1c79c71c71cf1c7ULL, }, + { 0xe38eb8e30e39e38eULL, 0xb8e30e39e38eb8e3ULL, }, + { 0x2aaa2aaa2aaa2aaaULL, 0x2aaa2aaa2aaa2aaaULL, }, /* 24 */ + { 0x2aab2aab2aab2aabULL, 0x2aab2aab2aab2aabULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x1111111111111111ULL, 0x1111111111111111ULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0x1c72471cf1c71c72ULL, 0x471cf1c71c72471cULL, }, + { 0x38e30e39638e38e3ULL, 0x0e39638e38e30e39ULL, }, + { 0xe666e666e666e666ULL, 0xe666e666e666e666ULL, }, /* 32 */ + { 0xe666e666e666e666ULL, 0xe666e666e666e666ULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0x1111111111111111ULL, 0x1111111111111111ULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xd82d02d8ad82d82dULL, 0x02d8ad82d82d02d8ULL, }, + { 0xf49fc9f41f4af49fULL, 0xc9f41f4af49fc9f4ULL, }, + { 0x1999199919991999ULL, 0x1999199919991999ULL, }, /* 40 */ + { 0x199a199a199a199aULL, 0x199a199a199a199aULL, }, + { 0xeeefeeefeeefeeefULL, 0xeeefeeefeeefeeefULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x0b61360be0b60b61ULL, 0x360be0b60b61360bULL, }, + { 0x27d2fd28527d27d2ULL, 0xfd28527d27d2fd28ULL, }, + { 0xf1c71c71c71cf1c7ULL, 0x1c71c71cf1c71c71ULL, }, /* 48 */ + { 0xf1c71c72c71cf1c7ULL, 0x1c72c71cf1c71c72ULL, }, + { 0xc71cf1c79c71c71cULL, 0xf1c79c71c71cf1c7ULL, }, + { 0x1c72471cf1c71c72ULL, 0x471cf1c71c72471cULL, }, + { 0xd82d02d8ad82d82dULL, 0x02d8ad82d82d02d8ULL, }, + { 0x0b61360be0b60b61ULL, 0x360be0b60b61360bULL, }, + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0e38e38e38e30e38ULL, 0xe38e38e30e38e38eULL, }, /* 56 */ + { 0x0e39e38e38e40e39ULL, 0xe38e38e40e39e38eULL, }, + { 0xe38eb8e30e39e38eULL, 0xb8e30e39e38eb8e3ULL, }, + { 0x38e30e39638e38e3ULL, 0x0e39638e38e30e39ULL, }, + { 0xf49fc9f41f4af49fULL, 0xc9f41f4af49fc9f4ULL, }, + { 0x27d2fd28527d27d2ULL, 0xfd28527d27d2fd28ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */ + { 0xc214f3983afb0e24ULL, 0x2f2fe33c09dd0184ULL, }, + { 0x9a62cabbf119f060ULL, 0x39a0e92fd4d3ea90ULL, }, + { 0xfc5dfe8d434a1bc7ULL, 0xecacca1bd3dfc956ULL, }, + { 0xc214f3983afb0e24ULL, 0x2f2fe33c09dd0184ULL, }, + { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, }, + { 0xd40cd78703b1a944ULL, 0x1d68c10de0353c08ULL, }, + { 0x36070b5855e2d4abULL, 0xd074a1f9df411aceULL, }, + { 0x9a62cabbf119f060ULL, 0x39a0e92fd4d3ea90ULL, }, /* 72 */ + { 0xd40cd78703b1a944ULL, 0x1d68c10de0353c08ULL, }, + { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, }, + { 0x0e55e27c0c00b6e7ULL, 0xdae5a7ecaa3703daULL, }, + { 0xfc5dfe8d434a1bc7ULL, 0xecacca1bd3dfc956ULL, }, + { 0x36070b5855e2d4abULL, 0xd074a1f9df411aceULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_AVER_S_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_AVER_S_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_w.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_w.c new file mode 100644 index 0000000000..31f4553916 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_w.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction AVER_S.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 = "AVER_S.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] = { + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xd5555555d5555555ULL, 0xd5555555d5555555ULL, }, + { 0x2aaaaaaa2aaaaaaaULL, 0x2aaaaaaa2aaaaaaaULL, }, + { 0xe6666666e6666666ULL, 0xe6666666e6666666ULL, }, + { 0x1999999919999999ULL, 0x1999999919999999ULL, }, + { 0xf1c71c71c71c71c7ULL, 0x1c71c71cf1c71c71ULL, }, + { 0x0e38e38e38e38e38ULL, 0xe38e38e30e38e38eULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xd5555555d5555555ULL, 0xd5555555d5555555ULL, }, + { 0x2aaaaaab2aaaaaabULL, 0x2aaaaaab2aaaaaabULL, }, + { 0xe6666666e6666666ULL, 0xe6666666e6666666ULL, }, + { 0x1999999a1999999aULL, 0x1999999a1999999aULL, }, + { 0xf1c71c72c71c71c7ULL, 0x1c71c71cf1c71c72ULL, }, + { 0x0e38e38e38e38e39ULL, 0xe38e38e40e38e38eULL, }, + { 0xd5555555d5555555ULL, 0xd5555555d5555555ULL, }, /* 16 */ + { 0xd5555555d5555555ULL, 0xd5555555d5555555ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0xeeeeeeefeeeeeeefULL, 0xeeeeeeefeeeeeeefULL, }, + { 0xc71c71c79c71c71cULL, 0xf1c71c71c71c71c7ULL, }, + { 0xe38e38e30e38e38eULL, 0xb8e38e39e38e38e3ULL, }, + { 0x2aaaaaaa2aaaaaaaULL, 0x2aaaaaaa2aaaaaaaULL, }, /* 24 */ + { 0x2aaaaaab2aaaaaabULL, 0x2aaaaaab2aaaaaabULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x1111111111111111ULL, 0x1111111111111111ULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0x1c71c71cf1c71c72ULL, 0x471c71c71c71c71cULL, }, + { 0x38e38e39638e38e3ULL, 0x0e38e38e38e38e39ULL, }, + { 0xe6666666e6666666ULL, 0xe6666666e6666666ULL, }, /* 32 */ + { 0xe6666666e6666666ULL, 0xe6666666e6666666ULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0x1111111111111111ULL, 0x1111111111111111ULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xd82d82d8ad82d82dULL, 0x02d82d82d82d82d8ULL, }, + { 0xf49f49f41f49f49fULL, 0xc9f49f4af49f49f4ULL, }, + { 0x1999999919999999ULL, 0x1999999919999999ULL, }, /* 40 */ + { 0x1999999a1999999aULL, 0x1999999a1999999aULL, }, + { 0xeeeeeeefeeeeeeefULL, 0xeeeeeeefeeeeeeefULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x0b60b60be0b60b61ULL, 0x360b60b60b60b60bULL, }, + { 0x27d27d28527d27d2ULL, 0xfd27d27d27d27d28ULL, }, + { 0xf1c71c71c71c71c7ULL, 0x1c71c71cf1c71c71ULL, }, /* 48 */ + { 0xf1c71c72c71c71c7ULL, 0x1c71c71cf1c71c72ULL, }, + { 0xc71c71c79c71c71cULL, 0xf1c71c71c71c71c7ULL, }, + { 0x1c71c71cf1c71c72ULL, 0x471c71c71c71c71cULL, }, + { 0xd82d82d8ad82d82dULL, 0x02d82d82d82d82d8ULL, }, + { 0x0b60b60be0b60b61ULL, 0x360b60b60b60b60bULL, }, + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0e38e38e38e38e38ULL, 0xe38e38e30e38e38eULL, }, /* 56 */ + { 0x0e38e38e38e38e39ULL, 0xe38e38e40e38e38eULL, }, + { 0xe38e38e30e38e38eULL, 0xb8e38e39e38e38e3ULL, }, + { 0x38e38e39638e38e3ULL, 0x0e38e38e38e38e39ULL, }, + { 0xf49f49f41f49f49fULL, 0xc9f49f4af49f49f4ULL, }, + { 0x27d27d28527d27d2ULL, 0xfd27d27d27d27d28ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */ + { 0xc21473983afb0e24ULL, 0x2f2f633c09dd8184ULL, }, + { 0x9a62cabbf118f060ULL, 0x399fe92fd4d36a90ULL, }, + { 0xfc5cfe8d434a1bc7ULL, 0xecac4a1bd3df4956ULL, }, + { 0xc21473983afb0e24ULL, 0x2f2f633c09dd8184ULL, }, + { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, }, + { 0xd40c578703b1a944ULL, 0x1d68410de0353c08ULL, }, + { 0x36068b5855e2d4abULL, 0xd074a1f9df411aceULL, }, + { 0x9a62cabbf118f060ULL, 0x399fe92fd4d36a90ULL, }, /* 72 */ + { 0xd40c578703b1a944ULL, 0x1d68410de0353c08ULL, }, + { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, }, + { 0x0e54e27c0c00b6e7ULL, 0xdae527ecaa3703daULL, }, + { 0xfc5cfe8d434a1bc7ULL, 0xecac4a1bd3df4956ULL, }, + { 0x36068b5855e2d4abULL, 0xd074a1f9df411aceULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_AVER_S_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_AVER_S_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_b.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_b.c new file mode 100644 index 0000000000..8aa7ec6a41 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_b.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction AVER_U.B + * + * 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 = "AVER_U.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] = { + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */ + { 0x8080808080808080ULL, 0x8080808080808080ULL, }, + { 0xd5d5d5d5d5d5d5d5ULL, 0xd5d5d5d5d5d5d5d5ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0xe6e6e6e6e6e6e6e6ULL, 0xe6e6e6e6e6e6e6e6ULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, + { 0xf1c79cf1c79cf1c7ULL, 0x9cf1c79cf1c79cf1ULL, }, + { 0x8eb8e38eb8e38eb8ULL, 0xe38eb8e38eb8e38eULL, }, + { 0x8080808080808080ULL, 0x8080808080808080ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x2b2b2b2b2b2b2b2bULL, 0x2b2b2b2b2b2b2b2bULL, }, + { 0x6666666666666666ULL, 0x6666666666666666ULL, }, + { 0x1a1a1a1a1a1a1a1aULL, 0x1a1a1a1a1a1a1a1aULL, }, + { 0x72471c72471c7247ULL, 0x1c72471c72471c72ULL, }, + { 0x0e39640e39640e39ULL, 0x640e39640e39640eULL, }, + { 0xd5d5d5d5d5d5d5d5ULL, 0xd5d5d5d5d5d5d5d5ULL, }, /* 16 */ + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x8080808080808080ULL, 0x8080808080808080ULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0x6f6f6f6f6f6f6f6fULL, 0x6f6f6f6f6f6f6f6fULL, }, + { 0xc79c71c79c71c79cULL, 0x71c79c71c79c71c7ULL, }, + { 0x638eb9638eb9638eULL, 0xb9638eb9638eb963ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 24 */ + { 0x2b2b2b2b2b2b2b2bULL, 0x2b2b2b2b2b2b2b2bULL, }, + { 0x8080808080808080ULL, 0x8080808080808080ULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x9191919191919191ULL, 0x9191919191919191ULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0x9c72479c72479c72ULL, 0x479c72479c72479cULL, }, + { 0x39638e39638e3963ULL, 0x8e39638e39638e39ULL, }, + { 0xe6e6e6e6e6e6e6e6ULL, 0xe6e6e6e6e6e6e6e6ULL, }, /* 32 */ + { 0x6666666666666666ULL, 0x6666666666666666ULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0x9191919191919191ULL, 0x9191919191919191ULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x8080808080808080ULL, 0x8080808080808080ULL, }, + { 0xd8ad82d8ad82d8adULL, 0x82d8ad82d8ad82d8ULL, }, + { 0x749fca749fca749fULL, 0xca749fca749fca74ULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, /* 40 */ + { 0x1a1a1a1a1a1a1a1aULL, 0x1a1a1a1a1a1a1a1aULL, }, + { 0x6f6f6f6f6f6f6f6fULL, 0x6f6f6f6f6f6f6f6fULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0x8080808080808080ULL, 0x8080808080808080ULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x8b61368b61368b61ULL, 0x368b61368b61368bULL, }, + { 0x28527d28527d2852ULL, 0x7d28527d28527d28ULL, }, + { 0xf1c79cf1c79cf1c7ULL, 0x9cf1c79cf1c79cf1ULL, }, /* 48 */ + { 0x72471c72471c7247ULL, 0x1c72471c72471c72ULL, }, + { 0xc79c71c79c71c79cULL, 0x71c79c71c79c71c7ULL, }, + { 0x9c72479c72479c72ULL, 0x479c72479c72479cULL, }, + { 0xd8ad82d8ad82d8adULL, 0x82d8ad82d8ad82d8ULL, }, + { 0x8b61368b61368b61ULL, 0x368b61368b61368bULL, }, + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x8080808080808080ULL, 0x8080808080808080ULL, }, + { 0x8eb8e38eb8e38eb8ULL, 0xe38eb8e38eb8e38eULL, }, /* 56 */ + { 0x0e39640e39640e39ULL, 0x640e39640e39640eULL, }, + { 0x638eb9638eb9638eULL, 0xb9638eb9638eb963ULL, }, + { 0x39638e39638e3963ULL, 0x8e39638e39638e39ULL, }, + { 0x749fca749fca749fULL, 0xca749fca749fca74ULL, }, + { 0x28527d28527d2852ULL, 0x7d28527d28527d28ULL, }, + { 0x8080808080808080ULL, 0x8080808080808080ULL, }, + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */ + { 0xc29473983b7b8e24ULL, 0x2faf633c8a5d8184ULL, }, + { 0x9a62cabb71997060ULL, 0x39a069afd5536b10ULL, }, + { 0x7c5d7e8d434a9c47ULL, 0x6cac4a9bd45fc956ULL, }, + { 0xc29473983b7b8e24ULL, 0x2faf633c8a5d8184ULL, }, + { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, }, + { 0xd48c578783b1a944ULL, 0x1de8c18d60353c88ULL, }, + { 0xb6870b585662d52bULL, 0x50f4a2795f419aceULL, }, + { 0x9a62cabb71997060ULL, 0x39a069afd5536b10ULL, }, /* 72 */ + { 0xd48c578783b1a944ULL, 0x1de8c18d60353c88ULL, }, + { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, }, + { 0x8e55627c8c80b767ULL, 0x5ae5a7ecaa37845aULL, }, + { 0x7c5d7e8d434a9c47ULL, 0x6cac4a9bd45fc956ULL, }, + { 0xb6870b585662d52bULL, 0x50f4a2795f419aceULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_AVER_U_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_AVER_U_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_d.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_d.c new file mode 100644 index 0000000000..9b16e1250f --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_d.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction AVER_U.D + * + * 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 = "AVER_U.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] = { + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */ + { 0x8000000000000000ULL, 0x8000000000000000ULL, }, + { 0xd555555555555555ULL, 0xd555555555555555ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0xe666666666666666ULL, 0xe666666666666666ULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, + { 0xf1c71c71c71c71c7ULL, 0x9c71c71c71c71c71ULL, }, + { 0x8e38e38e38e38e38ULL, 0xe38e38e38e38e38eULL, }, + { 0x8000000000000000ULL, 0x8000000000000000ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x2aaaaaaaaaaaaaabULL, 0x2aaaaaaaaaaaaaabULL, }, + { 0x6666666666666666ULL, 0x6666666666666666ULL, }, + { 0x199999999999999aULL, 0x199999999999999aULL, }, + { 0x71c71c71c71c71c7ULL, 0x1c71c71c71c71c72ULL, }, + { 0x0e38e38e38e38e39ULL, 0x638e38e38e38e38eULL, }, + { 0xd555555555555555ULL, 0xd555555555555555ULL, }, /* 16 */ + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x8000000000000000ULL, 0x8000000000000000ULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0x6eeeeeeeeeeeeeefULL, 0x6eeeeeeeeeeeeeefULL, }, + { 0xc71c71c71c71c71cULL, 0x71c71c71c71c71c7ULL, }, + { 0x638e38e38e38e38eULL, 0xb8e38e38e38e38e3ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 24 */ + { 0x2aaaaaaaaaaaaaabULL, 0x2aaaaaaaaaaaaaabULL, }, + { 0x8000000000000000ULL, 0x8000000000000000ULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x9111111111111111ULL, 0x9111111111111111ULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0x9c71c71c71c71c72ULL, 0x471c71c71c71c71cULL, }, + { 0x38e38e38e38e38e3ULL, 0x8e38e38e38e38e39ULL, }, + { 0xe666666666666666ULL, 0xe666666666666666ULL, }, /* 32 */ + { 0x6666666666666666ULL, 0x6666666666666666ULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0x9111111111111111ULL, 0x9111111111111111ULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x8000000000000000ULL, 0x8000000000000000ULL, }, + { 0xd82d82d82d82d82dULL, 0x82d82d82d82d82d8ULL, }, + { 0x749f49f49f49f49fULL, 0xc9f49f49f49f49f4ULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, /* 40 */ + { 0x199999999999999aULL, 0x199999999999999aULL, }, + { 0x6eeeeeeeeeeeeeefULL, 0x6eeeeeeeeeeeeeefULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0x8000000000000000ULL, 0x8000000000000000ULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x8b60b60b60b60b61ULL, 0x360b60b60b60b60bULL, }, + { 0x27d27d27d27d27d2ULL, 0x7d27d27d27d27d28ULL, }, + { 0xf1c71c71c71c71c7ULL, 0x9c71c71c71c71c71ULL, }, /* 48 */ + { 0x71c71c71c71c71c7ULL, 0x1c71c71c71c71c72ULL, }, + { 0xc71c71c71c71c71cULL, 0x71c71c71c71c71c7ULL, }, + { 0x9c71c71c71c71c72ULL, 0x471c71c71c71c71cULL, }, + { 0xd82d82d82d82d82dULL, 0x82d82d82d82d82d8ULL, }, + { 0x8b60b60b60b60b61ULL, 0x360b60b60b60b60bULL, }, + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x8000000000000000ULL, 0x8000000000000000ULL, }, + { 0x8e38e38e38e38e38ULL, 0xe38e38e38e38e38eULL, }, /* 56 */ + { 0x0e38e38e38e38e39ULL, 0x638e38e38e38e38eULL, }, + { 0x638e38e38e38e38eULL, 0xb8e38e38e38e38e3ULL, }, + { 0x38e38e38e38e38e3ULL, 0x8e38e38e38e38e39ULL, }, + { 0x749f49f49f49f49fULL, 0xc9f49f49f49f49f4ULL, }, + { 0x27d27d27d27d27d2ULL, 0x7d27d27d27d27d28ULL, }, + { 0x8000000000000000ULL, 0x8000000000000000ULL, }, + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */ + { 0xc2147397bafb0e24ULL, 0x2f2f633c89dd8184ULL, }, + { 0x9a62cabb7118f060ULL, 0x399fe92f54d36a90ULL, }, + { 0x7c5cfe8cc34a1bc7ULL, 0x6cac4a1bd3df4956ULL, }, + { 0xc2147397bafb0e24ULL, 0x2f2f633c89dd8184ULL, }, + { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, }, + { 0xd40c578703b1a944ULL, 0x1d68410ce0353c08ULL, }, + { 0xb6068b5855e2d4abULL, 0x5074a1f95f411aceULL, }, + { 0x9a62cabb7118f060ULL, 0x399fe92f54d36a90ULL, }, /* 72 */ + { 0xd40c578703b1a944ULL, 0x1d68410ce0353c08ULL, }, + { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, }, + { 0x8e54e27c0c00b6e7ULL, 0x5ae527ec2a3703daULL, }, + { 0x7c5cfe8cc34a1bc7ULL, 0x6cac4a1bd3df4956ULL, }, + { 0xb6068b5855e2d4abULL, 0x5074a1f95f411aceULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_AVER_U_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_AVER_U_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_h.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_h.c new file mode 100644 index 0000000000..191e4acbdc --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_h.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction AVER_U.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 = "AVER_U.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] = { + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */ + { 0x8000800080008000ULL, 0x8000800080008000ULL, }, + { 0xd555d555d555d555ULL, 0xd555d555d555d555ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0xe666e666e666e666ULL, 0xe666e666e666e666ULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, + { 0xf1c79c71c71cf1c7ULL, 0x9c71c71cf1c79c71ULL, }, + { 0x8e38e38eb8e38e38ULL, 0xe38eb8e38e38e38eULL, }, + { 0x8000800080008000ULL, 0x8000800080008000ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x2aab2aab2aab2aabULL, 0x2aab2aab2aab2aabULL, }, + { 0x6666666666666666ULL, 0x6666666666666666ULL, }, + { 0x199a199a199a199aULL, 0x199a199a199a199aULL, }, + { 0x71c71c72471c71c7ULL, 0x1c72471c71c71c72ULL, }, + { 0x0e39638e38e40e39ULL, 0x638e38e40e39638eULL, }, + { 0xd555d555d555d555ULL, 0xd555d555d555d555ULL, }, /* 16 */ + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x8000800080008000ULL, 0x8000800080008000ULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0x6eef6eef6eef6eefULL, 0x6eef6eef6eef6eefULL, }, + { 0xc71c71c79c71c71cULL, 0x71c79c71c71c71c7ULL, }, + { 0x638eb8e38e39638eULL, 0xb8e38e39638eb8e3ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 24 */ + { 0x2aab2aab2aab2aabULL, 0x2aab2aab2aab2aabULL, }, + { 0x8000800080008000ULL, 0x8000800080008000ULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x9111911191119111ULL, 0x9111911191119111ULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0x9c72471c71c79c72ULL, 0x471c71c79c72471cULL, }, + { 0x38e38e39638e38e3ULL, 0x8e39638e38e38e39ULL, }, + { 0xe666e666e666e666ULL, 0xe666e666e666e666ULL, }, /* 32 */ + { 0x6666666666666666ULL, 0x6666666666666666ULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0x9111911191119111ULL, 0x9111911191119111ULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x8000800080008000ULL, 0x8000800080008000ULL, }, + { 0xd82d82d8ad82d82dULL, 0x82d8ad82d82d82d8ULL, }, + { 0x749fc9f49f4a749fULL, 0xc9f49f4a749fc9f4ULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, /* 40 */ + { 0x199a199a199a199aULL, 0x199a199a199a199aULL, }, + { 0x6eef6eef6eef6eefULL, 0x6eef6eef6eef6eefULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0x8000800080008000ULL, 0x8000800080008000ULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x8b61360b60b68b61ULL, 0x360b60b68b61360bULL, }, + { 0x27d27d28527d27d2ULL, 0x7d28527d27d27d28ULL, }, + { 0xf1c79c71c71cf1c7ULL, 0x9c71c71cf1c79c71ULL, }, /* 48 */ + { 0x71c71c72471c71c7ULL, 0x1c72471c71c71c72ULL, }, + { 0xc71c71c79c71c71cULL, 0x71c79c71c71c71c7ULL, }, + { 0x9c72471c71c79c72ULL, 0x471c71c79c72471cULL, }, + { 0xd82d82d8ad82d82dULL, 0x82d8ad82d82d82d8ULL, }, + { 0x8b61360b60b68b61ULL, 0x360b60b68b61360bULL, }, + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x8000800080008000ULL, 0x8000800080008000ULL, }, + { 0x8e38e38eb8e38e38ULL, 0xe38eb8e38e38e38eULL, }, /* 56 */ + { 0x0e39638e38e40e39ULL, 0x638e38e40e39638eULL, }, + { 0x638eb8e38e39638eULL, 0xb8e38e39638eb8e3ULL, }, + { 0x38e38e39638e38e3ULL, 0x8e39638e38e38e39ULL, }, + { 0x749fc9f49f4a749fULL, 0xc9f49f4a749fc9f4ULL, }, + { 0x27d27d28527d27d2ULL, 0x7d28527d27d27d28ULL, }, + { 0x8000800080008000ULL, 0x8000800080008000ULL, }, + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */ + { 0xc21473983afb8e24ULL, 0x2f2f633c89dd8184ULL, }, + { 0x9a62cabb71197060ULL, 0x39a0692fd4d36a90ULL, }, + { 0x7c5d7e8d434a9bc7ULL, 0x6cac4a1bd3dfc956ULL, }, + { 0xc21473983afb8e24ULL, 0x2f2f633c89dd8184ULL, }, + { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, }, + { 0xd40c578783b1a944ULL, 0x1d68c10d60353c08ULL, }, + { 0xb6070b5855e2d4abULL, 0x5074a1f95f419aceULL, }, + { 0x9a62cabb71197060ULL, 0x39a0692fd4d36a90ULL, }, /* 72 */ + { 0xd40c578783b1a944ULL, 0x1d68c10d60353c08ULL, }, + { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, }, + { 0x8e55627c8c00b6e7ULL, 0x5ae5a7ecaa3783daULL, }, + { 0x7c5d7e8d434a9bc7ULL, 0x6cac4a1bd3dfc956ULL, }, + { 0xb6070b5855e2d4abULL, 0x5074a1f95f419aceULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_AVER_U_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_AVER_U_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_w.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_w.c new file mode 100644 index 0000000000..e0d6b177c4 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_w.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction AVER_U.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 = "AVER_U.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] = { + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */ + { 0x8000000080000000ULL, 0x8000000080000000ULL, }, + { 0xd5555555d5555555ULL, 0xd5555555d5555555ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0xe6666666e6666666ULL, 0xe6666666e6666666ULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, + { 0xf1c71c71c71c71c7ULL, 0x9c71c71cf1c71c71ULL, }, + { 0x8e38e38eb8e38e38ULL, 0xe38e38e38e38e38eULL, }, + { 0x8000000080000000ULL, 0x8000000080000000ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x2aaaaaab2aaaaaabULL, 0x2aaaaaab2aaaaaabULL, }, + { 0x6666666666666666ULL, 0x6666666666666666ULL, }, + { 0x1999999a1999999aULL, 0x1999999a1999999aULL, }, + { 0x71c71c72471c71c7ULL, 0x1c71c71c71c71c72ULL, }, + { 0x0e38e38e38e38e39ULL, 0x638e38e40e38e38eULL, }, + { 0xd5555555d5555555ULL, 0xd5555555d5555555ULL, }, /* 16 */ + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x8000000080000000ULL, 0x8000000080000000ULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0x6eeeeeef6eeeeeefULL, 0x6eeeeeef6eeeeeefULL, }, + { 0xc71c71c79c71c71cULL, 0x71c71c71c71c71c7ULL, }, + { 0x638e38e38e38e38eULL, 0xb8e38e39638e38e3ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 24 */ + { 0x2aaaaaab2aaaaaabULL, 0x2aaaaaab2aaaaaabULL, }, + { 0x8000000080000000ULL, 0x8000000080000000ULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x9111111191111111ULL, 0x9111111191111111ULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0x9c71c71c71c71c72ULL, 0x471c71c79c71c71cULL, }, + { 0x38e38e39638e38e3ULL, 0x8e38e38e38e38e39ULL, }, + { 0xe6666666e6666666ULL, 0xe6666666e6666666ULL, }, /* 32 */ + { 0x6666666666666666ULL, 0x6666666666666666ULL, }, + { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, }, + { 0x9111111191111111ULL, 0x9111111191111111ULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x8000000080000000ULL, 0x8000000080000000ULL, }, + { 0xd82d82d8ad82d82dULL, 0x82d82d82d82d82d8ULL, }, + { 0x749f49f49f49f49fULL, 0xc9f49f4a749f49f4ULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, /* 40 */ + { 0x1999999a1999999aULL, 0x1999999a1999999aULL, }, + { 0x6eeeeeef6eeeeeefULL, 0x6eeeeeef6eeeeeefULL, }, + { 0x4444444444444444ULL, 0x4444444444444444ULL, }, + { 0x8000000080000000ULL, 0x8000000080000000ULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x8b60b60b60b60b61ULL, 0x360b60b68b60b60bULL, }, + { 0x27d27d28527d27d2ULL, 0x7d27d27d27d27d28ULL, }, + { 0xf1c71c71c71c71c7ULL, 0x9c71c71cf1c71c71ULL, }, /* 48 */ + { 0x71c71c72471c71c7ULL, 0x1c71c71c71c71c72ULL, }, + { 0xc71c71c79c71c71cULL, 0x71c71c71c71c71c7ULL, }, + { 0x9c71c71c71c71c72ULL, 0x471c71c79c71c71cULL, }, + { 0xd82d82d8ad82d82dULL, 0x82d82d82d82d82d8ULL, }, + { 0x8b60b60b60b60b61ULL, 0x360b60b68b60b60bULL, }, + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x8000000080000000ULL, 0x8000000080000000ULL, }, + { 0x8e38e38eb8e38e38ULL, 0xe38e38e38e38e38eULL, }, /* 56 */ + { 0x0e38e38e38e38e39ULL, 0x638e38e40e38e38eULL, }, + { 0x638e38e38e38e38eULL, 0xb8e38e39638e38e3ULL, }, + { 0x38e38e39638e38e3ULL, 0x8e38e38e38e38e39ULL, }, + { 0x749f49f49f49f49fULL, 0xc9f49f4a749f49f4ULL, }, + { 0x27d27d28527d27d2ULL, 0x7d27d27d27d27d28ULL, }, + { 0x8000000080000000ULL, 0x8000000080000000ULL, }, + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */ + { 0xc21473983afb0e24ULL, 0x2f2f633c89dd8184ULL, }, + { 0x9a62cabb7118f060ULL, 0x399fe92fd4d36a90ULL, }, + { 0x7c5cfe8d434a1bc7ULL, 0x6cac4a1bd3df4956ULL, }, + { 0xc21473983afb0e24ULL, 0x2f2f633c89dd8184ULL, }, + { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, }, + { 0xd40c578783b1a944ULL, 0x1d68410d60353c08ULL, }, + { 0xb6068b5855e2d4abULL, 0x5074a1f95f411aceULL, }, + { 0x9a62cabb7118f060ULL, 0x399fe92fd4d36a90ULL, }, /* 72 */ + { 0xd40c578783b1a944ULL, 0x1d68410d60353c08ULL, }, + { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, }, + { 0x8e54e27c8c00b6e7ULL, 0x5ae527ecaa3703daULL, }, + { 0x7c5cfe8d434a1bc7ULL, 0x6cac4a1bd3df4956ULL, }, + { 0xb6068b5855e2d4abULL, 0x5074a1f95f411aceULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_AVER_U_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_AVER_U_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_b.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_b.c index b47b42e76e..bb884ee752 100644 --- a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_b.c +++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_b.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction CEQ.B * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_d.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_d.c index e169bdc320..ef13f7d05d 100644 --- a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_d.c +++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_d.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction CEQ.D * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_h.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_h.c index 9f03cb0b2b..1c43d40ee1 100644 --- a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_h.c +++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_h.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction CEQ.H * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_w.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_w.c index a927d96a89..1297d41f29 100644 --- a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_w.c +++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_w.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction CEQ.W * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_b.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_b.c index 1c1cb3bc4a..afd5f635f0 100644 --- a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_b.c +++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_b.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction CLE_S.B * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_d.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_d.c index b51907cbc0..04d58d103c 100644 --- a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_d.c +++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_d.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction CLE_S.D * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_h.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_h.c index 20ebbfbafb..ed1a1e21bd 100644 --- a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_h.c +++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_h.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction CLE_S.H * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_w.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_w.c index 4a78cce460..ea4dc1a30b 100644 --- a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_w.c +++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_w.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction CLE_S.W * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_b.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_b.c index 9990a5b08a..6e4fdd83ec 100644 --- a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_b.c +++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_b.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction CLE_U.B * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_d.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_d.c index cde86d824a..b2b2f557b8 100644 --- a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_d.c +++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_d.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction CLE_U.D * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_h.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_h.c index 70e4b48de5..b2267752eb 100644 --- a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_h.c +++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_h.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction CLE_U.H * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_w.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_w.c index f38feacef2..00e930c0c7 100644 --- a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_w.c +++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_w.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction CLE_U.W * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_b.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_b.c index b81b569498..4a52ebe491 100644 --- a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_b.c +++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_b.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction CLT_S.B * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_d.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_d.c index 393457a3c1..cc945cdf8d 100644 --- a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_d.c +++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_d.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction CLT_S.D * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_h.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_h.c index 56860d7bcc..b228dfe7f5 100644 --- a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_h.c +++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_h.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction CLT_S.H * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_w.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_w.c index 346b2939bb..6cb192a851 100644 --- a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_w.c +++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_w.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction CLT_S.W * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_b.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_b.c index be79646b45..b6189d6b72 100644 --- a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_b.c +++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_b.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction CLT_U.B * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_d.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_d.c index afbe4904f8..4f547d8f0b 100644 --- a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_d.c +++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_d.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction CLT_U.D * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_h.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_h.c index 126597af9d..9fcd81c653 100644 --- a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_h.c +++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_h.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction CLT_U.H * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_w.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_w.c index b4059292cd..8f648afa62 100644 --- a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_w.c +++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_w.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction CLT_U.W * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_b.c b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_b.c new file mode 100644 index 0000000000..38e3670422 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_b.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction DIV_S.B + * + * 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 = "DIV_S.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] = { + { 0x0101010101010101ULL, 0x0101010101010101ULL, }, /* 0 */ + { 0x0101010101010101ULL, 0x0101010101010101ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5656565656565656ULL, 0x5656565656565656ULL, }, /* 16 */ + { 0x0101010101010101ULL, 0x0101010101010101ULL, }, + { 0x0101010101010101ULL, 0x0101010101010101ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0101010101010101ULL, 0x0101010101010101ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0200ff0200ff0200ULL, 0xff0200ff0200ff02ULL, }, + { 0xfd0001fd0001fd00ULL, 0x01fd0001fd0001fdULL, }, + { 0xababababababababULL, 0xababababababababULL, }, /* 24 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0101010101010101ULL, 0x0101010101010101ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0101010101010101ULL, 0x0101010101010101ULL, }, + { 0xfe0001fe0001fe00ULL, 0x01fe0001fe0001feULL, }, + { 0x0300ff0300ff0300ULL, 0xff0300ff0300ff03ULL, }, + { 0x3434343434343434ULL, 0x3434343434343434ULL, }, /* 32 */ + { 0x0101010101010101ULL, 0x0101010101010101ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0101010101010101ULL, 0x0101010101010101ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0100000100000100ULL, 0x0001000001000001ULL, }, + { 0xff0000ff0000ff00ULL, 0x00ff0000ff0000ffULL, }, + { 0xcdcdcdcdcdcdcdcdULL, 0xcdcdcdcdcdcdcdcdULL, }, /* 40 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0101010101010101ULL, 0x0101010101010101ULL, }, + { 0xff0000ff0000ff00ULL, 0x00ff0000ff0000ffULL, }, + { 0x0100000100000100ULL, 0x0001000001000001ULL, }, + { 0x1d72c81d72c81d72ULL, 0xc81d72c81d72c81dULL, }, /* 48 */ + { 0x0101ff0101ff0101ULL, 0xff0101ff0101ff01ULL, }, + { 0x0001000001000001ULL, 0x0000010000010000ULL, }, + { 0x00ff0000ff0000ffULL, 0x0000ff0000ff0000ULL, }, + { 0x0002ff0002ff0002ULL, 0xff0002ff0002ff00ULL, }, + { 0x00fe0100fe0100feULL, 0x0100fe0100fe0100ULL, }, + { 0x0101010101010101ULL, 0x0101010101010101ULL, }, + { 0xffff00ffff00ffffULL, 0x00ffff00ffff00ffULL, }, + { 0xe48f39e48f39e48fULL, 0x39e48f39e48f39e4ULL, }, /* 56 */ + { 0xffff01ffff01ffffULL, 0x01ffff01ffff01ffULL, }, + { 0x00ff0000ff0000ffULL, 0x0000ff0000ff0000ULL, }, + { 0x0001000001000001ULL, 0x0000010000010000ULL, }, + { 0x00fe0100fe0100feULL, 0x0100fe0100fe0100ULL, }, + { 0x0002ff0002ff0002ULL, 0xff0002ff0002ff00ULL, }, + { 0x0000ff0000ff0000ULL, 0xff0000ff0000ff00ULL, }, + { 0x0101010101010101ULL, 0x0101010101010101ULL, }, + { 0x0101010101010101ULL, 0x0101010101010101ULL, }, /* 64 */ + { 0x18ff01000000ff08ULL, 0x04f50003000100fdULL, }, + { 0x0101000000fe0000ULL, 0x01fe00a20002fe00ULL, }, + { 0xff01ff000002fe00ULL, 0x00fa00fe00010200ULL, }, + { 0x000000ff01ff0000ULL, 0x0000fa00f600ff00ULL, }, + { 0x0101ff0101010101ULL, 0x0101010101010101ULL, }, + { 0x000000ffff020000ULL, 0x000001e600010200ULL, }, + { 0x0000000100fe0100ULL, 0x000000000000fe00ULL, }, + { 0x00000301ff00fffeULL, 0x0000fb002a000001ULL, }, /* 72 */ + { 0x10ff0100000002f0ULL, 0x02040000fc0000fbULL, }, + { 0x0101010101010101ULL, 0x0101010101010101ULL, }, + { 0x0001fdff00ff03ffULL, 0x000200000000ff00ULL, }, + { 0x000000ff02000001ULL, 0xff00f6002b0000f8ULL, }, + { 0xeaffff0001000009ULL, 0xfa0101fffc010018ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_DIV_S_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_DIV_S_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_d.c b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_d.c new file mode 100644 index 0000000000..d92b6953e8 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_d.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction DIV_S.D + * + * 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 = "DIV_S.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] = { + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, /* 0 */ + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555555555556ULL, 0x5555555555555556ULL, }, /* 16 */ + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000003ULL, 0xffffffffffffffffULL, }, + { 0xfffffffffffffffdULL, 0x0000000000000001ULL, }, + { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, }, /* 24 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, + { 0xfffffffffffffffeULL, 0x0000000000000001ULL, }, + { 0x0000000000000003ULL, 0xffffffffffffffffULL, }, + { 0x3333333333333334ULL, 0x3333333333333334ULL, }, /* 32 */ + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000001ULL, 0x0000000000000000ULL, }, + { 0xffffffffffffffffULL, 0x0000000000000000ULL, }, + { 0xcccccccccccccccdULL, 0xcccccccccccccccdULL, }, /* 40 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, + { 0xffffffffffffffffULL, 0x0000000000000000ULL, }, + { 0x0000000000000001ULL, 0x0000000000000000ULL, }, + { 0x1c71c71c71c71c72ULL, 0xc71c71c71c71c71dULL, }, /* 48 */ + { 0x0000000000000001ULL, 0xffffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0xffffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000001ULL, }, + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, + { 0xffffffffffffffffULL, 0x0000000000000000ULL, }, + { 0xe38e38e38e38e38fULL, 0x38e38e38e38e38e4ULL, }, /* 56 */ + { 0xffffffffffffffffULL, 0x0000000000000001ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000001ULL, }, + { 0x0000000000000000ULL, 0xffffffffffffffffULL, }, + { 0x0000000000000000ULL, 0xffffffffffffffffULL, }, + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, /* 64 */ + { 0x000000000000001cULL, 0x0000000000000003ULL, }, + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, + { 0xffffffffffffffffULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 72 */ + { 0x0000000000000013ULL, 0x0000000000000002ULL, }, + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0xffffffffffffffffULL, }, + { 0xffffffffffffffe6ULL, 0xfffffffffffffffaULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_DIV_S_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_DIV_S_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_h.c b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_h.c new file mode 100644 index 0000000000..f191b985b1 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_h.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction DIV_S.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 = "DIV_S.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] = { + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, /* 0 */ + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5556555655565556ULL, 0x5556555655565556ULL, }, /* 16 */ + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0003ffff00000003ULL, 0xffff00000003ffffULL, }, + { 0xfffd00010000fffdULL, 0x00010000fffd0001ULL, }, + { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, }, /* 24 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, + { 0xfffe00010000fffeULL, 0x00010000fffe0001ULL, }, + { 0x0003ffff00000003ULL, 0xffff00000003ffffULL, }, + { 0x3334333433343334ULL, 0x3334333433343334ULL, }, /* 32 */ + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0001000000000001ULL, 0x0000000000010000ULL, }, + { 0xffff00000000ffffULL, 0x00000000ffff0000ULL, }, + { 0xcccdcccdcccdcccdULL, 0xcccdcccdcccdcccdULL, }, /* 40 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, + { 0xffff00000000ffffULL, 0x00000000ffff0000ULL, }, + { 0x0001000000000001ULL, 0x0000000000010000ULL, }, + { 0x1c72c71d71c81c72ULL, 0xc71d71c81c72c71dULL, }, /* 48 */ + { 0x0001ffff00010001ULL, 0xffff00010001ffffULL, }, + { 0x0000000000010000ULL, 0x0000000100000000ULL, }, + { 0x00000000ffff0000ULL, 0x0000ffff00000000ULL, }, + { 0x0000ffff00020000ULL, 0xffff00020000ffffULL, }, + { 0x00000001fffe0000ULL, 0x0001fffe00000001ULL, }, + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, + { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, }, + { 0xe38f38e48e39e38fULL, 0x38e48e39e38f38e4ULL, }, /* 56 */ + { 0xffff0001ffffffffULL, 0x0001ffffffff0001ULL, }, + { 0x00000000ffff0000ULL, 0x0000ffff00000000ULL, }, + { 0x0000000000010000ULL, 0x0000000100000000ULL, }, + { 0x00000001fffe0000ULL, 0x0001fffe00000001ULL, }, + { 0x0000ffff00020000ULL, 0xffff00020000ffffULL, }, + { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, }, + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, /* 64 */ + { 0x001cffbf0000ffffULL, 0x0003000000000000ULL, }, + { 0x0001000000000000ULL, 0x000100000000fffeULL, }, + { 0xffffffff0000fffeULL, 0x0000000000000002ULL, }, + { 0x0000000000010000ULL, 0x0000fffafff3ffffULL, }, + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, + { 0x00000000ffff0000ULL, 0x0000000100000002ULL, }, + { 0x0000000000000001ULL, 0x000000000000fffeULL, }, + { 0x00000003ffffffffULL, 0x0000fffb00370000ULL, }, /* 72 */ + { 0x0013ff2e00000002ULL, 0x00020000fffd0000ULL, }, + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, + { 0x0000fffd00000003ULL, 0x000000000000ffffULL, }, + { 0x0000000000020000ULL, 0xfffffff600390000ULL, }, + { 0xffe6003900010000ULL, 0xfffa0001fffc0000ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_DIV_S_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_DIV_S_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_w.c b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_w.c new file mode 100644 index 0000000000..0baaff10f9 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_w.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction DIV_S.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 = "DIV_S.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] = { + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, /* 0 */ + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555655555556ULL, 0x5555555655555556ULL, }, /* 16 */ + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000200000000ULL, 0xffffffff00000002ULL, }, + { 0xfffffffd00000000ULL, 0x00000001fffffffdULL, }, + { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, }, /* 24 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, + { 0xfffffffe00000000ULL, 0x00000001fffffffeULL, }, + { 0x0000000300000000ULL, 0xffffffff00000003ULL, }, + { 0x3333333433333334ULL, 0x3333333433333334ULL, }, /* 32 */ + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000100000000ULL, 0x0000000000000001ULL, }, + { 0xffffffff00000000ULL, 0x00000000ffffffffULL, }, + { 0xcccccccdcccccccdULL, 0xcccccccdcccccccdULL, }, /* 40 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, + { 0xffffffff00000000ULL, 0x00000000ffffffffULL, }, + { 0x0000000100000000ULL, 0x0000000000000001ULL, }, + { 0x1c71c71d71c71c72ULL, 0xc71c71c81c71c71dULL, }, /* 48 */ + { 0x0000000100000001ULL, 0xffffffff00000001ULL, }, + { 0x0000000000000001ULL, 0x0000000000000000ULL, }, + { 0x00000000ffffffffULL, 0x0000000000000000ULL, }, + { 0x0000000000000002ULL, 0xffffffff00000000ULL, }, + { 0x00000000fffffffeULL, 0x0000000100000000ULL, }, + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, + { 0xffffffffffffffffULL, 0x00000000ffffffffULL, }, + { 0xe38e38e48e38e38fULL, 0x38e38e39e38e38e4ULL, }, /* 56 */ + { 0xffffffffffffffffULL, 0x00000001ffffffffULL, }, + { 0x00000000ffffffffULL, 0x0000000000000000ULL, }, + { 0x0000000000000001ULL, 0x0000000000000000ULL, }, + { 0x00000000fffffffeULL, 0x0000000100000000ULL, }, + { 0x0000000000000002ULL, 0xffffffff00000000ULL, }, + { 0x0000000000000000ULL, 0xffffffff00000000ULL, }, + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, /* 64 */ + { 0x0000001c00000000ULL, 0x0000000300000000ULL, }, + { 0x0000000100000000ULL, 0x0000000100000000ULL, }, + { 0xffffffff00000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000001ULL, 0x00000000fffffff2ULL, }, + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, + { 0x00000000ffffffffULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x00000000ffffffffULL, 0x0000000000000037ULL, }, /* 72 */ + { 0x0000001300000000ULL, 0x00000002fffffffdULL, }, + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000002ULL, 0xffffffff00000039ULL, }, + { 0xffffffe600000001ULL, 0xfffffffafffffffcULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_DIV_S_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_DIV_S_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_b.c b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_b.c new file mode 100644 index 0000000000..770544a2de --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_b.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction DIV_U.B + * + * 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 = "DIV_U.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] = { + { 0x0101010101010101ULL, 0x0101010101010101ULL, }, /* 0 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0101010101010101ULL, 0x0101010101010101ULL, }, + { 0x0303030303030303ULL, 0x0303030303030303ULL, }, + { 0x0101010101010101ULL, 0x0101010101010101ULL, }, + { 0x0505050505050505ULL, 0x0505050505050505ULL, }, + { 0x0101040101040101ULL, 0x0401010401010401ULL, }, + { 0x0902010902010902ULL, 0x0109020109020109ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0101010101010101ULL, 0x0101010101010101ULL, }, + { 0x0202020202020202ULL, 0x0202020202020202ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0303030303030303ULL, 0x0303030303030303ULL, }, + { 0x0001030001030001ULL, 0x0300010300010300ULL, }, + { 0x0601000601000601ULL, 0x0006010006010006ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0101010101010101ULL, 0x0101010101010101ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0101010101010101ULL, 0x0101010101010101ULL, }, + { 0x0000010000010000ULL, 0x0100000100000100ULL, }, + { 0x0300000300000300ULL, 0x0003000003000003ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0101010101010101ULL, 0x0101010101010101ULL, }, + { 0x0202020202020202ULL, 0x0202020202020202ULL, }, + { 0x0101010101010101ULL, 0x0101010101010101ULL, }, + { 0x0404040404040404ULL, 0x0404040404040404ULL, }, + { 0x0001030001030001ULL, 0x0300010300010300ULL, }, + { 0x0701010701010701ULL, 0x0107010107010107ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0101010101010101ULL, 0x0101010101010101ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0100000100000100ULL, 0x0001000001000001ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 48 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0100000100000100ULL, 0x0001000001000001ULL, }, + { 0x0201000201000201ULL, 0x0002010002010002ULL, }, + { 0x0100000100000100ULL, 0x0001000001000001ULL, }, + { 0x0402010402010402ULL, 0x0104020104020104ULL, }, + { 0x0101010101010101ULL, 0x0101010101010101ULL, }, + { 0x0801000801000801ULL, 0x0008010008010008ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 56 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000010000010000ULL, 0x0100000100000100ULL, }, + { 0x0001020001020001ULL, 0x0200010200010200ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0002030002030002ULL, 0x0300020300020300ULL, }, + { 0x0000030000030000ULL, 0x0300000300000300ULL, }, + { 0x0101010101010101ULL, 0x0101010101010101ULL, }, + { 0x0101010101010101ULL, 0x0101010101010101ULL, }, /* 64 */ + { 0x0000ff0200000008ULL, 0x040000030c010200ULL, }, + { 0x0001010100000000ULL, 0x0100000001020400ULL, }, + { 0x01010a0200020000ULL, 0x0000000001010000ULL, }, + { 0x0101000001010200ULL, 0x0002110000000015ULL, }, + { 0x0101ff0101010101ULL, 0x0101010101010101ULL, }, + { 0x0102000000000100ULL, 0x000100000001020cULL, }, + { 0x0202000100030000ULL, 0x0001010000000001ULL, }, + { 0x0100000004020102ULL, 0x0002120200000001ULL, }, /* 72 */ + { 0x0000ff0102010010ULL, 0x0200010908000000ULL, }, + { 0x0101010101010101ULL, 0x0101010101010101ULL, }, + { 0x0101070201040001ULL, 0x0000010101000000ULL, }, + { 0x0000000002000201ULL, 0x01020c020000010dULL, }, + { 0x0000ff0001000109ULL, 0x0700000808010200ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_DIV_U_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_DIV_U_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_d.c b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_d.c new file mode 100644 index 0000000000..9653e7db5c --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_d.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction DIV_U.D + * + * 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 = "DIV_U.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] = { + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, /* 0 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, + { 0x0000000000000003ULL, 0x0000000000000003ULL, }, + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, + { 0x0000000000000005ULL, 0x0000000000000005ULL, }, + { 0x0000000000000001ULL, 0x0000000000000004ULL, }, + { 0x0000000000000009ULL, 0x0000000000000001ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, + { 0x0000000000000002ULL, 0x0000000000000002ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000003ULL, 0x0000000000000003ULL, }, + { 0x0000000000000000ULL, 0x0000000000000003ULL, }, + { 0x0000000000000006ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, + { 0x0000000000000000ULL, 0x0000000000000001ULL, }, + { 0x0000000000000003ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, + { 0x0000000000000002ULL, 0x0000000000000002ULL, }, + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, + { 0x0000000000000004ULL, 0x0000000000000004ULL, }, + { 0x0000000000000000ULL, 0x0000000000000003ULL, }, + { 0x0000000000000007ULL, 0x0000000000000001ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000001ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 48 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000001ULL, 0x0000000000000000ULL, }, + { 0x0000000000000002ULL, 0x0000000000000000ULL, }, + { 0x0000000000000001ULL, 0x0000000000000000ULL, }, + { 0x0000000000000004ULL, 0x0000000000000001ULL, }, + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, + { 0x0000000000000008ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 56 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000001ULL, }, + { 0x0000000000000000ULL, 0x0000000000000002ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000003ULL, }, + { 0x0000000000000000ULL, 0x0000000000000003ULL, }, + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, /* 64 */ + { 0x0000000000000000ULL, 0x0000000000000003ULL, }, + { 0x0000000000000000ULL, 0x0000000000000001ULL, }, + { 0x0000000000000001ULL, 0x0000000000000000ULL, }, + { 0x0000000000000001ULL, 0x0000000000000000ULL, }, + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, + { 0x0000000000000001ULL, 0x0000000000000000ULL, }, + { 0x0000000000000002ULL, 0x0000000000000000ULL, }, + { 0x0000000000000001ULL, 0x0000000000000000ULL, }, /* 72 */ + { 0x0000000000000000ULL, 0x0000000000000002ULL, }, + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, + { 0x0000000000000001ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000001ULL, }, + { 0x0000000000000000ULL, 0x0000000000000007ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_DIV_U_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_DIV_U_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_h.c b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_h.c new file mode 100644 index 0000000000..3dcd30bee9 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_h.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction DIV_U.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 = "DIV_U.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] = { + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, /* 0 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, + { 0x0003000300030003ULL, 0x0003000300030003ULL, }, + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, + { 0x0005000500050005ULL, 0x0005000500050005ULL, }, + { 0x0001000400010001ULL, 0x0004000100010004ULL, }, + { 0x0009000100020009ULL, 0x0001000200090001ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, + { 0x0002000200020002ULL, 0x0002000200020002ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0003000300030003ULL, 0x0003000300030003ULL, }, + { 0x0000000300010000ULL, 0x0003000100000003ULL, }, + { 0x0006000000010006ULL, 0x0000000100060000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, + { 0x0000000100000000ULL, 0x0001000000000001ULL, }, + { 0x0003000000000003ULL, 0x0000000000030000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, + { 0x0002000200020002ULL, 0x0002000200020002ULL, }, + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, + { 0x0004000400040004ULL, 0x0004000400040004ULL, }, + { 0x0000000300010000ULL, 0x0003000100000003ULL, }, + { 0x0007000100010007ULL, 0x0001000100070001ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0001000000000001ULL, 0x0000000000010000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 48 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0001000000000001ULL, 0x0000000000010000ULL, }, + { 0x0002000000010002ULL, 0x0000000100020000ULL, }, + { 0x0001000000000001ULL, 0x0000000000010000ULL, }, + { 0x0004000100020004ULL, 0x0001000200040001ULL, }, + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, + { 0x0008000000010008ULL, 0x0000000100080000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 56 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000100000000ULL, 0x0001000000000001ULL, }, + { 0x0000000200010000ULL, 0x0002000100000002ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000300020000ULL, 0x0003000200000003ULL, }, + { 0x0000000300000000ULL, 0x0003000000000003ULL, }, + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, /* 64 */ + { 0x0000025400000000ULL, 0x00030000000b0002ULL, }, + { 0x0000000100000000ULL, 0x0001000000010004ULL, }, + { 0x0001000a00000000ULL, 0x0000000000010000ULL, }, + { 0x0001000000010002ULL, 0x0000001000000000ULL, }, + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, + { 0x0001000000000001ULL, 0x0000000000000002ULL, }, + { 0x0002000000000000ULL, 0x0000000100000000ULL, }, + { 0x0001000000040001ULL, 0x0000001100000000ULL, }, /* 72 */ + { 0x000001c300020000ULL, 0x0002000100080000ULL, }, + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, + { 0x0001000700010000ULL, 0x0000000100010000ULL, }, + { 0x0000000000020002ULL, 0x0001000c00000001ULL, }, + { 0x0000003900010001ULL, 0x0007000000070002ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_DIV_U_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_DIV_U_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_w.c b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_w.c new file mode 100644 index 0000000000..fd395ef5e9 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_w.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction DIV_U.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 = "DIV_U.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] = { + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, /* 0 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, + { 0x0000000300000003ULL, 0x0000000300000003ULL, }, + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, + { 0x0000000500000005ULL, 0x0000000500000005ULL, }, + { 0x0000000100000001ULL, 0x0000000400000001ULL, }, + { 0x0000000900000002ULL, 0x0000000100000009ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, + { 0x0000000200000002ULL, 0x0000000200000002ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000300000003ULL, 0x0000000300000003ULL, }, + { 0x0000000000000001ULL, 0x0000000300000000ULL, }, + { 0x0000000600000001ULL, 0x0000000000000006ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, + { 0x0000000000000000ULL, 0x0000000100000000ULL, }, + { 0x0000000300000000ULL, 0x0000000000000003ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, + { 0x0000000200000002ULL, 0x0000000200000002ULL, }, + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, + { 0x0000000400000004ULL, 0x0000000400000004ULL, }, + { 0x0000000000000001ULL, 0x0000000300000000ULL, }, + { 0x0000000700000001ULL, 0x0000000100000007ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000100000000ULL, 0x0000000000000001ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 48 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000100000000ULL, 0x0000000000000001ULL, }, + { 0x0000000200000001ULL, 0x0000000000000002ULL, }, + { 0x0000000100000000ULL, 0x0000000000000001ULL, }, + { 0x0000000400000002ULL, 0x0000000100000004ULL, }, + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, + { 0x0000000800000001ULL, 0x0000000000000008ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 56 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000100000000ULL, }, + { 0x0000000000000001ULL, 0x0000000200000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000002ULL, 0x0000000300000000ULL, }, + { 0x0000000000000000ULL, 0x0000000300000000ULL, }, + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, /* 64 */ + { 0x0000000000000000ULL, 0x000000030000000bULL, }, + { 0x0000000000000000ULL, 0x0000000100000001ULL, }, + { 0x0000000100000000ULL, 0x0000000000000001ULL, }, + { 0x0000000100000001ULL, 0x0000000000000000ULL, }, + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, + { 0x0000000100000000ULL, 0x0000000000000000ULL, }, + { 0x0000000200000000ULL, 0x0000000000000000ULL, }, + { 0x0000000100000004ULL, 0x0000000000000000ULL, }, /* 72 */ + { 0x0000000000000002ULL, 0x0000000200000008ULL, }, + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, + { 0x0000000100000001ULL, 0x0000000000000001ULL, }, + { 0x0000000000000002ULL, 0x0000000100000000ULL, }, + { 0x0000000000000001ULL, 0x0000000700000007ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_DIV_U_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_DIV_U_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_d.c b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_d.c new file mode 100644 index 0000000000..af8d609bea --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_d.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction DOTP_S.D + * + * 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 = "DOTP_S.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] = { + { 0x0000000000000002ULL, 0x0000000000000002ULL, }, /* 0 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x00000000aaaaaaacULL, 0x00000000aaaaaaacULL, }, + { 0xffffffff55555556ULL, 0xffffffff55555556ULL, }, + { 0x0000000066666668ULL, 0x0000000066666668ULL, }, + { 0xffffffff9999999aULL, 0xffffffff9999999aULL, }, + { 0x000000008e38e38fULL, 0xffffffffe38e38e5ULL, }, + { 0xffffffff71c71c73ULL, 0x000000001c71c71dULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x00000000aaaaaaacULL, 0x00000000aaaaaaacULL, }, /* 16 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x38e38e39c71c71c8ULL, 0x38e38e39c71c71c8ULL, }, + { 0xc71c71c6e38e38e4ULL, 0xc71c71c6e38e38e4ULL, }, + { 0x22222222eeeeeef0ULL, 0x22222222eeeeeef0ULL, }, + { 0xddddddddbbbbbbbcULL, 0xddddddddbbbbbbbcULL, }, + { 0x2f684bdab425ed0aULL, 0xf684bda197b425eeULL, }, + { 0xd097b425f684bda2ULL, 0x097b425f12f684beULL, }, + { 0xffffffff55555556ULL, 0xffffffff55555556ULL, }, /* 24 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xc71c71c6e38e38e4ULL, 0xc71c71c6e38e38e4ULL, }, + { 0x38e38e3871c71c72ULL, 0x38e38e3871c71c72ULL, }, + { 0xdddddddd77777778ULL, 0xdddddddd77777778ULL, }, + { 0x22222221dddddddeULL, 0x22222221dddddddeULL, }, + { 0xd097b425da12f685ULL, 0x097b425e4bda12f7ULL, }, + { 0x2f684bd97b425ed1ULL, 0xf684bda1097b425fULL, }, + { 0x0000000066666668ULL, 0x0000000066666668ULL, }, /* 32 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x22222222eeeeeef0ULL, 0x22222222eeeeeef0ULL, }, + { 0xdddddddd77777778ULL, 0xdddddddd77777778ULL, }, + { 0x147ae14851eb8520ULL, 0x147ae14851eb8520ULL, }, + { 0xeb851eb8147ae148ULL, 0xeb851eb8147ae148ULL, }, + { 0x1c71c71d0b60b60cULL, 0xfa4fa4fa82d82d84ULL, }, + { 0xe38e38e35b05b05cULL, 0x05b05b05e38e38e4ULL, }, + { 0xffffffff9999999aULL, 0xffffffff9999999aULL, }, /* 40 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xddddddddbbbbbbbcULL, 0xddddddddbbbbbbbcULL, }, + { 0x22222221dddddddeULL, 0x22222221dddddddeULL, }, + { 0xeb851eb8147ae148ULL, 0xeb851eb8147ae148ULL, }, + { 0x147ae147851eb852ULL, 0x147ae147851eb852ULL, }, + { 0xe38e38e382d82d83ULL, 0x05b05b0560b60b61ULL, }, + { 0x1c71c71c16c16c17ULL, 0xfa4fa4fa38e38e39ULL, }, + { 0x000000008e38e38fULL, 0xffffffffe38e38e5ULL, }, /* 48 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x2f684bdab425ed0aULL, 0xf684bda197b425eeULL, }, + { 0xd097b425da12f685ULL, 0x097b425e4bda12f7ULL, }, + { 0x1c71c71d0b60b60cULL, 0xfa4fa4fa82d82d84ULL, }, + { 0xe38e38e382d82d83ULL, 0x05b05b0560b60b61ULL, }, + { 0x35ba78199add3c0dULL, 0x0fcd6e9dc0ca4589ULL, }, + { 0xca4587e6f35ba782ULL, 0xf032916222c3f35cULL, }, + { 0xffffffff71c71c73ULL, 0x000000001c71c71dULL, }, /* 56 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xd097b425f684bda2ULL, 0x097b425f12f684beULL, }, + { 0x2f684bd97b425ed1ULL, 0xf684bda1097b425fULL, }, + { 0xe38e38e35b05b05cULL, 0x05b05b05e38e38e4ULL, }, + { 0x1c71c71c16c16c17ULL, 0xfa4fa4fa38e38e39ULL, }, + { 0xca4587e6f35ba782ULL, 0xf032916222c3f35cULL, }, + { 0x35ba78187e6b74f1ULL, 0x0fcd6e9df9add3c1ULL, }, + { 0x3e3ad4ae1266c290ULL, 0x1637d725aebdb714ULL, }, /* 64 */ + { 0x0e3a0c27f7d6aae4ULL, 0x0575fbb7f08ff55cULL, }, + { 0x1c00082337c84b78ULL, 0x0c3d39640fde8392ULL, }, + { 0xda65cd5e9f696cdcULL, 0xdeeb6bec644a26d0ULL, }, + { 0x0e3a0c27f7d6aae4ULL, 0x0575fbb7f08ff55cULL, }, + { 0x17945c09b2e19689ULL, 0x032b395187d966b4ULL, }, + { 0xec1f0e54b5aa67beULL, 0xfbe95b6e67ae6296ULL, }, + { 0x1aad30609bff5437ULL, 0xf059a43d01b40370ULL, }, + { 0x1c00082337c84b78ULL, 0x0c3d39640fde8392ULL, }, /* 72 */ + { 0xec1f0e54b5aa67beULL, 0xfbe95b6e67ae6296ULL, }, + { 0x2e9326619bb7c8e4ULL, 0x225024d84d163b91ULL, }, + { 0xc17a5d0372a2a622ULL, 0x0afd6368668933a8ULL, }, + { 0xda65cd5e9f696cdcULL, 0xdeeb6bec644a26d0ULL, }, + { 0x1aad30609bff5437ULL, 0xf059a43d01b40370ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_DOTP_S_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_DOTP_S_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_h.c b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_h.c new file mode 100644 index 0000000000..40de72ae97 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_h.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction DOTP_S.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 = "DOTP_S.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] = { + { 0x0002000200020002ULL, 0x0002000200020002ULL, }, /* 0 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x00ac00ac00ac00acULL, 0x00ac00ac00ac00acULL, }, + { 0xff56ff56ff56ff56ULL, 0xff56ff56ff56ff56ULL, }, + { 0x0068006800680068ULL, 0x0068006800680068ULL, }, + { 0xff9aff9aff9aff9aULL, 0xff9aff9aff9aff9aULL, }, + { 0x008fffe5003a008fULL, 0xffe5003a008fffe5ULL, }, + { 0xff73001dffc8ff73ULL, 0x001dffc8ff73001dULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x00ac00ac00ac00acULL, 0x00ac00ac00ac00acULL, }, /* 16 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x39c839c839c839c8ULL, 0x39c839c839c839c8ULL, }, + { 0xc6e4c6e4c6e4c6e4ULL, 0xc6e4c6e4c6e4c6e4ULL, }, + { 0x22f022f022f022f0ULL, 0x22f022f022f022f0ULL, }, + { 0xddbcddbcddbcddbcULL, 0xddbcddbcddbcddbcULL, }, + { 0x300af6ee137c300aULL, 0xf6ee137c300af6eeULL, }, + { 0xd0a209beed30d0a2ULL, 0x09beed30d0a209beULL, }, + { 0xff56ff56ff56ff56ULL, 0xff56ff56ff56ff56ULL, }, /* 24 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xc6e4c6e4c6e4c6e4ULL, 0xc6e4c6e4c6e4c6e4ULL, }, + { 0x3872387238723872ULL, 0x3872387238723872ULL, }, + { 0xdd78dd78dd78dd78ULL, 0xdd78dd78dd78dd78ULL, }, + { 0x21de21de21de21deULL, 0x21de21de21de21deULL, }, + { 0xd08508f7ecbed085ULL, 0x08f7ecbed08508f7ULL, }, + { 0x2ed1f65f12982ed1ULL, 0xf65f12982ed1f65fULL, }, + { 0x0068006800680068ULL, 0x0068006800680068ULL, }, /* 32 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x22f022f022f022f0ULL, 0x22f022f022f022f0ULL, }, + { 0xdd78dd78dd78dd78ULL, 0xdd78dd78dd78dd78ULL, }, + { 0x1520152015201520ULL, 0x1520152015201520ULL, }, + { 0xeb48eb48eb48eb48ULL, 0xeb48eb48eb48eb48ULL, }, + { 0x1d0cfa840bc81d0cULL, 0xfa840bc81d0cfa84ULL, }, + { 0xe35c05e4f4a0e35cULL, 0x05e4f4a0e35c05e4ULL, }, + { 0xff9aff9aff9aff9aULL, 0xff9aff9aff9aff9aULL, }, /* 40 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xddbcddbcddbcddbcULL, 0xddbcddbcddbcddbcULL, }, + { 0x21de21de21de21deULL, 0x21de21de21de21deULL, }, + { 0xeb48eb48eb48eb48ULL, 0xeb48eb48eb48eb48ULL, }, + { 0x1452145214521452ULL, 0x1452145214521452ULL, }, + { 0xe3830561f472e383ULL, 0x0561f472e3830561ULL, }, + { 0x1c17fa390b281c17ULL, 0xfa390b281c17fa39ULL, }, + { 0x008fffe5003a008fULL, 0xffe5003a008fffe5ULL, }, /* 48 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x300af6ee137c300aULL, 0xf6ee137c300af6eeULL, }, + { 0xd08508f7ecbed085ULL, 0x08f7ecbed08508f7ULL, }, + { 0x1d0cfa840bc81d0cULL, 0xfa840bc81d0cfa84ULL, }, + { 0xe3830561f472e383ULL, 0x0561f472e3830561ULL, }, + { 0x360d0f893f04360dULL, 0x0f893f04360d0f89ULL, }, + { 0xca82f05cc136ca82ULL, 0xf05cc136ca82f05cULL, }, + { 0xff73001dffc8ff73ULL, 0x001dffc8ff73001dULL, }, /* 56 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xd0a209beed30d0a2ULL, 0x09beed30d0a209beULL, }, + { 0x2ed1f65f12982ed1ULL, 0xf65f12982ed1f65fULL, }, + { 0xe35c05e4f4a0e35cULL, 0x05e4f4a0e35c05e4ULL, }, + { 0x1c17fa390b281c17ULL, 0xfa390b281c17fa39ULL, }, + { 0xca82f05cc136ca82ULL, 0xf05cc136ca82f05cULL, }, + { 0x34f10fc13e9234f1ULL, 0x0fc13e9234f10fc1ULL, }, + { 0x64240d342bc42c39ULL, 0x3f6a22fd3b1d1990ULL, }, /* 64 */ + { 0xe704ebe4e24eef13ULL, 0x01a706951e1be630ULL, }, + { 0x4ca419cce226b927ULL, 0xfb55fd241553f560ULL, }, + { 0xec36ee202172098aULL, 0xd846ec28206404e0ULL, }, + { 0xe704ebe4e24eef13ULL, 0x01a706951e1be630ULL, }, + { 0x111d264945920cf1ULL, 0x0195153d113a1a54ULL, }, + { 0xea70debeff82160dULL, 0x04260f88039c0b8aULL, }, + { 0xe9721dc70769091eULL, 0xf8711c48091bf7e4ULL, }, + { 0x4ca419cce226b927ULL, 0xfb55fd241553f560ULL, }, /* 72 */ + { 0xea70debeff82160dULL, 0x04260f88039c0b8aULL, }, + { 0x3b3437281d127579ULL, 0x0c310d25237206e9ULL, }, + { 0xf706df16dc8de6b6ULL, 0xf0d31b5827f9f42aULL, }, + { 0xec36ee202172098aULL, 0xd846ec28206404e0ULL, }, + { 0xe9721dc70769091eULL, 0xf8711c48091bf7e4ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_DOTP_S_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_DOTP_S_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_w.c b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_w.c new file mode 100644 index 0000000000..2f1d23be6f --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_w.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction DOTP_S.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 = "DOTP_S.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] = { + { 0x0000000200000002ULL, 0x0000000200000002ULL, }, /* 0 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000aaac0000aaacULL, 0x0000aaac0000aaacULL, }, + { 0xffff5556ffff5556ULL, 0xffff5556ffff5556ULL, }, + { 0x0000666800006668ULL, 0x0000666800006668ULL, }, + { 0xffff999affff999aULL, 0xffff999affff999aULL, }, + { 0xffffe38f00008e3aULL, 0x000038e5ffffe38fULL, }, + { 0x00001c73ffff71c8ULL, 0xffffc71d00001c73ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000aaac0000aaacULL, 0x0000aaac0000aaacULL, }, /* 16 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x38e471c838e471c8ULL, 0x38e471c838e471c8ULL, }, + { 0xc71c38e4c71c38e4ULL, 0xc71c38e4c71c38e4ULL, }, + { 0x2222eef02222eef0ULL, 0x2222eef02222eef0ULL, }, + { 0xddddbbbcddddbbbcULL, 0xddddbbbcddddbbbcULL, }, + { 0xf684ed0a2f69097cULL, 0x12f725eef684ed0aULL, }, + { 0x097bbda2d097a130ULL, 0xed0984be097bbda2ULL, }, + { 0xffff5556ffff5556ULL, 0xffff5556ffff5556ULL, }, /* 24 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xc71c38e4c71c38e4ULL, 0xc71c38e4c71c38e4ULL, }, + { 0x38e31c7238e31c72ULL, 0x38e31c7238e31c72ULL, }, + { 0xdddd7778dddd7778ULL, 0xdddd7778dddd7778ULL, }, + { 0x2221ddde2221dddeULL, 0x2221ddde2221dddeULL, }, + { 0x097af685d09784beULL, 0xed0912f7097af685ULL, }, + { 0xf6845ed12f67d098ULL, 0x12f6425ff6845ed1ULL, }, + { 0x0000666800006668ULL, 0x0000666800006668ULL, }, /* 32 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x2222eef02222eef0ULL, 0x2222eef02222eef0ULL, }, + { 0xdddd7778dddd7778ULL, 0xdddd7778dddd7778ULL, }, + { 0x147b8520147b8520ULL, 0x147b8520147b8520ULL, }, + { 0xeb84e148eb84e148ULL, 0xeb84e148eb84e148ULL, }, + { 0xfa4fb60c1c7271c8ULL, 0x0b612d84fa4fb60cULL, }, + { 0x05b0b05ce38df4a0ULL, 0xf49f38e405b0b05cULL, }, + { 0xffff999affff999aULL, 0xffff999affff999aULL, }, /* 40 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xddddbbbcddddbbbcULL, 0xddddbbbcddddbbbcULL, }, + { 0x2221ddde2221dddeULL, 0x2221ddde2221dddeULL, }, + { 0xeb84e148eb84e148ULL, 0xeb84e148eb84e148ULL, }, + { 0x147ab852147ab852ULL, 0x147ab852147ab852ULL, }, + { 0x05b02d83e38e1c72ULL, 0xf49f0b6105b02d83ULL, }, + { 0xfa4f6c171c717d28ULL, 0x0b608e39fa4f6c17ULL, }, + { 0xffffe38f00008e3aULL, 0x000038e5ffffe38fULL, }, /* 48 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xf684ed0a2f69097cULL, 0x12f725eef684ed0aULL, }, + { 0x097af685d09784beULL, 0xed0912f7097af685ULL, }, + { 0xfa4fb60c1c7271c8ULL, 0x0b612d84fa4fb60cULL, }, + { 0x05b02d83e38e1c72ULL, 0xf49f0b6105b02d83ULL, }, + { 0x0fcd3c0d35bb4f04ULL, 0x3f3645890fcd3c0dULL, }, + { 0xf032a782ca453f36ULL, 0xc0c9f35cf032a782ULL, }, + { 0x00001c73ffff71c8ULL, 0xffffc71d00001c73ULL, }, /* 56 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x097bbda2d097a130ULL, 0xed0984be097bbda2ULL, }, + { 0xf6845ed12f67d098ULL, 0x12f6425ff6845ed1ULL, }, + { 0x05b0b05ce38df4a0ULL, 0xf49f38e405b0b05cULL, }, + { 0xfa4f6c171c717d28ULL, 0x0b608e39fa4f6c17ULL, }, + { 0xf032a782ca453f36ULL, 0xc0c9f35cf032a782ULL, }, + { 0x0fcd74f135ba3292ULL, 0x3f35d3c10fcd74f1ULL, }, + { 0x3a57fe7422c25584ULL, 0x16b6b9f518facfa9ULL, }, /* 64 */ + { 0x01f36d90f9441446ULL, 0x0286cfede5f4db15ULL, }, + { 0x2f1518bcce21d93eULL, 0x0934568af4ec6499ULL, }, + { 0xc9576c1204f83042ULL, 0xd91d3e4709b06e36ULL, }, + { 0x01f36d90f9441446ULL, 0x0286cfede5f4db15ULL, }, + { 0x0012474d242f32a9ULL, 0x13f2a8f51ca9cd91ULL, }, + { 0x0144b48a04a7d0ddULL, 0x124b1c4e04fa8e45ULL, }, + { 0xfe2a6f6923268793ULL, 0x179e9377ef4766beULL, }, + { 0x2f1518bcce21d93eULL, 0x0934568af4ec6499ULL, }, /* 72 */ + { 0x0144b48a04a7d0ddULL, 0x124b1c4e04fa8e45ULL, }, + { 0x352c988848431561ULL, 0x12e4f841217b42c9ULL, }, + { 0xd437b4e8f3b0139fULL, 0x08c7d980187d5896ULL, }, + { 0xc9576c1204f83042ULL, 0xd91d3e4709b06e36ULL, }, + { 0xfe2a6f6923268793ULL, 0x179e9377ef4766beULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_DOTP_S_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_DOTP_S_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_u_d.c b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_u_d.c new file mode 100644 index 0000000000..e998e00410 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_u_d.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction DOTP_U.D + * + * 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 = "DOTP_U.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] = { + { 0xfffffffc00000002ULL, 0xfffffffc00000002ULL, }, /* 0 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x55555552aaaaaaacULL, 0x55555552aaaaaaacULL, }, + { 0xaaaaaaa955555556ULL, 0xaaaaaaa955555556ULL, }, + { 0x9999999666666668ULL, 0x9999999666666668ULL, }, + { 0x666666659999999aULL, 0x666666659999999aULL, }, + { 0x71c71c6f8e38e38fULL, 0x1c71c719e38e38e5ULL, }, + { 0x8e38e38c71c71c73ULL, 0xe38e38e21c71c71dULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x55555552aaaaaaacULL, 0x55555552aaaaaaacULL, }, /* 16 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xe38e38e1c71c71c8ULL, 0xe38e38e1c71c71c8ULL, }, + { 0x71c71c70e38e38e4ULL, 0x71c71c70e38e38e4ULL, }, + { 0x1111110eeeeeeef0ULL, 0x1111110eeeeeeef0ULL, }, + { 0x44444443bbbbbbbcULL, 0x44444443bbbbbbbcULL, }, + { 0xf684bd9fb425ed0aULL, 0xbda12f6697b425eeULL, }, + { 0x5ed097b2f684bda2ULL, 0x97b425ec12f684beULL, }, + { 0xaaaaaaa955555556ULL, 0xaaaaaaa955555556ULL, }, /* 24 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x71c71c70e38e38e4ULL, 0x71c71c70e38e38e4ULL, }, + { 0x38e38e3871c71c72ULL, 0x38e38e3871c71c72ULL, }, + { 0x8888888777777778ULL, 0x8888888777777778ULL, }, + { 0x22222221dddddddeULL, 0x22222221dddddddeULL, }, + { 0x7b425ecfda12f685ULL, 0x5ed097b34bda12f7ULL, }, + { 0x2f684bd97b425ed1ULL, 0x4bda12f6097b425fULL, }, + { 0x9999999666666668ULL, 0x9999999666666668ULL, }, /* 32 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x1111110eeeeeeef0ULL, 0x1111110eeeeeeef0ULL, }, + { 0x8888888777777778ULL, 0x8888888777777778ULL, }, + { 0x47ae147851eb8520ULL, 0x47ae147851eb8520ULL, }, + { 0x51eb851e147ae148ULL, 0x51eb851e147ae148ULL, }, + { 0x27d27d260b60b60cULL, 0xe38e38e182d82d84ULL, }, + { 0x71c71c705b05b05cULL, 0xb60b60b4e38e38e4ULL, }, + { 0x666666659999999aULL, 0x666666659999999aULL, }, /* 40 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x44444443bbbbbbbcULL, 0x44444443bbbbbbbcULL, }, + { 0x22222221dddddddeULL, 0x22222221dddddddeULL, }, + { 0x51eb851e147ae148ULL, 0x51eb851e147ae148ULL, }, + { 0x147ae147851eb852ULL, 0x147ae147851eb852ULL, }, + { 0x49f49f4982d82d83ULL, 0x38e38e3860b60b61ULL, }, + { 0x1c71c71c16c16c17ULL, 0x2d82d82d38e38e39ULL, }, + { 0x71c71c6f8e38e38fULL, 0x1c71c719e38e38e5ULL, }, /* 48 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xf684bd9fb425ed0aULL, 0xbda12f6697b425eeULL, }, + { 0x7b425ecfda12f685ULL, 0x5ed097b34bda12f7ULL, }, + { 0x27d27d260b60b60cULL, 0xe38e38e182d82d84ULL, }, + { 0x49f49f4982d82d83ULL, 0x38e38e3860b60b61ULL, }, + { 0x1948b0fb9add3c0dULL, 0xd6e9e063c0ca4589ULL, }, + { 0x587e6b73f35ba782ULL, 0x4587e6b622c3f35cULL, }, + { 0x8e38e38c71c71c73ULL, 0xe38e38e21c71c71dULL, }, /* 56 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5ed097b2f684bda2ULL, 0x97b425ec12f684beULL, }, + { 0x2f684bd97b425ed1ULL, 0x4bda12f6097b425fULL, }, + { 0x71c71c705b05b05cULL, 0xb60b60b4e38e38e4ULL, }, + { 0x1c71c71c16c16c17ULL, 0x2d82d82d38e38e39ULL, }, + { 0x587e6b73f35ba782ULL, 0x4587e6b622c3f35cULL, }, + { 0x35ba78187e6b74f1ULL, 0x9e06522bf9add3c1ULL, }, + { 0x4f10a2461266c290ULL, 0x132f373daebdb714ULL, }, /* 64 */ + { 0x9262f356f7d6aae4ULL, 0x1ab54eb3f08ff55cULL, }, + { 0x7927f2d937c84b78ULL, 0xb5e40e840fde8392ULL, }, + { 0x4ab4e3ab9f696cdcULL, 0xd21109f6644a26d0ULL, }, + { 0x9262f356f7d6aae4ULL, 0x1ab54eb3f08ff55cULL, }, + { 0x0f105ccfb2e19689ULL, 0x032b395187d966b4ULL, }, + { 0xe1cb8469b5aa67beULL, 0x1128ae6a67ae6296ULL, }, + { 0x8afc46ad9bff5437ULL, 0x1890b25301b40370ULL, }, + { 0x7927f2d937c84b78ULL, 0xb5e40e840fde8392ULL, }, /* 72 */ + { 0xe1cb8469b5aa67beULL, 0x1128ae6a67ae6296ULL, }, + { 0xfae79ab59bb7c8e4ULL, 0x78a66f004d163b91ULL, }, + { 0x8ffb559e72a2a622ULL, 0x8744321b668933a8ULL, }, + { 0x4ab4e3ab9f696cdcULL, 0xd21109f6644a26d0ULL, }, + { 0x8afc46ad9bff5437ULL, 0x1890b25301b40370ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_DOTP_U_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_DOTP_U_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_u_h.c b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_u_h.c new file mode 100644 index 0000000000..e8db601a74 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_u_h.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction DOTP_U.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 = "DOTP_U.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] = { + { 0xfc02fc02fc02fc02ULL, 0xfc02fc02fc02fc02ULL, }, /* 0 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x52ac52ac52ac52acULL, 0x52ac52ac52ac52acULL, }, + { 0xa956a956a956a956ULL, 0xa956a956a956a956ULL, }, + { 0x9668966896689668ULL, 0x9668966896689668ULL, }, + { 0x659a659a659a659aULL, 0x659a659a659a659aULL, }, + { 0x6f8f19e5c53a6f8fULL, 0x19e5c53a6f8f19e5ULL, }, + { 0x8c73e21d36c88c73ULL, 0xe21d36c88c73e21dULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x52ac52ac52ac52acULL, 0x52ac52ac52ac52acULL, }, /* 16 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xe1c8e1c8e1c8e1c8ULL, 0xe1c8e1c8e1c8e1c8ULL, }, + { 0x70e470e470e470e4ULL, 0x70e470e470e470e4ULL, }, + { 0x0ef00ef00ef00ef0ULL, 0x0ef00ef00ef00ef0ULL, }, + { 0x43bc43bc43bc43bcULL, 0x43bc43bc43bc43bcULL, }, + { 0xf50abbee837cf50aULL, 0xbbee837cf50abbeeULL, }, + { 0x5da296becf305da2ULL, 0x96becf305da296beULL, }, + { 0xa956a956a956a956ULL, 0xa956a956a956a956ULL, }, /* 24 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x70e470e470e470e4ULL, 0x70e470e470e470e4ULL, }, + { 0x3872387238723872ULL, 0x3872387238723872ULL, }, + { 0x8778877887788778ULL, 0x8778877887788778ULL, }, + { 0x21de21de21de21deULL, 0x21de21de21de21deULL, }, + { 0x7a855df741be7a85ULL, 0x5df741be7a855df7ULL, }, + { 0x2ed14b5f67982ed1ULL, 0x4b5f67982ed14b5fULL, }, + { 0x9668966896689668ULL, 0x9668966896689668ULL, }, /* 32 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0ef00ef00ef00ef0ULL, 0x0ef00ef00ef00ef0ULL, }, + { 0x8778877887788778ULL, 0x8778877887788778ULL, }, + { 0x4520452045204520ULL, 0x4520452045204520ULL, }, + { 0x5148514851485148ULL, 0x5148514851485148ULL, }, + { 0x260ce1849dc8260cULL, 0xe1849dc8260ce184ULL, }, + { 0x705cb4e4f8a0705cULL, 0xb4e4f8a0705cb4e4ULL, }, + { 0x659a659a659a659aULL, 0x659a659a659a659aULL, }, /* 40 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x43bc43bc43bc43bcULL, 0x43bc43bc43bc43bcULL, }, + { 0x21de21de21de21deULL, 0x21de21de21de21deULL, }, + { 0x5148514851485148ULL, 0x5148514851485148ULL, }, + { 0x1452145214521452ULL, 0x1452145214521452ULL, }, + { 0x4983386127724983ULL, 0x3861277249833861ULL, }, + { 0x1c172d393e281c17ULL, 0x2d393e281c172d39ULL, }, + { 0x6f8f19e5c53a6f8fULL, 0x19e5c53a6f8f19e5ULL, }, /* 48 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xf50abbee837cf50aULL, 0xbbee837cf50abbeeULL, }, + { 0x7a855df741be7a85ULL, 0x5df741be7a855df7ULL, }, + { 0x260ce1849dc8260cULL, 0xe1849dc8260ce184ULL, }, + { 0x4983386127724983ULL, 0x3861277249833861ULL, }, + { 0x180dd5895b04180dULL, 0xd5895b04180dd589ULL, }, + { 0x5782445c6a365782ULL, 0x445c6a365782445cULL, }, + { 0x8c73e21d36c88c73ULL, 0xe21d36c88c73e21dULL, }, /* 56 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5da296becf305da2ULL, 0x96becf305da296beULL, }, + { 0x2ed14b5f67982ed1ULL, 0x4b5f67982ed14b5fULL, }, + { 0x705cb4e4f8a0705cULL, 0xb4e4f8a0705cb4e4ULL, }, + { 0x1c172d393e281c17ULL, 0x2d393e281c172d39ULL, }, + { 0x5782445c6a365782ULL, 0x445c6a365782445cULL, }, + { 0x34f19dc1cc9234f1ULL, 0x9dc1cc9234f19dc1ULL, }, + { 0x742471342bc42c39ULL, 0x3f6a22fd371d7990ULL, }, /* 64 */ + { 0xd4044ee4444e4413ULL, 0x68a71195331b4430ULL, }, + { 0x80a423cc6c264e27ULL, 0x62556624be531a60ULL, }, + { 0x5c36512021725e8aULL, 0x8a465528c764a2e0ULL, }, + { 0xd4044ee4444e4413ULL, 0x68a71195331b4430ULL, }, + { 0x831d26496b929af1ULL, 0xef958b3d113a1254ULL, }, + { 0xeb7041beae82700dULL, 0xd326aa88189c1f8aULL, }, + { 0xa8721dc73869b21eULL, 0xf27179481e1be5e4ULL, }, + { 0x80a423cc6c264e27ULL, 0x62556624be531a60ULL, }, /* 72 */ + { 0xeb7041beae82700dULL, 0xd326aa88189c1f8aULL, }, + { 0x9334e7282d128b79ULL, 0xbc319725797206e9ULL, }, + { 0x670642166b8da1b6ULL, 0xe0d340587bf92d2aULL, }, + { 0x5c36512021725e8aULL, 0x8a465528c764a2e0ULL, }, + { 0xa8721dc73869b21eULL, 0xf27179481e1be5e4ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_DOTP_U_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_DOTP_U_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_u_w.c b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_u_w.c new file mode 100644 index 0000000000..cf5bd13f48 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_u_w.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction DOTP_U.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 = "DOTP_U.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] = { + { 0xfffc0002fffc0002ULL, 0xfffc0002fffc0002ULL, }, /* 0 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5552aaac5552aaacULL, 0x5552aaac5552aaacULL, }, + { 0xaaa95556aaa95556ULL, 0xaaa95556aaa95556ULL, }, + { 0x9996666899966668ULL, 0x9996666899966668ULL, }, + { 0x6665999a6665999aULL, 0x6665999a6665999aULL, }, + { 0x1c6fe38f71c48e3aULL, 0xc71a38e51c6fe38fULL, }, + { 0xe38c1c738e3771c8ULL, 0x38e1c71de38c1c73ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5552aaac5552aaacULL, 0x5552aaac5552aaacULL, }, /* 16 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xe38c71c8e38c71c8ULL, 0xe38c71c8e38c71c8ULL, }, + { 0x71c638e471c638e4ULL, 0x71c638e471c638e4ULL, }, + { 0x110eeef0110eeef0ULL, 0x110eeef0110eeef0ULL, }, + { 0x4443bbbc4443bbbcULL, 0x4443bbbc4443bbbcULL, }, + { 0xbd9fed0af683097cULL, 0x84bc25eebd9fed0aULL, }, + { 0x97b2bda25ecfa130ULL, 0xd09684be97b2bda2ULL, }, + { 0xaaa95556aaa95556ULL, 0xaaa95556aaa95556ULL, }, /* 24 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x71c638e471c638e4ULL, 0x71c638e471c638e4ULL, }, + { 0x38e31c7238e31c72ULL, 0x38e31c7238e31c72ULL, }, + { 0x8887777888877778ULL, 0x8887777888877778ULL, }, + { 0x2221ddde2221dddeULL, 0x2221ddde2221dddeULL, }, + { 0x5ecff6857b4184beULL, 0x425e12f75ecff685ULL, }, + { 0x4bd95ed12f67d098ULL, 0x684b425f4bd95ed1ULL, }, + { 0x9996666899966668ULL, 0x9996666899966668ULL, }, /* 32 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x110eeef0110eeef0ULL, 0x110eeef0110eeef0ULL, }, + { 0x8887777888877778ULL, 0x8887777888877778ULL, }, + { 0x47ab852047ab8520ULL, 0x47ab852047ab8520ULL, }, + { 0x51eae14851eae148ULL, 0x51eae14851eae148ULL, }, + { 0xe38cb60c27d071c8ULL, 0x9f482d84e38cb60cULL, }, + { 0xb609b05c71c5f4a0ULL, 0xfa4e38e4b609b05cULL, }, + { 0x6665999a6665999aULL, 0x6665999a6665999aULL, }, /* 40 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x4443bbbc4443bbbcULL, 0x4443bbbc4443bbbcULL, }, + { 0x2221ddde2221dddeULL, 0x2221ddde2221dddeULL, }, + { 0x51eae14851eae148ULL, 0x51eae14851eae148ULL, }, + { 0x147ab852147ab852ULL, 0x147ab852147ab852ULL, }, + { 0x38e32d8349f41c72ULL, 0x27d20b6138e32d83ULL, }, + { 0x2d826c171c717d28ULL, 0x3e938e392d826c17ULL, }, + { 0x1c6fe38f71c48e3aULL, 0xc71a38e51c6fe38fULL, }, /* 48 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xbd9fed0af683097cULL, 0x84bc25eebd9fed0aULL, }, + { 0x5ecff6857b4184beULL, 0x425e12f75ecff685ULL, }, + { 0xe38cb60c27d071c8ULL, 0x9f482d84e38cb60cULL, }, + { 0x38e32d8349f41c72ULL, 0x27d20b6138e32d83ULL, }, + { 0xd6e93c0d19474f04ULL, 0x5ba64589d6e93c0dULL, }, + { 0x4586a782587d3f36ULL, 0x6b73f35c4586a782ULL, }, + { 0xe38c1c738e3771c8ULL, 0x38e1c71de38c1c73ULL, }, /* 56 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x97b2bda25ecfa130ULL, 0xd09684be97b2bda2ULL, }, + { 0x4bd95ed12f67d098ULL, 0x684b425f4bd95ed1ULL, }, + { 0xb609b05c71c5f4a0ULL, 0xfa4e38e4b609b05cULL, }, + { 0x2d826c171c717d28ULL, 0x3e938e392d826c17ULL, }, + { 0x4586a782587d3f36ULL, 0x6b73f35c4586a782ULL, }, + { 0x9e0574f135ba3292ULL, 0xcd6dd3c19e0574f1ULL, }, + { 0x18c3fe7422c25584ULL, 0x16b6b9f57608cfa9ULL, }, /* 64 */ + { 0x867e6d904e841446ULL, 0x0de4cfed4e2fdb15ULL, }, + { 0xf94f18bc4bc3d93eULL, 0x1492568ac3a66499ULL, }, + { 0x4ff36c125a383042ULL, 0x2fe23e4744196e36ULL, }, + { 0x867e6d904e841446ULL, 0x0de4cfed4e2fdb15ULL, }, + { 0xf78e474db23f32a9ULL, 0x8a26a8f51ca9cd91ULL, }, + { 0xa9bfb48aa4c2d0ddULL, 0x94641c4e1a398e45ULL, }, + { 0x6e796f69cc7c8793ULL, 0x6e879377578266beULL, }, + { 0xf94f18bc4bc3d93eULL, 0x1492568ac3a66499ULL, }, /* 72 */ + { 0xa9bfb48aa4c2d0ddULL, 0x94641c4e1a398e45ULL, }, + { 0xeb349888d2e11561ULL, 0xa0e2f84177d142c9ULL, }, + { 0x5ad3b4e8bfaf139fULL, 0x8076d98091fe5896ULL, }, + { 0x4ff36c125a383042ULL, 0x2fe23e4744196e36ULL, }, + { 0x6e796f69cc7c8793ULL, 0x6e879377578266beULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_DOTP_U_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_DOTP_U_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_b.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_b.c index b7a9a61548..5fa2644c30 100644 --- a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_b.c +++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_b.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction MAX_A.B * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_d.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_d.c index dfffaf5b5e..9d97982ab5 100644 --- a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_d.c +++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_d.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction MAX_A.D * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_h.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_h.c index e0c1bd4c4b..3365f726a2 100644 --- a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_h.c +++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_h.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction MAX_A.H * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_w.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_w.c index 40c30c5569..b33f4b7d79 100644 --- a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_w.c +++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_w.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction MAX_A.W * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_b.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_b.c index ab50eee187..71e571d0c4 100644 --- a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_b.c +++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_b.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction MAX_S.B * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_d.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_d.c index 2957db4abc..e088ab99e3 100644 --- a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_d.c +++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_d.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction MAX_S.D * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_h.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_h.c index e101764d73..6d1b81a119 100644 --- a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_h.c +++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_h.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction MAX_S.H * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_w.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_w.c index 119f03ffba..bd64294322 100644 --- a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_w.c +++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_w.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction MAX_S.W * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_b.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_b.c index d18b6bf0cc..206d907a26 100644 --- a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_b.c +++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_b.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction MAX_U.B * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_d.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_d.c index 1396e740ff..4dd247f54a 100644 --- a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_d.c +++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_d.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction MAX_U.D * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_h.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_h.c index c7dff10709..0e6a7651eb 100644 --- a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_h.c +++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_h.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction MAX_U.H * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_w.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_w.c index 910dbfc0ca..db61440551 100644 --- a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_w.c +++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_w.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction MAX_U.W * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_b.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_b.c index c632fe974f..d2a93a2e44 100644 --- a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_b.c +++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_b.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction MIN_A.B * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_d.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_d.c index 5f9a9d4706..69fd3c7662 100644 --- a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_d.c +++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_d.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction MIN_A.D * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_h.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_h.c index dc73927bb7..9f45b55539 100644 --- a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_h.c +++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_h.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction MIN_A.H * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_w.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_w.c index 67b33f3751..b08231d65f 100644 --- a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_w.c +++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_w.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction MIN_A.W * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_b.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_b.c index 76bb133da7..80b5201be1 100644 --- a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_b.c +++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_b.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction MIN_S.B * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_d.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_d.c index 8ef57a9533..0ed319024c 100644 --- a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_d.c +++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_d.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction MIN_S.D * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_h.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_h.c index e206040f98..b049054d9f 100644 --- a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_h.c +++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_h.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction MIN_S.H * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_w.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_w.c index 7532bce550..2bcd0a00ef 100644 --- a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_w.c +++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_w.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction MIN_S.W * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_b.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_b.c index 1f611453a2..2a06b43379 100644 --- a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_b.c +++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_b.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction MIN_U.B * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_d.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_d.c index 4626c62354..37924f3038 100644 --- a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_d.c +++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_d.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction MIN_U.D * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_h.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_h.c index 5eeb8d034b..1846995ce4 100644 --- a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_h.c +++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_h.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction MIN_U.H * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_w.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_w.c index e70964afa8..8b20c05440 100644 --- a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_w.c +++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_w.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction MIN_U.W * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mul_q_h.c b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mul_q_h.c new file mode 100644 index 0000000000..f1526087fa --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mul_q_h.c @@ -0,0 +1,151 @@ +/* + * 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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mul_q_w.c b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mul_q_w.c new file mode 100644 index 0000000000..df815ee9da --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mul_q_w.c @@ -0,0 +1,151 @@ +/* + * 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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulr_q_h.c b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulr_q_h.c new file mode 100644 index 0000000000..fd0a5fa7a8 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulr_q_h.c @@ -0,0 +1,151 @@ +/* + * 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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulr_q_w.c b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulr_q_w.c new file mode 100644 index 0000000000..f28b0d0a20 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulr_q_w.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction MULR_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 = "MULR_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, }, + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000001ULL, 0x0000000000000000ULL, }, + { 0x00000000ffffffffULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, /* 16 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x38e38e3a38e38e3aULL, 0x38e38e3a38e38e3aULL, }, + { 0xc71c71c7c71c71c7ULL, 0xc71c71c7c71c71c7ULL, }, + { 0x2222222322222223ULL, 0x2222222322222223ULL, }, + { 0xdddddddedddddddeULL, 0xdddddddedddddddeULL, }, + { 0x12f684be4bda12f7ULL, 0xda12f68512f684beULL, }, + { 0xed097b43b425ed09ULL, 0x25ed097ced097b43ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xc71c71c7c71c71c7ULL, 0xc71c71c7c71c71c7ULL, }, + { 0x38e38e3838e38e38ULL, 0x38e38e3838e38e38ULL, }, + { 0xddddddddddddddddULL, 0xddddddddddddddddULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0xed097b42b425ed0aULL, 0x25ed097bed097b42ULL, }, + { 0x12f684bd4bda12f6ULL, 0xda12f68512f684bdULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x2222222322222223ULL, 0x2222222322222223ULL, }, + { 0xddddddddddddddddULL, 0xddddddddddddddddULL, }, + { 0x147ae148147ae148ULL, 0x147ae148147ae148ULL, }, + { 0xeb851eb8eb851eb8ULL, 0xeb851eb8eb851eb8ULL, }, + { 0x0b60b60c2d82d82eULL, 0xe93e93e90b60b60cULL, }, + { 0xf49f49f5d27d27d2ULL, 0x16c16c17f49f49f5ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xdddddddedddddddeULL, 0xdddddddedddddddeULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0xeb851eb8eb851eb8ULL, 0xeb851eb8eb851eb8ULL, }, + { 0x147ae148147ae148ULL, 0x147ae148147ae148ULL, }, + { 0xf49f49f4d27d27d3ULL, 0x16c16c16f49f49f4ULL, }, + { 0x0b60b60b2d82d82dULL, 0xe93e93e90b60b60bULL, }, + { 0x0000000000000001ULL, 0x0000000000000000ULL, }, /* 48 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x12f684be4bda12f7ULL, 0xda12f68512f684beULL, }, + { 0xed097b42b425ed0aULL, 0x25ed097bed097b42ULL, }, + { 0x0b60b60c2d82d82eULL, 0xe93e93e90b60b60cULL, }, + { 0xf49f49f4d27d27d3ULL, 0x16c16c16f49f49f4ULL, }, + { 0x06522c3f6522c3f4ULL, 0x1948b0fc06522c3fULL, }, + { 0xf9add3c19add3c0dULL, 0xe6b74f04f9add3c1ULL, }, + { 0x00000000ffffffffULL, 0x0000000000000000ULL, }, /* 56 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xed097b43b425ed09ULL, 0x25ed097ced097b43ULL, }, + { 0x12f684bd4bda12f6ULL, 0xda12f68512f684bdULL, }, + { 0xf49f49f5d27d27d2ULL, 0x16c16c17f49f49f5ULL, }, + { 0x0b60b60b2d82d82dULL, 0xe93e93e90b60b60bULL, }, + { 0xf9add3c19add3c0dULL, 0xe6b74f04f9add3c1ULL, }, + { 0x06522c3f6522c3f2ULL, 0x1948b0fd06522c3fULL, }, + { 0x6fb7e8890cbdc0d3ULL, 0x2c6b144600049a05ULL, }, /* 64 */ + { 0x03fa514e1879c702ULL, 0x0b2c6ca9ffbf8ac7ULL, }, + { 0x4e252087e9daefc0ULL, 0x1779189301015a35ULL, }, + { 0x9713a7171db7f3a6ULL, 0xbccfb46a0107236fULL, }, + { 0x03fa514e1879c702ULL, 0x0b2c6ca9ffbf8ac7ULL, }, + { 0x002442012f047612ULL, 0x02cf8c140386e68fULL, }, + { 0x02c84b88d575d121ULL, 0x05e79a8bf1eb1c52ULL, }, + { 0xfc439edd3916c1e4ULL, 0xef19389cf19a0fdeULL, }, + { 0x4e252087e9daefc0ULL, 0x1779189301015a35ULL, }, /* 72 */ + { 0x02c84b88d575d121ULL, 0x05e79a8bf1eb1c52ULL, }, + { 0x36a93aff267d11c4ULL, 0x0c6788643838c14cULL, }, + { 0xb69baa3acc590fcdULL, 0xdc7e6df7397c58daULL, }, + { 0x9713a7171db7f3a6ULL, 0xbccfb46a0107236fULL, }, + { 0xfc439edd3916c1e4ULL, 0xef19389cf19a0fdeULL, }, +}; + + 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_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_MULR_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_b.c b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_b.c new file mode 100644 index 0000000000..6beeda906d --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_b.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction MULV.B + * + * 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 = "MULV.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] = { + { 0x0101010101010101ULL, 0x0101010101010101ULL, }, /* 0 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5656565656565656ULL, 0x5656565656565656ULL, }, + { 0xababababababababULL, 0xababababababababULL, }, + { 0x3434343434343434ULL, 0x3434343434343434ULL, }, + { 0xcdcdcdcdcdcdcdcdULL, 0xcdcdcdcdcdcdcdcdULL, }, + { 0x1d72c81d72c81d72ULL, 0xc81d72c81d72c81dULL, }, + { 0xe48f39e48f39e48fULL, 0x39e48f39e48f39e4ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5656565656565656ULL, 0x5656565656565656ULL, }, /* 16 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xe4e4e4e4e4e4e4e4ULL, 0xe4e4e4e4e4e4e4e4ULL, }, + { 0x7272727272727272ULL, 0x7272727272727272ULL, }, + { 0x7878787878787878ULL, 0x7878787878787878ULL, }, + { 0xdedededededededeULL, 0xdedededededededeULL, }, + { 0xbe4c30be4c30be4cULL, 0x30be4c30be4c30beULL, }, + { 0x980a26980a26980aULL, 0x26980a26980a2698ULL, }, + { 0xababababababababULL, 0xababababababababULL, }, /* 24 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x7272727272727272ULL, 0x7272727272727272ULL, }, + { 0x3939393939393939ULL, 0x3939393939393939ULL, }, + { 0xbcbcbcbcbcbcbcbcULL, 0xbcbcbcbcbcbcbcbcULL, }, + { 0xefefefefefefefefULL, 0xefefefefefefefefULL, }, + { 0x5f26985f26985f26ULL, 0x985f26985f26985fULL, }, + { 0x4c85134c85134c85ULL, 0x134c85134c85134cULL, }, + { 0x3434343434343434ULL, 0x3434343434343434ULL, }, /* 32 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x7878787878787878ULL, 0x7878787878787878ULL, }, + { 0xbcbcbcbcbcbcbcbcULL, 0xbcbcbcbcbcbcbcbcULL, }, + { 0x9090909090909090ULL, 0x9090909090909090ULL, }, + { 0xa4a4a4a4a4a4a4a4ULL, 0xa4a4a4a4a4a4a4a4ULL, }, + { 0xe428a0e428a0e428ULL, 0xa0e428a0e428a0e4ULL, }, + { 0x500c94500c94500cULL, 0x94500c94500c9450ULL, }, + { 0xcdcdcdcdcdcdcdcdULL, 0xcdcdcdcdcdcdcdcdULL, }, /* 40 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xdedededededededeULL, 0xdedededededededeULL, }, + { 0xefefefefefefefefULL, 0xefefefefefefefefULL, }, + { 0xa4a4a4a4a4a4a4a4ULL, 0xa4a4a4a4a4a4a4a4ULL, }, + { 0x2929292929292929ULL, 0x2929292929292929ULL, }, + { 0x394a28394a28394aULL, 0x28394a28394a2839ULL, }, + { 0x9483a59483a59483ULL, 0xa59483a59483a594ULL, }, + { 0x1d72c81d72c81d72ULL, 0xc81d72c81d72c81dULL, }, /* 48 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xbe4c30be4c30be4cULL, 0x30be4c30be4c30beULL, }, + { 0x5f26985f26985f26ULL, 0x985f26985f26985fULL, }, + { 0xe428a0e428a0e428ULL, 0xa0e428a0e428a0e4ULL, }, + { 0x394a28394a28394aULL, 0x28394a28394a2839ULL, }, + { 0x49c44049c44049c4ULL, 0x4049c44049c44049ULL, }, + { 0xd4ae88d4ae88d4aeULL, 0x88d4ae88d4ae88d4ULL, }, + { 0xe48f39e48f39e48fULL, 0x39e48f39e48f39e4ULL, }, /* 56 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x980a26980a26980aULL, 0x26980a26980a2698ULL, }, + { 0x4c85134c85134c85ULL, 0x134c85134c85134cULL, }, + { 0x500c94500c94500cULL, 0x94500c94500c9450ULL, }, + { 0x9483a59483a59483ULL, 0xa59483a59483a594ULL, }, + { 0xd4ae88d4ae88d4aeULL, 0x88d4ae88d4ae88d4ULL, }, + { 0x10e1b110e1b110e1ULL, 0xb110e1b110e1b110ULL, }, + { 0x40e4a49040843900ULL, 0xf971798404190090ULL, }, /* 64 */ + { 0x58ac00e408461300ULL, 0x4661098cd64560d0ULL, }, + { 0x60445478e83e2700ULL, 0x6de882a2aaa970f0ULL, }, + { 0x80b6c45cb0c20a80ULL, 0x4ff7d850aeb66080ULL, }, + { 0x58ac00e408461300ULL, 0x4661098cd64560d0ULL, }, + { 0x190400492969b140ULL, 0x445199a4b9814410ULL, }, + { 0xa4cc00bea5dd0d00ULL, 0xbe68a2e60795dab0ULL, }, + { 0xd0a200c74623ae70ULL, 0xea8758f0dd3e6480ULL, }, + { 0x60445478e83e2700ULL, 0x6de882a2aaa970f0ULL, }, /* 72 */ + { 0xa4cc00bea5dd0d00ULL, 0xbe68a2e60795dab0ULL, }, + { 0x90a444e4b1617900ULL, 0xf140240139395990ULL, }, + { 0x40c6f422ee9fb600ULL, 0x7b583028e316aa80ULL, }, + { 0x80b6c45cb0c20a80ULL, 0x4ff7d850aeb66080ULL, }, + { 0xd0a200c74623ae70ULL, 0xea8758f0dd3e6480ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_MULV_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_MULV_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_d.c b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_d.c new file mode 100644 index 0000000000..3205d4b378 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_d.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction MULV.D + * + * 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 = "MULV.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] = { + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, /* 0 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555555555556ULL, 0x5555555555555556ULL, }, + { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, }, + { 0x3333333333333334ULL, 0x3333333333333334ULL, }, + { 0xcccccccccccccccdULL, 0xcccccccccccccccdULL, }, + { 0x1c71c71c71c71c72ULL, 0xc71c71c71c71c71dULL, }, + { 0xe38e38e38e38e38fULL, 0x38e38e38e38e38e4ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555555555556ULL, 0x5555555555555556ULL, }, /* 16 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x38e38e38e38e38e4ULL, 0x38e38e38e38e38e4ULL, }, + { 0x1c71c71c71c71c72ULL, 0x1c71c71c71c71c72ULL, }, + { 0x7777777777777778ULL, 0x7777777777777778ULL, }, + { 0xdddddddddddddddeULL, 0xdddddddddddddddeULL, }, + { 0x12f684bda12f684cULL, 0x2f684bda12f684beULL, }, + { 0x425ed097b425ed0aULL, 0x25ed097b425ed098ULL, }, + { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, }, /* 24 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x1c71c71c71c71c72ULL, 0x1c71c71c71c71c72ULL, }, + { 0x8e38e38e38e38e39ULL, 0x8e38e38e38e38e39ULL, }, + { 0xbbbbbbbbbbbbbbbcULL, 0xbbbbbbbbbbbbbbbcULL, }, + { 0xeeeeeeeeeeeeeeefULL, 0xeeeeeeeeeeeeeeefULL, }, + { 0x097b425ed097b426ULL, 0x97b425ed097b425fULL, }, + { 0xa12f684bda12f685ULL, 0x12f684bda12f684cULL, }, + { 0x3333333333333334ULL, 0x3333333333333334ULL, }, /* 32 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x7777777777777778ULL, 0x7777777777777778ULL, }, + { 0xbbbbbbbbbbbbbbbcULL, 0xbbbbbbbbbbbbbbbcULL, }, + { 0xf5c28f5c28f5c290ULL, 0xf5c28f5c28f5c290ULL, }, + { 0x3d70a3d70a3d70a4ULL, 0x3d70a3d70a3d70a4ULL, }, + { 0x7d27d27d27d27d28ULL, 0x38e38e38e38e38e4ULL, }, + { 0xb60b60b60b60b60cULL, 0xfa4fa4fa4fa4fa50ULL, }, + { 0xcccccccccccccccdULL, 0xcccccccccccccccdULL, }, /* 40 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xdddddddddddddddeULL, 0xdddddddddddddddeULL, }, + { 0xeeeeeeeeeeeeeeefULL, 0xeeeeeeeeeeeeeeefULL, }, + { 0x3d70a3d70a3d70a4ULL, 0x3d70a3d70a3d70a4ULL, }, + { 0x8f5c28f5c28f5c29ULL, 0x8f5c28f5c28f5c29ULL, }, + { 0x9f49f49f49f49f4aULL, 0x8e38e38e38e38e39ULL, }, + { 0x2d82d82d82d82d83ULL, 0x3e93e93e93e93e94ULL, }, + { 0x1c71c71c71c71c72ULL, 0xc71c71c71c71c71dULL, }, /* 48 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x12f684bda12f684cULL, 0x2f684bda12f684beULL, }, + { 0x097b425ed097b426ULL, 0x97b425ed097b425fULL, }, + { 0x7d27d27d27d27d28ULL, 0x38e38e38e38e38e4ULL, }, + { 0x9f49f49f49f49f4aULL, 0x8e38e38e38e38e39ULL, }, + { 0xb0fcd6e9e06522c4ULL, 0x522c3f35ba781949ULL, }, + { 0x6b74f0329161f9aeULL, 0x74f0329161f9add4ULL, }, + { 0xe38e38e38e38e38fULL, 0x38e38e38e38e38e4ULL, }, /* 56 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x425ed097b425ed0aULL, 0x25ed097b425ed098ULL, }, + { 0xa12f684bda12f685ULL, 0x12f684bda12f684cULL, }, + { 0xb60b60b60b60b60cULL, 0xfa4fa4fa4fa4fa50ULL, }, + { 0x2d82d82d82d82d83ULL, 0x3e93e93e93e93e94ULL, }, + { 0x6b74f0329161f9aeULL, 0x74f0329161f9add4ULL, }, + { 0x781948b0fcd6e9e1ULL, 0xc3f35ba781948b10ULL, }, + { 0xad45be6961639000ULL, 0x3297fdea74988090ULL, }, /* 64 */ + { 0xefa7a5a0e7176a00ULL, 0xb8110a1f6f1923d0ULL, }, + { 0x08c6139fc4346000ULL, 0xab209f86581f7cf0ULL, }, + { 0xfbe1883aee787980ULL, 0x821d25438dd09f80ULL, }, + { 0xefa7a5a0e7176a00ULL, 0xb8110a1f6f1923d0ULL, }, + { 0x37ae2b38fded7040ULL, 0x682476774aee6810ULL, }, + { 0x6acb3d68be6cdc00ULL, 0xafdad2311444e7b0ULL, }, + { 0xedbf72842143b470ULL, 0x7f8223caefce5580ULL, }, + { 0x08c6139fc4346000ULL, 0xab209f86581f7cf0ULL, }, /* 72 */ + { 0x6acb3d68be6cdc00ULL, 0xafdad2311444e7b0ULL, }, + { 0x8624e5e1e5044000ULL, 0xd98178a63216c990ULL, }, + { 0x76a5ab8089e38100ULL, 0xa1019a60d4dad480ULL, }, + { 0xfbe1883aee787980ULL, 0x821d25438dd09f80ULL, }, + { 0xedbf72842143b470ULL, 0x7f8223caefce5580ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_MULV_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_MULV_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_h.c b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_h.c new file mode 100644 index 0000000000..e7bd985ae1 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_h.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction MULV.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 = "MULV.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] = { + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, /* 0 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5556555655565556ULL, 0x5556555655565556ULL, }, + { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, }, + { 0x3334333433343334ULL, 0x3334333433343334ULL, }, + { 0xcccdcccdcccdcccdULL, 0xcccdcccdcccdcccdULL, }, + { 0x1c72c71d71c81c72ULL, 0xc71d71c81c72c71dULL, }, + { 0xe38f38e48e39e38fULL, 0x38e48e39e38f38e4ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5556555655565556ULL, 0x5556555655565556ULL, }, /* 16 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x38e438e438e438e4ULL, 0x38e438e438e438e4ULL, }, + { 0x1c721c721c721c72ULL, 0x1c721c721c721c72ULL, }, + { 0x7778777877787778ULL, 0x7778777877787778ULL, }, + { 0xdddedddedddedddeULL, 0xdddedddedddedddeULL, }, + { 0x684c84bea130684cULL, 0x84bea130684c84beULL, }, + { 0xed0ad098b426ed0aULL, 0xd098b426ed0ad098ULL, }, + { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, }, /* 24 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x1c721c721c721c72ULL, 0x1c721c721c721c72ULL, }, + { 0x8e398e398e398e39ULL, 0x8e398e398e398e39ULL, }, + { 0xbbbcbbbcbbbcbbbcULL, 0xbbbcbbbcbbbcbbbcULL, }, + { 0xeeefeeefeeefeeefULL, 0xeeefeeefeeefeeefULL, }, + { 0xb426425fd098b426ULL, 0x425fd098b426425fULL, }, + { 0xf685684cda13f685ULL, 0x684cda13f685684cULL, }, + { 0x3334333433343334ULL, 0x3334333433343334ULL, }, /* 32 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x7778777877787778ULL, 0x7778777877787778ULL, }, + { 0xbbbcbbbcbbbcbbbcULL, 0xbbbcbbbcbbbcbbbcULL, }, + { 0xc290c290c290c290ULL, 0xc290c290c290c290ULL, }, + { 0x70a470a470a470a4ULL, 0x70a470a470a470a4ULL, }, + { 0x7d2838e4f4a07d28ULL, 0x38e4f4a07d2838e4ULL, }, + { 0xb60cfa503e94b60cULL, 0xfa503e94b60cfa50ULL, }, + { 0xcccdcccdcccdcccdULL, 0xcccdcccdcccdcccdULL, }, /* 40 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xdddedddedddedddeULL, 0xdddedddedddedddeULL, }, + { 0xeeefeeefeeefeeefULL, 0xeeefeeefeeefeeefULL, }, + { 0x70a470a470a470a4ULL, 0x70a470a470a470a4ULL, }, + { 0x5c295c295c295c29ULL, 0x5c295c295c295c29ULL, }, + { 0x9f4a8e397d289f4aULL, 0x8e397d289f4a8e39ULL, }, + { 0x2d833e944fa52d83ULL, 0x3e944fa52d833e94ULL, }, + { 0x1c72c71d71c81c72ULL, 0xc71d71c81c72c71dULL, }, /* 48 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x684c84bea130684cULL, 0x84bea130684c84beULL, }, + { 0xb426425fd098b426ULL, 0x425fd098b426425fULL, }, + { 0x7d2838e4f4a07d28ULL, 0x38e4f4a07d2838e4ULL, }, + { 0x9f4a8e397d289f4aULL, 0x8e397d289f4a8e39ULL, }, + { 0x22c419492c4022c4ULL, 0x19492c4022c41949ULL, }, + { 0xf9aeadd44588f9aeULL, 0xadd44588f9aeadd4ULL, }, + { 0xe38f38e48e39e38fULL, 0x38e48e39e38f38e4ULL, }, /* 56 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xed0ad098b426ed0aULL, 0xd098b426ed0ad098ULL, }, + { 0xf685684cda13f685ULL, 0x684cda13f685684cULL, }, + { 0xb60cfa503e94b60cULL, 0xfa503e94b60cfa50ULL, }, + { 0x2d833e944fa52d83ULL, 0x3e944fa52d833e94ULL, }, + { 0xf9aeadd44588f9aeULL, 0xadd44588f9aeadd4ULL, }, + { 0xe9e18b1048b1e9e1ULL, 0x8b1048b1e9e18b10ULL, }, + { 0xcbe43290c5849000ULL, 0x837136844f198090ULL, }, /* 64 */ + { 0x2cac40e4aa466a00ULL, 0xfe61d18cb74523d0ULL, }, + { 0x2d44eb78793e6000ULL, 0x4fe806a2e7a97cf0ULL, }, + { 0x78b6f35cb6c27980ULL, 0xb6f78750ceb69f80ULL, }, + { 0x2cac40e4aa466a00ULL, 0xfe61d18cb74523d0ULL, }, + { 0x21042649c2697040ULL, 0xaa51fea465816810ULL, }, + { 0x28cc8bbef4dddc00ULL, 0xa1687ae6a695e7b0ULL, }, + { 0xcfa29fc7d323b470ULL, 0xe587adf0113e5580ULL, }, + { 0x2d44eb78793e6000ULL, 0x4fe806a2e7a97cf0ULL, }, /* 72 */ + { 0x28cc8bbef4dddc00ULL, 0xa1687ae6a695e7b0ULL, }, + { 0x0fa488e4d5614000ULL, 0x864072017939c990ULL, }, + { 0x8fc62522929f8100ULL, 0x7a585f288416d480ULL, }, + { 0x78b6f35cb6c27980ULL, 0xb6f78750ceb69f80ULL, }, + { 0xcfa29fc7d323b470ULL, 0xe587adf0113e5580ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_MULV_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_MULV_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_w.c b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_w.c new file mode 100644 index 0000000000..9c318b3fbb --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_w.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction MULV.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 = "MULV.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] = { + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, /* 0 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555655555556ULL, 0x5555555655555556ULL, }, + { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, }, + { 0x3333333433333334ULL, 0x3333333433333334ULL, }, + { 0xcccccccdcccccccdULL, 0xcccccccdcccccccdULL, }, + { 0x1c71c71d71c71c72ULL, 0xc71c71c81c71c71dULL, }, + { 0xe38e38e48e38e38fULL, 0x38e38e39e38e38e4ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555655555556ULL, 0x5555555655555556ULL, }, /* 16 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xe38e38e4e38e38e4ULL, 0xe38e38e4e38e38e4ULL, }, + { 0x71c71c7271c71c72ULL, 0x71c71c7271c71c72ULL, }, + { 0x7777777877777778ULL, 0x7777777877777778ULL, }, + { 0xdddddddedddddddeULL, 0xdddddddedddddddeULL, }, + { 0x12f684bea12f684cULL, 0x84bda13012f684beULL, }, + { 0x425ed098b425ed0aULL, 0xd097b426425ed098ULL, }, + { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, }, /* 24 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x71c71c7271c71c72ULL, 0x71c71c7271c71c72ULL, }, + { 0x38e38e3938e38e39ULL, 0x38e38e3938e38e39ULL, }, + { 0xbbbbbbbcbbbbbbbcULL, 0xbbbbbbbcbbbbbbbcULL, }, + { 0xeeeeeeefeeeeeeefULL, 0xeeeeeeefeeeeeeefULL, }, + { 0x097b425fd097b426ULL, 0x425ed098097b425fULL, }, + { 0xa12f684cda12f685ULL, 0x684bda13a12f684cULL, }, + { 0x3333333433333334ULL, 0x3333333433333334ULL, }, /* 32 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x7777777877777778ULL, 0x7777777877777778ULL, }, + { 0xbbbbbbbcbbbbbbbcULL, 0xbbbbbbbcbbbbbbbcULL, }, + { 0x28f5c29028f5c290ULL, 0x28f5c29028f5c290ULL, }, + { 0x0a3d70a40a3d70a4ULL, 0x0a3d70a40a3d70a4ULL, }, + { 0xe38e38e427d27d28ULL, 0x9f49f4a0e38e38e4ULL, }, + { 0x4fa4fa500b60b60cULL, 0x93e93e944fa4fa50ULL, }, + { 0xcccccccdcccccccdULL, 0xcccccccdcccccccdULL, }, /* 40 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xdddddddedddddddeULL, 0xdddddddedddddddeULL, }, + { 0xeeeeeeefeeeeeeefULL, 0xeeeeeeefeeeeeeefULL, }, + { 0x0a3d70a40a3d70a4ULL, 0x0a3d70a40a3d70a4ULL, }, + { 0xc28f5c29c28f5c29ULL, 0xc28f5c29c28f5c29ULL, }, + { 0x38e38e3949f49f4aULL, 0x27d27d2838e38e39ULL, }, + { 0x93e93e9482d82d83ULL, 0xa4fa4fa593e93e94ULL, }, + { 0x1c71c71d71c71c72ULL, 0xc71c71c81c71c71dULL, }, /* 48 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x12f684bea12f684cULL, 0x84bda13012f684beULL, }, + { 0x097b425fd097b426ULL, 0x425ed098097b425fULL, }, + { 0xe38e38e427d27d28ULL, 0x9f49f4a0e38e38e4ULL, }, + { 0x38e38e3949f49f4aULL, 0x27d27d2838e38e39ULL, }, + { 0xba781949e06522c4ULL, 0x06522c40ba781949ULL, }, + { 0x61f9add49161f9aeULL, 0xc0ca458861f9add4ULL, }, + { 0xe38e38e48e38e38fULL, 0x38e38e39e38e38e4ULL, }, /* 56 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x425ed098b425ed0aULL, 0xd097b426425ed098ULL, }, + { 0xa12f684cda12f685ULL, 0x684bda13a12f684cULL, }, + { 0x4fa4fa500b60b60cULL, 0x93e93e944fa4fa50ULL, }, + { 0x93e93e9482d82d83ULL, 0xa4fa4fa593e93e94ULL, }, + { 0x61f9add49161f9aeULL, 0xc0ca458861f9add4ULL, }, + { 0x81948b10fcd6e9e1ULL, 0x781948b181948b10ULL, }, + { 0xb103329061639000ULL, 0x3a25368474988090ULL, }, /* 64 */ + { 0x10bf40e4e7176a00ULL, 0x8176d18c6f1923d0ULL, }, + { 0x7393eb78c4346000ULL, 0xb7bf06a2581f7cf0ULL, }, + { 0xb0f0f35cee787980ULL, 0xd67987508dd09f80ULL, }, + { 0x10bf40e4e7176a00ULL, 0x8176d18c6f1923d0ULL, }, + { 0xb4f42649fded7040ULL, 0x3ceafea44aee6810ULL, }, + { 0xf73d8bbebe6cdc00ULL, 0x53697ae61444e7b0ULL, }, + { 0x7abb9fc72143b470ULL, 0x11e5adf0efce5580ULL, }, + { 0x7393eb78c4346000ULL, 0xb7bf06a2581f7cf0ULL, }, /* 72 */ + { 0xf73d8bbebe6cdc00ULL, 0x53697ae61444e7b0ULL, }, + { 0xb6b388e4e5044000ULL, 0x1aff72013216c990ULL, }, + { 0xe8bf252289e38100ULL, 0x91ae5f28d4dad480ULL, }, + { 0xb0f0f35cee787980ULL, 0xd67987508dd09f80ULL, }, + { 0x7abb9fc72143b470ULL, 0x11e5adf0efce5580ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_MULV_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_MULV_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_s_b.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_s_b.c new file mode 100644 index 0000000000..04e6159fc7 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_s_b.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction SUBS_S.B + * + * 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 = "SUBS_S.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] = { + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x0101010101010101ULL, 0x0101010101010101ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5656565656565656ULL, 0x5656565656565656ULL, }, + { 0xababababababababULL, 0xababababababababULL, }, + { 0x3434343434343434ULL, 0x3434343434343434ULL, }, + { 0xcdcdcdcdcdcdcdcdULL, 0xcdcdcdcdcdcdcdcdULL, }, + { 0x1d72c81d72c81d72ULL, 0xc81d72c81d72c81dULL, }, + { 0xe48f39e48f39e48fULL, 0x39e48f39e48f39e4ULL, }, + { 0xababababababababULL, 0xababababababababULL, }, /* 16 */ + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x8080808080808080ULL, 0x8080808080808080ULL, }, + { 0xdedededededededeULL, 0xdedededededededeULL, }, + { 0x8080808080808080ULL, 0x8080808080808080ULL, }, + { 0xc71c80c71c80c71cULL, 0x80c71c80c71c80c7ULL, }, + { 0x8e80e38e80e38e80ULL, 0xe38e80e38e80e38eULL, }, + { 0x5656565656565656ULL, 0x5656565656565656ULL, }, /* 24 */ + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x727f1d727f1d727fULL, 0x1d727f1d727f1d72ULL, }, + { 0x39e47f39e47f39e4ULL, 0x7f39e47f39e47f39ULL, }, + { 0xcdcdcdcdcdcdcdcdULL, 0xcdcdcdcdcdcdcdcdULL, }, /* 32 */ + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x8080808080808080ULL, 0x8080808080808080ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, + { 0xe93e94e93e94e93eULL, 0x94e93e94e93e94e9ULL, }, + { 0xb08005b08005b080ULL, 0x05b08005b08005b0ULL, }, + { 0x3434343434343434ULL, 0x3434343434343434ULL, }, /* 40 */ + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, }, + { 0xdedededededededeULL, 0xdedededededededeULL, }, + { 0x6767676767676767ULL, 0x6767676767676767ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x507ffb507ffb507fULL, 0xfb507ffb507ffb50ULL, }, + { 0x17c26c17c26c17c2ULL, 0x6c17c26c17c26c17ULL, }, + { 0xe48f39e48f39e48fULL, 0x39e48f39e48f39e4ULL, }, /* 48 */ + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x39e47f39e47f39e4ULL, 0x7f39e47f39e47f39ULL, }, + { 0x8e80e38e80e38e80ULL, 0xe38e80e38e80e38eULL, }, + { 0x17c26c17c26c17c2ULL, 0x6c17c26c17c26c17ULL, }, + { 0xb08005b08005b080ULL, 0x05b08005b08005b0ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xc78071c78071c780ULL, 0x71c78071c78071c7ULL, }, + { 0x1d72c81d72c81d72ULL, 0xc81d72c81d72c81dULL, }, /* 56 */ + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x727f1d727f1d727fULL, 0x1d727f1d727f1d72ULL, }, + { 0xc71c80c71c80c71cULL, 0x80c71c80c71c80c7ULL, }, + { 0x507ffb507ffb507fULL, 0xfb507ffb507ffb50ULL, }, + { 0xe93e94e93e94e93eULL, 0x94e93e94e93e94e9ULL, }, + { 0x397f8f397f8f397fULL, 0x8f397f8f397f8f39ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */ + { 0x8d7fe680db7f7f38ULL, 0x39705044e93c8010ULL, }, + { 0xdc1038226f7f7f7fULL, 0x247f455f53508bf8ULL, }, + { 0x801bd080ca3173f2ULL, 0x7f767f7f5539ce6cULL, }, + { 0x73801a7f258080c8ULL, 0xc790b0bc17c47ff0ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x4f80527f7fc43c7fULL, 0xeb1ff51b6a142de8ULL, }, + { 0x8b80ea16ef80e5baULL, 0x7f0633426cfd705cULL, }, + { 0x24f0c8de91808080ULL, 0xdc80bba1adb07508ULL, }, /* 72 */ + { 0xb17fae80803cc480ULL, 0x15e10be596ecd318ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x800b9880809ea980ULL, 0x7fe73e2702e94374ULL, }, + { 0x7fe5307f36cf8d0eULL, 0x808a8080abc73294ULL, }, + { 0x757f16ea117f1b46ULL, 0x80facdbe940390a4ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_SUBS_S_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_SUBS_S_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_s_d.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_s_d.c new file mode 100644 index 0000000000..195137f41f --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_s_d.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction SUBS_S.D + * + * 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 = "SUBS_S.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] = { + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555555555556ULL, 0x5555555555555556ULL, }, + { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, }, + { 0x3333333333333334ULL, 0x3333333333333334ULL, }, + { 0xcccccccccccccccdULL, 0xcccccccccccccccdULL, }, + { 0x1c71c71c71c71c72ULL, 0xc71c71c71c71c71dULL, }, + { 0xe38e38e38e38e38fULL, 0x38e38e38e38e38e4ULL, }, + { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, }, /* 16 */ + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x8000000000000000ULL, 0x8000000000000000ULL, }, + { 0xdddddddddddddddeULL, 0xdddddddddddddddeULL, }, + { 0x8000000000000000ULL, 0x8000000000000000ULL, }, + { 0xc71c71c71c71c71cULL, 0x8000000000000000ULL, }, + { 0x8e38e38e38e38e39ULL, 0xe38e38e38e38e38eULL, }, + { 0x5555555555555556ULL, 0x5555555555555556ULL, }, /* 24 */ + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x71c71c71c71c71c7ULL, 0x1c71c71c71c71c72ULL, }, + { 0x38e38e38e38e38e4ULL, 0x7fffffffffffffffULL, }, + { 0xcccccccccccccccdULL, 0xcccccccccccccccdULL, }, /* 32 */ + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x8000000000000000ULL, 0x8000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, + { 0xe93e93e93e93e93eULL, 0x93e93e93e93e93e9ULL, }, + { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, }, + { 0x3333333333333334ULL, 0x3333333333333334ULL, }, /* 40 */ + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, }, + { 0xdddddddddddddddeULL, 0xdddddddddddddddeULL, }, + { 0x6666666666666667ULL, 0x6666666666666667ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x4fa4fa4fa4fa4fa5ULL, 0xfa4fa4fa4fa4fa50ULL, }, + { 0x16c16c16c16c16c2ULL, 0x6c16c16c16c16c17ULL, }, + { 0xe38e38e38e38e38fULL, 0x38e38e38e38e38e4ULL, }, /* 48 */ + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x38e38e38e38e38e4ULL, 0x7fffffffffffffffULL, }, + { 0x8e38e38e38e38e39ULL, 0xe38e38e38e38e38eULL, }, + { 0x16c16c16c16c16c2ULL, 0x6c16c16c16c16c17ULL, }, + { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xc71c71c71c71c71dULL, 0x71c71c71c71c71c7ULL, }, + { 0x1c71c71c71c71c72ULL, 0xc71c71c71c71c71dULL, }, /* 56 */ + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x71c71c71c71c71c7ULL, 0x1c71c71c71c71c72ULL, }, + { 0xc71c71c71c71c71cULL, 0x8000000000000000ULL, }, + { 0x4fa4fa4fa4fa4fa5ULL, 0xfa4fa4fa4fa4fa50ULL, }, + { 0xe93e93e93e93e93eULL, 0x93e93e93e93e93e9ULL, }, + { 0x38e38e38e38e38e3ULL, 0x8e38e38e38e38e39ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */ + { 0x8cace668dace8e38ULL, 0x386f5044e93c5d10ULL, }, + { 0xdc1038216e92c9c0ULL, 0x238e445f53508af8ULL, }, + { 0x8000000000000000ULL, 0x7fffffffffffffffULL, }, + { 0x73531997253171c8ULL, 0xc790afbb16c3a2f0ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x4f6351b893c43b88ULL, 0xeb1ef41a6a142de8ULL, }, + { 0x8b6eea15ef61e4baULL, 0x7fffffffffffffffULL, }, + { 0x23efc7de916d3640ULL, 0xdc71bba0acaf7508ULL, }, /* 72 */ + { 0xb09cae476c3bc478ULL, 0x14e10be595ebd218ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x8000000000000000ULL, 0x7fffffffffffffffULL, }, + { 0x7fffffffffffffffULL, 0x8000000000000000ULL, }, + { 0x749115ea109e1b46ULL, 0x8000000000000000ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_SUBS_S_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_SUBS_S_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_s_h.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_s_h.c new file mode 100644 index 0000000000..c57238d31a --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_s_h.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction SUBS_S.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 = "SUBS_S.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 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5556555655565556ULL, 0x5556555655565556ULL, }, + { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, }, + { 0x3334333433343334ULL, 0x3334333433343334ULL, }, + { 0xcccdcccdcccdcccdULL, 0xcccdcccdcccdcccdULL, }, + { 0x1c72c71d71c81c72ULL, 0xc71d71c81c72c71dULL, }, + { 0xe38f38e48e39e38fULL, 0x38e48e39e38f38e4ULL, }, + { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, }, /* 16 */ + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x8000800080008000ULL, 0x8000800080008000ULL, }, + { 0xdddedddedddedddeULL, 0xdddedddedddedddeULL, }, + { 0x8000800080008000ULL, 0x8000800080008000ULL, }, + { 0xc71c80001c72c71cULL, 0x80001c72c71c8000ULL, }, + { 0x8e39e38e80008e39ULL, 0xe38e80008e39e38eULL, }, + { 0x5556555655565556ULL, 0x5556555655565556ULL, }, /* 24 */ + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x71c71c727fff71c7ULL, 0x1c727fff71c71c72ULL, }, + { 0x38e47fffe38e38e4ULL, 0x7fffe38e38e47fffULL, }, + { 0xcccdcccdcccdcccdULL, 0xcccdcccdcccdcccdULL, }, /* 32 */ + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x8000800080008000ULL, 0x8000800080008000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, + { 0xe93e93e93e94e93eULL, 0x93e93e94e93e93e9ULL, }, + { 0xb05b05b08000b05bULL, 0x05b08000b05b05b0ULL, }, + { 0x3334333433343334ULL, 0x3334333433343334ULL, }, /* 40 */ + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, }, + { 0xdddedddedddedddeULL, 0xdddedddedddedddeULL, }, + { 0x6667666766676667ULL, 0x6667666766676667ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x4fa5fa507fff4fa5ULL, 0xfa507fff4fa5fa50ULL, }, + { 0x16c26c17c16c16c2ULL, 0x6c17c16c16c26c17ULL, }, + { 0xe38f38e48e39e38fULL, 0x38e48e39e38f38e4ULL, }, /* 48 */ + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x38e47fffe38e38e4ULL, 0x7fffe38e38e47fffULL, }, + { 0x8e39e38e80008e39ULL, 0xe38e80008e39e38eULL, }, + { 0x16c26c17c16c16c2ULL, 0x6c17c16c16c26c17ULL, }, + { 0xb05b05b08000b05bULL, 0x05b08000b05b05b0ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xc71d71c78000c71dULL, 0x71c78000c71d71c7ULL, }, + { 0x1c72c71d71c81c72ULL, 0xc71d71c81c72c71dULL, }, /* 56 */ + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x71c71c727fff71c7ULL, 0x1c727fff71c71c72ULL, }, + { 0xc71c80001c72c71cULL, 0x80001c72c71c8000ULL, }, + { 0x4fa5fa507fff4fa5ULL, 0xfa507fff4fa5fa50ULL, }, + { 0xe93e93e93e94e93eULL, 0x93e93e94e93e93e9ULL, }, + { 0x38e38e397fff38e3ULL, 0x8e397fff38e38e39ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */ + { 0x8cace669dacf7fffULL, 0x38705044e93c8000ULL, }, + { 0xdc1038226e937fffULL, 0x238f445f53508af8ULL, }, + { 0x8000d07fca3172f2ULL, 0x7fff7fff5539cd6cULL, }, + { 0x7354199725318000ULL, 0xc790afbc16c47fffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x4f6451b97fff3b88ULL, 0xeb1ff41b6a142de8ULL, }, + { 0x8b6fea16ef62e4baULL, 0x7fff32426bfd705cULL, }, + { 0x23f0c7de916d8000ULL, 0xdc71bba1acb07508ULL, }, /* 72 */ + { 0xb09cae478000c478ULL, 0x14e10be595ecd218ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x8000985d8000a932ULL, 0x7fff3e2701e94274ULL, }, + { 0x7fff2f8135cf8d0eULL, 0x80008000aac73294ULL, }, + { 0x749115ea109e1b46ULL, 0x8000cdbe94038fa4ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_SUBS_S_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_SUBS_S_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_s_w.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_s_w.c new file mode 100644 index 0000000000..1cded65a7e --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_s_w.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction SUBS_S.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 = "SUBS_S.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 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555655555556ULL, 0x5555555655555556ULL, }, + { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, }, + { 0x3333333433333334ULL, 0x3333333433333334ULL, }, + { 0xcccccccdcccccccdULL, 0xcccccccdcccccccdULL, }, + { 0x1c71c71d71c71c72ULL, 0xc71c71c81c71c71dULL, }, + { 0xe38e38e48e38e38fULL, 0x38e38e39e38e38e4ULL, }, + { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, }, /* 16 */ + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x8000000080000000ULL, 0x8000000080000000ULL, }, + { 0xdddddddedddddddeULL, 0xdddddddedddddddeULL, }, + { 0x8000000080000000ULL, 0x8000000080000000ULL, }, + { 0xc71c71c71c71c71cULL, 0x80000000c71c71c7ULL, }, + { 0x8e38e38e80000000ULL, 0xe38e38e38e38e38eULL, }, + { 0x5555555655555556ULL, 0x5555555655555556ULL, }, /* 24 */ + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x71c71c727fffffffULL, 0x1c71c71d71c71c72ULL, }, + { 0x38e38e39e38e38e4ULL, 0x7fffffff38e38e39ULL, }, + { 0xcccccccdcccccccdULL, 0xcccccccdcccccccdULL, }, /* 32 */ + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x8000000080000000ULL, 0x8000000080000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, + { 0xe93e93e93e93e93eULL, 0x93e93e94e93e93e9ULL, }, + { 0xb05b05b080000000ULL, 0x05b05b05b05b05b0ULL, }, + { 0x3333333433333334ULL, 0x3333333433333334ULL, }, /* 40 */ + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, }, + { 0xdddddddedddddddeULL, 0xdddddddedddddddeULL, }, + { 0x6666666766666667ULL, 0x6666666766666667ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x4fa4fa507fffffffULL, 0xfa4fa4fb4fa4fa50ULL, }, + { 0x16c16c17c16c16c2ULL, 0x6c16c16c16c16c17ULL, }, + { 0xe38e38e48e38e38fULL, 0x38e38e39e38e38e4ULL, }, /* 48 */ + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x38e38e39e38e38e4ULL, 0x7fffffff38e38e39ULL, }, + { 0x8e38e38e80000000ULL, 0xe38e38e38e38e38eULL, }, + { 0x16c16c17c16c16c2ULL, 0x6c16c16c16c16c17ULL, }, + { 0xb05b05b080000000ULL, 0x05b05b05b05b05b0ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xc71c71c780000000ULL, 0x71c71c71c71c71c7ULL, }, + { 0x1c71c71d71c71c72ULL, 0xc71c71c81c71c71dULL, }, /* 56 */ + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x71c71c727fffffffULL, 0x1c71c71d71c71c72ULL, }, + { 0xc71c71c71c71c71cULL, 0x80000000c71c71c7ULL, }, + { 0x4fa4fa507fffffffULL, 0xfa4fa4fb4fa4fa50ULL, }, + { 0xe93e93e93e93e93eULL, 0x93e93e94e93e93e9ULL, }, + { 0x38e38e397fffffffULL, 0x8e38e38f38e38e39ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */ + { 0x8cace669dace8e38ULL, 0x386f5044e93c5d10ULL, }, + { 0xdc1038226e92c9c0ULL, 0x238e445f53508af8ULL, }, + { 0x80000000ca3072f2ULL, 0x7fffffff5538cd6cULL, }, + { 0x73531997253171c8ULL, 0xc790afbc16c3a2f0ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x4f6351b97fffffffULL, 0xeb1ef41b6a142de8ULL, }, + { 0x8b6eea16ef61e4baULL, 0x7fffffff6bfc705cULL, }, + { 0x23efc7de916d3640ULL, 0xdc71bba1acaf7508ULL, }, /* 72 */ + { 0xb09cae4780000000ULL, 0x14e10be595ebd218ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x8000000080000000ULL, 0x7fffffff01e84274ULL, }, + { 0x7fffffff35cf8d0eULL, 0x80000000aac73294ULL, }, + { 0x749115ea109e1b46ULL, 0x8000000094038fa4ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_SUBS_S_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_SUBS_S_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_u_b.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_u_b.c new file mode 100644 index 0000000000..cb38f033a6 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_u_b.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction SUBS_U.B + * + * 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 = "SUBS_U.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] = { + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */ + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0x001c72001c72001cULL, 0x72001c72001c7200ULL, }, + { 0x8e39008e39008e39ULL, 0x008e39008e39008eULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */ + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x00001d00001d0000ULL, 0x1d00001d00001d00ULL, }, + { 0x3900003900003900ULL, 0x0039000039000039ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */ + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, + { 0x003e94003e94003eULL, 0x94003e94003e9400ULL, }, + { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */ + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x1700001700001700ULL, 0x0017000017000017ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 48 */ + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x3900003900003900ULL, 0x0039000039000039ULL, }, + { 0x8e39008e39008e39ULL, 0x008e39008e39008eULL, }, + { 0x1700001700001700ULL, 0x0017000017000017ULL, }, + { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xc71d00c71d00c71dULL, 0x00c71d00c71d00c7ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 56 */ + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x00001d00001d0000ULL, 0x1d00001d00001d00ULL, }, + { 0x001c72001c72001cULL, 0x72001c72001c7200ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x003e94003e94003eULL, 0x94003e94003e9400ULL, }, + { 0x00008f00008f0000ULL, 0x8f00008f00008f00ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */ + { 0x0000e66900000038ULL, 0x39000044e93c5e00ULL, }, + { 0x0010382200000000ULL, 0x2400000053508b00ULL, }, + { 0x181bd07f00310000ULL, 0x0000000055390000ULL, }, + { 0x7354000025317200ULL, 0x0090b000000000f0ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x4f64000000003c00ULL, 0x001f000000142de8ULL, }, + { 0x8b6f001600620000ULL, 0x000633000000005cULL, }, + { 0x24000000916d3640ULL, 0x0071bba100000008ULL, }, /* 72 */ + { 0x0000ae476c3c0078ULL, 0x15000be596000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x3c0b985d5b9e0032ULL, 0x00003e2702000000ULL, }, + { 0x0000000036008d0eULL, 0x428a7d7a00003294ULL, }, + { 0x0000160011001b46ULL, 0x7b0000be94039000ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_SUBS_U_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_SUBS_U_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_u_d.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_u_d.c new file mode 100644 index 0000000000..2685b2fe7e --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_u_d.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction SUBS_U.D + * + * 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 = "SUBS_U.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] = { + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */ + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0x0000000000000000ULL, 0x71c71c71c71c71c7ULL, }, + { 0x8e38e38e38e38e39ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */ + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x0000000000000000ULL, 0x1c71c71c71c71c72ULL, }, + { 0x38e38e38e38e38e4ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */ + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, + { 0x0000000000000000ULL, 0x93e93e93e93e93e9ULL, }, + { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */ + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x16c16c16c16c16c2ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 48 */ + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x38e38e38e38e38e4ULL, 0x0000000000000000ULL, }, + { 0x8e38e38e38e38e39ULL, 0x0000000000000000ULL, }, + { 0x16c16c16c16c16c2ULL, 0x0000000000000000ULL, }, + { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xc71c71c71c71c71dULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 56 */ + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x0000000000000000ULL, 0x1c71c71c71c71c72ULL, }, + { 0x0000000000000000ULL, 0x71c71c71c71c71c7ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x93e93e93e93e93e9ULL, }, + { 0x0000000000000000ULL, 0x8e38e38e38e38e39ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */ + { 0x0000000000000000ULL, 0x386f5044e93c5d10ULL, }, + { 0x0000000000000000ULL, 0x238e445f53508af8ULL, }, + { 0x181bd07eca3072f2ULL, 0x0000000000000000ULL, }, + { 0x73531997253171c8ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x4f6351b893c43b88ULL, 0x0000000000000000ULL, }, + { 0x8b6eea15ef61e4baULL, 0x0000000000000000ULL, }, + { 0x23efc7de916d3640ULL, 0x0000000000000000ULL, }, /* 72 */ + { 0x0000000000000000ULL, 0x14e10be595ebd218ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x3c0b985d5b9da932ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x428a7d79aac73294ULL, }, + { 0x0000000000000000ULL, 0x7af9cdbe94038fa4ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_SUBS_U_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_SUBS_U_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_u_h.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_u_h.c new file mode 100644 index 0000000000..ca6dd38b69 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_u_h.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction SUBS_U.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 = "SUBS_U.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 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */ + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0x000071c71c720000ULL, 0x71c71c72000071c7ULL, }, + { 0x8e39000038e38e39ULL, 0x000038e38e390000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */ + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x00001c7200000000ULL, 0x1c72000000001c72ULL, }, + { 0x38e40000000038e4ULL, 0x0000000038e40000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */ + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, + { 0x000093e93e940000ULL, 0x93e93e94000093e9ULL, }, + { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */ + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x16c20000000016c2ULL, 0x0000000016c20000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 48 */ + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x38e40000000038e4ULL, 0x0000000038e40000ULL, }, + { 0x8e39000038e38e39ULL, 0x000038e38e390000ULL, }, + { 0x16c20000000016c2ULL, 0x0000000016c20000ULL, }, + { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xc71d00001c71c71dULL, 0x00001c71c71d0000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 56 */ + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x00001c7200000000ULL, 0x1c72000000001c72ULL, }, + { 0x000071c71c720000ULL, 0x71c71c72000071c7ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x000093e93e940000ULL, 0x93e93e94000093e9ULL, }, + { 0x00008e3900000000ULL, 0x8e39000000008e39ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */ + { 0x0000e66900000000ULL, 0x38700000e93c5d10ULL, }, + { 0x0000382200000000ULL, 0x238f000053508af8ULL, }, + { 0x181bd07f00000000ULL, 0x0000000055390000ULL, }, + { 0x73540000253171c8ULL, 0x0000afbc00000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x4f64000000003b88ULL, 0x0000000000002de8ULL, }, + { 0x8b6f000000000000ULL, 0x0000324200000000ULL, }, + { 0x23f00000916d3640ULL, 0x0000bba100000000ULL, }, /* 72 */ + { 0x0000ae476c3c0000ULL, 0x14e10be595ec0000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x3c0b985d5b9e0000ULL, 0x00003e2701e90000ULL, }, + { 0x0000000035cf8d0eULL, 0x428a7d7a00003294ULL, }, + { 0x000015ea109e1b46ULL, 0x7afa000094038fa4ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_SUBS_U_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_SUBS_U_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_u_w.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_u_w.c new file mode 100644 index 0000000000..42ebddb408 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_u_w.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction SUBS_U.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 = "SUBS_U.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 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */ + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0x000000001c71c71cULL, 0x71c71c7200000000ULL, }, + { 0x8e38e38e38e38e39ULL, 0x000000008e38e38eULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */ + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x0000000000000000ULL, 0x1c71c71d00000000ULL, }, + { 0x38e38e3900000000ULL, 0x0000000038e38e39ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */ + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, + { 0x000000003e93e93eULL, 0x93e93e9400000000ULL, }, + { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */ + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x16c16c1700000000ULL, 0x0000000016c16c17ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 48 */ + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x38e38e3900000000ULL, 0x0000000038e38e39ULL, }, + { 0x8e38e38e38e38e39ULL, 0x000000008e38e38eULL, }, + { 0x16c16c1700000000ULL, 0x0000000016c16c17ULL, }, + { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xc71c71c71c71c71dULL, 0x00000000c71c71c7ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 56 */ + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x0000000000000000ULL, 0x1c71c71d00000000ULL, }, + { 0x000000001c71c71cULL, 0x71c71c7200000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x000000003e93e93eULL, 0x93e93e9400000000ULL, }, + { 0x0000000000000000ULL, 0x8e38e38f00000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */ + { 0x0000000000000000ULL, 0x386f5044e93c5d10ULL, }, + { 0x0000000000000000ULL, 0x238e445f53508af8ULL, }, + { 0x181bd07f00000000ULL, 0x000000005538cd6cULL, }, + { 0x73531997253171c8ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x4f6351b900000000ULL, 0x0000000000000000ULL, }, + { 0x8b6eea1600000000ULL, 0x0000000000000000ULL, }, + { 0x23efc7de916d3640ULL, 0x0000000000000000ULL, }, /* 72 */ + { 0x000000006c3bc478ULL, 0x14e10be595ebd218ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x3c0b985d5b9da932ULL, 0x0000000001e84274ULL, }, + { 0x0000000035cf8d0eULL, 0x428a7d7a00000000ULL, }, + { 0x00000000109e1b46ULL, 0x7af9cdbe94038fa4ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_SUBS_U_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_SUBS_U_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsus_u_b.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsus_u_b.c new file mode 100644 index 0000000000..dac20cc769 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsus_u_b.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction SUBSUS_U.B + * + * 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 = "SUBSUS_U.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] = { + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0xffffc7ffffc7ffffULL, 0xc7ffffc7ffffc7ffULL, }, + { 0xe38effe38effe38eULL, 0xffe38effe38effe3ULL, }, + { 0x0101010101010101ULL, 0x0101010101010101ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5656565656565656ULL, 0x5656565656565656ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x3434343434343434ULL, 0x3434343434343434ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x1d72001d72001d72ULL, 0x001d72001d72001dULL, }, + { 0x0000390000390000ULL, 0x3900003900003900ULL, }, + { 0xababababababababULL, 0xababababababababULL, }, /* 16 */ + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xdedededededededeULL, 0xdedededededededeULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0xc7ff72c7ff72c7ffULL, 0x72c7ff72c7ff72c7ULL, }, + { 0x8e39e38e39e38e39ULL, 0xe38e39e38e39e38eULL, }, + { 0x5656565656565656ULL, 0x5656565656565656ULL, }, /* 24 */ + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xababababababababULL, 0xababababababababULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x8989898989898989ULL, 0x8989898989898989ULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x72c71d72c71d72c7ULL, 0x1d72c71d72c71d72ULL, }, + { 0x39008e39008e3900ULL, 0x8e39008e39008e39ULL, }, + { 0xcdcdcdcdcdcdcdcdULL, 0xcdcdcdcdcdcdcdcdULL, }, /* 32 */ + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, + { 0xe9ff94e9ff94e9ffULL, 0x94e9ff94e9ff94e9ULL, }, + { 0xb05bffb05bffb05bULL, 0xffb05bffb05bffb0ULL, }, + { 0x3434343434343434ULL, 0x3434343434343434ULL, }, /* 40 */ + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x8989898989898989ULL, 0x8989898989898989ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x6767676767676767ULL, 0x6767676767676767ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x50a50050a50050a5ULL, 0x0050a50050a50050ULL, }, + { 0x17006c17006c1700ULL, 0x6c17006c17006c17ULL, }, + { 0xe48f39e48f39e48fULL, 0x39e48f39e48f39e4ULL, }, /* 48 */ + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0xffe48effe48effe4ULL, 0x8effe48effe48effULL, }, + { 0x8e39008e39008e39ULL, 0x008e39008e39008eULL, }, + { 0xffc26cffc26cffc2ULL, 0x6cffc26cffc26cffULL, }, + { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, }, + { 0xffff00ffff00ffffULL, 0x00ffff00ffff00ffULL, }, + { 0xc71d71c71d71c71dULL, 0x71c71d71c71d71c7ULL, }, + { 0x1d72c81d72c81d72ULL, 0xc81d72c81d72c81dULL, }, /* 56 */ + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x72c7ff72c7ff72c7ULL, 0xff72c7ff72c7ff72ULL, }, + { 0x001c72001c72001cULL, 0x72001c72001c7200ULL, }, + { 0x50a5fb50a5fb50a5ULL, 0xfb50a5fb50a5fb50ULL, }, + { 0x003e94003e94003eULL, 0x94003e94003e9400ULL, }, + { 0x39e38f39e38f39e3ULL, 0x8f39e38f39e38f39ULL, }, + { 0x0000ff0000ff0000ULL, 0xff0000ff0000ff00ULL, }, + { 0xff00ffff00000000ULL, 0x00000000ff00ff00ULL, }, /* 64 */ + { 0x8dace66900cf8e38ULL, 0x39705044e93c5e10ULL, }, + { 0xdc10ffff6f93cac0ULL, 0x248f455fff508b00ULL, }, + { 0x181bd07f00317300ULL, 0xbe768386ff39ce6cULL, }, + { 0xff541a9725317200ULL, 0x0090b0001700a2f0ULL, }, + { 0xffff000000ffff00ULL, 0x00ffff00000000ffULL, }, + { 0xff6452b994c4ff88ULL, 0x00fff51b6a142de8ULL, }, + { 0x8b6f00160062e500ULL, 0x85ffff426c0070ffULL, }, + { 0xff00c8de916d3640ULL, 0x0071bba1ad007508ULL, }, /* 72 */ + { 0xb19cae476cffc478ULL, 0x15e1ffe596000018ULL, }, + { 0xff00ffffffffffffULL, 0x00ffffffff000000ULL, }, + { 0x3c0b985d5b9ea932ULL, 0x9ae7ffffff004374ULL, }, + { 0xe800308136008d0eULL, 0x428a7d7aab00ff94ULL, }, + { 0x75911600119eff46ULL, 0x7bfacdbe940390a4ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_SUBSUS_U_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_SUBSUS_U_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsus_u_d.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsus_u_d.c new file mode 100644 index 0000000000..4485502c1c --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsus_u_d.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction SUBSUS_U.D + * + * 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 = "SUBSUS_U.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] = { + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0xffffffffffffffffULL, 0xc71c71c71c71c71cULL, }, + { 0xe38e38e38e38e38eULL, 0xffffffffffffffffULL, }, + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555555555556ULL, 0x5555555555555556ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x3333333333333334ULL, 0x3333333333333334ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x1c71c71c71c71c72ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x38e38e38e38e38e4ULL, }, + { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, }, /* 16 */ + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xdddddddddddddddeULL, 0xdddddddddddddddeULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0xc71c71c71c71c71cULL, 0x71c71c71c71c71c7ULL, }, + { 0x8e38e38e38e38e39ULL, 0xe38e38e38e38e38eULL, }, + { 0x5555555555555556ULL, 0x5555555555555556ULL, }, /* 24 */ + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x8888888888888889ULL, 0x8888888888888889ULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x71c71c71c71c71c7ULL, 0x1c71c71c71c71c72ULL, }, + { 0x38e38e38e38e38e4ULL, 0x8e38e38e38e38e39ULL, }, + { 0xcccccccccccccccdULL, 0xcccccccccccccccdULL, }, /* 32 */ + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, + { 0xe93e93e93e93e93eULL, 0x93e93e93e93e93e9ULL, }, + { 0xb05b05b05b05b05bULL, 0xffffffffffffffffULL, }, + { 0x3333333333333334ULL, 0x3333333333333334ULL, }, /* 40 */ + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x8888888888888889ULL, 0x8888888888888889ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x6666666666666667ULL, 0x6666666666666667ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x4fa4fa4fa4fa4fa5ULL, 0x0000000000000000ULL, }, + { 0x16c16c16c16c16c2ULL, 0x6c16c16c16c16c17ULL, }, + { 0xe38e38e38e38e38fULL, 0x38e38e38e38e38e4ULL, }, /* 48 */ + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0xffffffffffffffffULL, 0x8e38e38e38e38e39ULL, }, + { 0x8e38e38e38e38e39ULL, 0x0000000000000000ULL, }, + { 0xffffffffffffffffULL, 0x6c16c16c16c16c17ULL, }, + { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, }, + { 0xffffffffffffffffULL, 0x0000000000000000ULL, }, + { 0xc71c71c71c71c71dULL, 0x71c71c71c71c71c7ULL, }, + { 0x1c71c71c71c71c72ULL, 0xc71c71c71c71c71dULL, }, /* 56 */ + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x71c71c71c71c71c7ULL, 0xffffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x71c71c71c71c71c7ULL, }, + { 0x4fa4fa4fa4fa4fa5ULL, 0xfa4fa4fa4fa4fa50ULL, }, + { 0x0000000000000000ULL, 0x93e93e93e93e93e9ULL, }, + { 0x38e38e38e38e38e3ULL, 0x8e38e38e38e38e39ULL, }, + { 0x0000000000000000ULL, 0xffffffffffffffffULL, }, + { 0xffffffffffffffffULL, 0x0000000000000000ULL, }, /* 64 */ + { 0x8cace668dace8e38ULL, 0x386f5044e93c5d10ULL, }, + { 0xdc1038216e92c9c0ULL, 0x238e445f53508af8ULL, }, + { 0x181bd07eca3072f2ULL, 0xbd7582865538cd6cULL, }, + { 0xffffffffffffffffULL, 0x0000000000000000ULL, }, + { 0xffffffffffffffffULL, 0x0000000000000000ULL, }, + { 0xffffffffffffffffULL, 0x0000000000000000ULL, }, + { 0x8b6eea15ef61e4baULL, 0x850632416bfc705cULL, }, + { 0xffffffffffffffffULL, 0x0000000000000000ULL, }, /* 72 */ + { 0xb09cae476c3bc478ULL, 0x14e10be595ebd218ULL, }, + { 0xffffffffffffffffULL, 0x0000000000000000ULL, }, + { 0x3c0b985d5b9da932ULL, 0x99e73e2701e84274ULL, }, + { 0xe7e42f8135cf8d0eULL, 0x428a7d79aac73294ULL, }, + { 0x749115ea109e1b46ULL, 0x7af9cdbe94038fa4ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_SUBSUS_U_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_SUBSUS_U_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsus_u_h.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsus_u_h.c new file mode 100644 index 0000000000..9e99aeefc5 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsus_u_h.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction SUBSUS_U.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 = "SUBSUS_U.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] = { + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0xffffc71cffffffffULL, 0xc71cffffffffc71cULL, }, + { 0xe38effff8e38e38eULL, 0xffff8e38e38effffULL, }, + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5556555655565556ULL, 0x5556555655565556ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x3334333433343334ULL, 0x3334333433343334ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x1c72000071c81c72ULL, 0x000071c81c720000ULL, }, + { 0x000038e400000000ULL, 0x38e40000000038e4ULL, }, + { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, }, /* 16 */ + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xdddedddedddedddeULL, 0xdddedddedddedddeULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0xc71c71c7ffffc71cULL, 0x71c7ffffc71c71c7ULL, }, + { 0x8e39e38e38e38e39ULL, 0xe38e38e38e39e38eULL, }, + { 0x5556555655565556ULL, 0x5556555655565556ULL, }, /* 24 */ + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x8889888988898889ULL, 0x8889888988898889ULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x71c71c72c71d71c7ULL, 0x1c72c71d71c71c72ULL, }, + { 0x38e48e39000038e4ULL, 0x8e39000038e48e39ULL, }, + { 0xcccdcccdcccdcccdULL, 0xcccdcccdcccdcccdULL, }, /* 32 */ + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, + { 0xe93e93e9ffffe93eULL, 0x93e9ffffe93e93e9ULL, }, + { 0xb05bffff5b05b05bULL, 0xffff5b05b05bffffULL, }, + { 0x3334333433343334ULL, 0x3334333433343334ULL, }, /* 40 */ + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x8889888988898889ULL, 0x8889888988898889ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x6667666766676667ULL, 0x6667666766676667ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x4fa50000a4fb4fa5ULL, 0x0000a4fb4fa50000ULL, }, + { 0x16c26c17000016c2ULL, 0x6c17000016c26c17ULL, }, + { 0xe38f38e48e39e38fULL, 0x38e48e39e38f38e4ULL, }, /* 48 */ + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0xffff8e39e38effffULL, 0x8e39e38effff8e39ULL, }, + { 0x8e39000038e38e39ULL, 0x000038e38e390000ULL, }, + { 0xffff6c17c16cffffULL, 0x6c17c16cffff6c17ULL, }, + { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, }, + { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, }, + { 0xc71d71c71c71c71dULL, 0x71c71c71c71d71c7ULL, }, + { 0x1c72c71d71c81c72ULL, 0xc71d71c81c72c71dULL, }, /* 56 */ + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x71c7ffffc71d71c7ULL, 0xffffc71d71c7ffffULL, }, + { 0x000071c71c720000ULL, 0x71c71c72000071c7ULL, }, + { 0x4fa5fa50a4fb4fa5ULL, 0xfa50a4fb4fa5fa50ULL, }, + { 0x000093e93e940000ULL, 0x93e93e94000093e9ULL, }, + { 0x38e38e39e38f38e3ULL, 0x8e39e38f38e38e39ULL, }, + { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, }, + { 0xffffffff00000000ULL, 0x00000000ffffffffULL, }, /* 64 */ + { 0x8cace66900008e38ULL, 0x38705044e93c5d10ULL, }, + { 0xdc10ffff6e93c9c0ULL, 0x238f445fffff8af8ULL, }, + { 0x181bd07f000072f2ULL, 0xbd768286ffffcd6cULL, }, + { 0xffff1997253171c8ULL, 0x0000afbc16c4a2f0ULL, }, + { 0xffff00000000ffffULL, 0x0000ffff00000000ULL, }, + { 0xffff51b993c4ffffULL, 0x0000f41b6a142de8ULL, }, + { 0x8b6f00000000e4baULL, 0x8506ffff6bfd705cULL, }, + { 0xffffc7de916d3640ULL, 0x0000bba1acb07508ULL, }, /* 72 */ + { 0xb09cae476c3cc478ULL, 0x14e1ffff95ec0000ULL, }, + { 0xffffffffffffffffULL, 0x0000ffffffff0000ULL, }, + { 0x3c0b985d5b9ea932ULL, 0x99e7ffffffff4274ULL, }, + { 0xe7e52f8135cf8d0eULL, 0x428a7d7aaac7ffffULL, }, + { 0x749115ea109effffULL, 0x7afacdbe94038fa4ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_SUBSUS_U_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_SUBSUS_U_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsus_u_w.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsus_u_w.c new file mode 100644 index 0000000000..53a9acac1b --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsus_u_w.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction SUBSUS_U.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 = "SUBSUS_U.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] = { + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0xffffffffffffffffULL, 0xc71c71c7ffffffffULL, }, + { 0xe38e38e38e38e38eULL, 0xffffffffe38e38e3ULL, }, + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555655555556ULL, 0x5555555655555556ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x3333333433333334ULL, 0x3333333433333334ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x1c71c71d71c71c72ULL, 0x000000001c71c71dULL, }, + { 0x0000000000000000ULL, 0x38e38e3900000000ULL, }, + { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, }, /* 16 */ + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xdddddddedddddddeULL, 0xdddddddedddddddeULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0xc71c71c7ffffffffULL, 0x71c71c72c71c71c7ULL, }, + { 0x8e38e38e38e38e39ULL, 0xe38e38e38e38e38eULL, }, + { 0x5555555655555556ULL, 0x5555555655555556ULL, }, /* 24 */ + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x8888888988888889ULL, 0x8888888988888889ULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x71c71c72c71c71c7ULL, 0x1c71c71d71c71c72ULL, }, + { 0x38e38e3900000000ULL, 0x8e38e38e38e38e39ULL, }, + { 0xcccccccdcccccccdULL, 0xcccccccdcccccccdULL, }, /* 32 */ + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, + { 0xe93e93e9ffffffffULL, 0x93e93e94e93e93e9ULL, }, + { 0xb05b05b05b05b05bULL, 0xffffffffb05b05b0ULL, }, + { 0x3333333433333334ULL, 0x3333333433333334ULL, }, /* 40 */ + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x8888888988888889ULL, 0x8888888988888889ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x6666666766666667ULL, 0x6666666766666667ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x4fa4fa50a4fa4fa5ULL, 0x000000004fa4fa50ULL, }, + { 0x16c16c1700000000ULL, 0x6c16c16c16c16c17ULL, }, + { 0xe38e38e48e38e38fULL, 0x38e38e39e38e38e4ULL, }, /* 48 */ + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0xffffffffe38e38e4ULL, 0x8e38e38effffffffULL, }, + { 0x8e38e38e38e38e39ULL, 0x000000008e38e38eULL, }, + { 0xffffffffc16c16c2ULL, 0x6c16c16cffffffffULL, }, + { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, }, + { 0xffffffffffffffffULL, 0x00000000ffffffffULL, }, + { 0xc71c71c71c71c71dULL, 0x71c71c71c71c71c7ULL, }, + { 0x1c71c71d71c71c72ULL, 0xc71c71c81c71c71dULL, }, /* 56 */ + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x71c71c72c71c71c7ULL, 0xffffffff71c71c72ULL, }, + { 0x000000001c71c71cULL, 0x71c71c7200000000ULL, }, + { 0x4fa4fa50a4fa4fa5ULL, 0xfa4fa4fb4fa4fa50ULL, }, + { 0x000000003e93e93eULL, 0x93e93e9400000000ULL, }, + { 0x38e38e39e38e38e3ULL, 0x8e38e38f38e38e39ULL, }, + { 0x0000000000000000ULL, 0xffffffff00000000ULL, }, + { 0xffffffff00000000ULL, 0x00000000ffffffffULL, }, /* 64 */ + { 0x8cace66900000000ULL, 0x386f5044e93c5d10ULL, }, + { 0xdc1038226e92c9c0ULL, 0x238e445fffffffffULL, }, + { 0x181bd07f00000000ULL, 0xbd758286ffffffffULL, }, + { 0xffffffff253171c8ULL, 0x0000000016c3a2f0ULL, }, + { 0xffffffff00000000ULL, 0x0000000000000000ULL, }, + { 0xffffffff93c43b88ULL, 0x000000006a142de8ULL, }, + { 0x8b6eea1600000000ULL, 0x850632426bfc705cULL, }, + { 0xffffffff916d3640ULL, 0x00000000acaf7508ULL, }, /* 72 */ + { 0xb09cae476c3bc478ULL, 0x14e10be595ebd218ULL, }, + { 0xffffffffffffffffULL, 0x00000000ffffffffULL, }, + { 0x3c0b985d5b9da932ULL, 0x99e73e27ffffffffULL, }, + { 0xe7e42f8135cf8d0eULL, 0x428a7d7aaac73294ULL, }, + { 0x749115ea109e1b46ULL, 0x7af9cdbe94038fa4ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_SUBSUS_U_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_SUBSUS_U_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsuu_s_b.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsuu_s_b.c new file mode 100644 index 0000000000..86fb4f3e26 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsuu_s_b.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction SUBSUU_S.B + * + * 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 = "SUBSUU_S.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] = { + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */ + { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, }, + { 0x1c717f1c717f1c71ULL, 0x7f1c717f1c717f1cULL, }, + { 0x7f7f387f7f387f7fULL, 0x387f7f387f7f387fULL, }, + { 0x8080808080808080ULL, 0x8080808080808080ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x8080808080808080ULL, 0x8080808080808080ULL, }, + { 0xababababababababULL, 0xababababababababULL, }, + { 0x8080808080808080ULL, 0x8080808080808080ULL, }, + { 0xcdcdcdcdcdcdcdcdULL, 0xcdcdcdcdcdcdcdcdULL, }, + { 0x8080c88080c88080ULL, 0xc88080c88080c880ULL, }, + { 0xe48f80e48f80e48fULL, 0x80e48f80e48f80e4ULL, }, + { 0xababababababababULL, 0xababababababababULL, }, /* 16 */ + { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xdedededededededeULL, 0xdedededededededeULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0xc71c72c71c72c71cULL, 0x72c71c72c71c72c7ULL, }, + { 0x7f39e37f39e37f39ULL, 0xe37f39e37f39e37fULL, }, + { 0x8080808080808080ULL, 0x8080808080808080ULL, }, /* 24 */ + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xababababababababULL, 0xababababababababULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x8989898989898989ULL, 0x8989898989898989ULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x80c71d80c71d80c7ULL, 0x1d80c71d80c71d80ULL, }, + { 0x39e48e39e48e39e4ULL, 0x8e39e48e39e48e39ULL, }, + { 0xcdcdcdcdcdcdcdcdULL, 0xcdcdcdcdcdcdcdcdULL, }, /* 32 */ + { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, }, + { 0xe93e7fe93e7fe93eULL, 0x7fe93e7fe93e7fe9ULL, }, + { 0x7f5b057f5b057f5bULL, 0x057f5b057f5b057fULL, }, + { 0x8080808080808080ULL, 0x8080808080808080ULL, }, /* 40 */ + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x8989898989898989ULL, 0x8989898989898989ULL, }, + { 0xdedededededededeULL, 0xdedededededededeULL, }, + { 0x8080808080808080ULL, 0x8080808080808080ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x80a5fb80a5fb80a5ULL, 0xfb80a5fb80a5fb80ULL, }, + { 0x17c28017c28017c2ULL, 0x8017c28017c28017ULL, }, + { 0xe48f80e48f80e48fULL, 0x80e48f80e48f80e4ULL, }, /* 48 */ + { 0x7f7f387f7f387f7fULL, 0x387f7f387f7f387fULL, }, + { 0x39e48e39e48e39e4ULL, 0x8e39e48e39e48e39ULL, }, + { 0x7f39e37f39e37f39ULL, 0xe37f39e37f39e37fULL, }, + { 0x17c28017c28017c2ULL, 0x8017c28017c28017ULL, }, + { 0x7f5b057f5b057f5bULL, 0x057f5b057f5b057fULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x7f1d807f1d807f1dULL, 0x807f1d807f1d807fULL, }, + { 0x8080c88080c88080ULL, 0xc88080c88080c880ULL, }, /* 56 */ + { 0x1c717f1c717f1c71ULL, 0x7f1c717f1c717f1cULL, }, + { 0x80c71d80c71d80c7ULL, 0x1d80c71d80c71d80ULL, }, + { 0xc71c72c71c72c71cULL, 0x72c71c72c71c72c7ULL, }, + { 0x80a5fb80a5fb80a5ULL, 0xfb80a5fb80a5fb80ULL, }, + { 0xe93e7fe93e7fe93eULL, 0x7fe93e7fe93e7fe9ULL, }, + { 0x80e37f80e37f80e3ULL, 0x7f80e37f80e37f80ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */ + { 0x8dac7f69dbcf8e38ULL, 0x398080447f3c5e80ULL, }, + { 0xdc1038228093cac0ULL, 0x248f808053507ff8ULL, }, + { 0x181b7f7fca3180f2ULL, 0xbe8083865539ce80ULL, }, + { 0x73548097253172c8ULL, 0xc77f7fbc80c4a27fULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x4f6480b994c43c88ULL, 0xeb1ff58080142d7fULL, }, + { 0x7f6fea16ef62e5baULL, 0x8506338080fd805cULL, }, + { 0x24f0c8de7f6d3640ULL, 0xdc717f7fadb08008ULL, }, /* 72 */ + { 0xb19c7f476c3cc478ULL, 0x15e10b7f7fecd380ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x3c0b7f5d5b7fa932ULL, 0x9ae73e2702e98080ULL, }, + { 0xe8e5808136cf7f0eULL, 0x427f7d7aabc7327fULL, }, + { 0x809116ea119e1b46ULL, 0x7bfacd7f7f037fa4ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_SUBSUU_S_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_SUBSUU_S_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsuu_s_d.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsuu_s_d.c new file mode 100644 index 0000000000..45a1eb3094 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsuu_s_d.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction SUBSUU_S.D + * + * 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 = "SUBSUU_S.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] = { + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */ + { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, }, + { 0x1c71c71c71c71c71ULL, 0x7fffffffffffffffULL, }, + { 0x7fffffffffffffffULL, 0x38e38e38e38e38e3ULL, }, + { 0x8000000000000000ULL, 0x8000000000000000ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x8000000000000000ULL, 0x8000000000000000ULL, }, + { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, }, + { 0x8000000000000000ULL, 0x8000000000000000ULL, }, + { 0xcccccccccccccccdULL, 0xcccccccccccccccdULL, }, + { 0x8000000000000000ULL, 0xc71c71c71c71c71dULL, }, + { 0xe38e38e38e38e38fULL, 0x8000000000000000ULL, }, + { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, }, /* 16 */ + { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xdddddddddddddddeULL, 0xdddddddddddddddeULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0xc71c71c71c71c71cULL, 0x71c71c71c71c71c7ULL, }, + { 0x7fffffffffffffffULL, 0xe38e38e38e38e38eULL, }, + { 0x8000000000000000ULL, 0x8000000000000000ULL, }, /* 24 */ + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x8888888888888889ULL, 0x8888888888888889ULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x8000000000000000ULL, 0x1c71c71c71c71c72ULL, }, + { 0x38e38e38e38e38e4ULL, 0x8e38e38e38e38e39ULL, }, + { 0xcccccccccccccccdULL, 0xcccccccccccccccdULL, }, /* 32 */ + { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, }, + { 0xe93e93e93e93e93eULL, 0x7fffffffffffffffULL, }, + { 0x7fffffffffffffffULL, 0x05b05b05b05b05b0ULL, }, + { 0x8000000000000000ULL, 0x8000000000000000ULL, }, /* 40 */ + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x8888888888888889ULL, 0x8888888888888889ULL, }, + { 0xdddddddddddddddeULL, 0xdddddddddddddddeULL, }, + { 0x8000000000000000ULL, 0x8000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x8000000000000000ULL, 0xfa4fa4fa4fa4fa50ULL, }, + { 0x16c16c16c16c16c2ULL, 0x8000000000000000ULL, }, + { 0xe38e38e38e38e38fULL, 0x8000000000000000ULL, }, /* 48 */ + { 0x7fffffffffffffffULL, 0x38e38e38e38e38e3ULL, }, + { 0x38e38e38e38e38e4ULL, 0x8e38e38e38e38e39ULL, }, + { 0x7fffffffffffffffULL, 0xe38e38e38e38e38eULL, }, + { 0x16c16c16c16c16c2ULL, 0x8000000000000000ULL, }, + { 0x7fffffffffffffffULL, 0x05b05b05b05b05b0ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x7fffffffffffffffULL, 0x8000000000000000ULL, }, + { 0x8000000000000000ULL, 0xc71c71c71c71c71dULL, }, /* 56 */ + { 0x1c71c71c71c71c71ULL, 0x7fffffffffffffffULL, }, + { 0x8000000000000000ULL, 0x1c71c71c71c71c72ULL, }, + { 0xc71c71c71c71c71cULL, 0x71c71c71c71c71c7ULL, }, + { 0x8000000000000000ULL, 0xfa4fa4fa4fa4fa50ULL, }, + { 0xe93e93e93e93e93eULL, 0x7fffffffffffffffULL, }, + { 0x8000000000000000ULL, 0x7fffffffffffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */ + { 0x8cace668dace8e38ULL, 0x386f5044e93c5d10ULL, }, + { 0xdc1038216e92c9c0ULL, 0x238e445f53508af8ULL, }, + { 0x181bd07eca3072f2ULL, 0xbd7582865538cd6cULL, }, + { 0x73531997253171c8ULL, 0xc790afbb16c3a2f0ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x4f6351b893c43b88ULL, 0xeb1ef41a6a142de8ULL, }, + { 0x7fffffffffffffffULL, 0x850632416bfc705cULL, }, + { 0x23efc7de916d3640ULL, 0xdc71bba0acaf7508ULL, }, /* 72 */ + { 0xb09cae476c3bc478ULL, 0x14e10be595ebd218ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x3c0b985d5b9da932ULL, 0x99e73e2701e84274ULL, }, + { 0xe7e42f8135cf8d0eULL, 0x428a7d79aac73294ULL, }, + { 0x8000000000000000ULL, 0x7af9cdbe94038fa4ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_SUBSUU_S_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_SUBSUU_S_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsuu_s_h.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsuu_s_h.c new file mode 100644 index 0000000000..14ac7def29 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsuu_s_h.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction SUBSUU_S.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 = "SUBSUU_S.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 */ + { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, }, + { 0x1c717fff71c71c71ULL, 0x7fff71c71c717fffULL, }, + { 0x7fff38e37fff7fffULL, 0x38e37fff7fff38e3ULL, }, + { 0x8000800080008000ULL, 0x8000800080008000ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x8000800080008000ULL, 0x8000800080008000ULL, }, + { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, }, + { 0x8000800080008000ULL, 0x8000800080008000ULL, }, + { 0xcccdcccdcccdcccdULL, 0xcccdcccdcccdcccdULL, }, + { 0x8000c71d80008000ULL, 0xc71d80008000c71dULL, }, + { 0xe38f80008e39e38fULL, 0x80008e39e38f8000ULL, }, + { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, }, /* 16 */ + { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xdddedddedddedddeULL, 0xdddedddedddedddeULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0xc71c71c71c72c71cULL, 0x71c71c72c71c71c7ULL, }, + { 0x7fffe38e38e37fffULL, 0xe38e38e37fffe38eULL, }, + { 0x8000800080008000ULL, 0x8000800080008000ULL, }, /* 24 */ + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x8889888988898889ULL, 0x8889888988898889ULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x80001c72c71d8000ULL, 0x1c72c71d80001c72ULL, }, + { 0x38e48e39e38e38e4ULL, 0x8e39e38e38e48e39ULL, }, + { 0xcccdcccdcccdcccdULL, 0xcccdcccdcccdcccdULL, }, /* 32 */ + { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, }, + { 0xe93e7fff3e94e93eULL, 0x7fff3e94e93e7fffULL, }, + { 0x7fff05b05b057fffULL, 0x05b05b057fff05b0ULL, }, + { 0x8000800080008000ULL, 0x8000800080008000ULL, }, /* 40 */ + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x8889888988898889ULL, 0x8889888988898889ULL, }, + { 0xdddedddedddedddeULL, 0xdddedddedddedddeULL, }, + { 0x8000800080008000ULL, 0x8000800080008000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x8000fa50a4fb8000ULL, 0xfa50a4fb8000fa50ULL, }, + { 0x16c28000c16c16c2ULL, 0x8000c16c16c28000ULL, }, + { 0xe38f80008e39e38fULL, 0x80008e39e38f8000ULL, }, /* 48 */ + { 0x7fff38e37fff7fffULL, 0x38e37fff7fff38e3ULL, }, + { 0x38e48e39e38e38e4ULL, 0x8e39e38e38e48e39ULL, }, + { 0x7fffe38e38e37fffULL, 0xe38e38e37fffe38eULL, }, + { 0x16c28000c16c16c2ULL, 0x8000c16c16c28000ULL, }, + { 0x7fff05b05b057fffULL, 0x05b05b057fff05b0ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x7fff80001c717fffULL, 0x80001c717fff8000ULL, }, + { 0x8000c71d80008000ULL, 0xc71d80008000c71dULL, }, /* 56 */ + { 0x1c717fff71c71c71ULL, 0x7fff71c71c717fffULL, }, + { 0x80001c72c71d8000ULL, 0x1c72c71d80001c72ULL, }, + { 0xc71c71c71c72c71cULL, 0x71c71c72c71c71c7ULL, }, + { 0x8000fa50a4fb8000ULL, 0xfa50a4fb8000fa50ULL, }, + { 0xe93e7fff3e94e93eULL, 0x7fff3e94e93e7fffULL, }, + { 0x80007fffe38f8000ULL, 0x7fffe38f80007fffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */ + { 0x8cac7fffdacf8e38ULL, 0x387080007fff5d10ULL, }, + { 0xdc1038228000c9c0ULL, 0x238f800053507fffULL, }, + { 0x181b7fffca318000ULL, 0xbd7682865539cd6cULL, }, + { 0x73548000253171c8ULL, 0xc7907fff8000a2f0ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x4f64800093c43b88ULL, 0xeb1ff41b80002de8ULL, }, + { 0x7fffea16ef62e4baULL, 0x8506324280008000ULL, }, + { 0x23f0c7de7fff3640ULL, 0xdc717fffacb08000ULL, }, /* 72 */ + { 0xb09c7fff6c3cc478ULL, 0x14e10be57fffd218ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x3c0b7fff5b9ea932ULL, 0x99e73e2701e98000ULL, }, + { 0xe7e5800035cf7fffULL, 0x428a7d7aaac73294ULL, }, + { 0x800015ea109e1b46ULL, 0x7afacdbe7fff7fffULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_SUBSUU_S_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_SUBSUU_S_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsuu_s_w.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsuu_s_w.c new file mode 100644 index 0000000000..688f469cd0 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsuu_s_w.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction SUBSUU_S.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 = "SUBSUU_S.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 */ + { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, }, + { 0x1c71c71c71c71c71ULL, 0x7fffffff1c71c71cULL, }, + { 0x7fffffff7fffffffULL, 0x38e38e387fffffffULL, }, + { 0x8000000080000000ULL, 0x8000000080000000ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x8000000080000000ULL, 0x8000000080000000ULL, }, + { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, }, + { 0x8000000080000000ULL, 0x8000000080000000ULL, }, + { 0xcccccccdcccccccdULL, 0xcccccccdcccccccdULL, }, + { 0x8000000080000000ULL, 0xc71c71c880000000ULL, }, + { 0xe38e38e48e38e38fULL, 0x80000000e38e38e4ULL, }, + { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, }, /* 16 */ + { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xdddddddedddddddeULL, 0xdddddddedddddddeULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0xc71c71c71c71c71cULL, 0x71c71c72c71c71c7ULL, }, + { 0x7fffffff38e38e39ULL, 0xe38e38e37fffffffULL, }, + { 0x8000000080000000ULL, 0x8000000080000000ULL, }, /* 24 */ + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x8888888988888889ULL, 0x8888888988888889ULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x80000000c71c71c7ULL, 0x1c71c71d80000000ULL, }, + { 0x38e38e39e38e38e4ULL, 0x8e38e38e38e38e39ULL, }, + { 0xcccccccdcccccccdULL, 0xcccccccdcccccccdULL, }, /* 32 */ + { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, }, + { 0xe93e93e93e93e93eULL, 0x7fffffffe93e93e9ULL, }, + { 0x7fffffff5b05b05bULL, 0x05b05b057fffffffULL, }, + { 0x8000000080000000ULL, 0x8000000080000000ULL, }, /* 40 */ + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x8888888988888889ULL, 0x8888888988888889ULL, }, + { 0xdddddddedddddddeULL, 0xdddddddedddddddeULL, }, + { 0x8000000080000000ULL, 0x8000000080000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x80000000a4fa4fa5ULL, 0xfa4fa4fb80000000ULL, }, + { 0x16c16c17c16c16c2ULL, 0x8000000016c16c17ULL, }, + { 0xe38e38e48e38e38fULL, 0x80000000e38e38e4ULL, }, /* 48 */ + { 0x7fffffff7fffffffULL, 0x38e38e387fffffffULL, }, + { 0x38e38e39e38e38e4ULL, 0x8e38e38e38e38e39ULL, }, + { 0x7fffffff38e38e39ULL, 0xe38e38e37fffffffULL, }, + { 0x16c16c17c16c16c2ULL, 0x8000000016c16c17ULL, }, + { 0x7fffffff5b05b05bULL, 0x05b05b057fffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x7fffffff1c71c71dULL, 0x800000007fffffffULL, }, + { 0x8000000080000000ULL, 0xc71c71c880000000ULL, }, /* 56 */ + { 0x1c71c71c71c71c71ULL, 0x7fffffff1c71c71cULL, }, + { 0x80000000c71c71c7ULL, 0x1c71c71d80000000ULL, }, + { 0xc71c71c71c71c71cULL, 0x71c71c72c71c71c7ULL, }, + { 0x80000000a4fa4fa5ULL, 0xfa4fa4fb80000000ULL, }, + { 0xe93e93e93e93e93eULL, 0x7fffffffe93e93e9ULL, }, + { 0x80000000e38e38e3ULL, 0x7fffffff80000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */ + { 0x8cace669dace8e38ULL, 0x386f50447fffffffULL, }, + { 0xdc10382280000000ULL, 0x238e445f53508af8ULL, }, + { 0x181bd07fca3072f2ULL, 0xbd7582865538cd6cULL, }, + { 0x73531997253171c8ULL, 0xc790afbc80000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x4f6351b993c43b88ULL, 0xeb1ef41b80000000ULL, }, + { 0x7fffffffef61e4baULL, 0x8506324280000000ULL, }, + { 0x23efc7de7fffffffULL, 0xdc71bba1acaf7508ULL, }, /* 72 */ + { 0xb09cae476c3bc478ULL, 0x14e10be57fffffffULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x3c0b985d5b9da932ULL, 0x99e73e2701e84274ULL, }, + { 0xe7e42f8135cf8d0eULL, 0x428a7d7aaac73294ULL, }, + { 0x80000000109e1b46ULL, 0x7af9cdbe7fffffffULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_SUBSUU_S_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_SUBSUU_S_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subv_b.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subv_b.c new file mode 100644 index 0000000000..d0964dcd59 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subv_b.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction SUBV.B + * + * 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 = "SUBV.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] = { + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x0101010101010101ULL, 0x0101010101010101ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5656565656565656ULL, 0x5656565656565656ULL, }, + { 0xababababababababULL, 0xababababababababULL, }, + { 0x3434343434343434ULL, 0x3434343434343434ULL, }, + { 0xcdcdcdcdcdcdcdcdULL, 0xcdcdcdcdcdcdcdcdULL, }, + { 0x1d72c81d72c81d72ULL, 0xc81d72c81d72c81dULL, }, + { 0xe48f39e48f39e48fULL, 0x39e48f39e48f39e4ULL, }, + { 0xababababababababULL, 0xababababababababULL, }, /* 16 */ + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xdedededededededeULL, 0xdedededededededeULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0xc71c72c71c72c71cULL, 0x72c71c72c71c72c7ULL, }, + { 0x8e39e38e39e38e39ULL, 0xe38e39e38e39e38eULL, }, + { 0x5656565656565656ULL, 0x5656565656565656ULL, }, /* 24 */ + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xababababababababULL, 0xababababababababULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x8989898989898989ULL, 0x8989898989898989ULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x72c71d72c71d72c7ULL, 0x1d72c71d72c71d72ULL, }, + { 0x39e48e39e48e39e4ULL, 0x8e39e48e39e48e39ULL, }, + { 0xcdcdcdcdcdcdcdcdULL, 0xcdcdcdcdcdcdcdcdULL, }, /* 32 */ + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, + { 0xe93e94e93e94e93eULL, 0x94e93e94e93e94e9ULL, }, + { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, }, + { 0x3434343434343434ULL, 0x3434343434343434ULL, }, /* 40 */ + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x8989898989898989ULL, 0x8989898989898989ULL, }, + { 0xdedededededededeULL, 0xdedededededededeULL, }, + { 0x6767676767676767ULL, 0x6767676767676767ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x50a5fb50a5fb50a5ULL, 0xfb50a5fb50a5fb50ULL, }, + { 0x17c26c17c26c17c2ULL, 0x6c17c26c17c26c17ULL, }, + { 0xe48f39e48f39e48fULL, 0x39e48f39e48f39e4ULL, }, /* 48 */ + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x39e48e39e48e39e4ULL, 0x8e39e48e39e48e39ULL, }, + { 0x8e39e38e39e38e39ULL, 0xe38e39e38e39e38eULL, }, + { 0x17c26c17c26c17c2ULL, 0x6c17c26c17c26c17ULL, }, + { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xc71d71c71d71c71dULL, 0x71c71d71c71d71c7ULL, }, + { 0x1d72c81d72c81d72ULL, 0xc81d72c81d72c81dULL, }, /* 56 */ + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x72c71d72c71d72c7ULL, 0x1d72c71d72c71d72ULL, }, + { 0xc71c72c71c72c71cULL, 0x72c71c72c71c72c7ULL, }, + { 0x50a5fb50a5fb50a5ULL, 0xfb50a5fb50a5fb50ULL, }, + { 0xe93e94e93e94e93eULL, 0x94e93e94e93e94e9ULL, }, + { 0x39e38f39e38f39e3ULL, 0x8f39e38f39e38f39ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */ + { 0x8dace669dbcf8e38ULL, 0x39705044e93c5e10ULL, }, + { 0xdc1038226f93cac0ULL, 0x248f455f53508bf8ULL, }, + { 0x181bd07fca3173f2ULL, 0xbe7683865539ce6cULL, }, + { 0x73541a97253172c8ULL, 0xc790b0bc17c4a2f0ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x4f6452b994c43c88ULL, 0xeb1ff51b6a142de8ULL, }, + { 0x8b6fea16ef62e5baULL, 0x850633426cfd705cULL, }, + { 0x24f0c8de916d3640ULL, 0xdc71bba1adb07508ULL, }, /* 72 */ + { 0xb19cae476c3cc478ULL, 0x15e10be596ecd318ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x3c0b985d5b9ea932ULL, 0x9ae73e2702e94374ULL, }, + { 0xe8e5308136cf8d0eULL, 0x428a7d7aabc73294ULL, }, + { 0x759116ea119e1b46ULL, 0x7bfacdbe940390a4ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_SUBV_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_SUBV_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subv_d.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subv_d.c new file mode 100644 index 0000000000..ec26a8e0c6 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subv_d.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction SUBV.D + * + * 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 = "SUBV.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] = { + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x0000000000000001ULL, 0x0000000000000001ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555555555556ULL, 0x5555555555555556ULL, }, + { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, }, + { 0x3333333333333334ULL, 0x3333333333333334ULL, }, + { 0xcccccccccccccccdULL, 0xcccccccccccccccdULL, }, + { 0x1c71c71c71c71c72ULL, 0xc71c71c71c71c71dULL, }, + { 0xe38e38e38e38e38fULL, 0x38e38e38e38e38e4ULL, }, + { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, }, /* 16 */ + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xdddddddddddddddeULL, 0xdddddddddddddddeULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0xc71c71c71c71c71cULL, 0x71c71c71c71c71c7ULL, }, + { 0x8e38e38e38e38e39ULL, 0xe38e38e38e38e38eULL, }, + { 0x5555555555555556ULL, 0x5555555555555556ULL, }, /* 24 */ + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x8888888888888889ULL, 0x8888888888888889ULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x71c71c71c71c71c7ULL, 0x1c71c71c71c71c72ULL, }, + { 0x38e38e38e38e38e4ULL, 0x8e38e38e38e38e39ULL, }, + { 0xcccccccccccccccdULL, 0xcccccccccccccccdULL, }, /* 32 */ + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, + { 0xe93e93e93e93e93eULL, 0x93e93e93e93e93e9ULL, }, + { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, }, + { 0x3333333333333334ULL, 0x3333333333333334ULL, }, /* 40 */ + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x8888888888888889ULL, 0x8888888888888889ULL, }, + { 0xdddddddddddddddeULL, 0xdddddddddddddddeULL, }, + { 0x6666666666666667ULL, 0x6666666666666667ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x4fa4fa4fa4fa4fa5ULL, 0xfa4fa4fa4fa4fa50ULL, }, + { 0x16c16c16c16c16c2ULL, 0x6c16c16c16c16c17ULL, }, + { 0xe38e38e38e38e38fULL, 0x38e38e38e38e38e4ULL, }, /* 48 */ + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x38e38e38e38e38e4ULL, 0x8e38e38e38e38e39ULL, }, + { 0x8e38e38e38e38e39ULL, 0xe38e38e38e38e38eULL, }, + { 0x16c16c16c16c16c2ULL, 0x6c16c16c16c16c17ULL, }, + { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xc71c71c71c71c71dULL, 0x71c71c71c71c71c7ULL, }, + { 0x1c71c71c71c71c72ULL, 0xc71c71c71c71c71dULL, }, /* 56 */ + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x71c71c71c71c71c7ULL, 0x1c71c71c71c71c72ULL, }, + { 0xc71c71c71c71c71cULL, 0x71c71c71c71c71c7ULL, }, + { 0x4fa4fa4fa4fa4fa5ULL, 0xfa4fa4fa4fa4fa50ULL, }, + { 0xe93e93e93e93e93eULL, 0x93e93e93e93e93e9ULL, }, + { 0x38e38e38e38e38e3ULL, 0x8e38e38e38e38e39ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */ + { 0x8cace668dace8e38ULL, 0x386f5044e93c5d10ULL, }, + { 0xdc1038216e92c9c0ULL, 0x238e445f53508af8ULL, }, + { 0x181bd07eca3072f2ULL, 0xbd7582865538cd6cULL, }, + { 0x73531997253171c8ULL, 0xc790afbb16c3a2f0ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x4f6351b893c43b88ULL, 0xeb1ef41a6a142de8ULL, }, + { 0x8b6eea15ef61e4baULL, 0x850632416bfc705cULL, }, + { 0x23efc7de916d3640ULL, 0xdc71bba0acaf7508ULL, }, /* 72 */ + { 0xb09cae476c3bc478ULL, 0x14e10be595ebd218ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x3c0b985d5b9da932ULL, 0x99e73e2701e84274ULL, }, + { 0xe7e42f8135cf8d0eULL, 0x428a7d79aac73294ULL, }, + { 0x749115ea109e1b46ULL, 0x7af9cdbe94038fa4ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_SUBV_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_SUBV_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subv_h.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subv_h.c new file mode 100644 index 0000000000..420422ecf1 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subv_h.c @@ -0,0 +1,151 @@ +/* + * Test program for MSA instruction SUBV.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 = "SUBV.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 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x0001000100010001ULL, 0x0001000100010001ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5556555655565556ULL, 0x5556555655565556ULL, }, + { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, }, + { 0x3334333433343334ULL, 0x3334333433343334ULL, }, + { 0xcccdcccdcccdcccdULL, 0xcccdcccdcccdcccdULL, }, + { 0x1c72c71d71c81c72ULL, 0xc71d71c81c72c71dULL, }, + { 0xe38f38e48e39e38fULL, 0x38e48e39e38f38e4ULL, }, + { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, }, /* 16 */ + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xdddedddedddedddeULL, 0xdddedddedddedddeULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0xc71c71c71c72c71cULL, 0x71c71c72c71c71c7ULL, }, + { 0x8e39e38e38e38e39ULL, 0xe38e38e38e39e38eULL, }, + { 0x5556555655565556ULL, 0x5556555655565556ULL, }, /* 24 */ + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x8889888988898889ULL, 0x8889888988898889ULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x71c71c72c71d71c7ULL, 0x1c72c71d71c71c72ULL, }, + { 0x38e48e39e38e38e4ULL, 0x8e39e38e38e48e39ULL, }, + { 0xcccdcccdcccdcccdULL, 0xcccdcccdcccdcccdULL, }, /* 32 */ + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, + { 0xe93e93e93e94e93eULL, 0x93e93e94e93e93e9ULL, }, + { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, }, + { 0x3334333433343334ULL, 0x3334333433343334ULL, }, /* 40 */ + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x8889888988898889ULL, 0x8889888988898889ULL, }, + { 0xdddedddedddedddeULL, 0xdddedddedddedddeULL, }, + { 0x6667666766676667ULL, 0x6667666766676667ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x4fa5fa50a4fb4fa5ULL, 0xfa50a4fb4fa5fa50ULL, }, + { 0x16c26c17c16c16c2ULL, 0x6c17c16c16c26c17ULL, }, + { 0xe38f38e48e39e38fULL, 0x38e48e39e38f38e4ULL, }, /* 48 */ + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x38e48e39e38e38e4ULL, 0x8e39e38e38e48e39ULL, }, + { 0x8e39e38e38e38e39ULL, 0xe38e38e38e39e38eULL, }, + { 0x16c26c17c16c16c2ULL, 0x6c17c16c16c26c17ULL, }, + { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xc71d71c71c71c71dULL, 0x71c71c71c71d71c7ULL, }, + { 0x1c72c71d71c81c72ULL, 0xc71d71c81c72c71dULL, }, /* 56 */ + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x71c71c72c71d71c7ULL, 0x1c72c71d71c71c72ULL, }, + { 0xc71c71c71c72c71cULL, 0x71c71c72c71c71c7ULL, }, + { 0x4fa5fa50a4fb4fa5ULL, 0xfa50a4fb4fa5fa50ULL, }, + { 0xe93e93e93e94e93eULL, 0x93e93e94e93e93e9ULL, }, + { 0x38e38e39e38f38e3ULL, 0x8e39e38f38e38e39ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */ + { 0x8cace669dacf8e38ULL, 0x38705044e93c5d10ULL, }, + { 0xdc1038226e93c9c0ULL, 0x238f445f53508af8ULL, }, + { 0x181bd07fca3172f2ULL, 0xbd7682865539cd6cULL, }, + { 0x73541997253171c8ULL, 0xc790afbc16c4a2f0ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x4f6451b993c43b88ULL, 0xeb1ff41b6a142de8ULL, }, + { 0x8b6fea16ef62e4baULL, 0x850632426bfd705cULL, }, + { 0x23f0c7de916d3640ULL, 0xdc71bba1acb07508ULL, }, /* 72 */ + { 0xb09cae476c3cc478ULL, 0x14e10be595ecd218ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x3c0b985d5b9ea932ULL, 0x99e73e2701e94274ULL, }, + { 0xe7e52f8135cf8d0eULL, 0x428a7d7aaac73294ULL, }, + { 0x749115ea109e1b46ULL, 0x7afacdbe94038fa4ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_SUBV_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_SUBV_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; +} diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subv_w.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subv_w.c new file mode 100644 index 0000000000..3e97005815 --- /dev/null +++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subv_w.c @@ -0,0 +1,153 @@ +/* + * Test program for MSA instruction SUBV.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 = "SUBV.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 */ + { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x0000000100000001ULL, 0x0000000100000001ULL, }, /* 8 */ + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555655555556ULL, 0x5555555655555556ULL, }, + { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, }, + { 0x3333333433333334ULL, 0x3333333433333334ULL, }, + { 0xcccccccdcccccccdULL, 0xcccccccdcccccccdULL, }, + { 0x1c71c71d71c71c72ULL, 0xc71c71c81c71c71dULL, }, + { 0xe38e38e48e38e38fULL, 0x38e38e39e38e38e4ULL, }, + { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, }, /* 16 */ + { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xdddddddedddddddeULL, 0xdddddddedddddddeULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0xc71c71c71c71c71cULL, 0x71c71c72c71c71c7ULL, }, + { 0x8e38e38e38e38e39ULL, 0xe38e38e38e38e38eULL, }, + { 0x5555555655555556ULL, 0x5555555655555556ULL, }, /* 24 */ + { 0x5555555555555555ULL, 0x5555555555555555ULL, }, + { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x8888888988888889ULL, 0x8888888988888889ULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x71c71c72c71c71c7ULL, 0x1c71c71d71c71c72ULL, }, + { 0x38e38e39e38e38e4ULL, 0x8e38e38e38e38e39ULL, }, + { 0xcccccccdcccccccdULL, 0xcccccccdcccccccdULL, }, /* 32 */ + { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, + { 0x2222222222222222ULL, 0x2222222222222222ULL, }, + { 0x7777777777777777ULL, 0x7777777777777777ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x9999999999999999ULL, 0x9999999999999999ULL, }, + { 0xe93e93e93e93e93eULL, 0x93e93e94e93e93e9ULL, }, + { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, }, + { 0x3333333433333334ULL, 0x3333333433333334ULL, }, /* 40 */ + { 0x3333333333333333ULL, 0x3333333333333333ULL, }, + { 0x8888888988888889ULL, 0x8888888988888889ULL, }, + { 0xdddddddedddddddeULL, 0xdddddddedddddddeULL, }, + { 0x6666666766666667ULL, 0x6666666766666667ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x4fa4fa50a4fa4fa5ULL, 0xfa4fa4fb4fa4fa50ULL, }, + { 0x16c16c17c16c16c2ULL, 0x6c16c16c16c16c17ULL, }, + { 0xe38e38e48e38e38fULL, 0x38e38e39e38e38e4ULL, }, /* 48 */ + { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, + { 0x38e38e39e38e38e4ULL, 0x8e38e38e38e38e39ULL, }, + { 0x8e38e38e38e38e39ULL, 0xe38e38e38e38e38eULL, }, + { 0x16c16c17c16c16c2ULL, 0x6c16c16c16c16c17ULL, }, + { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0xc71c71c71c71c71dULL, 0x71c71c71c71c71c7ULL, }, + { 0x1c71c71d71c71c72ULL, 0xc71c71c81c71c71dULL, }, /* 56 */ + { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, + { 0x71c71c72c71c71c7ULL, 0x1c71c71d71c71c72ULL, }, + { 0xc71c71c71c71c71cULL, 0x71c71c72c71c71c7ULL, }, + { 0x4fa4fa50a4fa4fa5ULL, 0xfa4fa4fb4fa4fa50ULL, }, + { 0xe93e93e93e93e93eULL, 0x93e93e94e93e93e9ULL, }, + { 0x38e38e39e38e38e3ULL, 0x8e38e38f38e38e39ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */ + { 0x8cace669dace8e38ULL, 0x386f5044e93c5d10ULL, }, + { 0xdc1038226e92c9c0ULL, 0x238e445f53508af8ULL, }, + { 0x181bd07fca3072f2ULL, 0xbd7582865538cd6cULL, }, + { 0x73531997253171c8ULL, 0xc790afbc16c3a2f0ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x4f6351b993c43b88ULL, 0xeb1ef41b6a142de8ULL, }, + { 0x8b6eea16ef61e4baULL, 0x850632426bfc705cULL, }, + { 0x23efc7de916d3640ULL, 0xdc71bba1acaf7508ULL, }, /* 72 */ + { 0xb09cae476c3bc478ULL, 0x14e10be595ebd218ULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, + { 0x3c0b985d5b9da932ULL, 0x99e73e2701e84274ULL, }, + { 0xe7e42f8135cf8d0eULL, 0x428a7d7aaac73294ULL, }, + { 0x749115ea109e1b46ULL, 0x7af9cdbe94038fa4ULL, }, + { 0xc3f467a3a46256ceULL, 0x6618c1d9fe17bd8cULL, }, + { 0x0000000000000000ULL, 0x0000000000000000ULL, }, +}; + + gettimeofday(&start, NULL); + + for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) { + for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) { + do_msa_SUBV_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_SUBV_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; +} diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_b.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_b.c index 5cf862756a..d720dc30a5 100644 --- a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_b.c +++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_b.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction ILVEV.B * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_d.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_d.c index d3600e96b4..83239949af 100644 --- a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_d.c +++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_d.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction ILVEV.D * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_h.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_h.c index 9a80fac8eb..3f6fc265d2 100644 --- a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_h.c +++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_h.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction ILVEV.H * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_w.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_w.c index 8f62d4700a..30d2e3802d 100644 --- a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_w.c +++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_w.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction ILVEV.W * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_b.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_b.c index f7e6dc0503..c771287a71 100644 --- a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_b.c +++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_b.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction ILVL.B * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_d.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_d.c index 0f4c048ff6..b7d5fcdc18 100644 --- a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_d.c +++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_d.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction ILVL.D * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_h.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_h.c index 6c1c6d9f36..af72876236 100644 --- a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_h.c +++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_h.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction ILVL.H * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_w.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_w.c index d22d96558d..e06c9d94ca 100644 --- a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_w.c +++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_w.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction ILVL.W * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_b.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_b.c index c55f3a4d7d..8e7f1c4706 100644 --- a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_b.c +++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_b.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction ILVOD.B * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_d.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_d.c index d03e7b4eca..acbd94a68d 100644 --- a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_d.c +++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_d.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction ILVOD.D * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_h.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_h.c index f64d8b5fc9..8a82def407 100644 --- a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_h.c +++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_h.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction ILVOD.H * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_w.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_w.c index 4ae75f85f8..e19170c364 100644 --- a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_w.c +++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_w.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction ILVOD.W * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_b.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_b.c index f2cc7bf414..1e519e6e9e 100644 --- a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_b.c +++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_b.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction ILVR.B * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_d.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_d.c index f5ff947c0b..be760430c7 100644 --- a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_d.c +++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_d.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction ILVR.D * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_h.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_h.c index 5a2986dca6..cbd4685eca 100644 --- a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_h.c +++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_h.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction ILVR.H * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_w.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_w.c index fa0d6ea900..5f4cfd0377 100644 --- a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_w.c +++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_w.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction ILVR.W * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/logic/test_msa_and_v.c b/tests/tcg/mips/user/ase/msa/logic/test_msa_and_v.c index 51b256fa50..534c4201a8 100644 --- a/tests/tcg/mips/user/ase/msa/logic/test_msa_and_v.c +++ b/tests/tcg/mips/user/ase/msa/logic/test_msa_and_v.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction AND.V * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/logic/test_msa_nor_v.c b/tests/tcg/mips/user/ase/msa/logic/test_msa_nor_v.c index 90ca19843c..f781a8bb9d 100644 --- a/tests/tcg/mips/user/ase/msa/logic/test_msa_nor_v.c +++ b/tests/tcg/mips/user/ase/msa/logic/test_msa_nor_v.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction NOR.V * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/logic/test_msa_or_v.c b/tests/tcg/mips/user/ase/msa/logic/test_msa_or_v.c index 4ad5366dfb..924f216e41 100644 --- a/tests/tcg/mips/user/ase/msa/logic/test_msa_or_v.c +++ b/tests/tcg/mips/user/ase/msa/logic/test_msa_or_v.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction OR.V * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/logic/test_msa_xor_v.c b/tests/tcg/mips/user/ase/msa/logic/test_msa_xor_v.c index 54effeda63..f0442e6577 100644 --- a/tests/tcg/mips/user/ase/msa/logic/test_msa_xor_v.c +++ b/tests/tcg/mips/user/ase/msa/logic/test_msa_xor_v.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction XOR.V * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_b.c b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_b.c index d98dd224d7..409773d7f2 100644 --- a/tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_b.c +++ b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_b.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction PCKEV.B * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_d.c b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_d.c index 543fb6ae5e..8e89716416 100644 --- a/tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_d.c +++ b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_d.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction PCKEV.D * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_h.c b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_h.c index 64a18c02f0..b389587dfe 100644 --- a/tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_h.c +++ b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_h.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction PCKEV.H * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_w.c b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_w.c index a0acacdf26..d393ad5066 100644 --- a/tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_w.c +++ b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_w.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction PCKEV.W * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_b.c b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_b.c index 7bf86fccbd..ab363a0cdc 100644 --- a/tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_b.c +++ b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_b.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction PCKOD.B * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_d.c b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_d.c index 3c4d55b694..09a61408bc 100644 --- a/tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_d.c +++ b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_d.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction PCKOD.D * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_h.c b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_h.c index 5c3c529f22..d7a8c5b5af 100644 --- a/tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_h.c +++ b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_h.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction PCKOD.H * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_w.c b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_w.c index 9275890214..4b732d0359 100644 --- a/tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_w.c +++ b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_w.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction PCKOD.W * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_b.c b/tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_b.c index fcf857a6c0..d9ccf575fa 100644 --- a/tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_b.c +++ b/tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_b.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction VSHF.B * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_d.c b/tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_d.c index 700c1596a2..6c555fbb23 100644 --- a/tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_d.c +++ b/tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_d.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction VSHF.D * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_h.c b/tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_h.c index 3d6c1dc5be..9dfcb51fe5 100644 --- a/tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_h.c +++ b/tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_h.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction VSHF.H * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ diff --git a/tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_w.c b/tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_w.c index 6030762855..97074c0924 100644 --- a/tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_w.c +++ b/tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_w.c @@ -1,8 +1,8 @@ /* * Test program for MSA instruction VSHF.W * - * Copyright (C) 2018 Wave Computing, Inc. - * Copyright (C) 2018 Aleksandar Markovic <amarkovic@wavecomp.com> + * 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 @@ -23,8 +23,8 @@ #include <stdint.h> #include "../../../../include/wrappers_msa.h" -#include "../../../../include/test_inputs.h" -#include "../../../../include/test_utils.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) + \ |