MIPS queue for March 11th, 2019
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABAgAGBQJchm2pAAoJENSXKoln91plG4AIAIwWX2wBk0LHxYEZjH8MRn7Y 2bJbuVO0A6n3Sck6ngiFYZkjAVBVURe97tryHsC/SBAcyomDbhJVyFzY5sGMhBdn j5i1oBRLHaLC3RDnWUT/io3JTPWh3kGK6j2KtPeRxGFCP8A/DOQ12Q7jl2mUsGJT PlwE+hvfQWtM+/YhgnkykDBCVbTrDAYuq4dWS+OIorTe0NFVh8ovbrQ49Cf/KfxD Yn8yPSR9oXSoyHtHZApm6DKDW/c5fEoWjHtoa7GGRiybelDvyEP6NDAsVFzTjxjW AR/JlY6ZiSPjGyMtokZpGXVQ4AuKkNs0BPTN7DKO6aqGVau+49pGprjj1EbvuLM= =9tVm -----END PGP SIGNATURE----- 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>
This commit is contained in:
commit
c876180938
@ -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>
|
||||
|
@ -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>
|
@ -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
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_b.c
Normal file
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_b.c
Normal file
@ -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;
|
||||
}
|
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_d.c
Normal file
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_d.c
Normal file
@ -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;
|
||||
}
|
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_h.c
Normal file
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_h.c
Normal file
@ -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;
|
||||
}
|
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_w.c
Normal file
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_w.c
Normal file
@ -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;
|
||||
}
|
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_b.c
Normal file
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_b.c
Normal file
@ -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;
|
||||
}
|
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_d.c
Normal file
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_d.c
Normal file
@ -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;
|
||||
}
|
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_h.c
Normal file
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_h.c
Normal file
@ -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;
|
||||
}
|
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_w.c
Normal file
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_w.c
Normal file
@ -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;
|
||||
}
|
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_b.c
Normal file
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_b.c
Normal file
@ -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;
|
||||
}
|
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_d.c
Normal file
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_d.c
Normal file
@ -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;
|
||||
}
|
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_h.c
Normal file
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_h.c
Normal file
@ -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;
|
||||
}
|
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_w.c
Normal file
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_w.c
Normal file
@ -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;
|
||||
}
|
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_b.c
Normal file
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_b.c
Normal file
@ -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;
|
||||
}
|
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_d.c
Normal file
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_d.c
Normal file
@ -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;
|
||||
}
|
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_h.c
Normal file
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_h.c
Normal file
@ -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;
|
||||
}
|
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_w.c
Normal file
151
tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_w.c
Normal file
@ -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;
|
||||
}
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
151
tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_b.c
Normal file
151
tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_b.c
Normal file
@ -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;
|
||||
}
|
151
tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_d.c
Normal file
151
tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_d.c
Normal file
@ -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;
|
||||
}
|
151
tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_h.c
Normal file
151
tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_h.c
Normal file
@ -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;
|
||||
}
|
151
tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_w.c
Normal file
151
tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_w.c
Normal file
@ -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;
|
||||
}
|
151
tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_b.c
Normal file
151
tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_b.c
Normal file
@ -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;
|
||||
}
|
151
tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_d.c
Normal file
151
tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_d.c
Normal file
@ -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;
|
||||
}
|
151
tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_h.c
Normal file
151
tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_h.c
Normal file
@ -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;
|
||||
}
|
151
tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_w.c
Normal file
151
tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_w.c
Normal file
@ -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;
|
||||
}
|
151
tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_d.c
Normal file
151
tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_d.c
Normal file
@ -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;
|
||||
}
|
151
tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_h.c
Normal file
151
tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_h.c
Normal file
@ -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;
|
||||
}
|
151
tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_w.c
Normal file
151
tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_w.c
Normal file
@ -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;
|
||||
}
|
151
tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_u_d.c
Normal file
151
tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_u_d.c
Normal file
@ -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;
|
||||
}
|
151
tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_u_h.c
Normal file
151
tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_u_h.c
Normal file
@ -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;
|
||||
}
|
151
tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_u_w.c
Normal file
151
tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_u_w.c
Normal file
@ -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;
|
||||
}
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
@ -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) + \
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user