Misc target/mips fixes and improvements
v4 cover Misc target/mips fixes and improvements
From: Aleksandar Markovic <[email protected]>
A collection of misc target/mips fixes and improvements for February 2019.
v3->v4:
- added a patch on DSPRAM support
- order of patches slightly changed
- minor changes in commit messages
- rebased to the latest code
v2->v3:
- added a patches on documenting Boston board
- added two patches on testing integer max/min MSA instructions
- removed four patches that had been accepted
- amended patch on DSP-related comments
v1->v2:
- added two patches on updating end user documentation
- minor updates to commit messages
Aleksandar Markovic (8):
tests/tcg: target/mips: Add tests for MSA integer compare instructions
disas: nanoMIPS: Fix a function misnomer
qemu-doc: Move section on MIPS' mipssim pseudo board
qemu-doc: Add section on MIPS' Fulong 2E board
qemu-doc: Add section on MIPS' Boston board
tests/tcg: target/mips: Add wrappers for MSA integer max/min
instructions
tests/tcg: target/mips: Add tests for MSA integer max/min instructions
disas: nanoMIPS: Correct comments to handlers of some DSP instructions
Yongbok Kim (1):
target/mips: Add support for DSPRAM
default-configs/mips-softmmu-common.mak | 1 + disas/nanomips.cpp | 381 +++++++++++---------- disas/nanomips.h | 2 +- hw/mips/cps.c | 3 +- hw/mips/mips_malta.c | 31 ++ hw/misc/Makefile.objs | 1 + include/hw/mips/cps.h | 2 + qemu-doc.texi | 46 ++- target/mips/cpu.h | 5 + target/mips/internal.h | 1 + target/mips/op_helper.c | 10 + target/mips/translate.c | 8 + target/mips/translate_init.inc.c | 2 + tests/tcg/mips/include/wrappers_msa.h | 30 ++ .../mips/user/ase/msa/int-compare/test_msa_ceq_b.c | 153 +++++++++ .../mips/user/ase/msa/int-compare/test_msa_ceq_d.c | 153 +++++++++ .../mips/user/ase/msa/int-compare/test_msa_ceq_h.c | 153 +++++++++ .../mips/user/ase/msa/int-compare/test_msa_ceq_w.c | 153 +++++++++ .../user/ase/msa/int-compare/test_msa_cle_s_b.c | 153 +++++++++ .../user/ase/msa/int-compare/test_msa_cle_s_d.c | 153 +++++++++ .../user/ase/msa/int-compare/test_msa_cle_s_h.c | 153 +++++++++ .../user/ase/msa/int-compare/test_msa_cle_s_w.c | 153 +++++++++ .../user/ase/msa/int-compare/test_msa_cle_u_b.c | 153 +++++++++ .../user/ase/msa/int-compare/test_msa_cle_u_d.c | 153 +++++++++ .../user/ase/msa/int-compare/test_msa_cle_u_h.c | 153 +++++++++ .../user/ase/msa/int-compare/test_msa_cle_u_w.c | 153 +++++++++ .../user/ase/msa/int-compare/test_msa_clt_s_b.c | 153 +++++++++ .../user/ase/msa/int-compare/test_msa_clt_s_d.c | 153 +++++++++ .../user/ase/msa/int-compare/test_msa_clt_s_h.c | 153 +++++++++ .../user/ase/msa/int-compare/test_msa_clt_s_w.c | 153 +++++++++ .../user/ase/msa/int-compare/test_msa_clt_u_b.c | 153 +++++++++ .../user/ase/msa/int-compare/test_msa_clt_u_d.c | 153 +++++++++ .../user/ase/msa/int-compare/test_msa_clt_u_h.c | 153 +++++++++ .../user/ase/msa/int-compare/test_msa_clt_u_w.c | 153 +++++++++ .../user/ase/msa/int-max-min/test_msa_max_a_b.c | 153 +++++++++ .../user/ase/msa/int-max-min/test_msa_max_a_d.c | 153 +++++++++ .../user/ase/msa/int-max-min/test_msa_max_a_h.c | 153 +++++++++ .../user/ase/msa/int-max-min/test_msa_max_a_w.c | 153 +++++++++ .../user/ase/msa/int-max-min/test_msa_max_s_b.c | 153 +++++++++ .../user/ase/msa/int-max-min/test_msa_max_s_d.c | 153 +++++++++ .../user/ase/msa/int-max-min/test_msa_max_s_h.c | 153 +++++++++ .../user/ase/msa/int-max-min/test_msa_max_s_w.c | 153 +++++++++ .../user/ase/msa/int-max-min/test_msa_max_u_b.c | 153 +++++++++ .../user/ase/msa/int-max-min/test_msa_max_u_d.c | 153 +++++++++ .../user/ase/msa/int-max-min/test_msa_max_u_h.c | 153 +++++++++ .../user/ase/msa/int-max-min/test_msa_max_u_w.c | 153 +++++++++ .../user/ase/msa/int-max-min/test_msa_min_a_b.c | 153 +++++++++ .../user/ase/msa/int-max-min/test_msa_min_a_d.c | 153 +++++++++ .../user/ase/msa/int-max-min/test_msa_min_a_h.c | 153 +++++++++ .../user/ase/msa/int-max-min/test_msa_min_a_w.c | 153 +++++++++ .../user/ase/msa/int-max-min/test_msa_min_s_b.c | 153 +++++++++ .../user/ase/msa/int-max-min/test_msa_min_s_d.c | 153 +++++++++ .../user/ase/msa/int-max-min/test_msa_min_s_h.c | 153 +++++++++ .../user/ase/msa/int-max-min/test_msa_min_s_w.c | 153 +++++++++ .../user/ase/msa/int-max-min/test_msa_min_u_b.c | 153 +++++++++ .../user/ase/msa/int-max-min/test_msa_min_u_d.c | 153 +++++++++ .../user/ase/msa/int-max-min/test_msa_min_u_h.c | 153 +++++++++ .../user/ase/msa/int-max-min/test_msa_min_u_w.c | 153 +++++++++ 58 files changed, 7058 insertions(+), 197 deletions(-) create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_b.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_d.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_h.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_w.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_b.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_d.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_h.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_w.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_b.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_d.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_h.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_w.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_b.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_d.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_h.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_w.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_b.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_d.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_h.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_w.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_b.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_d.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_h.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_w.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_b.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_d.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_h.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_w.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_b.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_d.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_h.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_w.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_b.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_d.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_h.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_w.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_b.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_d.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_h.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_w.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_b.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_d.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_h.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_w.c
Signature · 1 line
2.7.4
PATCH v4 1/9 tests/tcg: target/mips: Add tests for MSA integer compare instructions
From: Aleksandar Markovic <[email protected]>
Add tests for MSA integer compare instructions. This includes following instructions:
* CEQ.B - integer compare equal (bytes)
* CEQ.H - integer compare equal (halfwords)
* CEQ.W - integer compare equal (words)
* CEQ.D - integer compare equal (doublewords)
* CLE_S.B - signed integer compare less or equal (bytes)
* CLE_S.H - signed integer compare less or equal (halfwords)
* CLE_S.W - signed integer compare less or equal (words)
* CLE_S.D - signed integer compare less or equal (doublewords)
* CLE_U.B - unsigned integer compare less or equal (bytes)
* CLE_U.H - unsigned integer compare less or equal (halfwords)
* CLE_U.W - unsigned integer compare less or equal (words)
* CLE_U.D - unsigned integer compare less or equal (doublewords)
* CLT_S.B - signed integer compare less or equal (bytes)
* CLT_S.H - signed integer compare less or equal (halfwords)
* CLT_S.W - signed integer compare less or equal (words)
* CLT_S.D - signed integer compare less or equal (doublewords)
* CLT_U.B - unsigned integer compare less or equal (bytes)
* CLT_U.H - unsigned integer compare less or equal (halfwords)
* CLT_U.W - unsigned integer compare less or equal (words)
* CLT_U.D - unsigned integer compare less or equal (doublewords)
Each test consists of 80 test cases, so altogether there are 1600 test cases.
--- .../mips/user/ase/msa/int-compare/test_msa_ceq_b.c | 153 +++++++++++++++++++++ .../mips/user/ase/msa/int-compare/test_msa_ceq_d.c | 153 +++++++++++++++++++++ .../mips/user/ase/msa/int-compare/test_msa_ceq_h.c | 153 +++++++++++++++++++++ .../mips/user/ase/msa/int-compare/test_msa_ceq_w.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-compare/test_msa_cle_s_b.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-compare/test_msa_cle_s_d.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-compare/test_msa_cle_s_h.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-compare/test_msa_cle_s_w.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-compare/test_msa_cle_u_b.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-compare/test_msa_cle_u_d.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-compare/test_msa_cle_u_h.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-compare/test_msa_cle_u_w.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-compare/test_msa_clt_s_b.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-compare/test_msa_clt_s_d.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-compare/test_msa_clt_s_h.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-compare/test_msa_clt_s_w.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-compare/test_msa_clt_u_b.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-compare/test_msa_clt_u_d.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-compare/test_msa_clt_u_h.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-compare/test_msa_clt_u_w.c | 153 +++++++++++++++++++++ 20 files changed, 3060 insertions(+) create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_b.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_d.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_h.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_w.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_b.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_d.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_h.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_w.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_b.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_d.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_h.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_w.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_b.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_d.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_h.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_w.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_b.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_d.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_h.c create mode 100644 tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_w.c
tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_b.c new file +153 -0
@@ -0,0 +1,153 @@ +/* +* Test program for MSA instruction CEQ.B +* +* Copyright (C) 2018 Wave Computing, Inc. +* Copyright (C) 2018 Aleksandar Markovic <[email protected]> +* +* 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 ="CEQ.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 , }, + {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 , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , },/* 16 */ + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0xffffffffffffffffULL ,0xffffffffffffffffULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , },/* 24 */ + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0xffffffffffffffffULL ,0xffffffffffffffffULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , },/* 32 */ + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0xffffffffffffffffULL ,0xffffffffffffffffULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , },/* 40 */ + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0xffffffffffffffffULL ,0xffffffffffffffffULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , },/* 48 */ + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0xffffffffffffffffULL ,0xffffffffffffffffULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , },/* 56 */ + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0xffffffffffffffffULL ,0xffffffffffffffffULL , }, + {0xffffffffffffffffULL ,0xffffffffffffffffULL , },/* 64 */ + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0xffffffffffffffffULL ,0xffffffffffffffffULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , },/* 72 */ + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0xffffffffffffffffULL ,0xffffffffffffffffULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0xffffffffffffffffULL ,0xffffffffffffffffULL , }, + }; + +gettimeofday (&start,NULL ); + +for (i =0 ; i <PATTERN_INPUTS_SHORT_COUNT ; i++) { +for (j =0 ; j <PATTERN_INPUTS_SHORT_COUNT ; j++) { +do_msa_CEQ_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_CEQ_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; +}
tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_d.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_h.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_w.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_b.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_d.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_h.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_w.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_b.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_d.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_h.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_w.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_b.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_d.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_h.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_w.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_b.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_d.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_h.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_w.c new file +153 -0
93 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.7.4
Part of the diff is not shown here. View the raw message.
PATCH v4 2/9 disas: nanoMIPS: Fix a function misnomer
In reply to Aleksandar MarkovicFrom: Aleksandar Markovic <[email protected]>
Rename function extract_ac_13_12() to extract_ac_15_14().
--- disas/nanomips.cpp | 96 +++++++++++++++++++++++++++--------------------------- disas/nanomips.h | 2 +- 2 files changed, 49 insertions(+), 49 deletions(-)
disas/nanomips.cpp +48 -48
@@ -1058,7 +1058,7 @@ uint64 NMD::extract_stripe_6(uint64 instruction) } -uint64 NMD::extract_ac_13_12(uint64 instruction) +uint64 NMD::extract_ac_15_14(uint64 instruction) { uint64 value = 0; value |= extract_bits(instruction, 14, 2);
@@ -6375,7 +6375,7 @@ std::string NMD::DPA_W_PH(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string ac = AC(copy(ac_value)); std::string rs = GPR(copy(rs_value));
@@ -6399,7 +6399,7 @@ std::string NMD::DPAQ_SA_L_W(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string ac = AC(copy(ac_value)); std::string rs = GPR(copy(rs_value));
@@ -6423,7 +6423,7 @@ std::string NMD::DPAQ_S_W_PH(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string ac = AC(copy(ac_value)); std::string rs = GPR(copy(rs_value));
@@ -6447,7 +6447,7 @@ std::string NMD::DPAQX_SA_W_PH(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string ac = AC(copy(ac_value)); std::string rs = GPR(copy(rs_value));
@@ -6471,7 +6471,7 @@ std::string NMD::DPAQX_S_W_PH(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string ac = AC(copy(ac_value)); std::string rs = GPR(copy(rs_value));
@@ -6495,7 +6495,7 @@ std::string NMD::DPAU_H_QBL(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string ac = AC(copy(ac_value)); std::string rs = GPR(copy(rs_value));
@@ -6519,7 +6519,7 @@ std::string NMD::DPAU_H_QBR(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string ac = AC(copy(ac_value)); std::string rs = GPR(copy(rs_value));
@@ -6543,7 +6543,7 @@ std::string NMD::DPAX_W_PH(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string ac = AC(copy(ac_value)); std::string rs = GPR(copy(rs_value));
@@ -6567,7 +6567,7 @@ std::string NMD::DPS_W_PH(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string ac = AC(copy(ac_value)); std::string rs = GPR(copy(rs_value));
@@ -6591,7 +6591,7 @@ std::string NMD::DPSQ_SA_L_W(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string ac = AC(copy(ac_value)); std::string rs = GPR(copy(rs_value));
@@ -6615,7 +6615,7 @@ std::string NMD::DPSQ_S_W_PH(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string ac = AC(copy(ac_value)); std::string rs = GPR(copy(rs_value));
@@ -6639,7 +6639,7 @@ std::string NMD::DPSQX_SA_W_PH(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string ac = AC(copy(ac_value)); std::string rs = GPR(copy(rs_value));
@@ -6663,7 +6663,7 @@ std::string NMD::DPSQX_S_W_PH(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string ac = AC(copy(ac_value)); std::string rs = GPR(copy(rs_value));
@@ -6687,7 +6687,7 @@ std::string NMD::DPSU_H_QBL(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string ac = AC(copy(ac_value)); std::string rs = GPR(copy(rs_value));
@@ -6711,7 +6711,7 @@ std::string NMD::DPSU_H_QBR(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string ac = AC(copy(ac_value)); std::string rs = GPR(copy(rs_value));
@@ -6735,7 +6735,7 @@ std::string NMD::DPSX_W_PH(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string ac = AC(copy(ac_value)); std::string rs = GPR(copy(rs_value));
@@ -7373,7 +7373,7 @@ std::string NMD::EXTPDP(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 size_value = extract_size_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string rt = GPR(copy(rt_value)); std::string ac = AC(copy(ac_value));
@@ -7397,7 +7397,7 @@ std::string NMD::EXTPDPV(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string rt = GPR(copy(rt_value)); std::string ac = AC(copy(ac_value));
@@ -7421,7 +7421,7 @@ std::string NMD::EXTP(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 size_value = extract_size_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string rt = GPR(copy(rt_value)); std::string ac = AC(copy(ac_value));
@@ -7445,7 +7445,7 @@ std::string NMD::EXTPV(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string rt = GPR(copy(rt_value)); std::string ac = AC(copy(ac_value));
@@ -7469,7 +7469,7 @@ std::string NMD::EXTR_RS_W(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 shift_value = extract_shift_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string rt = GPR(copy(rt_value)); std::string ac = AC(copy(ac_value));
@@ -7493,7 +7493,7 @@ std::string NMD::EXTR_R_W(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 shift_value = extract_shift_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string rt = GPR(copy(rt_value)); std::string ac = AC(copy(ac_value));
@@ -7517,7 +7517,7 @@ std::string NMD::EXTR_S_H(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 shift_value = extract_shift_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string rt = GPR(copy(rt_value)); std::string ac = AC(copy(ac_value));
@@ -7541,7 +7541,7 @@ std::string NMD::EXTR_W(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 shift_value = extract_shift_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string rt = GPR(copy(rt_value)); std::string ac = AC(copy(ac_value));
@@ -7565,7 +7565,7 @@ std::string NMD::EXTRV_RS_W(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string rt = GPR(copy(rt_value)); std::string ac = AC(copy(ac_value));
@@ -7589,7 +7589,7 @@ std::string NMD::EXTRV_R_W(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string rt = GPR(copy(rt_value)); std::string ac = AC(copy(ac_value));
@@ -7613,7 +7613,7 @@ std::string NMD::EXTRV_S_H(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string rt = GPR(copy(rt_value)); std::string ac = AC(copy(ac_value));
@@ -7637,7 +7637,7 @@ std::string NMD::EXTRV_W(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string rt = GPR(copy(rt_value)); std::string ac = AC(copy(ac_value));
@@ -9719,7 +9719,7 @@ std::string NMD::MADD_DSP_(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string ac = AC(copy(ac_value)); std::string rs = GPR(copy(rs_value));
@@ -9792,7 +9792,7 @@ std::string NMD::MADDU_DSP_(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string ac = AC(copy(ac_value)); std::string rs = GPR(copy(rs_value));
@@ -9817,7 +9817,7 @@ std::string NMD::MAQ_S_W_PHL(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string ac = AC(copy(ac_value)); std::string rs = GPR(copy(rs_value));
@@ -9842,7 +9842,7 @@ std::string NMD::MAQ_S_W_PHR(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string ac = AC(copy(ac_value)); std::string rs = GPR(copy(rs_value));
@@ -9867,7 +9867,7 @@ std::string NMD::MAQ_SA_W_PHL(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string ac = AC(copy(ac_value)); std::string rs = GPR(copy(rs_value));
@@ -9892,7 +9892,7 @@ std::string NMD::MAQ_SA_W_PHR(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string ac = AC(copy(ac_value)); std::string rs = GPR(copy(rs_value));
@@ -10195,7 +10195,7 @@ std::string NMD::MFHGC0(uint64 instruction) std::string NMD::MFHI_DSP_(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string rt = GPR(copy(rt_value)); std::string ac = AC(copy(ac_value));
@@ -10243,7 +10243,7 @@ std::string NMD::MFHTR(uint64 instruction) std::string NMD::MFLO_DSP_(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string rt = GPR(copy(rt_value)); std::string ac = AC(copy(ac_value));
@@ -10652,7 +10652,7 @@ std::string NMD::MSUB_DSP_(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string ac = AC(copy(ac_value)); std::string rs = GPR(copy(rs_value));
@@ -10724,7 +10724,7 @@ std::string NMD::MSUBU_DSP_(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string ac = AC(copy(ac_value)); std::string rs = GPR(copy(rs_value));
@@ -10931,7 +10931,7 @@ std::string NMD::MTHGC0(uint64 instruction) std::string NMD::MTHI_DSP_(uint64 instruction) { uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string rs = GPR(copy(rs_value)); std::string ac = AC(copy(ac_value));
@@ -10953,7 +10953,7 @@ std::string NMD::MTHI_DSP_(uint64 instruction) std::string NMD::MTHLIP(uint64 instruction) { uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string rs = GPR(copy(rs_value)); std::string ac = AC(copy(ac_value));
@@ -11001,7 +11001,7 @@ std::string NMD::MTHTR(uint64 instruction) std::string NMD::MTLO_DSP_(uint64 instruction) { uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string rs = GPR(copy(rs_value)); std::string ac = AC(copy(ac_value));
@@ -11432,7 +11432,7 @@ std::string NMD::MULSA_W_PH(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string ac = AC(copy(ac_value)); std::string rs = GPR(copy(rs_value));
@@ -11456,7 +11456,7 @@ std::string NMD::MULSAQ_S_W_PH(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string ac = AC(copy(ac_value)); std::string rs = GPR(copy(rs_value));
@@ -11480,7 +11480,7 @@ std::string NMD::MULT_DSP_(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string ac = AC(copy(ac_value)); std::string rs = GPR(copy(rs_value));
@@ -11504,7 +11504,7 @@ std::string NMD::MULTU_DSP_(uint64 instruction) { uint64 rt_value = extract_rt_25_24_23_22_21(instruction); uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string ac = AC(copy(ac_value)); std::string rs = GPR(copy(rs_value));
@@ -13932,7 +13932,7 @@ std::string NMD::SHE(uint64 instruction) std::string NMD::SHILO(uint64 instruction) { int64 shift_value = extract_shift__se5_21_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string shift = IMMEDIATE(copy(shift_value)); std::string ac = AC(copy(ac_value));
@@ -13954,7 +13954,7 @@ std::string NMD::SHILO(uint64 instruction) std::string NMD::SHILOV(uint64 instruction) { uint64 rs_value = extract_rs_20_19_18_17_16(instruction); - uint64 ac_value = extract_ac_13_12(instruction); + uint64 ac_value = extract_ac_15_14(instruction); std::string rs = GPR(copy(rs_value)); std::string ac = AC(copy(ac_value));
disas/nanomips.h +1 -1
@@ -159,7 +159,7 @@ private:int64 extract_s__se31_0_11_to_2_20_to_12_s12 (uint64 instruction);int64 extract_shift__se5_21_20_19_18_17_16 (uint64 instruction); -uint64 extract_ac_13_12 (uint64 instruction); +uint64 extract_ac_15_14 (uint64 instruction);uint64 extract_bit_16_15_14_13_12_11 (uint64 instruction);uint64 extract_bit_23_22_21 (uint64 instruction);uint64 extract_c0s_20_19_18_17_16 (uint64 instruction);
Signature · 1 line
2.7.4
PATCH v4 3/9 qemu-doc: Move section on MIPS' mipssim pseudo board
In reply to Aleksandar MarkovicFrom: Aleksandar Markovic <[email protected]>
Move section on MIPS' mipssim pseudo board to the more appropriate place.
--- qemu-doc.texi | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)
qemu-doc.texi +13 -13
@@ -2062,19 +2062,6 @@ PC Keyboard IDE controller @end itemize -The mipssim pseudo board emulation provides an environment similar -to what the proprietary MIPS emulator uses for running Linux. -It supports: - -@itemize @minus -@item -A range of MIPS CPUs, default is the 24Kf -@item -PC style serial port -@item -MIPSnet network emulation -@end itemize - The MIPS Magnum R4000 emulation supports: @itemize @minus
@@ -2090,6 +2077,19 @@ SCSI controller G364 framebuffer @end itemize +The mipssim pseudo board emulation provides an environment similar +to what the proprietary MIPS emulator uses for running Linux. +It supports: + +@itemize @minus +@item +A range of MIPS CPUs, default is the 24Kf +@item +PC style serial port +@item +MIPSnet network emulation +@end itemize + @node nanoMIPS System emulator @subsection nanoMIPS System emulator @cindex system emulation (nanoMIPS)
Signature · 1 line
2.7.4
PATCH v4 4/9 qemu-doc: Add section on MIPS' Fulong 2E board
In reply to Aleksandar MarkovicFrom: Aleksandar Markovic <[email protected]>
Add section on MIPS' Fulong 2E board in QEMU user documentation.
--- qemu-doc.texi | 13 +++++++++++++ 1 file changed, 13 insertions(+)
qemu-doc.texi +13 -0
@@ -2077,6 +2077,19 @@ SCSI controller G364 framebuffer @end itemize +The Fulong 2E emulation supports: + +@itemize @minus +@item +Loongson 2E CPU +@item +Bonito64 system controller as North Bridge +@item +VT82C686 chipset as South Bridge +@item +RTL8139D as a network card chipset +@end itemize + The mipssim pseudo board emulation provides an environment similar to what the proprietary MIPS emulator uses for running Linux. It supports:
Signature · 1 line
2.7.4
PATCH v4 5/9 qemu-doc: Add section on MIPS' Boston board
In reply to Aleksandar MarkovicFrom: Aleksandar Markovic <[email protected]>
Add section on MIPS' Boston board in QEMU user documentation.
--- qemu-doc.texi | 9 +++++++++ 1 file changed, 9 insertions(+)
qemu-doc.texi +9 -0
@@ -2049,6 +2049,15 @@ Malta FPGA serial device Cirrus (default) or any other PCI VGA graphics card @end itemize +The Boston board emulation supports the following devices: + +@itemize @minus +@item +Xilinx FPGA, which includes a PCIe root port and an UART +@item +Intel EG20T PCH connects the I/O peripherals, but only the SATA bus is emulated +@end itemize + The ACER Pica emulation supports: @itemize @minus
Signature · 1 line
2.7.4
PATCH v4 6/9 tests/tcg: target/mips: Add wrappers for MSA integer max/min instructions
In reply to Aleksandar MarkovicFrom: Aleksandar Markovic <[email protected]>
Add wrappers for MSA integer max/min instructions.
--- tests/tcg/mips/include/wrappers_msa.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
tests/tcg/mips/include/wrappers_msa.h +30 -0
@@ -122,5 +122,35 @@ DO_MSA__WD__WS_WT(CLT_U_H, clt_u.h) DO_MSA__WD__WS_WT(CLT_U_W, clt_u.w) DO_MSA__WD__WS_WT(CLT_U_D, clt_u.d) +DO_MSA__WD__WS_WT(MAX_A_B, max_a.b) +DO_MSA__WD__WS_WT(MAX_A_H, max_a.h) +DO_MSA__WD__WS_WT(MAX_A_W, max_a.w) +DO_MSA__WD__WS_WT(MAX_A_D, max_a.d) + +DO_MSA__WD__WS_WT(MIN_A_B, min_a.b) +DO_MSA__WD__WS_WT(MIN_A_H, min_a.h) +DO_MSA__WD__WS_WT(MIN_A_W, min_a.w) +DO_MSA__WD__WS_WT(MIN_A_D, min_a.d) + +DO_MSA__WD__WS_WT(MAX_S_B, max_s.b) +DO_MSA__WD__WS_WT(MAX_S_H, max_s.h) +DO_MSA__WD__WS_WT(MAX_S_W, max_s.w) +DO_MSA__WD__WS_WT(MAX_S_D, max_s.d) + +DO_MSA__WD__WS_WT(MIN_S_B, min_s.b) +DO_MSA__WD__WS_WT(MIN_S_H, min_s.h) +DO_MSA__WD__WS_WT(MIN_S_W, min_s.w) +DO_MSA__WD__WS_WT(MIN_S_D, min_s.d) + +DO_MSA__WD__WS_WT(MAX_U_B, max_u.b) +DO_MSA__WD__WS_WT(MAX_U_H, max_u.h) +DO_MSA__WD__WS_WT(MAX_U_W, max_u.w) +DO_MSA__WD__WS_WT(MAX_U_D, max_u.d) + +DO_MSA__WD__WS_WT(MIN_U_B, min_u.b) +DO_MSA__WD__WS_WT(MIN_U_H, min_u.h) +DO_MSA__WD__WS_WT(MIN_U_W, min_u.w) +DO_MSA__WD__WS_WT(MIN_U_D, min_u.d) +#endif
Signature · 1 line
2.7.4
PATCH v4 7/9 tests/tcg: target/mips: Add tests for MSA integer max/min instructions
In reply to Aleksandar MarkovicFrom: Aleksandar Markovic <[email protected]>
Add tests for MSA integer max/min instructions. This includes following instructions:
* MAX_A.B - maximum of absolute of two signed values (bytes)
* MAX_A.H - maximum of absolute of two signed values (halfwords)
* MAX_A.W - maximum of absolute of two signed values (words)
* MAX_A.D - maximum of absolute of two signed values (doublewords)
* MIN_A.B - minimum of absolute of two signed values (bytes)
* MIN_A.H - minimum of absolute of two signed values (halfwords)
* MIN_A.W - minimum of absolute of two signed values (words)
* MIN_A.D - minimum of absolute of two signed values (doublewords)
* MAX_S.B - maximum of two signed values (bytes)
* MAX_S.H - maximum of two signed values (halfwords)
* MAX_S.W - maximum of two signed values (words)
* MAX_S.D - maximum of two signed values (doublewords)
* MIN_S.B - minimum of two signed values (bytes)
* MIN_S.H - minimum of two signed values (halfwords)
* MIN_S.W - minimum of two signed values (words)
* MIN_S.D - minimum of two signed values (doublewords)
* MAX_U.B - maximum of two unsigned values (bytes)
* MAX_U.H - maximum of two unsigned values (halfwords)
* MAX_U.W - maximum of two unsigned values (words)
* MAX_U.D - maximum of two unsigned values (doublewords)
* MIN_U.B - minimum of two unsigned values (bytes)
* MIN_U.H - minimum of two unsigned values (halfwords)
* MIN_U.W - minimum of two unsigned values (words)
* MIN_U.D - minimum of two unsigned values (doublewords)
Each test consists of 80 test cases, so altogether there are 1920 test cases.
--- .../user/ase/msa/int-max-min/test_msa_max_a_b.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-max-min/test_msa_max_a_d.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-max-min/test_msa_max_a_h.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-max-min/test_msa_max_a_w.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-max-min/test_msa_max_s_b.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-max-min/test_msa_max_s_d.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-max-min/test_msa_max_s_h.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-max-min/test_msa_max_s_w.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-max-min/test_msa_max_u_b.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-max-min/test_msa_max_u_d.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-max-min/test_msa_max_u_h.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-max-min/test_msa_max_u_w.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-max-min/test_msa_min_a_b.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-max-min/test_msa_min_a_d.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-max-min/test_msa_min_a_h.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-max-min/test_msa_min_a_w.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-max-min/test_msa_min_s_b.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-max-min/test_msa_min_s_d.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-max-min/test_msa_min_s_h.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-max-min/test_msa_min_s_w.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-max-min/test_msa_min_u_b.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-max-min/test_msa_min_u_d.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-max-min/test_msa_min_u_h.c | 153 +++++++++++++++++++++ .../user/ase/msa/int-max-min/test_msa_min_u_w.c | 153 +++++++++++++++++++++ 24 files changed, 3672 insertions(+) create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_b.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_d.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_h.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_w.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_b.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_d.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_h.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_w.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_b.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_d.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_h.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_w.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_b.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_d.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_h.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_w.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_b.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_d.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_h.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_w.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_b.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_d.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_h.c create mode 100644 tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_w.c
tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_b.c new file +153 -0
@@ -0,0 +1,153 @@ +/* +* Test program for MSA instruction MAX_A.B +* +* Copyright (C) 2018 Wave Computing, Inc. +* Copyright (C) 2018 Aleksandar Markovic <[email protected]> +* +* 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 ="MAX_A.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 , }, + {0xaaaaaaaaaaaaaaaaULL ,0xaaaaaaaaaaaaaaaaULL , }, + {0x5555555555555555ULL ,0x5555555555555555ULL , }, + {0xccccccccccccccccULL ,0xccccccccccccccccULL , }, + {0x3333333333333333ULL ,0x3333333333333333ULL , }, + {0xe38e38e38e38e38eULL ,0x38e38e38e38e38e3ULL , }, + {0x1c71c71c71c71c71ULL ,0xc71c71c71c71c71cULL , }, + {0xffffffffffffffffULL ,0xffffffffffffffffULL , },/* 8 */ + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0xaaaaaaaaaaaaaaaaULL ,0xaaaaaaaaaaaaaaaaULL , }, + {0x5555555555555555ULL ,0x5555555555555555ULL , }, + {0xccccccccccccccccULL ,0xccccccccccccccccULL , }, + {0x3333333333333333ULL ,0x3333333333333333ULL , }, + {0xe38e38e38e38e38eULL ,0x38e38e38e38e38e3ULL , }, + {0x1c71c71c71c71c71ULL ,0xc71c71c71c71c71cULL , }, + {0xaaaaaaaaaaaaaaaaULL ,0xaaaaaaaaaaaaaaaaULL , },/* 16 */ + {0xaaaaaaaaaaaaaaaaULL ,0xaaaaaaaaaaaaaaaaULL , }, + {0xaaaaaaaaaaaaaaaaULL ,0xaaaaaaaaaaaaaaaaULL , }, + {0xaaaaaaaaaaaaaaaaULL ,0xaaaaaaaaaaaaaaaaULL , }, + {0xaaaaaaaaaaaaaaaaULL ,0xaaaaaaaaaaaaaaaaULL , }, + {0xaaaaaaaaaaaaaaaaULL ,0xaaaaaaaaaaaaaaaaULL , }, + {0xaa8eaaaa8eaaaa8eULL ,0xaaaa8eaaaa8eaaaaULL , }, + {0xaa71aaaa71aaaa71ULL ,0xaaaa71aaaa71aaaaULL , }, + {0x5555555555555555ULL ,0x5555555555555555ULL , },/* 24 */ + {0x5555555555555555ULL ,0x5555555555555555ULL , }, + {0xaaaaaaaaaaaaaaaaULL ,0xaaaaaaaaaaaaaaaaULL , }, + {0x5555555555555555ULL ,0x5555555555555555ULL , }, + {0x5555555555555555ULL ,0x5555555555555555ULL , }, + {0x5555555555555555ULL ,0x5555555555555555ULL , }, + {0x558e55558e55558eULL ,0x55558e55558e5555ULL , }, + {0x5571555571555571ULL ,0x5555715555715555ULL , }, + {0xccccccccccccccccULL ,0xccccccccccccccccULL , },/* 32 */ + {0xccccccccccccccccULL ,0xccccccccccccccccULL , }, + {0xaaaaaaaaaaaaaaaaULL ,0xaaaaaaaaaaaaaaaaULL , }, + {0x5555555555555555ULL ,0x5555555555555555ULL , }, + {0xccccccccccccccccULL ,0xccccccccccccccccULL , }, + {0xccccccccccccccccULL ,0xccccccccccccccccULL , }, + {0xcc8e38cc8e38cc8eULL ,0x38cc8e38cc8e38ccULL , }, + {0xcc71c7cc71c7cc71ULL ,0xc7cc71c7cc71c7ccULL , }, + {0x3333333333333333ULL ,0x3333333333333333ULL , },/* 40 */ + {0x3333333333333333ULL ,0x3333333333333333ULL , }, + {0xaaaaaaaaaaaaaaaaULL ,0xaaaaaaaaaaaaaaaaULL , }, + {0x5555555555555555ULL ,0x5555555555555555ULL , }, + {0xccccccccccccccccULL ,0xccccccccccccccccULL , }, + {0x3333333333333333ULL ,0x3333333333333333ULL , }, + {0x338e38338e38338eULL ,0x38338e38338e3833ULL , }, + {0x3371c73371c73371ULL ,0xc73371c73371c733ULL , }, + {0xe38e38e38e38e38eULL ,0x38e38e38e38e38e3ULL , },/* 48 */ + {0xe38e38e38e38e38eULL ,0x38e38e38e38e38e3ULL , }, + {0xaa8eaaaa8eaaaa8eULL ,0xaaaa8eaaaa8eaaaaULL , }, + {0x558e55558e55558eULL ,0x55558e55558e5555ULL , }, + {0xcc8e38cc8e38cc8eULL ,0x38cc8e38cc8e38ccULL , }, + {0x338e38338e38338eULL ,0x38338e38338e3833ULL , }, + {0xe38e38e38e38e38eULL ,0x38e38e38e38e38e3ULL , }, + {0xe38ec7e38ec7e38eULL ,0xc7e38ec7e38ec7e3ULL , }, + {0x1c71c71c71c71c71ULL ,0xc71c71c71c71c71cULL , },/* 56 */ + {0x1c71c71c71c71c71ULL ,0xc71c71c71c71c71cULL , }, + {0xaa71aaaa71aaaa71ULL ,0xaaaa71aaaa71aaaaULL , }, + {0x5571555571555571ULL ,0x5555715555715555ULL , }, + {0xcc71c7cc71c7cc71ULL ,0xc7cc71c7cc71c7ccULL , }, + {0x3371c73371c73371ULL ,0xc73371c73371c733ULL , }, + {0xe38ec7e38ec7e38eULL ,0xc7e38ec7e38ec7e3ULL , }, + {0x1c71c71c71c71c71ULL ,0xc71c71c71c71c71cULL , }, + {0x886ae6cc28625540ULL ,0x4b670b5efe7bb00cULL , },/* 64 */ + {0x886ae6634d935540ULL ,0x4b67bb5e157b520cULL , }, + {0x886aaeaab9628b80ULL ,0x4b67c65eab7bb014ULL , }, + {0x886ae64d5e62554eULL ,0x8d67885ea97bb0a0ULL , }, + {0x886ae6634d935540ULL ,0x4b67bb5e157b520cULL , }, + {0xfbbe00634d93c708ULL ,0x12f7bb1a153f52fcULL , }, + {0xac5aae634d938b80ULL ,0x27d8bb1aab3f5214ULL , }, + {0x704f16635e93c74eULL ,0x8df188d8a94252a0ULL , }, + {0x886aaeaab9628b80ULL ,0x4b67c65eab7bb014ULL , },/* 72 */ + {0xac5aae634d938b80ULL ,0x27d8bb1aab3f5214ULL , }, + {0xac5aaeaab9cf8b80ULL ,0x27d8c6ffab2b2514ULL , }, + {0x705aaeaa5e318b80ULL ,0x8dd888d8a94225a0ULL , }, + {0x886ae64d5e62554eULL ,0x8d67885ea97bb0a0ULL , }, + {0x704f16635e93c74eULL ,0x8df188d8a94252a0ULL , }, + {0x705aaeaa5ecf8b80ULL ,0x8dd888d8a94225a0ULL , }, + {0x704f164d5e31e24eULL ,0x8df188d8a942e2a0ULL , }, + }; + +gettimeofday (&start,NULL ); + +for (i =0 ; i <PATTERN_INPUTS_SHORT_COUNT ; i++) { +for (j =0 ; j <PATTERN_INPUTS_SHORT_COUNT ; j++) { +do_msa_MAX_A_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_MAX_A_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; +}
tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_d.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_h.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_w.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_b.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_d.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_h.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_w.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_b.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_d.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_h.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_w.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_b.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_d.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_h.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_w.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_b.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_d.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_h.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_w.c new file +153 -0
93 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_b.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_d.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_h.c new file +153 -0
153 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_w.c new file +153 -0
153 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.7.4
Part of the diff is not shown here. View the raw message.
PATCH v4 8/9 disas: nanoMIPS: Correct comments to handlers of some DSP instructions
In reply to Aleksandar MarkovicFrom: Aleksandar Markovic <[email protected]>
Correct comments to handlers of some DSP instructions.
--- disas/nanomips.cpp | 285 ++++++++++++++++++++++++++++------------------------- 1 file changed, 150 insertions(+), 135 deletions(-)
disas/nanomips.cpp +150 -135
@@ -10183,14 +10183,13 @@ std::string NMD::MFHGC0(uint64 instruction) /* - * + * [DSP] MFHI rs, ac - Move from HI register * * 3 2 1 * 10987654321098765432109876543210 - * 001000 x1110000101 + * 001000 xxxxx 00000001111111 * rt ----- - * rs ----- - * rd ----- + * ac -- */ std::string NMD::MFHI_DSP_(uint64 instruction) {
@@ -10231,14 +10230,13 @@ std::string NMD::MFHTR(uint64 instruction) /* - * + * [DSP] MFLO rs, ac - Move from HI register * * 3 2 1 * 10987654321098765432109876543210 - * 001000 x1110000101 + * 001000 xxxxx 01000001111111 * rt ----- - * rs ----- - * rd ----- + * ac -- */ std::string NMD::MFLO_DSP_(uint64 instruction) {
@@ -10399,7 +10397,7 @@ std::string NMD::MOD(uint64 instruction) /* - * + * [DSP] MODSUB rd, rs, rt - Modular subtraction on an index value * * 3 2 1 * 10987654321098765432109876543210
@@ -10427,7 +10425,7 @@ std::string NMD::MODSUB(uint64 instruction) * * 3 2 1 * 10987654321098765432109876543210 - * 001000 x1110000101 + * 001000 x1010010101 * rt ----- * rs ----- * rd -----
@@ -10639,14 +10637,14 @@ std::string NMD::MOVZ(uint64 instruction) /* - * ADDQH_R.W rd, rt, rs - Add Fractional Words And Shift Right to Halve Results + * [DSP] MSUB ac, rs, rt - Multiply word and subtract from accumulator * * 3 2 1 * 10987654321098765432109876543210 - * 001000 00010001101 + * 001000 10101010111111 * rt ----- * rs ----- - * rd ----- + * ac -- */ std::string NMD::MSUB_DSP_(uint64 instruction) {
@@ -10711,14 +10709,14 @@ std::string NMD::MSUBF_S(uint64 instruction) /* - * ADDQH_R.W rd, rt, rs - Add Fractional Words And Shift Right to Halve Results + * [DSP] MSUBU ac, rs, rt - Multiply word and add to accumulator * * 3 2 1 * 10987654321098765432109876543210 - * 001000 00010001101 + * 001000 11101010111111 * rt ----- * rs ----- - * rd ----- + * ac -- */ std::string NMD::MSUBU_DSP_(uint64 instruction) {
@@ -10919,14 +10917,13 @@ std::string NMD::MTHGC0(uint64 instruction) /* - * ADDQH_R.W rd, rt, rs - Add Fractional Words And Shift Right to Halve Results + * [DSP] MTHI rs, ac - Move to HI register * * 3 2 1 * 10987654321098765432109876543210 - * 001000 00010001101 - * rt ----- + * 001000xxxxx 10000001111111 * rs ----- - * rd ----- + * ac -- */ std::string NMD::MTHI_DSP_(uint64 instruction) {
@@ -10941,14 +10938,13 @@ std::string NMD::MTHI_DSP_(uint64 instruction) /* - * ADDQH_R.W rd, rt, rs - Add Fractional Words And Shift Right to Halve Results + * [DSP] MTHLIP rs, ac - Copy LO to HI and a GPR to LO and increment pos by 32 * * 3 2 1 * 10987654321098765432109876543210 - * 001000 00010001101 - * rt ----- + * 001000xxxxx 00001001111111 * rs ----- - * rd ----- + * ac -- */ std::string NMD::MTHLIP(uint64 instruction) {
@@ -10989,14 +10985,13 @@ std::string NMD::MTHTR(uint64 instruction) /* - * ADDQH_R.W rd, rt, rs - Add Fractional Words And Shift Right to Halve Results + * [DSP] MTLO rs, ac - Move to LO register * * 3 2 1 * 10987654321098765432109876543210 - * 001000 00010001101 - * rt ----- + * 001000xxxxx 11000001111111 * rs ----- - * rd ----- + * ac -- */ std::string NMD::MTLO_DSP_(uint64 instruction) {
@@ -11155,11 +11150,12 @@ std::string NMD::MUL_D(uint64 instruction) /* - * ADDQH_R.W rd, rt, rs - Add Fractional Words And Shift Right to Halve Results + * [DSP] MUL.PH rd, rs, rt - Multiply vector integer half words to same size + * products * * 3 2 1 * 10987654321098765432109876543210 - * 001000 00010001101 + * 001000 00000101101 * rt ----- * rs ----- * rd -----
@@ -11179,11 +11175,12 @@ std::string NMD::MUL_PH(uint64 instruction) /* - * ADDQH_R.W rd, rt, rs - Add Fractional Words And Shift Right to Halve Results + * [DSP] MUL_S.PH rd, rs, rt - Multiply vector integer half words to same size + * products (saturated) * * 3 2 1 * 10987654321098765432109876543210 - * 001000 00010001101 + * 001000 10000101101 * rt ----- * rs ----- * rd -----
@@ -11227,11 +11224,12 @@ std::string NMD::MUL_S(uint64 instruction) /* - * ADDQH_R.W rd, rt, rs - Add Fractional Words And Shift Right to Halve Results + * [DSP] MULEQ_S.W.PHL rd, rs, rt - Multiply vector fractional left halfwords + * to expanded width products * * 3 2 1 * 10987654321098765432109876543210 - * 001000 00010001101 + * 001000 x0000100101 * rt ----- * rs ----- * rd -----
@@ -11251,11 +11249,12 @@ std::string NMD::MULEQ_S_W_PHL(uint64 instruction) /* - * ADDQH_R.W rd, rt, rs - Add Fractional Words And Shift Right to Halve Results + * [DSP] MULEQ_S.W.PHR rd, rs, rt - Multiply vector fractional right halfwords + * to expanded width products * * 3 2 1 * 10987654321098765432109876543210 - * 001000 00010001101 + * 001000 x0001100101 * rt ----- * rs ----- * rd -----
@@ -11275,11 +11274,12 @@ std::string NMD::MULEQ_S_W_PHR(uint64 instruction) /* - * ADDQH_R.W rd, rt, rs - Add Fractional Words And Shift Right to Halve Results + * [DSP] MULEU_S.PH.QBL rd, rs, rt - Multiply vector fractional left bytes + * by halfwords to halfword products * * 3 2 1 * 10987654321098765432109876543210 - * 001000 00010001101 + * 001000 x0010010101 * rt ----- * rs ----- * rd -----
@@ -11299,11 +11299,12 @@ std::string NMD::MULEU_S_PH_QBL(uint64 instruction) /* - * ADDQH_R.W rd, rt, rs - Add Fractional Words And Shift Right to Halve Results + * [DSP] MULEU_S.PH.QBR rd, rs, rt - Multiply vector fractional right bytes + * by halfwords to halfword products * * 3 2 1 * 10987654321098765432109876543210 - * 001000 00010001101 + * 001000 x0011010101 * rt ----- * rs ----- * rd -----
@@ -11323,11 +11324,12 @@ std::string NMD::MULEU_S_PH_QBR(uint64 instruction) /* - * ADDQH_R.W rd, rt, rs - Add Fractional Words And Shift Right to Halve Results + * [DSP] MULQ_RS.PH rd, rs, rt - Multiply vector fractional halfwords + * to fractional halfword products * * 3 2 1 * 10987654321098765432109876543210 - * 001000 00010001101 + * 001000 x0100010101 * rt ----- * rs ----- * rd -----
@@ -11347,11 +11349,12 @@ std::string NMD::MULQ_RS_PH(uint64 instruction) /* - * ADDQH_R.W rd, rt, rs - Add Fractional Words And Shift Right to Halve Results + * [DSP] MULQ_RS.W rd, rs, rt - Multiply fractional words to same size + * product with saturation and rounding * * 3 2 1 * 10987654321098765432109876543210 - * 001000 00010001101 + * 001000 x0110010101 * rt ----- * rs ----- * rd -----
@@ -11371,11 +11374,12 @@ std::string NMD::MULQ_RS_W(uint64 instruction) /* - * ADDQH_R.W rd, rt, rs - Add Fractional Words And Shift Right to Halve Results + * [DSP] MULQ_S.PH rd, rs, rt - Multiply fractional halfwords to same size + * products * * 3 2 1 * 10987654321098765432109876543210 - * 001000 00010001101 + * 001000 x0101010101 * rt ----- * rs ----- * rd -----
@@ -11395,11 +11399,12 @@ std::string NMD::MULQ_S_PH(uint64 instruction) /* - * ADDQH_R.W rd, rt, rs - Add Fractional Words And Shift Right to Halve Results + * [DSP] MULQ_S.W rd, rs, rt - Multiply fractional words to same size product + * with saturation * * 3 2 1 * 10987654321098765432109876543210 - * 001000 00010001101 + * 001000 x0111010101 * rt ----- * rs ----- * rd -----
@@ -11419,14 +11424,15 @@ std::string NMD::MULQ_S_W(uint64 instruction) /* - * ADDQH_R.W rd, rt, rs - Add Fractional Words And Shift Right to Halve Results + * [DSP] MULSA.W.PH ac, rs, rt - Multiply and subtract vector integer halfword + * elements and accumulate * * 3 2 1 * 10987654321098765432109876543210 - * 001000 00010001101 + * 001000 10110010111111 * rt ----- * rs ----- - * rd ----- + * ac -- */ std::string NMD::MULSA_W_PH(uint64 instruction) {
@@ -11443,14 +11449,15 @@ std::string NMD::MULSA_W_PH(uint64 instruction) /* - * ADDQH_R.W rd, rt, rs - Add Fractional Words And Shift Right to Halve Results + * [DSP] MULSAQ_S.W.PH ac, rs, rt - Multiply and subtract vector fractional + * halfwords and accumulate * * 3 2 1 * 10987654321098765432109876543210 - * 001000 00010001101 + * 001000 11110010111111 * rt ----- * rs ----- - * rd ----- + * ac -- */ std::string NMD::MULSAQ_S_W_PH(uint64 instruction) {
@@ -11467,14 +11474,14 @@ std::string NMD::MULSAQ_S_W_PH(uint64 instruction) /* - * ADDQH_R.W rd, rt, rs - Add Fractional Words And Shift Right to Halve Results + * [DSP] MULT ac, rs, rt - Multiply word * * 3 2 1 * 10987654321098765432109876543210 - * 001000 00010001101 + * 001000 00110010111111 * rt ----- * rs ----- - * rd ----- + * ac -- */ std::string NMD::MULT_DSP_(uint64 instruction) {
@@ -11491,14 +11498,14 @@ std::string NMD::MULT_DSP_(uint64 instruction) /* - * ADDQH_R.W rd, rt, rs - Add Fractional Words And Shift Right to Halve Results + * [DSP] MULTU ac, rs, rt - Multiply unsigned word * * 3 2 1 * 10987654321098765432109876543210 - * 001000 00010001101 + * 001000 01110010111111 * rt ----- * rs ----- - * rd ----- + * ac -- */ std::string NMD::MULTU_DSP_(uint64 instruction) {
@@ -12060,11 +12067,12 @@ std::string NMD::PRECEU_PH_QBR(uint64 instruction) /* - * ADDQH_R.W rd, rt, rs - Add Fractional Words And Shift Right to Halve Results + * [DSP] PRECR.QB.PH rd, rs, rt - Reduce the precision of four integer + * halfwords to four bytes * * 3 2 1 * 10987654321098765432109876543210 - * 001000 00010001101 + * 001000 x0001101101 * rt ----- * rs ----- * rd -----
@@ -12084,7 +12092,8 @@ std::string NMD::PRECR_QB_PH(uint64 instruction) /* - * + * [DSP] PRECR_SRA.PH.W rt, rs, sa - Reduce the precision of two integer + * words to halfwords after a right shift * * 3 2 1 * 10987654321098765432109876543210
@@ -12108,7 +12117,8 @@ std::string NMD::PRECR_SRA_PH_W(uint64 instruction) /* - * + * [DSP] PRECR_SRA_R.PH.W rt, rs, sa - Reduce the precision of two integer + * words to halfwords after a right shift with rounding * * 3 2 1 * 10987654321098765432109876543210
@@ -12132,7 +12142,8 @@ std::string NMD::PRECR_SRA_R_PH_W(uint64 instruction) /* - * + * [DSP] PRECRQ.PH.W rd, rs, rt - Reduce the precision of fractional + * words to fractional halfwords * * 3 2 1 * 10987654321098765432109876543210
@@ -12156,11 +12167,12 @@ std::string NMD::PRECRQ_PH_W(uint64 instruction) /* - * + * [DSP] PRECRQ.QB.PH rd, rs, rt - Reduce the precision of four fractional + * halfwords to four bytes * * 3 2 1 * 10987654321098765432109876543210 - * 001000 x1110000101 + * 001000 x0010101101 * rt ----- * rs ----- * rd -----
@@ -12180,7 +12192,8 @@ std::string NMD::PRECRQ_QB_PH(uint64 instruction) /* - * + * [DSP] PRECRQ_RS.PH.W rd, rs, rt - Reduce the precision of fractional + * words to halfwords with rounding and saturation * * 3 2 1 * 10987654321098765432109876543210
@@ -12204,7 +12217,8 @@ std::string NMD::PRECRQ_RS_PH_W(uint64 instruction) /* - * + * [DSP] PRECRQU_S.QB.PH rd, rs, rt - Reduce the precision of fractional + * halfwords to unsigned bytes with saturation * * 3 2 1 * 10987654321098765432109876543210
@@ -12300,7 +12314,7 @@ std::string NMD::PREFE(uint64 instruction) /* - * + * [DSP] PREPEND rt, rs, sa - Right shift and prepend bits to the MSB * * 3 2 1 * 10987654321098765432109876543210
@@ -12324,14 +12338,13 @@ std::string NMD::PREPEND(uint64 instruction) /* - * + * [DSP] RADDU.W.QB rt, rs - Unsigned reduction add of vector quad bytes * * 3 2 1 * 10987654321098765432109876543210 - * 001000 x1110000101 + * 001000 1111000100111111 * rt ----- * rs ----- - * rd ----- */ std::string NMD::RADDU_W_QB(uint64 instruction) {
@@ -12346,14 +12359,13 @@ std::string NMD::RADDU_W_QB(uint64 instruction) /* - * + * [DSP] RDDSP rt, mask - Read DSPControl register fields to a GPR * * 3 2 1 * 10987654321098765432109876543210 - * 001000 x1110000101 + * 001000 00011001111111 * rt ----- - * rs ----- - * rd ----- + * mask ------- */ std::string NMD::RDDSP(uint64 instruction) {
@@ -12458,14 +12470,14 @@ std::string NMD::RECIP_S(uint64 instruction) /* - * + * [DSP] REPL.PH rd, s - Replicate immediate integer into all vector element + * positions * * 3 2 1 * 10987654321098765432109876543210 - * 001000 x1110000101 + * 001000 x0000111101 * rt ----- - * rs ----- - * rd ----- + * s ---------- */ std::string NMD::REPL_PH(uint64 instruction) {
@@ -12480,14 +12492,14 @@ std::string NMD::REPL_PH(uint64 instruction) /* - * + * [DSP] REPL.QB rd, u - Replicate immediate integer into all vector element + * positions * * 3 2 1 * 10987654321098765432109876543210 - * 001000 x1110000101 + * 001000 x010111111111 * rt ----- - * rs ----- - * rd ----- + * u -------- */ std::string NMD::REPL_QB(uint64 instruction) {
@@ -12502,14 +12514,14 @@ std::string NMD::REPL_QB(uint64 instruction) /* - * + * [DSP] REPLV.PH rt, rs - Replicate a halfword into all vector element + * positions * * 3 2 1 * 10987654321098765432109876543210 - * 001000 x1110000101 + * 001000 0000001100111111 * rt ----- * rs ----- - * rd ----- */ std::string NMD::REPLV_PH(uint64 instruction) {
@@ -12524,14 +12536,13 @@ std::string NMD::REPLV_PH(uint64 instruction) /* - * + * [DSP] REPLV.QB rt, rs - Replicate byte into all vector element positions * * 3 2 1 * 10987654321098765432109876543210 - * 001000 x1110000101 + * 001000 0001001100111111 * rt ----- * rs ----- - * rd ----- */ std::string NMD::REPLV_QB(uint64 instruction) {
@@ -13920,8 +13931,8 @@ std::string NMD::SHE(uint64 instruction) /* - * SHILO ac, shift - Shift an Accumulator Value Leaving the Result in the Same - * Accumulator + * [DSP] SHILO ac, shift - Shift an accumulator value leaving the result in + * the same accumulator * * 3 2 1 * 10987654321098765432109876543210
@@ -13942,8 +13953,8 @@ std::string NMD::SHILO(uint64 instruction) /* - * SHILOV ac, rs - Variable Shift of Accumulator Value Leaving the Result in - * the Same Accumulator + * [DSP] SHILOV ac, rs - Variable shift of accumulator value leaving the result + * in the same accumulator * * 3 2 1 * 10987654321098765432109876543210
@@ -13964,7 +13975,7 @@ std::string NMD::SHILOV(uint64 instruction) /* - * SHLL.PH rt, rs, sa - Shift Left Logical Vector Pair Halfwords + * [DSP] SHLL.PH rt, rs, sa - Shift left logical vector pair halfwords * * 3 2 1 * 10987654321098765432109876543210
@@ -13988,7 +13999,7 @@ std::string NMD::SHLL_PH(uint64 instruction) /* - * SHLL.QB rt, rs, sa - Shift Left Logical Vector Quad Bytes + * [DSP] SHLL.QB rt, rs, sa - Shift left logical vector quad bytes * * 3 2 1 * 10987654321098765432109876543210
@@ -14012,7 +14023,8 @@ std::string NMD::SHLL_QB(uint64 instruction) /* - * SHLL_S.PH rt, rs, sa - Shift Left Logical Vector Pair Halfwords (saturated) + * [DSP] SHLL_S.PH rt, rs, sa - Shift left logical vector pair halfwords + * with saturation * * 3 2 1 * 10987654321098765432109876543210
@@ -14036,14 +14048,14 @@ std::string NMD::SHLL_S_PH(uint64 instruction) /* - * + * [DSP] SHLL_S.PH rt, rs, sa - Shift left logical word with saturation * * 3 2 1 * 10987654321098765432109876543210 - * 001000 01001001101 + * 001000 x1111110101 * rt ----- * rs ----- - * rd ----- + * sa ----- */ std::string NMD::SHLL_S_W(uint64 instruction) {
@@ -14060,11 +14072,12 @@ std::string NMD::SHLL_S_W(uint64 instruction) /* - * + * [DSP] SHLLV.PH rd, rt, rs - Shift left logical variable vector pair + * halfwords * * 3 2 1 * 10987654321098765432109876543210 - * 001000 01001001101 + * 001000 01110001101 * rt ----- * rs ----- * rd -----
@@ -14084,11 +14097,11 @@ std::string NMD::SHLLV_PH(uint64 instruction) /* - * + * [DSP] SHLLV_S.QB rd, rt, rs - Shift left logical variable vector quad bytes * * 3 2 1 * 10987654321098765432109876543210 - * 001000 01001001101 + * 001000 x1110010101 * rt ----- * rs ----- * rd -----
@@ -14108,11 +14121,12 @@ std::string NMD::SHLLV_QB(uint64 instruction) /* - * + * [DSP] SHLLV.PH rd, rt, rs - Shift left logical variable vector pair + * halfwords with saturation * * 3 2 1 * 10987654321098765432109876543210 - * 001000 01001001101 + * 001000 11110001101 * rt ----- * rs ----- * rd -----
@@ -14132,11 +14146,11 @@ std::string NMD::SHLLV_S_PH(uint64 instruction) /* - * + * [DSP] SHLLV_S.W rd, rt, rs - Shift left logical variable vector word * * 3 2 1 * 10987654321098765432109876543210 - * 001000 01001001101 + * 001000 x1111010101 * rt ----- * rs ----- * rd -----
@@ -14396,14 +14410,14 @@ std::string NMD::SHRAV_R_W(uint64 instruction) /* - * + * [DSP] SHRL.PH rt, rs, sa - Shift right logical two halfwords * * 3 2 1 * 10987654321098765432109876543210 - * 001000 01001001101 + * 001000 001111111111 * rt ----- * rs ----- - * rd ----- + * sa ---- */ std::string NMD::SHRL_PH(uint64 instruction) {
@@ -14420,14 +14434,14 @@ std::string NMD::SHRL_PH(uint64 instruction) /* - * + * [DSP] SHRL.QB rt, rs, sa - Shift right logical vector quad bytes * * 3 2 1 * 10987654321098765432109876543210 - * 001000 01001001101 + * 001000 1100001111111 * rt ----- * rs ----- - * rd ----- + * sa --- */ std::string NMD::SHRL_QB(uint64 instruction) {
@@ -14444,11 +14458,12 @@ std::string NMD::SHRL_QB(uint64 instruction) /* - * + * [DSP] SHLLV.PH rd, rt, rs - Shift right logical variable vector pair of + * halfwords * * 3 2 1 * 10987654321098765432109876543210 - * 001000 01001001101 + * 001000 x1100010101 * rt ----- * rs ----- * rd -----
@@ -14468,11 +14483,11 @@ std::string NMD::SHRLV_PH(uint64 instruction) /* - * + * [DSP] SHLLV.QB rd, rt, rs - Shift right logical variable vector quad bytes * * 3 2 1 * 10987654321098765432109876543210 - * 001000 01001001101 + * 001000 x1101010101 * rt ----- * rs ----- * rd -----
@@ -15032,8 +15047,8 @@ std::string NMD::SUBQ_PH(uint64 instruction) /* - * SUBQH.PH rd, rt, rs - Subtract Fractional Halfword Vectors And Shift Right - * to Halve Results + * [DSP] SUBQ.S.PH rd, rt, rs - Subtract fractional halfword vectors and shift + * right to halve results * * 3 2 1 * 10987654321098765432109876543210
@@ -15057,8 +15072,8 @@ std::string NMD::SUBQ_S_PH(uint64 instruction) /* - * SUBQH.PH rd, rt, rs - Subtract Fractional Halfword Vectors And Shift Right - * to Halve Results + * [DSP] SUBQ.S.W rd, rt, rs - Subtract fractional halfword vectors and shift + * right to halve results * * 3 2 1 * 10987654321098765432109876543210
@@ -15082,8 +15097,8 @@ std::string NMD::SUBQ_S_W(uint64 instruction) /* - * SUBQH.PH rd, rt, rs - Subtract Fractional Halfword Vectors And Shift Right - * to Halve Results + * [DSP] SUBQH.PH rd, rt, rs - Subtract fractional halfword vectors and shift + * right to halve results * * 3 2 1 * 10987654321098765432109876543210
@@ -15107,8 +15122,8 @@ std::string NMD::SUBQH_PH(uint64 instruction) /* - * SUBQH.PH rd, rt, rs - Subtract Fractional Halfword Vectors And Shift Right - * to Halve Results + * [DSP] SUBQH_R.PH rd, rt, rs - Subtract fractional halfword vectors and shift + * right to halve results * * 3 2 1 * 10987654321098765432109876543210
@@ -15132,8 +15147,8 @@ std::string NMD::SUBQH_R_PH(uint64 instruction) /* - * SUBQH_R.PH rd, rt, rs - Subtract Fractional Halfword Vectors And Shift Right - * to Halve Results (rounding) + * [DSP] SUBQH_R.W rd, rt, rs - Subtract fractional halfword vectors and shift + * right to halve results with rounding * * 3 2 1 * 10987654321098765432109876543210
@@ -15157,8 +15172,8 @@ std::string NMD::SUBQH_R_W(uint64 instruction) /* - * SUBQH.W rd, rs, rt - Subtract Fractional Words And Shift Right to Halve - * Results + * [DSP] SUBQH.W rd, rs, rt - Subtract fractional words and shift right to + * halve results * * 3 2 1 * 10987654321098765432109876543210
@@ -15279,7 +15294,7 @@ std::string NMD::SUBU_QB(uint64 instruction) /* * [DSP] SUBU_S.PH rd, rs, rt - Subtract unsigned unsigned halfwords with - * 8-bit saturation + * 8-bit saturation * * 3 2 1 * 10987654321098765432109876543210
@@ -15304,7 +15319,7 @@ std::string NMD::SUBU_S_PH(uint64 instruction) /* * [DSP] SUBU_S.QB rd, rs, rt - Subtract unsigned quad byte vectors with - * 8-bit saturation + * 8-bit saturation * * 3 2 1 * 10987654321098765432109876543210
@@ -15329,7 +15344,7 @@ std::string NMD::SUBU_S_QB(uint64 instruction) /* * [DSP] SUBUH.QB rd, rs, rt - Subtract unsigned bytes and right shift - * to halve results + * to halve results * * 3 2 1 * 10987654321098765432109876543210
@@ -15354,7 +15369,7 @@ std::string NMD::SUBUH_QB(uint64 instruction) /* * [DSP] SUBUH_R.QB rd, rs, rt - Subtract unsigned bytes and right shift - * to halve results with rounding + * to halve results with rounding * * 3 2 1 * 10987654321098765432109876543210
Signature · 1 line
2.7.4
PATCH v4 9/9 target/mips: Add support for DSPRAM
In reply to Aleksandar MarkovicFrom: Yongbok Kim <[email protected]>
The optional Data Scratch Pad RAM (DSPRAM) block provides a general scratch pad RAM used for temporary storage of data. The DSPRAM provides a connection to on-chip memory or memory-mapped registers, which are accessed in parallel with the L1 data cache to minimize access latency
--- default-configs/mips-softmmu-common.mak | 1 + hw/mips/cps.c | 3 ++- hw/mips/mips_malta.c | 31 +++++++++++++++++++++++++++++++ hw/misc/Makefile.objs | 1 + include/hw/mips/cps.h | 2 ++ target/mips/cpu.h | 5 +++++ target/mips/internal.h | 1 + target/mips/op_helper.c | 10 ++++++++++ target/mips/translate.c | 8 ++++++++ target/mips/translate_init.inc.c | 2 ++ 10 files changed, 63 insertions(+), 1 deletion(-)
default-configs/mips-softmmu-common.mak +1 -0
@@ -35,6 +35,7 @@ CONFIG_ISA_TESTDEV=y CONFIG_EMPTY_SLOT=y CONFIG_MIPS_CPS=y CONFIG_MIPS_ITU=y +CONFIG_MIPS_DSPRAM=y CONFIG_I2C=y CONFIG_R4K=y CONFIG_MALTA=y
hw/mips/cps.c +2 -1
@@ -102,7 +102,8 @@ static void mips_cps_realize(DeviceState *dev, Error **errp)object_property_set_bool (OBJECT (&s->itu), saar_present,"saar-present" , &err);if (saar_present) { -qdev_prop_set_ptr (DEVICE (&s->itu),"saar" , (void *)&env->CP0_SAAR); +qdev_prop_set_ptr (DEVICE (&s->itu),"saar" , + (void *) &env->CP0_SAAR[0 ]); }object_property_set_bool (OBJECT (&s->itu), true,"realized" , &err);if (err !=NULL ) {
hw/mips/mips_malta.c +31 -0
@@ -1170,6 +1170,36 @@ static void create_cps(MaltaState *s, const char *cpu_type, *cbus_irq =NULL ; } +static void create_dspram (void ) +{ +MIPSCPU *cpu =MIPS_CPU (first_cpu); +CPUMIPSState *env = &cpu->env; +bool dspram_present = (bool ) env->dspramp; +Error *err =NULL ; + + env->dspram =g_new0 (MIPSDSPRAMState,1 ); + +/* DSPRAM */ +if (dspram_present) { +if (!(bool ) env->saarp) { +error_report ("%s: DSPRAM requires SAAR registers" , __func__); +exit (1 ); + } +object_initialize (env->dspram,sizeof (MIPSDSPRAMState), +TYPE_MIPS_DSPRAM ); +qdev_set_parent_bus (DEVICE (env->dspram),sysbus_get_default ()); +qdev_prop_set_ptr (DEVICE (env->dspram),"saar" , + (void *) &env->CP0_SAAR[1 ]); +object_property_set_bool (OBJECT (env->dspram), true,"realized" , &err); +if (err !=NULL ) { +error_report ("%s: DSPRAM initialisation failed" , __func__); +exit (1 ); + } +memory_region_add_subregion (get_system_memory (),0 , +sysbus_mmio_get_region (SYS_BUS_DEVICE (env->dspram),0 )); + } +} +static void mips_create_cpu (MaltaState *s,const char *cpu_type,qemu_irq *cbus_irq,qemu_irq *i8259_irq) {
@@ -1178,6 +1208,7 @@ static void mips_create_cpu(MaltaState *s, const char *cpu_type, }else {create_cpu_without_cps (cpu_type, cbus_irq, i8259_irq); } +create_dspram (); } static
hw/misc/Makefile.objs +1 -0
@@ -60,6 +60,7 @@ obj-$(CONFIG_STM32F2XX_SYSCFG) += stm32f2xx_syscfg.o obj-$(CONFIG_MIPS_CPS) += mips_cmgcr.o obj-$(CONFIG_MIPS_CPS) += mips_cpc.o obj-$(CONFIG_MIPS_ITU) += mips_itu.o +obj-$(CONFIG_MIPS_DSPRAM) += mips_dspram.o obj-$(CONFIG_MPS2_FPGAIO) += mps2-fpgaio.o obj-$(CONFIG_MPS2_SCC) += mps2-scc.o
include/hw/mips/cps.h +2 -0
@@ -25,6 +25,7 @@#include "hw/intc/mips_gic.h" #include "hw/misc/mips_cpc.h" #include "hw/misc/mips_itu.h" +#include "hw/misc/mips_dspram.h" #define TYPE_MIPS_CPS "mips-cps"#define MIPS_CPS (obj) OBJECT_CHECK(MIPSCPSState, (obj), TYPE_MIPS_CPS)
@@ -41,6 +42,7 @@ typedef struct MIPSCPSState {MIPSGICState gic;MIPSCPCState cpc;MIPSITUState itu; +MIPSDSPRAMState dspram; } MIPSCPSState;qemu_irq get_cps_irq (MIPSCPSState *cps,int pin_number);
target/mips/cpu.h +5 -0
@@ -1022,6 +1022,7 @@ struct CPUMIPSState {uint32_t CP0_TCStatus_rw_bitmask;/* Read/write bits in CP0_TCStatus */ uint64_t insn_flags;/* Supported instruction set */ int saarp; +int dspramp;/* Fields up to this point are cleared by a CPU reset */ struct {} end_reset_fields;
@@ -1039,6 +1040,7 @@ struct CPUMIPSState {QEMUTimer *timer;/* Internal timer */ struct MIPSITUState *itu;MemoryRegion *itc_tag;/* ITC Configuration Tags */ +struct MIPSDSPRAMState *dspram;target_ulong exception_base;/* ExceptionBase input to the core */ };
@@ -1181,6 +1183,9 @@ void cpu_mips_soft_irq(CPUMIPSState *env, int irq, int level);/* mips_itu.c */ void itc_reconfigure (struct MIPSITUState *tag); +/* mips_dspram.c */ +void dspram_reconfigure (struct MIPSDSPRAMState *dspram); +/* helper.c */ target_ulong exception_resume_pc (CPUMIPSState *env);
target/mips/internal.h +1 -0
@@ -62,6 +62,7 @@ struct mips_def_t {uint64_t insn_flags;enum mips_mmu_types mmu_type;int32_t SAARP ; +int32_t DSPRAMP ; };extern const struct mips_def_t mips_defs[];
target/mips/op_helper.c +10 -0
@@ -1614,6 +1614,11 @@ void helper_mtc0_saar(CPUMIPSState *env, target_ulong arg1)itc_reconfigure (env->itu); }break ; +case 1 : +if (env->dspram) { +dspram_reconfigure (env->dspram); + } +break ; } } }
@@ -1631,6 +1636,11 @@ void helper_mthc0_saar(CPUMIPSState *env, target_ulong arg1)itc_reconfigure (env->itu); }break ; +case 1 : +if (env->dspram) { +dspram_reconfigure (env->dspram); + } +break ; } } }
target/mips/translate.c +8 -0
@@ -29925,6 +29925,8 @@ void cpu_state_reset(CPUMIPSState *env) env->active_fpu.fcr31 = env->cpu_model->CP1_fcr31; env->msair = env->cpu_model->MSAIR; env->insn_flags = env->cpu_model->insn_flags; + env->saarp = env->cpu_model->SAARP; + env->dspramp = env->cpu_model->DSPRAMP;#if defined(CONFIG_USER_ONLY ) env->CP0_Status = (MIPS_HFLAG_UM << CP0St_KSU);
@@ -30079,6 +30081,12 @@ void cpu_state_reset(CPUMIPSState *env)msa_reset (env); } +/* DSPRAM */ +if (env->dspramp) { +/* Fixed DSPRAM size with Default Value */ + env->CP0_SAAR[1 ] =0x10 <<1 ; + } +compute_hflags (env);restore_fp_status (env);restore_pamask (env);
target/mips/translate_init.inc.c +2 -0
@@ -760,6 +760,8 @@ const mips_def_t mips_defs[] = .PABITS = 48, .insn_flags = CPU_MIPS64R6 | ASE_MSA, .mmu_type = MMU_TYPE_R4000, + .SAARP = 1, + .DSPRAMP = 1, }, { .name = "Loongson-2E",
Signature · 1 line
2.7.4
Re: [Qemu-devel] [PATCH v4 9/9] target/mips: Add support for DSPRAM
Hi Yongbok, Aleksandar.
(I believe this is the v6 of this patched, included in a v4 series).
Quoted 6 lines · Aleksandar Markovic
From: Yongbok Kim <[email protected]>
The optional Data Scratch Pad RAM (DSPRAM) block provides a general scratch pad RAM used for temporary storage of data. The DSPRAM provides a connection to on-chip memory or memory-mapped registers, which are accessed in parallel with the L1 data cache to minimize access latency
I made some comments around, but the most important is simply:
"please move create_dspram() into mips_cps".
Now I also made high level review (long mail, sorry), thus I Cc'ed Peter/Luc/Alistair who worked on multi-core object design in QEMU.
Quoted 33 lines
Signed-off-by Yongbok Kim <[email protected]>Signed-off-by Aleksandar Markovic <[email protected]>--- default-configs/mips-softmmu-common.mak | 1 + hw/mips/cps.c | 3 ++- hw/mips/mips_malta.c | 31 +++++++++++++++++++++++++++++++ hw/misc/Makefile.objs | 1 + include/hw/mips/cps.h | 2 ++ target/mips/cpu.h | 5 +++++ target/mips/internal.h | 1 + target/mips/op_helper.c | 10 ++++++++++ target/mips/translate.c | 8 ++++++++ target/mips/translate_init.inc.c | 2 ++ 10 files changed, 63 insertions(+), 1 deletion(-)default-configs/mips-softmmu-common.mak +1
-0@@ -35,6 +35,7 @@ CONFIG_ISA_TESTDEV=y CONFIG_EMPTY_SLOT=y CONFIG_MIPS_CPS=y CONFIG_MIPS_ITU=y +CONFIG_MIPS_DSPRAM=y CONFIG_I2C=y CONFIG_R4K=y CONFIG_MALTA=yhw/mips/cps.c +0
-0
hw/mips/cps.c static void mips_cps_realize(DeviceState *dev, Error **errp) · line 106
Quoted 6 lines
hw/mips/cps.c +2
-1@@ -102,7 +102,8 @@ static void mips_cps_realize(DeviceState *dev, Error **errp)object_property_set_bool (OBJECT (&s->itu), saar_present,"saar-present" , &err);if (saar_present) { -qdev_prop_set_ptr (DEVICE (&s->itu),"saar" , (void *)&env->CP0_SAAR); +qdev_prop_set_ptr (DEVICE (&s->itu),"saar" , + (void *) &env->CP0_SAAR[0 ]);
No need to cast.
Quoted 15 lines
hw/mips/cps.c +0
-0}object_property_set_bool (OBJECT (&s->itu), true,"realized" , &err);if (err !=NULL ) {hw/mips/mips_malta.c +4
-0@@ -1170,6 +1170,36 @@ static void create_cps(MaltaState *s, const char *cpu_type, *cbus_irq =NULL ; } +static void create_dspram (void ) +{ +MIPSCPU *cpu =MIPS_CPU (first_cpu); +CPUMIPSState *env = &cpu->env;
hw/mips/mips_malta.c static void create_cps(MaltaState *s, const char *cpu_type, · line 1186
Quoted 10 lines
hw/mips/mips_malta.c +10
-0+bool dspram_present = (bool ) env->dspramp; +Error *err =NULL ; + + env->dspram =g_new0 (MIPSDSPRAMState,1 ); + +/* DSPRAM */ +if (dspram_present) { +if (!(bool ) env->saarp) { +error_report ("%s: DSPRAM requires SAAR registers" , __func__); +exit (1 );
I recommend you to give this function a 'Error **errp' argument and set errp here, and call it with errp=&error_fatal. This will help further improvement of the DSPRAM as QOM and add qtesting.
hw/mips/mips_malta.c static void create_cps(MaltaState *s, const char *cpu_type, · line 1192
Quoted 6 lines
hw/mips/mips_malta.c +6
-0+ } +object_initialize (env->dspram,sizeof (MIPSDSPRAMState), +TYPE_MIPS_DSPRAM ); +qdev_set_parent_bus (DEVICE (env->dspram),sysbus_get_default ()); +qdev_prop_set_ptr (DEVICE (env->dspram),"saar" , + (void *) &env->CP0_SAAR[1 ]);
Again, you can drop the cast.
hw/mips/mips_malta.c static void create_cps(MaltaState *s, const char *cpu_type, · line 1196
Quoted 4 lines
hw/mips/mips_malta.c +4
-0+object_property_set_bool (OBJECT (env->dspram), true,"realized" , &err); +if (err !=NULL ) { +error_report ("%s: DSPRAM initialisation failed" , __func__); +exit (1 );
This now becomes error_propagate().
hw/mips/mips_malta.c static void create_cps(MaltaState *s, const char *cpu_type, · line 1198
Quoted 2 lines
hw/mips/mips_malta.c +2
-0+ } + memory_region_add_subregion(get_system_memory(), 0,
Here you map the DSPRAM at 0x0 of the whole system memory... This is currently not wrong, because the model is limited, but this doesn't scale at all. Also it is not obvious base address 0x0 is the reset value of the SAAR register. Can you add a comment?
hw/mips/mips_malta.c static void mips_create_cpu(MaltaState *s, const char *cpu_type, · line 1211
Quoted 12 lines
hw/mips/mips_malta.c +5
-0+ sysbus_mmio_get_region(SYS_BUS_DEVICE(env->dspram), 0)); + } +} +static void mips_create_cpu (MaltaState *s,const char *cpu_type,qemu_irq *cbus_irq,qemu_irq *i8259_irq) {@@ -1178,6 +1208,7 @@ static void mips_create_cpu(MaltaState *s, const char *cpu_type, }else {create_cpu_without_cps (cpu_type, cbus_irq, i8259_irq); } +create_dspram ();
Well, the DSPRAM is definitively not a machine feature, but a SoC one.
The current implementation doesn't differency between Cluster/Core/Thread. QEMU is not very clear about that (yet). Recently the TYPE_CPU_CLUSTER got introduced.
The CPS is actually a "Core" which creates various virtual processors (threads), an ITU, and is where the DSPRAM belongs.
Note that there is no multi-cluster model, we can see the current model as a single cluster of a single core. This core can has upto 'num-vp' threads.
A core share an ITU and a DSPRAM between all his threads. There is an unique SAAR register per core.
Each thread is a QEMU MIPS_CPU, and has his own SAARI register.
My understanding is the following schema:
+---------------------------------------------------+ | +-------------------------------------------+ | | | +-----------------------------+ +-----+ | | | | | | | IOCU| | | | | | +---------+ +------+ | +-----+ | | | | | | | |DSPRAM| +---+ +--+ | | | | | +-------+---+ +------+ | | | | | | | | | | | | | | | | | | | +-+ +--------+--+ | +---+ | | | | | | | | | | | | | | | | | | +--+ +--------+--+ | | | | | | | | | | | | | | | | | | | | | +---+ +--+ Thread | | | | | | | | | | |ITU| | | | | | | | | | | | +---+ +-----------+ | | | | | | | | +---------------------- Core--+ | | | | | | | | | | | | | | | +---+-------------------Core--+ | | | | | | | | | | | | | +----+ +-----------------------Core--+ | | | | | |IOCU| | | | | | +----+ | | | | +---------------------------------Cluster---+ | | | | | | | +---------------------------------Cluster--+ | | | +-------------I6500 Multiprocessing System----------+
Moving the create_dspram() code in cps.c, you already has access to saar_present and also the the 'container' object representing the Core. This allow you to restrict the DSPRAM to the Core (instead of having it exposed to the whole system), registering it as a subregion of the Core (=container).
Since this version still [*] doesn't include content of hw/misc/mips_dspram.c I'm unable to understand/test the extend of this device implementation.
From the System Programmer’s Guide:
"SPRAM blocks can be as small as 4 K and as large as 1 MB. The tags and sizes of all SPRAMs are configured at build time and are not modifiable by software."
And:
"When the TARGET field of the SAARI register is set to 0x01, kernel software programs the SAAR register with the base address and size of the DSPRAM block. Hardware then uses this information to program the internal SAAR1_DSPRAM register that is dedicated to the DSPRAM, thereby setting the base address and the size of the DSPRAM block."
Although I understand you are modelling this for the I6500, I still prefer this base addr to be explicit.
Since the SPRAM addr/sizes are variables, we should use them as object property.
[*] https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg02670.html
Quoted 28 lines
hw/mips/mips_malta.c +0
-0} statichw/misc/Makefile.objs +1
-0@@ -60,6 +60,7 @@ obj-$(CONFIG_STM32F2XX_SYSCFG) += stm32f2xx_syscfg.o obj-$(CONFIG_MIPS_CPS) += mips_cmgcr.o obj-$(CONFIG_MIPS_CPS) += mips_cpc.o obj-$(CONFIG_MIPS_ITU) += mips_itu.o +obj-$(CONFIG_MIPS_DSPRAM) += mips_dspram.o obj-$(CONFIG_MPS2_FPGAIO) += mps2-fpgaio.o obj-$(CONFIG_MPS2_SCC) += mps2-scc.oinclude/hw/mips/cps.h +1
-0@@ -25,6 +25,7 @@#include "hw/intc/mips_gic.h" #include "hw/misc/mips_cpc.h" #include "hw/misc/mips_itu.h" +#include "hw/misc/mips_dspram.h" #define TYPE_MIPS_CPS "mips-cps"#define MIPS_CPS (obj) OBJECT_CHECK(MIPSCPSState, (obj), TYPE_MIPS_CPS)
include/hw/mips/cps.h typedef struct MIPSCPSState { · line 45
Quoted 4 lines
include/hw/mips/cps.h +1
-0@@ -41,6 +42,7 @@ typedef struct MIPSCPSState {MIPSGICState gic;MIPSCPCState cpc;MIPSITUState itu; +MIPSDSPRAMState dspram;
Again, no idea how is defined MIPSDSPRAMState, hard to review...
Quoted 38 lines
include/hw/mips/cps.h +0
-0} MIPSCPSState;qemu_irq get_cps_irq (MIPSCPSState *cps,int pin_number);target/mips/cpu.h +5
-0@@ -1022,6 +1022,7 @@ struct CPUMIPSState {uint32_t CP0_TCStatus_rw_bitmask;/* Read/write bits in CP0_TCStatus */ uint64_t insn_flags;/* Supported instruction set */ int saarp; +int dspramp;/* Fields up to this point are cleared by a CPU reset */ struct {} end_reset_fields;@@ -1039,6 +1040,7 @@ struct CPUMIPSState {QEMUTimer *timer;/* Internal timer */ struct MIPSITUState *itu;MemoryRegion *itc_tag;/* ITC Configuration Tags */ +struct MIPSDSPRAMState *dspram;target_ulong exception_base;/* ExceptionBase input to the core */ };@@ -1181,6 +1183,9 @@ void cpu_mips_soft_irq(CPUMIPSState *env, int irq, int level);/* mips_itu.c */ void itc_reconfigure (struct MIPSITUState *tag); +/* mips_dspram.c */ +void dspram_reconfigure (struct MIPSDSPRAMState *dspram); +/* helper.c */ target_ulong exception_resume_pc (CPUMIPSState *env);target/mips/internal.h +0
-0
target/mips/internal.h struct mips_def_t { · line 65
Quoted 4 lines
target/mips/internal.h +1
-0@@ -62,6 +62,7 @@ struct mips_def_t {uint64_t insn_flags;enum mips_mmu_types mmu_type;int32_t SAARP ; +int32_t DSPRAMP ;
Since 'P' is for is_Present, why not use a boolean?
Quoted 8 lines
target/mips/internal.h +0
-0};extern const struct mips_def_t mips_defs[];target/mips/op_helper.c +0
-0
target/mips/op_helper.c void helper_mtc0_saar(CPUMIPSState *env, target_ulong arg1) · line 1620
Quoted 7 lines
target/mips/op_helper.c +4
-0@@ -1614,6 +1614,11 @@ void helper_mtc0_saar(CPUMIPSState *env, target_ulong arg1)itc_reconfigure (env->itu); }break ; +case 1 : +if (env->dspram) { +dspram_reconfigure (env->dspram); + }
else?
target/mips/op_helper.c void helper_mtc0_saar(CPUMIPSState *env, target_ulong arg1) · line 1621
Quoted 1 line
target/mips/op_helper.c +1
-0+break ;
I'd add an explicit:
default:
/* "Writes to reserved values will be dropped." */
break;target/mips/op_helper.c void helper_mthc0_saar(CPUMIPSState *env, target_ulong arg1) · line 1643
Quoted 12 lines
target/mips/op_helper.c +5
-0} } }@@ -1631,6 +1636,11 @@ void helper_mthc0_saar(CPUMIPSState *env, target_ulong arg1)itc_reconfigure (env->itu); }break ; +case 1 : +if (env->dspram) { +dspram_reconfigure (env->dspram); + } +break ;
Ditto.
target/mips/op_helper.c void helper_mthc0_saar(CPUMIPSState *env, target_ulong arg1) · line 1646
Quoted 3 lines
target/mips/op_helper.c +0
-0} } }
mf[h]c0_saar() return from env->CP0_SAAR: no need to add helpers, OK.
Quoted 14 lines
target/mips/translate.c +2
-0@@ -29925,6 +29925,8 @@ void cpu_state_reset(CPUMIPSState *env) env->active_fpu.fcr31 = env->cpu_model->CP1_fcr31; env->msair = env->cpu_model->MSAIR; env->insn_flags = env->cpu_model->insn_flags; + env->saarp = env->cpu_model->SAARP; + env->dspramp = env->cpu_model->DSPRAMP;#if defined(CONFIG_USER_ONLY ) env->CP0_Status = (MIPS_HFLAG_UM << CP0St_KSU);
target/mips/translate.c void cpu_state_reset(CPUMIPSState *env) · line 30087
Quoted 7 lines
target/mips/translate.c +4
-0@@ -30079,6 +30081,12 @@ void cpu_state_reset(CPUMIPSState *env)msa_reset (env); } +/* DSPRAM */ +if (env->dspramp) { +/* Fixed DSPRAM size with Default Value */ + env->CP0_SAAR[1 ] =0x10 <<1 ;
Hmmmmm this start to get messy...CP0_SAAR is not thread-related, but core-related. Remember, Mips Core = container of Mips threads (aka QEMU MIPS_CPU).
So the CP0_SAAR should redirect to the container object, and this register is reset only once in that object reset handler.
Now each thread do have a SAARI register.
I think how this object model is currently implemented in QEMU is via 'link property'. You instanciate the Core container, then create threads that expects DEFINE_PROP_LINK. You set the thread's link property with the container object, then the thread can access the container member (CP0_SAAR).
64KiB is indeed the default reset value for the I6500, and default base address 0x00000000_00000000.
Isn't the size a cpu-specific value (and belongs to mips_defs[])?
What about adding mips_defs[I6500].dspram_size = 0x10 and use this value in the reset handler? ...
Quoted 10 lines
target/mips/translate.c +2
-0+ } +compute_hflags (env);restore_fp_status (env);restore_pamask (env);target/mips/translate_init.inc.c +0
-0
target/mips/translate_init.inc.c const mips_def_t mips_defs[] = · line 764
Quoted 5 lines
target/mips/translate_init.inc.c +2
-0@@ -760,6 +760,8 @@ const mips_def_t mips_defs[] = .PABITS = 48, .insn_flags = CPU_MIPS64R6 | ASE_MSA, .mmu_type = MMU_TYPE_R4000, + .SAARP = 1, + .DSPRAMP = 1,
... We could even use directly 'dspram_size' and consider a size of zero as Data Scratchpad RAM not present (.DSPRAMP = 0):
.dspram_size = 0x10, /* 64 KiB of Data Scratchpad RAM */
So we can remove env->dspramp and mips_defs.DSPRAMP variables, and check:
/* DSPRAM */
if (env->cpu_model->dspram_size) {
/* Default DSPRAM size value, base address 0x0..0 */
env->CP0_SAAR[1] = env->cpu_model->dspram_size << 1;But still I'd rather use a property link... such:
env->CP0_SAAR[1] = core_container_of(env)->dspram_size << 1;
target/mips/translate_init.inc.c const mips_def_t mips_defs[] = · line 767
Quoted 4 lines
target/mips/translate_init.inc.c +0
-0}, { .name = "Loongson-2E",
I apologize it took me 5 months to review this, and for the long mail!
Regards,
Phil.
Re: [Qemu-devel] [PATCH v4 9/9] target/mips: Add support for DSPRAM
Quoted 4 lines
From: Philippe Mathieu-Daudé <[email protected]>
Subject: Re: [Qemu-devel] [PATCH v4 9/9] target/mips: Add support for DSPRAM(I believe this is the v6 of this patched, included in a v4 series).
Yes, there was a previous version of this patch in Oct 2028, but it wasn't accepted at that time.
Quoted 2 lines
I made some comments around, but the most important is simply:
"please movecreate_dspram()intomips_cps".
I appreciate your review, Philippe, thanks. I am going to send a new version of this patch (or perhaps a small series with equivalent content) in next few days.
Yours,
Aleksandar