target/mips: Mips improvements for 4.1
cover target/mips: Mips improvements for 4.1
From: Aleksandar Markovic <[email protected]>
A collection of misc MIPS improvements that would be nice to be integrated into 4.1.
Aleksandar Markovic (7):
tcg/tests: target/mips: Amend MSA fixed point multiply tests tcg/tests: target/mips: Amend MSA integer multiply tests target/mips: Correct comments in msa_helper.c target/mips: Correct comments in translate.c
tcg/tests: target/mips: Correct MSA test compilation and execution
order
target/mips: Unroll loops for MSA float max/min instructions target/mips: Correct helper for MSA FCLASS.<W|D> instructions
target/mips/msa_helper.c | 244 ++++++++++----- target/mips/translate.c | 347 +++++++++++++-------- tests/tcg/mips/include/wrappers_msa.h | 16 + .../ase/msa/fixed-multiply/test_msa_madd_q_h.c | 216 +++++++++++++ .../ase/msa/fixed-multiply/test_msa_madd_q_w.c | 216 +++++++++++++ .../ase/msa/fixed-multiply/test_msa_maddr_q_h.c | 216 +++++++++++++ .../ase/msa/fixed-multiply/test_msa_maddr_q_w.c | 216 +++++++++++++ .../ase/msa/fixed-multiply/test_msa_msub_q_h.c | 216 +++++++++++++ .../ase/msa/fixed-multiply/test_msa_msub_q_w.c | 216 +++++++++++++ .../ase/msa/fixed-multiply/test_msa_msubr_q_h.c | 216 +++++++++++++ .../ase/msa/fixed-multiply/test_msa_msubr_q_w.c | 216 +++++++++++++ .../user/ase/msa/int-multiply/test_msa_maddv_b.c | 224 ++++++------- .../user/ase/msa/int-multiply/test_msa_maddv_d.c | 214 ++++++------- .../user/ase/msa/int-multiply/test_msa_maddv_h.c | 224 ++++++------- .../user/ase/msa/int-multiply/test_msa_maddv_w.c | 224 ++++++------- .../user/ase/msa/int-multiply/test_msa_msubv_b.c | 224 ++++++------- .../user/ase/msa/int-multiply/test_msa_msubv_d.c | 224 ++++++------- .../user/ase/msa/int-multiply/test_msa_msubv_h.c | 224 ++++++------- .../user/ase/msa/int-multiply/test_msa_msubv_w.c | 224 ++++++------- .../mips/user/ase/msa/test_msa_compile_32r6eb.sh | 32 +- .../mips/user/ase/msa/test_msa_compile_32r6el.sh | 32 +- .../mips/user/ase/msa/test_msa_compile_64r6eb.sh | 32 +- .../mips/user/ase/msa/test_msa_compile_64r6el.sh | 32 +- tests/tcg/mips/user/ase/msa/test_msa_run_32r6eb.sh | 16 +- tests/tcg/mips/user/ase/msa/test_msa_run_32r6el.sh | 16 +- tests/tcg/mips/user/ase/msa/test_msa_run_64r6eb.sh | 16 +- tests/tcg/mips/user/ase/msa/test_msa_run_64r6el.sh | 16 +- 27 files changed, 3165 insertions(+), 1144 deletions(-) create mode 100644 tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_madd_q_h.c create mode 100644 tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_madd_q_w.c create mode 100644 tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_maddr_q_h.c create mode 100644 tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_maddr_q_w.c create mode 100644 tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msub_q_h.c create mode 100644 tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msub_q_w.c create mode 100644 tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msubr_q_h.c create mode 100644 tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msubr_q_w.c
Signature · 1 line
2.7.4
PATCH 1/7 tcg/tests: target/mips: Amend MSA fixed point multiply tests
From: Aleksandar Markovic <[email protected]>
Amend MSA fixed point multiply tests: add tests for MADD_Q.H, MADD_Q.W, MADDR_Q.H, MADDR_Q.W, MSUB_Q.H, MSUB_Q.W, MSUBR_Q.H and MSUBR_Q.W.
--- tests/tcg/mips/include/wrappers_msa.h | 16 ++ .../ase/msa/fixed-multiply/test_msa_madd_q_h.c | 216 +++++++++++++++++++++ .../ase/msa/fixed-multiply/test_msa_madd_q_w.c | 216 +++++++++++++++++++++ .../ase/msa/fixed-multiply/test_msa_maddr_q_h.c | 216 +++++++++++++++++++++ .../ase/msa/fixed-multiply/test_msa_maddr_q_w.c | 216 +++++++++++++++++++++ .../ase/msa/fixed-multiply/test_msa_msub_q_h.c | 216 +++++++++++++++++++++ .../ase/msa/fixed-multiply/test_msa_msub_q_w.c | 216 +++++++++++++++++++++ .../ase/msa/fixed-multiply/test_msa_msubr_q_h.c | 216 +++++++++++++++++++++ .../ase/msa/fixed-multiply/test_msa_msubr_q_w.c | 216 +++++++++++++++++++++ .../mips/user/ase/msa/test_msa_compile_32r6eb.sh | 16 ++ .../mips/user/ase/msa/test_msa_compile_32r6el.sh | 16 ++ .../mips/user/ase/msa/test_msa_compile_64r6eb.sh | 16 ++ .../mips/user/ase/msa/test_msa_compile_64r6el.sh | 16 ++ tests/tcg/mips/user/ase/msa/test_msa_run_32r6eb.sh | 8 + tests/tcg/mips/user/ase/msa/test_msa_run_32r6el.sh | 8 + tests/tcg/mips/user/ase/msa/test_msa_run_64r6eb.sh | 8 + tests/tcg/mips/user/ase/msa/test_msa_run_64r6el.sh | 8 + 17 files changed, 1840 insertions(+) create mode 100644 tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_madd_q_h.c create mode 100644 tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_madd_q_w.c create mode 100644 tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_maddr_q_h.c create mode 100644 tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_maddr_q_w.c create mode 100644 tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msub_q_h.c create mode 100644 tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msub_q_w.c create mode 100644 tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msubr_q_h.c create mode 100644 tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msubr_q_w.c
tests/tcg/mips/include/wrappers_msa.h +16 -0
@@ -252,16 +252,32 @@ DO_MSA__WD__WS_WT(BNEG_D, bneg.d)*/ DO_MSA__WD__WS_WT(MADD_Q_H, madd_q.h) +DO_MSA__WD__WD_WT(MADD_Q_H__DDT, madd_q.h) +DO_MSA__WD__WS_WD(MADD_Q_H__DSD, madd_q.h) DO_MSA__WD__WS_WT(MADD_Q_W, madd_q.w) +DO_MSA__WD__WD_WT(MADD_Q_W__DDT, madd_q.w) +DO_MSA__WD__WS_WD(MADD_Q_W__DSD, madd_q.w) DO_MSA__WD__WS_WT(MADDR_Q_H, maddr_q.h) +DO_MSA__WD__WD_WT(MADDR_Q_H__DDT, maddr_q.h) +DO_MSA__WD__WS_WD(MADDR_Q_H__DSD, maddr_q.h) DO_MSA__WD__WS_WT(MADDR_Q_W, maddr_q.w) +DO_MSA__WD__WD_WT(MADDR_Q_W__DDT, maddr_q.w) +DO_MSA__WD__WS_WD(MADDR_Q_W__DSD, maddr_q.w) DO_MSA__WD__WS_WT(MSUB_Q_H, msub_q.h) +DO_MSA__WD__WD_WT(MSUB_Q_H__DDT, msub_q.h) +DO_MSA__WD__WS_WD(MSUB_Q_H__DSD, msub_q.h) DO_MSA__WD__WS_WT(MSUB_Q_W, msub_q.w) +DO_MSA__WD__WD_WT(MSUB_Q_W__DDT, msub_q.w) +DO_MSA__WD__WS_WD(MSUB_Q_W__DSD, msub_q.w) DO_MSA__WD__WS_WT(MSUBR_Q_H, msubr_q.h) +DO_MSA__WD__WD_WT(MSUBR_Q_H__DDT, msubr_q.h) +DO_MSA__WD__WS_WD(MSUBR_Q_H__DSD, msubr_q.h) DO_MSA__WD__WS_WT(MSUBR_Q_W, msubr_q.w) +DO_MSA__WD__WD_WT(MSUBR_Q_W__DDT, msubr_q.w) +DO_MSA__WD__WS_WD(MSUBR_Q_W__DSD, msubr_q.w) DO_MSA__WD__WS_WT(MUL_Q_H, mul_q.h)DO_MSA__WD__WS_WT (MUL_Q_W , mul_q.w)
tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_madd_q_h.c new file +216 -0
216 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_madd_q_w.c new file +216 -0
216 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_maddr_q_h.c new file +216 -0
216 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_maddr_q_w.c new file +216 -0
216 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msub_q_h.c new file +216 -0
216 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msub_q_w.c new file +216 -0
216 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msubr_q_h.c new file +216 -0
216 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msubr_q_w.c new file +216 -0
216 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/test_msa_compile_32r6eb.sh +16 -0
@@ -88,6 +88,22 @@ # Fixed Multiply # -------------- # +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_madd_q_h.c \ +-EB -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_madd_q_h_32r6eb +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_madd_q_w.c \ +-EB -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_madd_q_w_32r6eb +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_maddr_q_h.c \ +-EB -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_maddr_q_h_32r6eb +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_maddr_q_w.c \ +-EB -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_maddr_q_w_32r6eb +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_msub_q_h.c \ +-EB -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_msub_q_h_32r6eb +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_msub_q_w.c \ +-EB -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_msub_q_w_32r6eb +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_msubr_q_h.c \ +-EB -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_msubr_q_h_32r6eb +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_msubr_q_w.c \ +-EB -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_msubr_q_w_32r6eb /opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_mul_q_h.c \ -EB -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_mul_q_h_32r6eb /opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_mul_q_w.c \
tests/tcg/mips/user/ase/msa/test_msa_compile_32r6el.sh +16 -0
@@ -88,6 +88,22 @@ # Fixed Multiply # -------------- # +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_madd_q_h.c \ +-EL -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_madd_q_h_32r6el +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_madd_q_w.c \ +-EL -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_madd_q_w_32r6el +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_maddr_q_h.c \ +-EL -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_maddr_q_h_32r6el +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_maddr_q_w.c \ +-EL -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_maddr_q_w_32r6el +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_msub_q_h.c \ +-EL -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_msub_q_h_32r6el +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_msub_q_w.c \ +-EL -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_msub_q_w_32r6el +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_msubr_q_h.c \ +-EL -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_msubr_q_h_32r6el +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_msubr_q_w.c \ +-EL -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_msubr_q_w_32r6el /opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_mul_q_h.c \ -EL -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_mul_q_h_32r6el /opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_mul_q_w.c \
tests/tcg/mips/user/ase/msa/test_msa_compile_64r6eb.sh +16 -0
@@ -88,6 +88,22 @@ # Fixed Multiply # -------------- # +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_madd_q_h.c \ +-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_madd_q_h_64r6eb +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_madd_q_w.c \ +-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_madd_q_w_64r6eb +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_maddr_q_h.c \ +-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_maddr_q_h_64r6eb +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_maddr_q_w.c \ +-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_maddr_q_w_64r6eb +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_msub_q_h.c \ +-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_msub_q_h_64r6eb +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_msub_q_w.c \ +-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_msub_q_w_64r6eb +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_msubr_q_h.c \ +-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_msubr_q_h_64r6eb +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_msubr_q_w.c \ +-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_msubr_q_w_64r6eb /opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_mul_q_h.c \ -EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mul_q_h_64r6eb /opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_mul_q_w.c \
tests/tcg/mips/user/ase/msa/test_msa_compile_64r6el.sh +16 -0
@@ -88,6 +88,22 @@ # Fixed Multiply # -------------- # +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_madd_q_h.c \ +-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_madd_q_h_64r6el +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_madd_q_w.c \ +-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_madd_q_w_64r6el +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_maddr_q_h.c \ +-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_maddr_q_h_64r6el +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_maddr_q_w.c \ +-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_maddr_q_w_64r6el +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_msub_q_h.c \ +-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_msub_q_h_64r6el +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_msub_q_w.c \ +-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_msub_q_w_64r6el +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_msubr_q_h.c \ +-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_msubr_q_h_64r6el +/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_msubr_q_w.c \ +-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_msubr_q_w_64r6el /opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_mul_q_h.c \ -EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mul_q_h_64r6el /opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_mul_q_w.c \
tests/tcg/mips/user/ase/msa/test_msa_run_32r6eb.sh +8 -0
@@ -55,6 +55,14 @@ $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bset_d_32r6eb # Fixed Multiply # -------------- # +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_madd_q_h_32r6eb +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_madd_q_w_32r6eb +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_maddr_q_h_32r6eb +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_maddr_q_w_32r6eb +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msub_q_h_32r6eb +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msub_q_w_32r6eb +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msubr_q_h_32r6eb +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msubr_q_w_32r6eb $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mul_q_h_32r6eb $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mul_q_w_32r6eb $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mulr_q_h_32r6eb
tests/tcg/mips/user/ase/msa/test_msa_run_32r6el.sh +8 -0
@@ -55,6 +55,14 @@ $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bset_d_32r6el # Fixed Multiply # -------------- # +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_madd_q_h_32r6el +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_madd_q_w_32r6el +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_maddr_q_h_32r6el +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_maddr_q_w_32r6el +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msub_q_h_32r6el +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msub_q_w_32r6el +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msubr_q_h_32r6el +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msubr_q_w_32r6el $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mul_q_h_32r6el $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mul_q_w_32r6el $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mulr_q_h_32r6el
tests/tcg/mips/user/ase/msa/test_msa_run_64r6eb.sh +8 -0
@@ -55,6 +55,14 @@ $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bset_d_64r6eb # Fixed Multiply # -------------- # +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_madd_q_h_64r6eb +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_madd_q_w_64r6eb +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_maddr_q_h_64r6eb +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_maddr_q_w_64r6eb +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msub_q_h_64r6eb +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msub_q_w_64r6eb +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msubr_q_h_64r6eb +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msubr_q_w_64r6eb $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mul_q_h_64r6eb $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mul_q_w_64r6eb $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mulr_q_h_64r6eb
tests/tcg/mips/user/ase/msa/test_msa_run_64r6el.sh +8 -0
@@ -55,6 +55,14 @@ $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bset_d_64r6el # Fixed Multiply # -------------- # +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_madd_q_h_64r6el +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_madd_q_w_64r6el +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_maddr_q_h_64r6el +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_maddr_q_w_64r6el +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msub_q_h_64r6el +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msub_q_w_64r6el +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msubr_q_h_64r6el +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msubr_q_w_64r6el $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mul_q_h_64r6el $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mul_q_w_64r6el $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mulr_q_h_64r6el
Signature · 1 line
2.7.4
PATCH 2/7 tcg/tests: target/mips: Amend MSA integer multiply tests
In reply to Aleksandar MarkovicFrom: Aleksandar Markovic <[email protected]>
Amend MSA fixed point multiply tests: correct output values for MADDV.B, MADDV.H, MADDV.W, MADDV.D, MSUBV.B, MSUBV.H, MSUBV.W and MSUBD.D.
--- .../user/ase/msa/int-multiply/test_msa_maddv_b.c | 224 ++++++++++----------- .../user/ase/msa/int-multiply/test_msa_maddv_d.c | 214 ++++++++++---------- .../user/ase/msa/int-multiply/test_msa_maddv_h.c | 224 ++++++++++----------- .../user/ase/msa/int-multiply/test_msa_maddv_w.c | 224 ++++++++++----------- .../user/ase/msa/int-multiply/test_msa_msubv_b.c | 224 ++++++++++----------- .../user/ase/msa/int-multiply/test_msa_msubv_d.c | 224 ++++++++++----------- .../user/ase/msa/int-multiply/test_msa_msubv_h.c | 224 ++++++++++----------- .../user/ase/msa/int-multiply/test_msa_msubv_w.c | 224 ++++++++++----------- 8 files changed, 891 insertions(+), 891 deletions(-)
tests/tcg/mips/user/ase/msa/int-multiply/test_msa_maddv_b.c +112 -112
@@ -43,118 +43,118 @@ int32_t main(void)uint64_t b128_result[TEST_COUNT_TOTAL ][2 ];uint64_t b128_expect[TEST_COUNT_TOTAL ][2 ] = { - {0x0000000000000002ULL ,0x0000000000000002ULL , },/* 0 */ - {0x0000000000000002ULL ,0x0000000000000002ULL , }, - {0x00000000aaaaaaaeULL ,0x00000000aaaaaaaeULL , }, - {0x0000000000000004ULL ,0x0000000000000004ULL , }, - {0x000000006666666cULL ,0x000000006666666cULL , }, - {0x0000000000000006ULL ,0x0000000000000006ULL , }, - {0x000000008e38e395ULL ,0xffffffffe38e38ebULL , }, - {0x0000000000000008ULL ,0x0000000000000008ULL , }, - {0x0000000000000008ULL ,0x0000000000000008ULL , },/* 8 */ - {0x0000000000000008ULL ,0x0000000000000008ULL , }, - {0x0000000000000008ULL ,0x0000000000000008ULL , }, - {0x0000000000000008ULL ,0x0000000000000008ULL , }, - {0x0000000000000008ULL ,0x0000000000000008ULL , }, - {0x0000000000000008ULL ,0x0000000000000008ULL , }, - {0x0000000000000008ULL ,0x0000000000000008ULL , }, - {0x0000000000000008ULL ,0x0000000000000008ULL , }, - {0x00000000aaaaaab4ULL ,0x00000000aaaaaab4ULL , },/* 16 */ - {0x00000000aaaaaab4ULL ,0x00000000aaaaaab4ULL , }, - {0x38e38e3a71c71c7cULL ,0x38e38e3a71c71c7cULL , }, - {0x0000000155555560ULL ,0x0000000155555560ULL , }, - {0x2222222444444450ULL ,0x2222222444444450ULL , }, - {0x000000020000000cULL ,0x000000020000000cULL , }, - {0x2f684bdcb425ed16ULL ,0xf684bda397b425faULL , }, - {0x00000002aaaaaab8ULL ,0x00000002aaaaaab8ULL , }, - {0x000000020000000eULL ,0x000000020000000eULL , },/* 24 */ - {0x000000020000000eULL ,0x000000020000000eULL , }, - {0xc71c71c8e38e38f2ULL ,0xc71c71c8e38e38f2ULL , }, - {0x0000000155555564ULL ,0x0000000155555564ULL , }, - {0xdddddddeccccccdcULL ,0xdddddddeccccccdcULL , }, - {0x00000000aaaaaabaULL ,0x00000000aaaaaabaULL , }, - {0xd097b42684bda13fULL ,0x097b425ef684bdb1ULL , }, - {0x0000000000000010ULL ,0x0000000000000010ULL , }, - {0x0000000066666678ULL ,0x0000000066666678ULL , },/* 32 */ - {0x0000000066666678ULL ,0x0000000066666678ULL , }, - {0x2222222355555568ULL ,0x2222222355555568ULL , }, - {0x00000000cccccce0ULL ,0x00000000cccccce0ULL , }, - {0x147ae1491eb85200ULL ,0x147ae1491eb85200ULL , }, - {0x0000000133333348ULL ,0x0000000133333348ULL , }, - {0x1c71c71e3e93e954ULL ,0xfa4fa4fbb60b60ccULL , }, - {0x00000001999999b0ULL ,0x00000001999999b0ULL , }, - {0x000000013333334aULL ,0x000000013333334aULL , },/* 40 */ - {0x000000013333334aULL ,0x000000013333334aULL , }, - {0xdddddddeeeeeef06ULL ,0xdddddddeeeeeef06ULL , }, - {0x00000000cccccce4ULL ,0x00000000cccccce4ULL , }, - {0xeb851eb8e147ae2cULL ,0xeb851eb8e147ae2cULL , }, - {0x000000006666667eULL ,0x000000006666667eULL , }, - {0xe38e38e3e93e9401ULL ,0x05b05b05c71c71dfULL , }, - {0x0000000000000018ULL ,0x0000000000000018ULL , }, - {0x000000008e38e3a7ULL ,0xffffffffe38e38fdULL , },/* 48 */ - {0x000000008e38e3a7ULL ,0xffffffffe38e38fdULL , }, - {0x2f684bdb425ed0b1ULL ,0xf684bda17b425eebULL , }, - {0x000000011c71c736ULL ,0xffffffffc71c71e2ULL , }, - {0x1c71c71e27d27d42ULL ,0xfa4fa4fa49f49f66ULL , }, - {0x00000001aaaaaac5ULL ,0xffffffffaaaaaac7ULL , }, - {0x35ba781b4587e6d2ULL ,0x0fcd6e9d6b74f050ULL , }, - {0x0000000238e38e54ULL ,0xffffffff8e38e3acULL , }, - {0x00000001aaaaaac7ULL ,0xffffffffaaaaaac9ULL , },/* 56 */ - {0x00000001aaaaaac7ULL ,0xffffffffaaaaaac9ULL , }, - {0xd097b427a12f6869ULL ,0x097b425ebda12f87ULL , }, - {0x000000011c71c73aULL ,0xffffffffc71c71e6ULL , }, - {0xe38e38e477777796ULL ,0x05b05b05aaaaaacaULL , }, - {0x000000008e38e3adULL ,0xffffffffe38e3903ULL , }, - {0xca4587e781948b2fULL ,0xf032916206522c5fULL , }, - {0x0000000000000020ULL ,0x0000000000000020ULL , }, - {0x3e3ad4ae1266c2b0ULL ,0x1637d725aebdb734ULL , },/* 64 */ - {0x4c74e0d60a3d6d94ULL ,0x1badd2dd9f4dac90ULL , }, - {0x6874e8f94205b90cULL ,0x27eb0c41af2c3022ULL , }, - {0x42dab657e16f25e8ULL ,0x06d6782e137656f2ULL , }, - {0x5114c27fd945d0ccULL ,0x0c4c73e604064c4eULL , }, - {0x68a91e898c276755ULL ,0x0f77ad378bdfb302ULL , }, - {0x54c82cde41d1cf13ULL ,0x0b6108a5f38e1598ULL , }, - {0x6f755d3eddd1234aULL ,0xfbbaace2f5421908ULL , }, - {0x8b75656215996ec2ULL ,0x07f7e64705209c9aULL , },/* 72 */ - {0x779473b6cb43d680ULL ,0x03e141b56cceff30ULL , }, - {0xa6279a1866fb9f64ULL ,0x2631668db9e53ac1ULL , }, - {0x67a1f71bd99e4586ULL ,0x312ec9f6206e6e69ULL , }, - {0x4207c47a7907b262ULL ,0x101a35e284b89539ULL , }, - {0x5cb4f4db15070699ULL ,0x0073da1f866c98a9ULL , }, - {0x1e2f51de87a9acbbULL ,0x0b713d87ecf5cc51ULL , }, - {0x721d49ba5f0acfa8ULL ,0x5ba5bbe9afeae691ULL , }, - {0x4bcd68690d995de0ULL ,0x771da6b4b6c967ebULL , },/* 80 */ - {0x4ea9a2cfbb5acd7bULL ,0x79dd6a73439e6387ULL , }, - {0x47c800b999dd2371ULL ,0x766d25914ef7a7a0ULL , }, - {0x41b0fa10eb77cf84ULL ,0x26e85189458965f8ULL , }, - {0x1fc448ce062c2944ULL ,0x31f490a9422a80e6ULL , }, - {0x211bdfadfd79770eULL ,0x3b25f4cac5763378ULL , }, - {0x16fbb87edd87b6f0ULL ,0x57c0b65fabdda20eULL , }, - {0x14621091eac4a5f6ULL ,0x4d29a25d32fa9ef6ULL , }, - {0x07832ded1c464b02ULL ,0x6396905709e3cfa4ULL , },/* 88 */ - {0x0ff4a84eab8df3b9ULL ,0x6bc9a7d8c6adf2eaULL , }, - {0x21e53326bfbd0b05ULL ,0x8f8f3b9c679dff5aULL , }, - {0x191ed6a24e1576f9ULL ,0x9e8c2e402760373aULL , }, - {0x19b438400fc27751ULL ,0x819c4bbfd3ee6972ULL , }, - {0x1e0d5dc1094ae999ULL ,0x7496a289f5eff010ULL , }, - {0x11af620b7bc03943ULL ,0x8a11f229836addc7ULL , }, - {0x46fa45d0e84440fcULL ,0xe8d2c0211fb042bfULL , }, - {0x22142516b5a8adbcULL ,0xe1cf1923e186aad1ULL , },/* 96 */ - {0x066ebbbb4ff6da44ULL ,0xd918d7e6a7e61877ULL , }, - {0x100acc9d22839a48ULL ,0xce291932929e367fULL , }, - {0x0dfe419d62a62f64ULL ,0xc020fe45a8cf7acfULL , }, - {0x2ba79b6ffbf3c63bULL ,0xb428f52c49fce695ULL , }, - {0x29b3b85200bdf100ULL ,0xb4ae7ea2f52aa5b9ULL , }, - {0x293bb84d6360c0b6ULL ,0xae33b26e4c493c49ULL , }, - {0x46a99fdf54f4862dULL ,0xae790dc5055f6f51ULL , }, - {0x18480e0fd728c7c3ULL ,0xa000ad7b15f8ebe0ULL , },/* 104 */ - {0x1b8b97aa205e1239ULL ,0x89c78b8909c4a8e5ULL , }, - {0x09abb26b05ef649dULL ,0x74242fa1bd49e740ULL , }, - {0x04e233bc861d272bULL ,0x9c5343ab30f62f9fULL , }, - {0xda2da0d0884dc3d1ULL ,0xb824f201640b4147ULL , }, - {0x9d8b22ee1b9a2e0fULL ,0xb642ddf1edb0747fULL , }, - {0x7c81956533686a37ULL ,0xdd5181781dc3ad37ULL , }, - {0xc60b1905717ff25aULL ,0xe2af726e71ad7ad7ULL , }, + {0x0101010101010101ULL ,0x0101010101010101ULL , },/* 0 */ + {0x0101010101010101ULL ,0x0101010101010101ULL , }, + {0x5757575757575757ULL ,0x5757575757575757ULL , }, + {0x0202020202020202ULL ,0x0202020202020202ULL , }, + {0x3636363636363636ULL ,0x3636363636363636ULL , }, + {0x0303030303030303ULL ,0x0303030303030303ULL , }, + {0x2075cb2075cb2075ULL ,0xcb2075cb2075cb20ULL , }, + {0x0404040404040404ULL ,0x0404040404040404ULL , }, + {0x0404040404040404ULL ,0x0404040404040404ULL , },/* 8 */ + {0x0404040404040404ULL ,0x0404040404040404ULL , }, + {0x0404040404040404ULL ,0x0404040404040404ULL , }, + {0x0404040404040404ULL ,0x0404040404040404ULL , }, + {0x0404040404040404ULL ,0x0404040404040404ULL , }, + {0x0404040404040404ULL ,0x0404040404040404ULL , }, + {0x0404040404040404ULL ,0x0404040404040404ULL , }, + {0x0404040404040404ULL ,0x0404040404040404ULL , }, + {0x5a5a5a5a5a5a5a5aULL ,0x5a5a5a5a5a5a5a5aULL , },/* 16 */ + {0x5a5a5a5a5a5a5a5aULL ,0x5a5a5a5a5a5a5a5aULL , }, + {0x3e3e3e3e3e3e3e3eULL ,0x3e3e3e3e3e3e3e3eULL , }, + {0xb0b0b0b0b0b0b0b0ULL ,0xb0b0b0b0b0b0b0b0ULL , }, + {0x2828282828282828ULL ,0x2828282828282828ULL , }, + {0x0606060606060606ULL ,0x0606060606060606ULL , }, + {0xc45236c45236c452ULL ,0x36c45236c45236c4ULL , }, + {0x5c5c5c5c5c5c5c5cULL ,0x5c5c5c5c5c5c5c5cULL , }, + {0x0707070707070707ULL ,0x0707070707070707ULL , },/* 24 */ + {0x0707070707070707ULL ,0x0707070707070707ULL , }, + {0x7979797979797979ULL ,0x7979797979797979ULL , }, + {0xb2b2b2b2b2b2b2b2ULL ,0xb2b2b2b2b2b2b2b2ULL , }, + {0x6e6e6e6e6e6e6e6eULL ,0x6e6e6e6e6e6e6e6eULL , }, + {0x5d5d5d5d5d5d5d5dULL ,0x5d5d5d5d5d5d5d5dULL , }, + {0xbc83f5bc83f5bc83ULL ,0xf5bc83f5bc83f5bcULL , }, + {0x0808080808080808ULL ,0x0808080808080808ULL , }, + {0x3c3c3c3c3c3c3c3cULL ,0x3c3c3c3c3c3c3c3cULL , },/* 32 */ + {0x3c3c3c3c3c3c3c3cULL ,0x3c3c3c3c3c3c3c3cULL , }, + {0xb4b4b4b4b4b4b4b4ULL ,0xb4b4b4b4b4b4b4b4ULL , }, + {0x7070707070707070ULL ,0x7070707070707070ULL , }, + {0x0000000000000000ULL ,0x0000000000000000ULL , }, + {0xa4a4a4a4a4a4a4a4ULL ,0xa4a4a4a4a4a4a4a4ULL , }, + {0x88cc4488cc4488ccULL ,0x4488cc4488cc4488ULL , }, + {0xd8d8d8d8d8d8d8d8ULL ,0xd8d8d8d8d8d8d8d8ULL , }, + {0xa5a5a5a5a5a5a5a5ULL ,0xa5a5a5a5a5a5a5a5ULL , },/* 40 */ + {0xa5a5a5a5a5a5a5a5ULL ,0xa5a5a5a5a5a5a5a5ULL , }, + {0x8383838383838383ULL ,0x8383838383838383ULL , }, + {0x7272727272727272ULL ,0x7272727272727272ULL , }, + {0x1616161616161616ULL ,0x1616161616161616ULL , }, + {0x3f3f3f3f3f3f3f3fULL ,0x3f3f3f3f3f3f3f3fULL , }, + {0x7889677889677889ULL ,0x6778896778896778ULL , }, + {0x0c0c0c0c0c0c0c0cULL ,0x0c0c0c0c0c0c0c0cULL , }, + {0x297ed4297ed4297eULL ,0xd4297ed4297ed429ULL , },/* 48 */ + {0x297ed4297ed4297eULL ,0xd4297ed4297ed429ULL , }, + {0xe7ca04e7ca04e7caULL ,0x04e7ca04e7ca04e7ULL , }, + {0x46f09c46f09c46f0ULL ,0x9c46f09c46f09c46ULL , }, + {0x2a183c2a183c2a18ULL ,0x3c2a183c2a183c2aULL , }, + {0x6362646362646362ULL ,0x6463626463626463ULL , }, + {0xac26a4ac26a4ac26ULL ,0xa4ac26a4ac26a4acULL , }, + {0x80d42c80d42c80d4ULL ,0x2c80d42c80d42c80ULL , }, + {0x6463656463656463ULL ,0x6564636564636564ULL , },/* 56 */ + {0x6463656463656463ULL ,0x6564636564636564ULL , }, + {0xfc6d8bfc6d8bfc6dULL ,0x8bfc6d8bfc6d8bfcULL , }, + {0x48f29e48f29e48f2ULL ,0x9e48f29e48f29e48ULL , }, + {0x98fe3298fe3298feULL ,0x3298fe3298fe3298ULL , }, + {0x2c81d72c81d72c81ULL ,0xd72c81d72c81d72cULL , }, + {0x002f5f002f5f002fULL ,0x5f002f5f002f5f00ULL , }, + {0x1010101010101010ULL ,0x1010101010101010ULL , }, + {0x50f4b4a050944910ULL ,0x09818994142910a0ULL , },/* 64 */ + {0xa8a0b48458da5c10ULL ,0x4fe29220ea6e7070ULL , }, + {0x08e408fc40188310ULL ,0xbcca14c29417e060ULL , }, + {0x889acc58f0da8d90ULL ,0x0bc1ec1242cd40e0ULL , }, + {0xe046cc3cf820a090ULL ,0x5122f59e1812a0b0ULL , }, + {0xf94acc85218951d0ULL ,0x95738e42d193e4c0ULL , }, + {0x9d16cc43c6665ed0ULL ,0x53db3028d828be70ULL , }, + {0x6db8cc0a0c890c40ULL ,0x3d628818b56622f0ULL , }, + {0xcdfc2082f4c73340ULL ,0xaa4a0aba5f0f92e0ULL , },/* 72 */ + {0x71c8204099a44040ULL ,0x68b2aca066a46c90ULL , }, + {0x016c64244a05b940ULL ,0x59f2d0a19fddc520ULL , }, + {0x4132584638a46f40ULL ,0xd44a00c982f36fa0ULL , }, + {0xc1e81ca2e86679c0ULL ,0x2341d81930a9cf20ULL , }, + {0x918a1c692e892730ULL ,0x0dc830090de733a0ULL , }, + {0xd150108b1c28dd30ULL ,0x88206031f0fddd20ULL , }, + {0xd1b1f4b4a08961f4ULL ,0x3101a07181016120ULL , }, + {0xd9fb2c24a0fb96f4ULL ,0x8c6880ef7f7c11a0ULL , },/* 80 */ + {0x9c452c10c01c3094ULL ,0x64c00035ea008320ULL , }, + {0x6c8714b080c04094ULL ,0xa0c00000380072a0ULL , }, + {0xac30cca08080c0acULL ,0xc0800000300016a0ULL , }, + {0x0c101420808080acULL ,0x00000000d0003620ULL , }, + {0xd0f014800000000cULL ,0x00000000e00082a0ULL , }, + {0x9050ac800000000cULL ,0x0000000080004c20ULL , }, + {0x90007400000000b4ULL ,0x0000000000006420ULL , }, + {0x1000ac00000000b4ULL ,0x00000000000024a0ULL , },/* 88 */ + {0xc000ac0000000054ULL ,0x000000000000ac20ULL , }, + {0xc000940000000054ULL ,0x00000000000088a0ULL , }, + {0xc0004c00000000ecULL ,0x00000000000098a0ULL , }, + {0xc0009400000000ecULL ,0x0000000000001820ULL , }, + {0x000094000000004cULL ,0x000000000000c8a0ULL , }, + {0x00002c000000004cULL ,0x000000000000b020ULL , }, + {0x0000f40000000074ULL ,0x0000000000001020ULL , }, + {0x00002c0000000074ULL ,0x00000000000010a0ULL , },/* 96 */ + {0x0000b40000000074ULL ,0x0000000000001020ULL , }, + {0x00006c0000000074ULL ,0x00000000000010a0ULL , }, + {0x0000740000000074ULL ,0x0000000000001020ULL , }, + {0x0000740000000014ULL ,0x00000000000030a0ULL , }, + {0x00007400000000b4ULL ,0x0000000000009020ULL , }, + {0x0000740000000054ULL ,0x000000000000b0a0ULL , }, + {0x00007400000000f4ULL ,0x0000000000001020ULL , }, + {0x00004c00000000f4ULL ,0x00000000000060a0ULL , },/* 104 */ + {0x0000f400000000f4ULL ,0x0000000000004020ULL , }, + {0x0000cc00000000f4ULL ,0x00000000000080a0ULL , }, + {0x00007400000000f4ULL ,0x0000000000000020ULL , }, + {0x00006c000000004cULL ,0x0000000000000020ULL , }, + {0x0000b40000000074ULL ,0x0000000000000020ULL , }, + {0x00002c00000000ccULL ,0x0000000000000020ULL , }, + {0x0000f400000000f4ULL ,0x0000000000000020ULL , }, };reset_msa_registers ();
tests/tcg/mips/user/ase/msa/int-multiply/test_msa_maddv_d.c +107 -107
225 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-multiply/test_msa_maddv_h.c +112 -112
230 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-multiply/test_msa_maddv_w.c +112 -112
230 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-multiply/test_msa_msubv_b.c +112 -112
230 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-multiply/test_msa_msubv_d.c +112 -112
230 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-multiply/test_msa_msubv_h.c +112 -112
230 lines not on this page · raw message
tests/tcg/mips/user/ase/msa/int-multiply/test_msa_msubv_w.c +112 -112
230 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 3/7 target/mips: Correct comments in msa_helper.c
In reply to Aleksandar MarkovicFrom: Aleksandar Markovic <[email protected]>
Fix some errors in comments for MSA helpers.
--- target/mips/msa_helper.c | 44 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 10 deletions(-)
target/mips/msa_helper.c +34 -10
@@ -72,9 +72,6 @@* -------- * * +---------------+----------------------------------------------------------+ -* | BMNZ.V | Vector Bit Move If Not Zero | -* | BMZ.V | Vector Bit Move If Zero | -* | BSEL.V | Vector Bit Select | * | BINSL.B | Vector Bit Insert Left (byte) | * | BINSL.H | Vector Bit Insert Left (halfword) | * | BINSL.W | Vector Bit Insert Left (word) |
@@ -83,6 +80,9 @@* | BINSR.H | Vector Bit Insert Right (halfword) | * | BINSR.W | Vector Bit Insert Right (word) | * | BINSR.D | Vector Bit Insert Right (doubleword) | +* | BMNZ.V | Vector Bit Move If Not Zero | +* | BMZ.V | Vector Bit Move If Zero | +* | BSEL.V | Vector Bit Select | * +---------------+----------------------------------------------------------+ */
@@ -179,12 +179,12 @@* | ADDV.H | Vector Add (halfword) | * | ADDV.W | Vector Add (word) | * | ADDV.D | Vector Add (doubleword) | -* | HSUB_S.H | Vector Signed Horizontal Add (halfword) | -* | HSUB_S.W | Vector Signed Horizontal Add (word) | -* | HSUB_S.D | Vector Signed Horizontal Add (doubleword) | -* | HSUB_U.H | Vector Unigned Horizontal Add (halfword) | -* | HSUB_U.W | Vector Unigned Horizontal Add (word) | -* | HSUB_U.D | Vector Unigned Horizontal Add (doubleword) | +* | HADD_S.H | Vector Signed Horizontal Add (halfword) | +* | HADD_S.W | Vector Signed Horizontal Add (word) | +* | HADD_S.D | Vector Signed Horizontal Add (doubleword) | +* | HADD_U.H | Vector Unigned Horizontal Add (halfword) | +* | HADD_U.W | Vector Unigned Horizontal Add (word) | +* | HADD_U.D | Vector Unigned Horizontal Add (doubleword) | * +---------------+----------------------------------------------------------+ */
@@ -279,6 +279,18 @@* | DOTP_U.H | Vector Unsigned Dot Product (halfword) | * | DOTP_U.W | Vector Unsigned Dot Product (word) | * | DOTP_U.D | Vector Unsigned Dot Product (doubleword) | +* | DPADD_S.H | Vector Signed Dot Product (halfword) | +* | DPADD_S.W | Vector Signed Dot Product (word) | +* | DPADD_S.D | Vector Signed Dot Product (doubleword) | +* | DPADD_U.H | Vector Unsigned Dot Product (halfword) | +* | DPADD_U.W | Vector Unsigned Dot Product (word) | +* | DPADD_U.D | Vector Unsigned Dot Product (doubleword) | +* | DPSUB_S.H | Vector Signed Dot Product (halfword) | +* | DPSUB_S.W | Vector Signed Dot Product (word) | +* | DPSUB_S.D | Vector Signed Dot Product (doubleword) | +* | DPSUB_U.H | Vector Unsigned Dot Product (halfword) | +* | DPSUB_U.W | Vector Unsigned Dot Product (word) | +* | DPSUB_U.D | Vector Unsigned Dot Product (doubleword) | * +---------------+----------------------------------------------------------+ */
@@ -446,7 +458,19 @@* +---------------+----------------------------------------------------------+ */ -/* TODO: insert Logic group helpers here */ +/* TODO: insert Interleave group helpers here */ + + +/* +* Move +* ---- +* +* +---------------+----------------------------------------------------------+ +* | MOVE.V | Vector Move | +* +---------------+----------------------------------------------------------+ +*/ + +/* TODO: insert Move group helpers here */ /*
Signature · 1 line
2.7.4
PATCH 4/7 target/mips: Correct comments in translate.c
In reply to Aleksandar MarkovicFrom: Aleksandar Markovic <[email protected]>
Fix some checkpatch comment-related warnings.
--- target/mips/translate.c | 347 +++++++++++++++++++++++++++++++----------------- 1 file changed, 225 insertions(+), 122 deletions(-)
target/mips/translate.c +225 -122
@@ -259,8 +259,10 @@ enum { OPC_SPECIAL3D_RESERVED = 0x3D | OPC_SPECIAL, }; -/* R6 Multiply and Divide instructions have the same Opcode -and function field as legacy OPC_MULT[U]/OPC_DIV[U] */ +/* +* R6 Multiply and Divide instructions have the same opcode +* and function field as legacy OPC_MULT[U]/OPC_DIV[U] +*/ #define MASK_R6_MULDIV (op) (MASK_SPECIAL(op) | (op & (0x7ff)))enum {
@@ -2923,10 +2925,11 @@ static inline void check_cp1_enabled(DisasContext *ctx) } } -/* Verify that the processor is running with COP1X instructions enabled. -This is associated with the nabla symbol in the MIPS32 and MIPS64 -opcode tables. */ - +/* +* Verify that the processor is running with COP1X instructions enabled. +* This is associated with the nabla symbol in the MIPS32 and MIPS64 +* opcode tables. +*/ static inline void check_cop1x (DisasContext *ctx) {if (unlikely (!(ctx->hflags &MIPS_HFLAG_COP1X ))) {
@@ -2934,9 +2937,10 @@ static inline void check_cop1x(DisasContext *ctx) } } -/* Verify that the processor is running with 64-bit floating-point -operations enabled. */ - +/* +* Verify that the processor is running with 64-bit floating-point +* operations enabled. +*/ static inline void check_cp1_64bitmode (DisasContext *ctx) {if (unlikely (~ctx->hflags & (MIPS_HFLAG_F64 |MIPS_HFLAG_COP1X ))) {
@@ -2962,10 +2966,10 @@ static inline void check_cp1_registers(DisasContext *ctx, int regs) } } -/* Verify that the processor is running with DSP instructions enabled. -This is enabled by CP0 Status register MX(24) bit. +/* +* Verify that the processor is running with DSP instructions enabled. +* This is enabled by CP0 Status register MX(24) bit. */ -static inline void check_dsp (DisasContext *ctx) {if (unlikely (!(ctx->hflags &MIPS_HFLAG_DSP ))) {
@@ -2999,8 +3003,10 @@ static inline void check_dsp_r3(DisasContext *ctx) } } -/* This code generates a "reserved instruction" exception if the -CPU does not support the instruction set corresponding to flags. */ +/* +* This code generates a "reserved instruction" exception if the +* CPU does not support the instruction set corresponding to flags. +*/ static inline void check_insn (DisasContext *ctx,uint64_t flags) {if (unlikely (!(ctx->insn_flags & flags))) {
@@ -3008,9 +3014,11 @@ static inline void check_insn(DisasContext *ctx, uint64_t flags) } } -/* This code generates a "reserved instruction" exception if the -CPU has corresponding flag set which indicates that the instruction -has been removed. */ +/* +* This code generates a "reserved instruction" exception if the +* CPU has corresponding flag set which indicates that the instruction +* has been removed. +*/ static inline void check_insn_opc_removed (DisasContext *ctx,uint64_t flags) {if (unlikely (ctx->insn_flags & flags)) {
@@ -3033,8 +3041,10 @@ static inline void check_insn_opc_user_only(DisasContext *ctx, uint64_t flags)#endif } -/* This code generates a "reserved instruction" exception if the -CPU does not support 64-bit paired-single (PS) floating point data type */ +/* +* This code generates a "reserved instruction" exception if the +* CPU does not support 64-bit paired-single (PS) floating point data type. +*/ static inline void check_ps (DisasContext *ctx) {if (unlikely (!ctx->ps)) {
@@ -3044,8 +3054,10 @@ static inline void check_ps(DisasContext *ctx) }#ifdef TARGET_MIPS64 -/* This code generates a "reserved instruction" exception if 64-bit -instructions are not enabled. */ +/* +* This code generates a "reserved instruction" exception if 64-bit +* instructions are not enabled. +*/ static inline void check_mips_64 (DisasContext *ctx) {if (unlikely (!(ctx->hflags &MIPS_HFLAG_64 ))) {
@@ -3157,10 +3169,12 @@ static inline void check_eva(DisasContext *ctx) } -/* Define small wrappers for gen_load_fpr* so that we have a uniform -calling interface for 32 and 64-bit FPRs. No sense in changing -all callers for gen_load_fpr32 when we need the CTX parameter for -this one use. */ +/* +* Define small wrappers for gen_load_fpr* so that we have a uniform +* calling interface for 32 and 64-bit FPRs. No sense in changing +* all callers for gen_load_fpr32 when we need the CTX parameter for +* this one use. +*/ #define gen_ldcmp_fpr32 (ctx, x, y) gen_load_fpr32(ctx, x, y)#define gen_ldcmp_fpr64 (ctx, x, y) gen_load_fpr64(ctx, x, y)#define FOP_CONDS (type, abs, fmt, ifmt, bits) \
@@ -3405,9 +3419,11 @@ static void gen_ld(DisasContext *ctx, uint32_t opc,int mem_idx = ctx->mem_idx;if (rt ==0 && ctx->insn_flags & (INSN_LOONGSON2E |INSN_LOONGSON2F )) { -/* Loongson CPU uses a load to zero register for prefetch. -We emulate it as a NOP. On other CPU we must perform the -actual memory access. */ +/* +* Loongson CPU uses a load to zero register for prefetch. +* We emulate it as a NOP. On other CPU we must perform the +* actual memory access. +*/ return ; }
@@ -3433,8 +3449,10 @@ static void gen_ld(DisasContext *ctx, uint32_t opc,break ;case OPC_LDL : t1 =tcg_temp_new (); -/* Do a byte access to possibly trigger a page -fault with the unaligned address. */ +/* +* Do a byte access to possibly trigger a page +* fault with the unaligned address. +*/ tcg_gen_qemu_ld_tl (t1, t0, mem_idx,MO_UB );tcg_gen_andi_tl (t1, t0,7 );#ifndef TARGET_WORDS_BIGENDIAN
@@ -3455,8 +3473,10 @@ static void gen_ld(DisasContext *ctx, uint32_t opc,break ;case OPC_LDR : t1 =tcg_temp_new (); -/* Do a byte access to possibly trigger a page -fault with the unaligned address. */ +/* +* Do a byte access to possibly trigger a page +* fault with the unaligned address. +*/ tcg_gen_qemu_ld_tl (t1, t0, mem_idx,MO_UB );tcg_gen_andi_tl (t1, t0,7 );#ifdef TARGET_WORDS_BIGENDIAN
@@ -3534,8 +3554,10 @@ static void gen_ld(DisasContext *ctx, uint32_t opc,/* fall through */ case OPC_LWL : t1 =tcg_temp_new (); -/* Do a byte access to possibly trigger a page -fault with the unaligned address. */ +/* +* Do a byte access to possibly trigger a page +* fault with the unaligned address. +*/ tcg_gen_qemu_ld_tl (t1, t0, mem_idx,MO_UB );tcg_gen_andi_tl (t1, t0,3 );#ifndef TARGET_WORDS_BIGENDIAN
@@ -3560,8 +3582,10 @@ static void gen_ld(DisasContext *ctx, uint32_t opc,/* fall through */ case OPC_LWR : t1 =tcg_temp_new (); -/* Do a byte access to possibly trigger a page -fault with the unaligned address. */ +/* +* Do a byte access to possibly trigger a page +* fault with the unaligned address. +*/ tcg_gen_qemu_ld_tl (t1, t0, mem_idx,MO_UB );tcg_gen_andi_tl (t1, t0,3 );#ifdef TARGET_WORDS_BIGENDIAN
@@ -3762,8 +3786,10 @@ static void gen_scwp(DisasContext *ctx, uint32_t base, int16_t offset,static void gen_flt_ldst (DisasContext *ctx,uint32_t opc,int ft,TCGv t0) { -/* Don't do NOP if destination is zero: we must perform the actual -memory access. */ +/* +* Don't do NOP if destination is zero: we must perform the actual +* memory access. +*/ switch (opc) {case OPC_LWC1 : {
@@ -3837,8 +3863,10 @@ static void gen_arith_imm(DisasContext *ctx, uint32_t opc,target_ulong uimm = (target_long )imm;/* Sign extend to 32/64 bits */ if (rt ==0 && opc !=OPC_ADDI && opc !=OPC_DADDI ) { -/* If no destination, treat it as a NOP. -For addi, we must generate the overflow exception when needed. */ +/* +* If no destination, treat it as a NOP. +* For addi, we must generate the overflow exception when needed. +*/ return ; }switch (opc) {
@@ -4064,8 +4092,10 @@ static void gen_arith(DisasContext *ctx, uint32_t opc, {if (rd ==0 && opc !=OPC_ADD && opc !=OPC_SUB && opc !=OPC_DADD && opc !=OPC_DSUB ) { -/* If no destination, treat it as a NOP. -For add & sub, we must generate the overflow exception when needed. */ +/* +* If no destination, treat it as a NOP. +* For add & sub, we must generate the overflow exception when needed. +*/ return ; }
@@ -4123,7 +4153,10 @@ static void gen_arith(DisasContext *ctx, uint32_t opc,tcg_temp_free (t2);tcg_gen_brcondi_tl (TCG_COND_GE , t1,0 , l1);tcg_temp_free (t1); -/* operands of different sign, first operand and result different sign */ +/* +* operands of different sign, first operand and the result +* of different sign +*/ generate_exception (ctx,EXCP_OVERFLOW );gen_set_label (l1);gen_store_gpr (t0, rd);
@@ -4346,8 +4379,10 @@ static void gen_shift(DisasContext *ctx, uint32_t opc,TCGv t0, t1;if (rd ==0 ) { -/* If no destination, treat it as a NOP. -For add & sub, we must generate the overflow exception when needed. */ +/* +* If no destination, treat it as a NOP. +* For add & sub, we must generate the overflow exception when needed. +*/ return ; }
@@ -5643,8 +5678,10 @@ static void gen_loongson_multimedia(DisasContext *ctx, int rd, int rs, int rt)break ;case OPC_SRA_CP2 :case OPC_DSRA_CP2 : -/* Since SRA is UndefinedResult without sign-extended inputs, -we can treat SRA and DSRA the same. */ +/* +* Since SRA is UndefinedResult without sign-extended inputs, +* we can treat SRA and DSRA the same. +*/ tcg_gen_sar_i64 (t0, t0, t1);break ;case OPC_SRL_CP2 :
@@ -5720,8 +5757,10 @@ static void gen_loongson_multimedia(DisasContext *ctx, int rd, int rs, int rt)case OPC_SLT_CP2 :case OPC_SLEU_CP2 :case OPC_SLE_CP2 : -/* ??? Document is unclear: Set FCC[CC]. Does that mean the -FD field is the CC field? */ +/* +* ??? Document is unclear: Set FCC[CC]. Does that mean the +* FD field is the CC field? +*/ default :MIPS_INVAL ("loongson_cp2" );generate_exception_end (ctx,EXCP_RI );
@@ -5972,8 +6011,10 @@ static void gen_compute_branch (DisasContext *ctx, uint32_t opc,/* Treat as NOP. */ goto out;case OPC_BLTZAL :/* 0 < 0 */ -/* Handle as an unconditional branch to get correct delay -slot checking. */ +/* +* Handle as an unconditional branch to get correct delay +* slot checking. +*/ blink =31 ; btgt = ctx->base.pc_next + insn_bytes + delayslot_size; ctx->hflags |=MIPS_HFLAG_B ;
@@ -6151,8 +6192,10 @@ static void gen_compute_branch_nm(DisasContext *ctx, uint32_t opc,case OPC_JALR :/* Jump to register */ if (offset !=0 && offset !=16 ) { -/* Hint = 0 is JR/JALR, hint 16 is JR.HB/JALR.HB, the -others are reserved. */ +/* +* Hint = 0 is JR/JALR, hint 16 is JR.HB/JALR.HB, the +* others are reserved. +*/ MIPS_INVAL ("jump hint" );generate_exception_end (ctx,EXCP_RI ); goto out;
@@ -6249,8 +6292,10 @@ static void gen_bitops(DisasContext *ctx, uint32_t opc, int rt,if (msb !=31 ) {tcg_gen_extract_tl (t0, t1, lsb, msb +1 ); }else { -/* The two checks together imply that lsb == 0, -so this is a simple sign-extension. */ +/* +* The two checks together imply that lsb == 0, +* so this is a simple sign-extension. +*/ tcg_gen_ext32s_tl (t0, t1); }break ;
@@ -6701,10 +6746,12 @@ static void gen_mthc0(DisasContext *ctx, TCGv arg, int reg, int sel)case CP0_REGISTER_17 :switch (sel) {case 0 : -/* LLAddr is read-only (the only exception is bit 0 if LLB is -supported); the CP0_LLAddr_rw_bitmask does not seem to be -relevant for modern MIPS cores supporting MTHC0, therefore -treating MTHC0 to LLAddr as NOP. */ +/* +* LLAddr is read-only (the only exception is bit 0 if LLB is +* supported); the CP0_LLAddr_rw_bitmask does not seem to be +* relevant for modern MIPS cores supporting MTHC0, therefore +* treating MTHC0 to LLAddr as NOP. +*/ register_name ="LLAddr" ;break ;case 1 :
@@ -6928,7 +6975,7 @@ static void gen_mfc0(DisasContext *ctx, TCGv arg, int reg, int sel) register_name ="Context" ;break ;case 1 : -// gen_helper_mfc0_contextconfig(arg); /* SmartMIPS ASE */ +/* gen_helper_mfc0_contextconfig(arg); - SmartMIPS ASE */ register_name ="ContextConfig" ; goto cp0_unimplemented;case 2 :
@@ -12389,8 +12436,10 @@ static void gen_flt3_ldst(DisasContext *ctx, uint32_t opc, }else {gen_op_addr_add (ctx, t0, cpu_gpr[base], cpu_gpr[index]); } -/* Don't do NOP if destination is zero: we must perform the actual -memory access. */ +/* +* Don't do NOP if destination is zero: we must perform the actual +* memory access. +*/ switch (opc) {case OPC_LWXC1 :check_cop1x (ctx);
@@ -12718,8 +12767,10 @@ static void gen_rdhwr(DisasContext *ctx, int rt, int rd, int sel)TCGv t0;#if !defined(CONFIG_USER_ONLY ) -/* The Linux kernel will emulate rdhwr if it's not supported natively. -Therefore only check the ISA in system mode. */ +/* +* The Linux kernel will emulate rdhwr if it's not supported natively. +* Therefore only check the ISA in system mode. +*/ check_insn (ctx,ISA_MIPS32R2 );#endif t0 =tcg_temp_new ();
@@ -12742,9 +12793,11 @@ static void gen_rdhwr(DisasContext *ctx, int rt, int rd, int sel)gen_io_end (); }gen_store_gpr (t0, rt); -/* Break the TB to be able to take timer interrupts immediately -after reading count. DISAS_STOP isn't sufficient, we need to ensure -we break completely out of translated code. */ +/* +* Break the TB to be able to take timer interrupts immediately +* after reading count. DISAS_STOP isn't sufficient, we need to ensure +* we break completely out of translated code. +*/ gen_save_pc (ctx->base.pc_next +4 ); ctx->base.is_jmp =DISAS_EXIT ;break ;
@@ -12755,7 +12808,8 @@ static void gen_rdhwr(DisasContext *ctx, int rt, int rd, int sel)case 4 :check_insn (ctx,ISA_MIPS32R6 );if (sel !=0 ) { -/* Performance counter registers are not implemented other than +/* +* Performance counter registers are not implemented other than * control register 0. */ generate_exception (ctx,EXCP_RI );
@@ -12799,8 +12853,10 @@ static inline void clear_branch_hflags(DisasContext *ctx)if (ctx->base.is_jmp ==DISAS_NEXT ) {save_cpu_state (ctx,0 ); }else { -/* it is not safe to save ctx->hflags as hflags may be changed -in execution time by the instruction in delay / forbidden slot. */ +/* +* It is not safe to save ctx->hflags as hflags may be changed +* in execution time by the instruction in delay / forbidden slot. +*/ tcg_gen_andi_i32 (hflags, hflags, ~MIPS_HFLAG_BMASK ); } }
@@ -13599,8 +13655,10 @@ static int decode_extended_mips16_opc(CPUMIPSState *env, DisasContext *ctx) | ((ctx->opcode >> 21) & 0x3f) << 5 | (ctx->opcode & 0x1f)); -/* The extended opcodes cleverly reuse the opcodes from their 16-bit -counterparts. */ +/* +* The extended opcodes cleverly reuse the opcodes from their 16-bit +* counterparts. +*/ switch (op) {case M16_OPC_ADDIUSP :gen_arith_imm (ctx,OPC_ADDIU , rx,29 , imm);
@@ -15056,8 +15114,10 @@ static void gen_pool16c_insn(DisasContext *ctx) {int reg = ctx->opcode &0x1f ;gen_compute_branch (ctx,OPC_JR ,2 , reg,0 ,0 ,0 ); -/* Let normal delay slot handling in our caller take us -to the branch target. */ +/* +* Let normal delay slot handling in our caller take us +* to the branch target. +*/ }break ;case JALR16 +0 :
@@ -15085,7 +15145,8 @@ static void gen_pool16c_insn(DisasContext *ctx)if (is_uhi (extract32 (ctx->opcode,0 ,4 ))) {gen_helper_do_semihosting (cpu_env); }else { -/* XXX: not clear which exception should be raised +/* +* XXX: not clear which exception should be raised * when in debug mode... */ check_insn (ctx,ISA_MIPS32 );
@@ -15098,8 +15159,10 @@ static void gen_pool16c_insn(DisasContext *ctx)int imm =ZIMM (ctx->opcode,0 ,5 );gen_compute_branch (ctx,OPC_JR ,2 ,31 ,0 ,0 ,0 );gen_arith_imm (ctx,OPC_ADDIU ,29 ,29 , imm <<2 ); -/* Let normal delay slot handling in our caller take us -to the branch target. */ +/* +* Let normal delay slot handling in our caller take us +* to the branch target. +*/ }break ;default :
@@ -17358,7 +17421,8 @@ static int decode_micromips_opc(CPUMIPSState *env, DisasContext *ctx)break ; }if (ctx->insn_flags &ISA_MIPS32R6 ) { -/* In the Release 6 the register number location in +/* +* In the Release 6, the register number location in * the instruction encoding has changed. */ gen_arith (ctx, opc, rs1, rd, rs2);
@@ -21083,9 +21147,11 @@ static int decode_nanomips_32_48_opc(CPUMIPSState *env, DisasContext *ctx)gen_p_lsx (ctx, rd, rs, rt);break ;case NM_LSA : -/* In nanoMIPS, the shift field directly encodes the shift +/* +* In nanoMIPS, the shift field directly encodes the shift * amount, meaning that the supported shift values are in -* the range 0 to 3 (instead of 1 to 4 in MIPSR6). */ +* the range 0 to 3 (instead of 1 to 4 in MIPSR6). +*/ gen_lsa (ctx,OPC_LSA , rd, rs, rt,extract32 (ctx->opcode,9 ,2 ) -1 );break ;
@@ -21440,8 +21506,10 @@ static int decode_nanomips_32_48_opc(CPUMIPSState *env, DisasContext *ctx)case NM_P_PREFU12 :if (rt ==31 ) {/* SYNCI */ -/* Break the TB to be able to sync copied instructions -immediately */ +/* +* Break the TB to be able to sync copied instructions +* immediately. +*/ ctx->base.is_jmp =DISAS_STOP ; }else {/* PREF */
@@ -21537,8 +21605,10 @@ static int decode_nanomips_32_48_opc(CPUMIPSState *env, DisasContext *ctx)case NM_P_PREFS9 :if (rt ==31 ) {/* SYNCI */ -/* Break the TB to be able to sync copied instructions -immediately */ +/* +* Break the TB to be able to sync copied instructions +* immediately. +*/ ctx->base.is_jmp =DISAS_STOP ; }else {/* PREF */
@@ -21630,8 +21700,10 @@ static int decode_nanomips_32_48_opc(CPUMIPSState *env, DisasContext *ctx)/* case NM_SYNCIE */ check_eva (ctx);check_cp0_enabled (ctx); -/* Break the TB to be able to sync copied instructions -immediately */ +/* +* Break the TB to be able to sync copied instructions +* immediately. +*/ ctx->base.is_jmp =DISAS_STOP ; }else {/* case NM_PREFE */
@@ -23026,8 +23098,10 @@ static void gen_mipsdsp_multiply(DisasContext *ctx, uint32_t op1, uint32_t op2,gen_load_gpr (v2_t, v2);switch (op1) { -/* OPC_MULT_G_2E, OPC_ADDUH_QB_DSP, OPC_MUL_PH_DSP have -* the same mask and op1. */ +/* +* OPC_MULT_G_2E, OPC_ADDUH_QB_DSP, OPC_MUL_PH_DSP have +* the same mask and op1. +*/ case OPC_MULT_G_2E :check_dsp_r2 (ctx);switch (op2) {
@@ -23996,8 +24070,10 @@ static void decode_opc_special_r6(CPUMIPSState *env, DisasContext *ctx)case R6_OPC_CLO :case R6_OPC_CLZ :if (rt ==0 && sa ==1 ) { -/* Major opcode and function field is shared with preR6 MFHI/MTHI. -We need additionally to check other fields */ +/* +* Major opcode and function field is shared with preR6 MFHI/MTHI. +* We need additionally to check other fields. +*/ gen_cl (ctx, op1, rd, rs); }else {generate_exception_end (ctx,EXCP_RI );
@@ -24022,8 +24098,10 @@ static void decode_opc_special_r6(CPUMIPSState *env, DisasContext *ctx)case R6_OPC_DCLO :case R6_OPC_DCLZ :if (rt ==0 && sa ==1 ) { -/* Major opcode and function field is shared with preR6 MFHI/MTHI. -We need additionally to check other fields */ +/* +* Major opcode and function field is shared with preR6 MFHI/MTHI. +* We need additionally to check other fields. +*/ check_mips_64 (ctx);gen_cl (ctx, op1, rd, rs); }else {
@@ -25939,7 +26017,7 @@ static void decode_opc_mxu__pool07(CPUMIPSState *env, DisasContext *ctx)* | SPECIAL2 | rb |x| s12 | XRa |MXU__POOL08| * +-----------+---------+-+-------------------+-------+-----------+ * -*/ +*/ static void decode_opc_mxu__pool08 (CPUMIPSState *env,DisasContext *ctx) {uint32_t opcode =extract32 (ctx->opcode,20 ,1 );
@@ -26835,7 +26913,8 @@ static void decode_opc_special2_legacy(CPUMIPSState *env, DisasContext *ctx)if (is_uhi (extract32 (ctx->opcode,6 ,20 ))) {gen_helper_do_semihosting (cpu_env); }else { -/* XXX: not clear which exception should be raised +/* +* XXX: not clear which exception should be raised * when in debug mode... */ check_insn (ctx,ISA_MIPS32 );
@@ -26977,8 +27056,10 @@ static void decode_opc_special3_legacy(CPUMIPSState *env, DisasContext *ctx)case OPC_MODU_G_2E :case OPC_MULT_G_2E :case OPC_MULTU_G_2E : -/* OPC_MULT_G_2E, OPC_ADDUH_QB_DSP, OPC_MUL_PH_DSP have -* the same mask and op1. */ +/* +* OPC_MULT_G_2E, OPC_ADDUH_QB_DSP, OPC_MUL_PH_DSP have +* the same mask and op1. +*/ if ((ctx->insn_flags &ASE_DSP_R2 ) && (op1 ==OPC_MULT_G_2E )) { op2 =MASK_ADDUH_QB (ctx->opcode);switch (op2) {
@@ -29165,8 +29246,10 @@ static void decode_opc(CPUMIPSState *env, DisasContext *ctx)break ;case OPC_SYNCI :check_insn (ctx,ISA_MIPS32R2 ); -/* Break the TB to be able to sync copied instructions -immediately */ +/* +* Break the TB to be able to sync copied instructions +* immediately. +*/ ctx->base.is_jmp =DISAS_STOP ;break ;case OPC_BPOSGE32 :/* MIPS DSP branch */
@@ -29283,8 +29366,10 @@ static void decode_opc(CPUMIPSState *env, DisasContext *ctx)save_cpu_state (ctx,1 );gen_helper_di (t0, cpu_env);gen_store_gpr (t0, rt); -/* Stop translation as we may have switched -the execution mode. */ +/* +* Stop translation as we may have switched +* the execution mode. +*/ ctx->base.is_jmp =DISAS_STOP ;break ;case OPC_EI :
@@ -29292,8 +29377,10 @@ static void decode_opc(CPUMIPSState *env, DisasContext *ctx)save_cpu_state (ctx,1 );gen_helper_ei (t0, cpu_env);gen_store_gpr (t0, rt); -/* DISAS_STOP isn't sufficient, we need to ensure we break -out of translated code to check for pending interrupts */ +/* +* DISAS_STOP isn't sufficient, we need to ensure we break +* out of translated code to check for pending interrupts. +*/ gen_save_pc (ctx->base.pc_next +4 ); ctx->base.is_jmp =DISAS_EXIT ;break ;
@@ -29876,10 +29963,12 @@ static bool mips_tr_breakpoint_check(DisasContextBase *dcbase, CPUState *cs,save_cpu_state (ctx,1 ); ctx->base.is_jmp =DISAS_NORETURN ;gen_helper_raise_exception_debug (cpu_env); -/* The address covered by the breakpoint must be included in -[tb->pc, tb->pc + tb->size) in order to for it to be -properly cleared -- thus we increment the PC here so that -the logic setting tb->size below does the right thing. */ +/* +* The address covered by the breakpoint must be included in +* [tb->pc, tb->pc + tb->size) in order to for it to be +* properly cleared -- thus we increment the PC here so that +* the logic setting tb->size below does the right thing. +*/ ctx->base.pc_next +=4 ;return true; }
@@ -29914,14 +30003,18 @@ static void mips_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)if (ctx->hflags &MIPS_HFLAG_BMASK ) {if (!(ctx->hflags & (MIPS_HFLAG_BDS16 |MIPS_HFLAG_BDS32 |MIPS_HFLAG_FBNSLOT ))) { -/* force to generate branch as there is neither delay nor -forbidden slot */ +/* +* Force to generate branch as there is neither delay nor +* forbidden slot. +*/ is_slot =1 ; }if ((ctx->hflags &MIPS_HFLAG_M16 ) && (ctx->hflags &MIPS_HFLAG_FBNSLOT )) { -/* Force to generate branch as microMIPS R6 doesn't restrict -branches in the forbidden slot. */ +/* +* Force to generate branch as microMIPS R6 doesn't restrict +* branches in the forbidden slot. +*/ is_slot =1 ; } }
@@ -29933,10 +30026,12 @@ static void mips_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)if (ctx->base.is_jmp !=DISAS_NEXT ) {return ; } -/* Execute a branch and its delay slot as a single instruction. -This is what GDB expects and is consistent with what the -hardware does (e.g. if a delay slot instruction faults, the -reported PC is the PC of the branch). */ +/* +* Execute a branch and its delay slot as a single instruction. +* This is what GDB expects and is consistent with what the +* hardware does (e.g. if a delay slot instruction faults, the +* reported PC is the PC of the branch). +*/ if (ctx->base.singlestep_enabled && (ctx->hflags &MIPS_HFLAG_BMASK ) ==0 ) { ctx->base.is_jmp =DISAS_TOO_MANY ;
@@ -30088,8 +30183,10 @@ void mips_tcg_init(void) int off = offsetof(CPUMIPSState, active_fpu.fpr[i].wr.d[0]); msa_wr_d[i *2 ] =tcg_global_mem_new_i64 (cpu_env, off, msaregnames[i *2 ]); -/* The scalar floating-point unit (FPU) registers are mapped on -* the MSA vector registers. */ +/* +* The scalar floating-point unit (FPU) registers are mapped on +* the MSA vector registers. +*/ fpu_f64[i] = msa_wr_d[i *2 ]; off = offsetof(CPUMIPSState, active_fpu.fpr[i].wr.d[1]); msa_wr_d[i * 2 + 1] =
@@ -30247,8 +30344,10 @@ void cpu_state_reset(CPUMIPSState *env)/* Enable 64-bit address mode. */ env->CP0_Status |= (1 << CP0St_UX);# endif -/* Enable access to the CPUNum, SYNCI_Step, CC, and CCRes RDHWR -hardware registers. */ +/* +* Enable access to the CPUNum, SYNCI_Step, CC, and CCRes RDHWR +* hardware registers. +*/ env->CP0_HWREna |=0x0000000F ;if (env->CP0_Config1 & (1 <<CP0C1_FP )) { env->CP0_Status |= (1 << CP0St_CU1);
@@ -30265,8 +30364,10 @@ void cpu_state_reset(CPUMIPSState *env)# endif #else if (env->hflags &MIPS_HFLAG_BMASK ) { -/* If the exception was raised from a delay slot, -come back to the jump. */ +/* +* If the exception was raised from a delay slot, +* come back to the jump. +*/ env->CP0_ErrorEPC = (env->active_tc.PC - (env->hflags &MIPS_HFLAG_B16 ?2 :4 )); }else {
@@ -30289,8 +30390,10 @@ void cpu_state_reset(CPUMIPSState *env) env->CP0_EntryHi_ASID_mask = (env->CP0_Config4 & (1 <<CP0C4_AE )) ?0x3ff :0xff ; env->CP0_Status = (1 << CP0St_BEV) | (1 << CP0St_ERL); -/* vectored interrupts not implemented, timer on int 7, -no performance counters. */ +/* +* Vectored interrupts not implemented, timer on int 7, +* no performance counters. +*/ env->CP0_IntCtl =0xe0000000 ; {int i;
Signature · 1 line
2.7.4
Re: [Qemu-devel] [PATCH 4/7] target/mips: Correct comments in translate.c
Quoted 749 lines · Aleksandar Markovic
From: Aleksandar Markovic <[email protected]>
Fix some checkpatch comment-related warnings.
Signed-off-by Aleksandar Markovic <[email protected]>--- target/mips/translate.c | 347 +++++++++++++++++++++++++++++++----------------- 1 file changed, 225 insertions(+), 122 deletions(-)target/mips/translate.c +221
-120@@ -259,8 +259,10 @@ enum { OPC_SPECIAL3D_RESERVED = 0x3D | OPC_SPECIAL, }; -/* R6 Multiply and Divide instructions have the same Opcode -and function field as legacy OPC_MULT[U]/OPC_DIV[U] */ +/* +* R6 Multiply and Divide instructions have the same opcode +* and function field as legacy OPC_MULT[U]/OPC_DIV[U] +*/ #define MASK_R6_MULDIV (op) (MASK_SPECIAL(op) | (op & (0x7ff)))enum {@@ -2923,10 +2925,11 @@ static inline void check_cp1_enabled(DisasContext *ctx) } } -/* Verify that the processor is running with COP1X instructions enabled. -This is associated with the nabla symbol in the MIPS32 and MIPS64 -opcode tables. */ - +/* +* Verify that the processor is running with COP1X instructions enabled. +* This is associated with the nabla symbol in the MIPS32 and MIPS64 +* opcode tables. +*/ static inline void check_cop1x (DisasContext *ctx) {if (unlikely (!(ctx->hflags &MIPS_HFLAG_COP1X ))) {@@ -2934,9 +2937,10 @@ static inline void check_cop1x(DisasContext *ctx) } } -/* Verify that the processor is running with 64-bit floating-point -operations enabled. */ - +/* +* Verify that the processor is running with 64-bit floating-point +* operations enabled. +*/ static inline void check_cp1_64bitmode (DisasContext *ctx) {if (unlikely (~ctx->hflags & (MIPS_HFLAG_F64 |MIPS_HFLAG_COP1X ))) {@@ -2962,10 +2966,10 @@ static inline void check_cp1_registers(DisasContext *ctx, int regs) } } -/* Verify that the processor is running with DSP instructions enabled. -This is enabled by CP0 Status register MX(24) bit. +/* +* Verify that the processor is running with DSP instructions enabled. +* This is enabled by CP0 Status register MX(24) bit. */ -static inline void check_dsp (DisasContext *ctx) {if (unlikely (!(ctx->hflags &MIPS_HFLAG_DSP ))) {@@ -2999,8 +3003,10 @@ static inline void check_dsp_r3(DisasContext *ctx) } } -/* This code generates a "reserved instruction" exception if the -CPU does not support the instruction set corresponding to flags. */ +/* +* This code generates a "reserved instruction" exception if the +* CPU does not support the instruction set corresponding to flags. +*/ static inline void check_insn (DisasContext *ctx,uint64_t flags) {if (unlikely (!(ctx->insn_flags & flags))) {@@ -3008,9 +3014,11 @@ static inline void check_insn(DisasContext *ctx, uint64_t flags) } } -/* This code generates a "reserved instruction" exception if the -CPU has corresponding flag set which indicates that the instruction -has been removed. */ +/* +* This code generates a "reserved instruction" exception if the +* CPU has corresponding flag set which indicates that the instruction +* has been removed. +*/ static inline void check_insn_opc_removed (DisasContext *ctx,uint64_t flags) {if (unlikely (ctx->insn_flags & flags)) {@@ -3033,8 +3041,10 @@ static inline void check_insn_opc_user_only(DisasContext *ctx, uint64_t flags)#endif } -/* This code generates a "reserved instruction" exception if the -CPU does not support 64-bit paired-single (PS) floating point data type */ +/* +* This code generates a "reserved instruction" exception if the +* CPU does not support 64-bit paired-single (PS) floating point data type. +*/ static inline void check_ps (DisasContext *ctx) {if (unlikely (!ctx->ps)) {@@ -3044,8 +3054,10 @@ static inline void check_ps(DisasContext *ctx) }#ifdef TARGET_MIPS64 -/* This code generates a "reserved instruction" exception if 64-bit -instructions are not enabled. */ +/* +* This code generates a "reserved instruction" exception if 64-bit +* instructions are not enabled. +*/ static inline void check_mips_64 (DisasContext *ctx) {if (unlikely (!(ctx->hflags &MIPS_HFLAG_64 ))) {@@ -3157,10 +3169,12 @@ static inline void check_eva(DisasContext *ctx) } -/* Define small wrappers for gen_load_fpr* so that we have a uniform -calling interface for 32 and 64-bit FPRs. No sense in changing -all callers for gen_load_fpr32 when we need the CTX parameter for -this one use. */ +/* +* Define small wrappers for gen_load_fpr* so that we have a uniform +* calling interface for 32 and 64-bit FPRs. No sense in changing +* all callers for gen_load_fpr32 when we need the CTX parameter for +* this one use. +*/ #define gen_ldcmp_fpr32 (ctx, x, y) gen_load_fpr32(ctx, x, y)#define gen_ldcmp_fpr64 (ctx, x, y) gen_load_fpr64(ctx, x, y)#define FOP_CONDS (type, abs, fmt, ifmt, bits) \@@ -3405,9 +3419,11 @@ static void gen_ld(DisasContext *ctx, uint32_t opc,int mem_idx = ctx->mem_idx;if (rt ==0 && ctx->insn_flags & (INSN_LOONGSON2E |INSN_LOONGSON2F )) { -/* Loongson CPU uses a load to zero register for prefetch. -We emulate it as a NOP. On other CPU we must perform the -actual memory access. */ +/* +* Loongson CPU uses a load to zero register for prefetch. +* We emulate it as a NOP. On other CPU we must perform the +* actual memory access. +*/ return ; }@@ -3433,8 +3449,10 @@ static void gen_ld(DisasContext *ctx, uint32_t opc,break ;case OPC_LDL : t1 =tcg_temp_new (); -/* Do a byte access to possibly trigger a page -fault with the unaligned address. */ +/* +* Do a byte access to possibly trigger a page +* fault with the unaligned address. +*/ tcg_gen_qemu_ld_tl (t1, t0, mem_idx,MO_UB );tcg_gen_andi_tl (t1, t0,7 );#ifndef TARGET_WORDS_BIGENDIAN @@ -3455,8 +3473,10 @@ static void gen_ld(DisasContext *ctx, uint32_t opc,break ;case OPC_LDR : t1 =tcg_temp_new (); -/* Do a byte access to possibly trigger a page -fault with the unaligned address. */ +/* +* Do a byte access to possibly trigger a page +* fault with the unaligned address. +*/ tcg_gen_qemu_ld_tl (t1, t0, mem_idx,MO_UB );tcg_gen_andi_tl (t1, t0,7 );#ifdef TARGET_WORDS_BIGENDIAN @@ -3534,8 +3554,10 @@ static void gen_ld(DisasContext *ctx, uint32_t opc,/* fall through */ case OPC_LWL : t1 =tcg_temp_new (); -/* Do a byte access to possibly trigger a page -fault with the unaligned address. */ +/* +* Do a byte access to possibly trigger a page +* fault with the unaligned address. +*/ tcg_gen_qemu_ld_tl (t1, t0, mem_idx,MO_UB );tcg_gen_andi_tl (t1, t0,3 );#ifndef TARGET_WORDS_BIGENDIAN @@ -3560,8 +3582,10 @@ static void gen_ld(DisasContext *ctx, uint32_t opc,/* fall through */ case OPC_LWR : t1 =tcg_temp_new (); -/* Do a byte access to possibly trigger a page -fault with the unaligned address. */ +/* +* Do a byte access to possibly trigger a page +* fault with the unaligned address. +*/ tcg_gen_qemu_ld_tl (t1, t0, mem_idx,MO_UB );tcg_gen_andi_tl (t1, t0,3 );#ifdef TARGET_WORDS_BIGENDIAN @@ -3762,8 +3786,10 @@ static void gen_scwp(DisasContext *ctx, uint32_t base, int16_t offset,static void gen_flt_ldst (DisasContext *ctx,uint32_t opc,int ft,TCGv t0) { -/* Don't do NOP if destination is zero: we must perform the actual -memory access. */ +/* +* Don't do NOP if destination is zero: we must perform the actual +* memory access. +*/ switch (opc) {case OPC_LWC1 : {@@ -3837,8 +3863,10 @@ static void gen_arith_imm(DisasContext *ctx, uint32_t opc,target_ulong uimm = (target_long )imm;/* Sign extend to 32/64 bits */ if (rt ==0 && opc !=OPC_ADDI && opc !=OPC_DADDI ) { -/* If no destination, treat it as a NOP. -For addi, we must generate the overflow exception when needed. */ +/* +* If no destination, treat it as a NOP. +* For addi, we must generate the overflow exception when needed. +*/ return ; }switch (opc) {@@ -4064,8 +4092,10 @@ static void gen_arith(DisasContext *ctx, uint32_t opc, {if (rd ==0 && opc !=OPC_ADD && opc !=OPC_SUB && opc !=OPC_DADD && opc !=OPC_DSUB ) { -/* If no destination, treat it as a NOP. -For add & sub, we must generate the overflow exception when needed. */ +/* +* If no destination, treat it as a NOP. +* For add & sub, we must generate the overflow exception when needed. +*/ return ; }@@ -4123,7 +4153,10 @@ static void gen_arith(DisasContext *ctx, uint32_t opc,tcg_temp_free (t2);tcg_gen_brcondi_tl (TCG_COND_GE , t1,0 , l1);tcg_temp_free (t1); -/* operands of different sign, first operand and result different sign */ +/* +* operands of different sign, first operand and the result +* of different sign +*/ generate_exception (ctx,EXCP_OVERFLOW );gen_set_label (l1);gen_store_gpr (t0, rd);@@ -4346,8 +4379,10 @@ static void gen_shift(DisasContext *ctx, uint32_t opc,TCGv t0, t1;if (rd ==0 ) { -/* If no destination, treat it as a NOP. -For add & sub, we must generate the overflow exception when needed. */ +/* +* If no destination, treat it as a NOP. +* For add & sub, we must generate the overflow exception when needed. +*/ return ; }@@ -5643,8 +5678,10 @@ static void gen_loongson_multimedia(DisasContext *ctx, int rd, int rs, int rt)break ;case OPC_SRA_CP2 :case OPC_DSRA_CP2 : -/* Since SRA is UndefinedResult without sign-extended inputs, -we can treat SRA and DSRA the same. */ +/* +* Since SRA is UndefinedResult without sign-extended inputs, +* we can treat SRA and DSRA the same. +*/ tcg_gen_sar_i64 (t0, t0, t1);break ;case OPC_SRL_CP2 :@@ -5720,8 +5757,10 @@ static void gen_loongson_multimedia(DisasContext *ctx, int rd, int rs, int rt)case OPC_SLT_CP2 :case OPC_SLEU_CP2 :case OPC_SLE_CP2 : -/* ??? Document is unclear: Set FCC[CC]. Does that mean the -FD field is the CC field? */ +/* +* ??? Document is unclear: Set FCC[CC]. Does that mean the +* FD field is the CC field? +*/ default :MIPS_INVAL ("loongson_cp2" );generate_exception_end (ctx,EXCP_RI );@@ -5972,8 +6011,10 @@ static void gen_compute_branch (DisasContext *ctx, uint32_t opc,/* Treat as NOP. */ goto out;case OPC_BLTZAL :/* 0 < 0 */ -/* Handle as an unconditional branch to get correct delay -slot checking. */ +/* +* Handle as an unconditional branch to get correct delay +* slot checking. +*/ blink =31 ; btgt = ctx->base.pc_next + insn_bytes + delayslot_size; ctx->hflags |=MIPS_HFLAG_B ;@@ -6151,8 +6192,10 @@ static void gen_compute_branch_nm(DisasContext *ctx, uint32_t opc,case OPC_JALR :/* Jump to register */ if (offset !=0 && offset !=16 ) { -/* Hint = 0 is JR/JALR, hint 16 is JR.HB/JALR.HB, the -others are reserved. */ +/* +* Hint = 0 is JR/JALR, hint 16 is JR.HB/JALR.HB, the +* others are reserved. +*/ MIPS_INVAL ("jump hint" );generate_exception_end (ctx,EXCP_RI ); goto out;@@ -6249,8 +6292,10 @@ static void gen_bitops(DisasContext *ctx, uint32_t opc, int rt,if (msb !=31 ) {tcg_gen_extract_tl (t0, t1, lsb, msb +1 ); }else { -/* The two checks together imply that lsb == 0, -so this is a simple sign-extension. */ +/* +* The two checks together imply that lsb == 0, +* so this is a simple sign-extension. +*/ tcg_gen_ext32s_tl (t0, t1); }break ;@@ -6701,10 +6746,12 @@ static void gen_mthc0(DisasContext *ctx, TCGv arg, int reg, int sel)case CP0_REGISTER_17 :switch (sel) {case 0 : -/* LLAddr is read-only (the only exception is bit 0 if LLB is -supported); the CP0_LLAddr_rw_bitmask does not seem to be -relevant for modern MIPS cores supporting MTHC0, therefore -treating MTHC0 to LLAddr as NOP. */ +/* +* LLAddr is read-only (the only exception is bit 0 if LLB is +* supported); the CP0_LLAddr_rw_bitmask does not seem to be +* relevant for modern MIPS cores supporting MTHC0, therefore +* treating MTHC0 to LLAddr as NOP. +*/ register_name ="LLAddr" ;break ;case 1 :@@ -6928,7 +6975,7 @@ static void gen_mfc0(DisasContext *ctx, TCGv arg, int reg, int sel) register_name ="Context" ;break ;case 1 : -// gen_helper_mfc0_contextconfig(arg); /* SmartMIPS ASE */ +/* gen_helper_mfc0_contextconfig(arg); - SmartMIPS ASE */ register_name ="ContextConfig" ; goto cp0_unimplemented;case 2 :@@ -12389,8 +12436,10 @@ static void gen_flt3_ldst(DisasContext *ctx, uint32_t opc, }else {gen_op_addr_add (ctx, t0, cpu_gpr[base], cpu_gpr[index]); } -/* Don't do NOP if destination is zero: we must perform the actual -memory access. */ +/* +* Don't do NOP if destination is zero: we must perform the actual +* memory access. +*/ switch (opc) {case OPC_LWXC1 :check_cop1x (ctx);@@ -12718,8 +12767,10 @@ static void gen_rdhwr(DisasContext *ctx, int rt, int rd, int sel)TCGv t0;#if !defined(CONFIG_USER_ONLY ) -/* The Linux kernel will emulate rdhwr if it's not supported natively. -Therefore only check the ISA in system mode. */ +/* +* The Linux kernel will emulate rdhwr if it's not supported natively. +* Therefore only check the ISA in system mode. +*/ check_insn (ctx,ISA_MIPS32R2 );#endif t0 =tcg_temp_new ();@@ -12742,9 +12793,11 @@ static void gen_rdhwr(DisasContext *ctx, int rt, int rd, int sel)gen_io_end (); }gen_store_gpr (t0, rt); -/* Break the TB to be able to take timer interrupts immediately -after reading count. DISAS_STOP isn't sufficient, we need to ensure -we break completely out of translated code. */ +/* +* Break the TB to be able to take timer interrupts immediately +* after reading count. DISAS_STOP isn't sufficient, we need to ensure +* we break completely out of translated code. +*/ gen_save_pc (ctx->base.pc_next +4 ); ctx->base.is_jmp =DISAS_EXIT ;break ;@@ -12755,7 +12808,8 @@ static void gen_rdhwr(DisasContext *ctx, int rt, int rd, int sel)case 4 :check_insn (ctx,ISA_MIPS32R6 );if (sel !=0 ) { -/* Performance counter registers are not implemented other than +/* +* Performance counter registers are not implemented other than * control register 0. */ generate_exception (ctx,EXCP_RI );@@ -12799,8 +12853,10 @@ static inline void clear_branch_hflags(DisasContext *ctx)if (ctx->base.is_jmp ==DISAS_NEXT ) {save_cpu_state (ctx,0 ); }else { -/* it is not safe to save ctx->hflags as hflags may be changed -in execution time by the instruction in delay / forbidden slot. */ +/* +* It is not safe to save ctx->hflags as hflags may be changed +* in execution time by the instruction in delay / forbidden slot. +*/ tcg_gen_andi_i32 (hflags, hflags, ~MIPS_HFLAG_BMASK ); } }@@ -13599,8 +13655,10 @@ static int decode_extended_mips16_opc(CPUMIPSState *env, DisasContext *ctx) | ((ctx->opcode >> 21) & 0x3f) << 5 | (ctx->opcode & 0x1f)); -/* The extended opcodes cleverly reuse the opcodes from their 16-bit -counterparts. */ +/* +* The extended opcodes cleverly reuse the opcodes from their 16-bit +* counterparts. +*/ switch (op) {case M16_OPC_ADDIUSP :gen_arith_imm (ctx,OPC_ADDIU , rx,29 , imm);@@ -15056,8 +15114,10 @@ static void gen_pool16c_insn(DisasContext *ctx) {int reg = ctx->opcode &0x1f ;gen_compute_branch (ctx,OPC_JR ,2 , reg,0 ,0 ,0 ); -/* Let normal delay slot handling in our caller take us -to the branch target. */ +/* +* Let normal delay slot handling in our caller take us +* to the branch target. +*/ }break ;case JALR16 +0 :@@ -15085,7 +15145,8 @@ static void gen_pool16c_insn(DisasContext *ctx)if (is_uhi (extract32 (ctx->opcode,0 ,4 ))) {gen_helper_do_semihosting (cpu_env); }else { -/* XXX: not clear which exception should be raised +/* +* XXX: not clear which exception should be raised * when in debug mode... */ check_insn (ctx,ISA_MIPS32 );@@ -15098,8 +15159,10 @@ static void gen_pool16c_insn(DisasContext *ctx)int imm =ZIMM (ctx->opcode,0 ,5 );gen_compute_branch (ctx,OPC_JR ,2 ,31 ,0 ,0 ,0 );gen_arith_imm (ctx,OPC_ADDIU ,29 ,29 , imm <<2 ); -/* Let normal delay slot handling in our caller take us -to the branch target. */ +/* +* Let normal delay slot handling in our caller take us +* to the branch target. +*/ }break ;default :@@ -17358,7 +17421,8 @@ static int decode_micromips_opc(CPUMIPSState *env, DisasContext *ctx)break ; }if (ctx->insn_flags &ISA_MIPS32R6 ) { -/* In the Release 6 the register number location in +/* +* In the Release 6, the register number location in * the instruction encoding has changed. */ gen_arith (ctx, opc, rs1, rd, rs2);@@ -21083,9 +21147,11 @@ static int decode_nanomips_32_48_opc(CPUMIPSState *env, DisasContext *ctx)gen_p_lsx (ctx, rd, rs, rt);break ;case NM_LSA : -/* In nanoMIPS, the shift field directly encodes the shift +/* +* In nanoMIPS, the shift field directly encodes the shift * amount, meaning that the supported shift values are in -* the range 0 to 3 (instead of 1 to 4 in MIPSR6). */ +* the range 0 to 3 (instead of 1 to 4 in MIPSR6). +*/ gen_lsa (ctx,OPC_LSA , rd, rs, rt,extract32 (ctx->opcode,9 ,2 ) -1 );break ;@@ -21440,8 +21506,10 @@ static int decode_nanomips_32_48_opc(CPUMIPSState *env, DisasContext *ctx)case NM_P_PREFU12 :if (rt ==31 ) {/* SYNCI */ -/* Break the TB to be able to sync copied instructions -immediately */ +/* +* Break the TB to be able to sync copied instructions +* immediately. +*/ ctx->base.is_jmp =DISAS_STOP ; }else {/* PREF */ @@ -21537,8 +21605,10 @@ static int decode_nanomips_32_48_opc(CPUMIPSState *env, DisasContext *ctx)case NM_P_PREFS9 :if (rt ==31 ) {/* SYNCI */ -/* Break the TB to be able to sync copied instructions -immediately */ +/* +* Break the TB to be able to sync copied instructions +* immediately. +*/ ctx->base.is_jmp =DISAS_STOP ; }else {/* PREF */ @@ -21630,8 +21700,10 @@ static int decode_nanomips_32_48_opc(CPUMIPSState *env, DisasContext *ctx)/* case NM_SYNCIE */ check_eva (ctx);check_cp0_enabled (ctx); -/* Break the TB to be able to sync copied instructions -immediately */ +/* +* Break the TB to be able to sync copied instructions +* immediately. +*/ ctx->base.is_jmp =DISAS_STOP ; }else {/* case NM_PREFE */ @@ -23026,8 +23098,10 @@ static void gen_mipsdsp_multiply(DisasContext *ctx, uint32_t op1, uint32_t op2,gen_load_gpr (v2_t, v2);switch (op1) { -/* OPC_MULT_G_2E, OPC_ADDUH_QB_DSP, OPC_MUL_PH_DSP have -* the same mask and op1. */ +/* +* OPC_MULT_G_2E, OPC_ADDUH_QB_DSP, OPC_MUL_PH_DSP have +* the same mask and op1. +*/ case OPC_MULT_G_2E :check_dsp_r2 (ctx);switch (op2) {@@ -23996,8 +24070,10 @@ static void decode_opc_special_r6(CPUMIPSState *env, DisasContext *ctx)case R6_OPC_CLO :case R6_OPC_CLZ :if (rt ==0 && sa ==1 ) { -/* Major opcode and function field is shared with preR6 MFHI/MTHI. -We need additionally to check other fields */ +/* +* Major opcode and function field is shared with preR6 MFHI/MTHI. +* We need additionally to check other fields. +*/ gen_cl (ctx, op1, rd, rs); }else {generate_exception_end (ctx,EXCP_RI );@@ -24022,8 +24098,10 @@ static void decode_opc_special_r6(CPUMIPSState *env, DisasContext *ctx)case R6_OPC_DCLO :case R6_OPC_DCLZ :if (rt ==0 && sa ==1 ) { -/* Major opcode and function field is shared with preR6 MFHI/MTHI. -We need additionally to check other fields */ +/* +* Major opcode and function field is shared with preR6 MFHI/MTHI. +* We need additionally to check other fields. +*/ check_mips_64 (ctx);gen_cl (ctx, op1, rd, rs); }else {@@ -25939,7 +26017,7 @@ static void decode_opc_mxu__pool07(CPUMIPSState *env, DisasContext *ctx)* | SPECIAL2 | rb |x| s12 | XRa |MXU__POOL08| * +-----------+---------+-+-------------------+-------+-----------+ * -*/ +*/ static void decode_opc_mxu__pool08 (CPUMIPSState *env,DisasContext *ctx) {uint32_t opcode =extract32 (ctx->opcode,20 ,1 );@@ -26835,7 +26913,8 @@ static void decode_opc_special2_legacy(CPUMIPSState *env, DisasContext *ctx)if (is_uhi (extract32 (ctx->opcode,6 ,20 ))) {gen_helper_do_semihosting (cpu_env); }else { -/* XXX: not clear which exception should be raised +/* +* XXX: not clear which exception should be raised * when in debug mode... */ check_insn (ctx,ISA_MIPS32 );@@ -26977,8 +27056,10 @@ static void decode_opc_special3_legacy(CPUMIPSState *env, DisasContext *ctx)case OPC_MODU_G_2E :case OPC_MULT_G_2E :case OPC_MULTU_G_2E : -/* OPC_MULT_G_2E, OPC_ADDUH_QB_DSP, OPC_MUL_PH_DSP have -* the same mask and op1. */ +/* +* OPC_MULT_G_2E, OPC_ADDUH_QB_DSP, OPC_MUL_PH_DSP have +* the same mask and op1. +*/ if ((ctx->insn_flags &ASE_DSP_R2 ) && (op1 ==OPC_MULT_G_2E )) { op2 =MASK_ADDUH_QB (ctx->opcode);switch (op2) {@@ -29165,8 +29246,10 @@ static void decode_opc(CPUMIPSState *env, DisasContext *ctx)break ;case OPC_SYNCI :check_insn (ctx,ISA_MIPS32R2 ); -/* Break the TB to be able to sync copied instructions -immediately */ +/* +* Break the TB to be able to sync copied instructions +* immediately. +*/ ctx->base.is_jmp =DISAS_STOP ;break ;case OPC_BPOSGE32 :/* MIPS DSP branch */ @@ -29283,8 +29366,10 @@ static void decode_opc(CPUMIPSState *env, DisasContext *ctx)save_cpu_state (ctx,1 );gen_helper_di (t0, cpu_env);gen_store_gpr (t0, rt); -/* Stop translation as we may have switched -the execution mode. */ +/* +* Stop translation as we may have switched +* the execution mode. +*/ ctx->base.is_jmp =DISAS_STOP ;break ;case OPC_EI :@@ -29292,8 +29377,10 @@ static void decode_opc(CPUMIPSState *env, DisasContext *ctx)save_cpu_state (ctx,1 );gen_helper_ei (t0, cpu_env);gen_store_gpr (t0, rt); -/* DISAS_STOP isn't sufficient, we need to ensure we break -out of translated code to check for pending interrupts */ +/* +* DISAS_STOP isn't sufficient, we need to ensure we break +* out of translated code to check for pending interrupts. +*/ gen_save_pc (ctx->base.pc_next +4 ); ctx->base.is_jmp =DISAS_EXIT ;break ;@@ -29876,10 +29963,12 @@ static bool mips_tr_breakpoint_check(DisasContextBase *dcbase, CPUState *cs,save_cpu_state (ctx,1 ); ctx->base.is_jmp =DISAS_NORETURN ;gen_helper_raise_exception_debug (cpu_env); -/* The address covered by the breakpoint must be included in -[tb->pc, tb->pc + tb->size) in order to for it to be -properly cleared -- thus we increment the PC here so that -the logic setting tb->size below does the right thing. */ +/* +* The address covered by the breakpoint must be included in +* [tb->pc, tb->pc + tb->size) in order to for it to be +* properly cleared -- thus we increment the PC here so that +* the logic setting tb->size below does the right thing. +*/ ctx->base.pc_next +=4 ;return true; }@@ -29914,14 +30003,18 @@ static void mips_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)if (ctx->hflags &MIPS_HFLAG_BMASK ) {if (!(ctx->hflags & (MIPS_HFLAG_BDS16 |MIPS_HFLAG_BDS32 |MIPS_HFLAG_FBNSLOT ))) { -/* force to generate branch as there is neither delay nor -forbidden slot */ +/* +* Force to generate branch as there is neither delay nor +* forbidden slot. +*/ is_slot =1 ; }if ((ctx->hflags &MIPS_HFLAG_M16 ) && (ctx->hflags &MIPS_HFLAG_FBNSLOT )) { -/* Force to generate branch as microMIPS R6 doesn't restrict -branches in the forbidden slot. */ +/* +* Force to generate branch as microMIPS R6 doesn't restrict +* branches in the forbidden slot. +*/ is_slot =1 ; } }@@ -29933,10 +30026,12 @@ static void mips_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)if (ctx->base.is_jmp !=DISAS_NEXT ) {return ; } -/* Execute a branch and its delay slot as a single instruction. -This is what GDB expects and is consistent with what the -hardware does (e.g. if a delay slot instruction faults, the -reported PC is the PC of the branch). */ +/* +* Execute a branch and its delay slot as a single instruction. +* This is what GDB expects and is consistent with what the +* hardware does (e.g. if a delay slot instruction faults, the +* reported PC is the PC of the branch). +*/ if (ctx->base.singlestep_enabled && (ctx->hflags &MIPS_HFLAG_BMASK ) ==0 ) { ctx->base.is_jmp =DISAS_TOO_MANY ;@@ -30088,8 +30183,10 @@ void mips_tcg_init(void) int off = offsetof(CPUMIPSState, active_fpu.fpr[i].wr.d[0]); msa_wr_d[i *2 ] =tcg_global_mem_new_i64 (cpu_env, off, msaregnames[i *2 ]); -/* The scalar floating-point unit (FPU) registers are mapped on -* the MSA vector registers. */ +/* +* The scalar floating-point unit (FPU) registers are mapped on +* the MSA vector registers. +*/ fpu_f64[i] = msa_wr_d[i *2 ]; off = offsetof(CPUMIPSState, active_fpu.fpr[i].wr.d[1]); msa_wr_d[i * 2 + 1] =@@ -30247,8 +30344,10 @@ void cpu_state_reset(CPUMIPSState *env)/* Enable 64-bit address mode. */ env->CP0_Status |= (1 << CP0St_UX);# endif -/* Enable access to the CPUNum, SYNCI_Step, CC, and CCRes RDHWR -hardware registers. */ +/* +* Enable access to the CPUNum, SYNCI_Step, CC, and CCRes RDHWR +* hardware registers. +*/ env->CP0_HWREna |=0x0000000F ;if (env->CP0_Config1 & (1 <<CP0C1_FP )) { env->CP0_Status |= (1 << CP0St_CU1);@@ -30265,8 +30364,10 @@ void cpu_state_reset(CPUMIPSState *env)# endif #else if (env->hflags &MIPS_HFLAG_BMASK ) { -/* If the exception was raised from a delay slot, -come back to the jump. */ +/* +* If the exception was raised from a delay slot, +* come back to the jump. +*/ env->CP0_ErrorEPC = (env->active_tc.PC - (env->hflags &MIPS_HFLAG_B16 ?2 :4 )); }else {@@ -30289,8 +30390,10 @@ void cpu_state_reset(CPUMIPSState *env) env->CP0_EntryHi_ASID_mask = (env->CP0_Config4 & (1 <<CP0C4_AE )) ?0x3ff :0xff ;
target/mips/translate.c void cpu_state_reset(CPUMIPSState *env) · line 30399
Quoted 10 lines
target/mips/translate.c +4
-2env->CP0_Status = (1 << CP0St_BEV) | (1 << CP0St_ERL); -/* vectored interrupts not implemented, timer on int 7, -no performance counters. */ +/* +* Vectored interrupts not implemented, timer on int 7, +* no performance counters. +*/ env->CP0_IntCtl =0xe0000000 ; {int i;
PATCH 5/7 tcg/tests: target/mips: Correct MSA test compilation and execution order
In reply to Aleksandar MarkovicFrom: Aleksandar Markovic <[email protected]>
Correct MSA test compilation and execution order, for the sake of consistence.
--- tests/tcg/mips/user/ase/msa/test_msa_compile_32r6eb.sh | 16 ++++++++-------- tests/tcg/mips/user/ase/msa/test_msa_compile_32r6el.sh | 16 ++++++++-------- tests/tcg/mips/user/ase/msa/test_msa_compile_64r6eb.sh | 16 ++++++++-------- tests/tcg/mips/user/ase/msa/test_msa_compile_64r6el.sh | 16 ++++++++-------- tests/tcg/mips/user/ase/msa/test_msa_run_32r6eb.sh | 8 ++++---- tests/tcg/mips/user/ase/msa/test_msa_run_32r6el.sh | 8 ++++---- tests/tcg/mips/user/ase/msa/test_msa_run_64r6eb.sh | 8 ++++---- tests/tcg/mips/user/ase/msa/test_msa_run_64r6el.sh | 8 ++++---- 8 files changed, 48 insertions(+), 48 deletions(-)
tests/tcg/mips/user/ase/msa/test_msa_compile_32r6eb.sh +8 -8
@@ -486,14 +486,6 @@ -EB -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_subs_u_w_32r6eb /opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subs_u_d.c \ -EB -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_subs_u_d_32r6eb -/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_b.c \ --EB -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_subsuu_s_b_32r6eb -/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_h.c \ --EB -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_subsuu_s_h_32r6eb -/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_w.c \ --EB -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_subsuu_s_w_32r6eb -/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_d.c \ --EB -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_subsuu_s_d_32r6eb /opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsus_u_b.c \ -EB -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_subsus_u_b_32r6eb /opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsus_u_h.c \
@@ -502,6 +494,14 @@ -EB -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_subsus_u_w_32r6eb /opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsus_u_d.c \ -EB -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_subsus_u_d_32r6eb +/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_b.c \ +-EB -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_subsuu_s_b_32r6eb +/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_h.c \ +-EB -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_subsuu_s_h_32r6eb +/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_w.c \ +-EB -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_subsuu_s_w_32r6eb +/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_d.c \ +-EB -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_subsuu_s_d_32r6eb /opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subv_b.c \ -EB -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_subv_b_32r6eb /opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subv_h.c \
tests/tcg/mips/user/ase/msa/test_msa_compile_32r6el.sh +8 -8
@@ -486,14 +486,6 @@ -EL -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_subs_u_w_32r6el /opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subs_u_d.c \ -EL -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_subs_u_d_32r6el -/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_b.c \ --EL -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_subsuu_s_b_32r6el -/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_h.c \ --EL -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_subsuu_s_h_32r6el -/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_w.c \ --EL -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_subsuu_s_w_32r6el -/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_d.c \ --EL -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_subsuu_s_d_32r6el /opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsus_u_b.c \ -EL -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_subsus_u_b_32r6el /opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsus_u_h.c \
@@ -502,6 +494,14 @@ -EL -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_subsus_u_w_32r6el /opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsus_u_d.c \ -EL -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_subsus_u_d_32r6el +/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_b.c \ +-EL -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_subsuu_s_b_32r6el +/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_h.c \ +-EL -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_subsuu_s_h_32r6el +/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_w.c \ +-EL -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_subsuu_s_w_32r6el +/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_d.c \ +-EL -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_subsuu_s_d_32r6el /opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subv_b.c \ -EL -static -mabi=32 -march=mips32r6 -mmsa -o /tmp/test_msa_subv_b_32r6el /opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subv_h.c \
tests/tcg/mips/user/ase/msa/test_msa_compile_64r6eb.sh +8 -8
@@ -486,14 +486,6 @@ -EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subs_u_w_64r6eb /opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subs_u_d.c \ -EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subs_u_d_64r6eb -/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_b.c \ --EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsuu_s_b_64r6eb -/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_h.c \ --EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsuu_s_h_64r6eb -/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_w.c \ --EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsuu_s_w_64r6eb -/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_d.c \ --EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsuu_s_d_64r6eb /opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsus_u_b.c \ -EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsus_u_b_64r6eb /opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsus_u_h.c \
@@ -502,6 +494,14 @@ -EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsus_u_w_64r6eb /opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsus_u_d.c \ -EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsus_u_d_64r6eb +/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_b.c \ +-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsuu_s_b_64r6eb +/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_h.c \ +-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsuu_s_h_64r6eb +/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_w.c \ +-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsuu_s_w_64r6eb +/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_d.c \ +-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsuu_s_d_64r6eb /opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subv_b.c \ -EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subv_b_64r6eb /opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subv_h.c \
tests/tcg/mips/user/ase/msa/test_msa_compile_64r6el.sh +8 -8
@@ -486,14 +486,6 @@ -EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subs_u_w_64r6el /opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subs_u_d.c \ -EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subs_u_d_64r6el -/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_b.c \ --EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsuu_s_b_64r6el -/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_h.c \ --EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsuu_s_h_64r6el -/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_w.c \ --EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsuu_s_w_64r6el -/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_d.c \ --EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsuu_s_d_64r6el /opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsus_u_b.c \ -EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsus_u_b_64r6el /opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsus_u_h.c \
@@ -502,6 +494,14 @@ -EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsus_u_w_64r6el /opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsus_u_d.c \ -EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsus_u_d_64r6el +/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_b.c \ +-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsuu_s_b_64r6el +/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_h.c \ +-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsuu_s_h_64r6el +/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_w.c \ +-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsuu_s_w_64r6el +/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_d.c \ +-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsuu_s_d_64r6el /opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subv_b.c \ -EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subv_b_64r6el /opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subv_h.c \
tests/tcg/mips/user/ase/msa/test_msa_run_32r6eb.sh +4 -4
@@ -279,14 +279,14 @@ $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_u_b_32r6eb $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_u_h_32r6eb $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_u_w_32r6eb $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_u_d_32r6eb -$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_b_32r6eb -$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_h_32r6eb -$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_w_32r6eb -$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_d_32r6eb $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsus_u_b_32r6eb $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsus_u_h_32r6eb $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsus_u_w_32r6eb $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsus_u_d_32r6eb +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_b_32r6eb +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_h_32r6eb +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_w_32r6eb +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_d_32r6eb $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subv_b_32r6eb $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subv_h_32r6eb $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subv_w_32r6eb
tests/tcg/mips/user/ase/msa/test_msa_run_32r6el.sh +4 -4
@@ -279,14 +279,14 @@ $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_u_b_32r6el $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_u_h_32r6el $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_u_w_32r6el $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_u_d_32r6el -$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_b_32r6el -$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_h_32r6el -$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_w_32r6el -$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_d_32r6el $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsus_u_b_32r6el $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsus_u_h_32r6el $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsus_u_w_32r6el $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsus_u_d_32r6el +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_b_32r6el +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_h_32r6el +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_w_32r6el +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_d_32r6el $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subv_b_32r6el $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subv_h_32r6el $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subv_w_32r6el
tests/tcg/mips/user/ase/msa/test_msa_run_64r6eb.sh +4 -4
@@ -279,14 +279,14 @@ $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_u_b_64r6eb $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_u_h_64r6eb $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_u_w_64r6eb $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_u_d_64r6eb -$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_b_64r6eb -$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_h_64r6eb -$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_w_64r6eb -$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_d_64r6eb $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsus_u_b_64r6eb $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsus_u_h_64r6eb $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsus_u_w_64r6eb $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsus_u_d_64r6eb +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_b_64r6eb +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_h_64r6eb +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_w_64r6eb +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_d_64r6eb $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subv_b_64r6eb $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subv_h_64r6eb $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subv_w_64r6eb
tests/tcg/mips/user/ase/msa/test_msa_run_64r6el.sh +4 -4
@@ -279,14 +279,14 @@ $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_u_b_64r6el $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_u_h_64r6el $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_u_w_64r6el $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_u_d_64r6el -$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_b_64r6el -$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_h_64r6el -$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_w_64r6el -$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_d_64r6el $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsus_u_b_64r6el $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsus_u_h_64r6el $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsus_u_w_64r6el $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsus_u_d_64r6el +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_b_64r6el +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_h_64r6el +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_w_64r6el +$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_d_64r6el $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subv_b_64r6el $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subv_h_64r6el $PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subv_w_64r6el
Signature · 1 line
2.7.4
PATCH 6/7 target/mips: Unroll loops for MSA float max/min instructions
In reply to Aleksandar MarkovicFrom: Aleksandar Markovic <[email protected]>
Slight preformance improvement for MSA float max/min instructions.
--- target/mips/msa_helper.c | 200 +++++++++++++++++++++++++++++------------------ 1 file changed, 126 insertions(+), 74 deletions(-)
target/mips/msa_helper.c +126 -74
@@ -458,7 +458,7 @@* +---------------+----------------------------------------------------------+ */ -/* TODO: insert Interleave group helpers here */ +/* TODO: insert Logic group helpers here */ /*
@@ -3850,35 +3850,65 @@ void helper_msa_fmin_df(CPUMIPSState *env, uint32_t df, uint32_t wd,wr_t *pwd = &(env->active_fpu.fpr[wd].wr);wr_t *pws = &(env->active_fpu.fpr[ws].wr);wr_t *pwt = &(env->active_fpu.fpr[wt].wr); -uint32_t i;clear_msacsr_cause (env); -switch (df) { -case DF_WORD : -for (i =0 ; i <DF_ELEMENTS (DF_WORD ); i++) { -if (NUMBER_QNAN_PAIR (pws->w[i], pwt->w[i],32 , status)) { -MSA_FLOAT_MAXOP (pwx->w[i], min, pws->w[i], pws->w[i],32 ); - }else if (NUMBER_QNAN_PAIR (pwt->w[i], pws->w[i],32 , status)) { -MSA_FLOAT_MAXOP (pwx->w[i], min, pwt->w[i], pwt->w[i],32 ); - }else { -MSA_FLOAT_MAXOP (pwx->w[i], min, pws->w[i], pwt->w[i],32 ); - } +if (df ==DF_WORD ) { + +if (NUMBER_QNAN_PAIR (pws->w[0 ], pwt->w[0 ],32 , status)) { +MSA_FLOAT_MAXOP (pwx->w[0 ], min, pws->w[0 ], pws->w[0 ],32 ); + }else if (NUMBER_QNAN_PAIR (pwt->w[0 ], pws->w[0 ],32 , status)) { +MSA_FLOAT_MAXOP (pwx->w[0 ], min, pwt->w[0 ], pwt->w[0 ],32 ); + }else { +MSA_FLOAT_MAXOP (pwx->w[0 ], min, pws->w[0 ], pwt->w[0 ],32 ); } -break ; -case DF_DOUBLE : -for (i =0 ; i <DF_ELEMENTS (DF_DOUBLE ); i++) { -if (NUMBER_QNAN_PAIR (pws->d[i], pwt->d[i],64 , status)) { -MSA_FLOAT_MAXOP (pwx->d[i], min, pws->d[i], pws->d[i],64 ); - }else if (NUMBER_QNAN_PAIR (pwt->d[i], pws->d[i],64 , status)) { -MSA_FLOAT_MAXOP (pwx->d[i], min, pwt->d[i], pwt->d[i],64 ); - }else { -MSA_FLOAT_MAXOP (pwx->d[i], min, pws->d[i], pwt->d[i],64 ); - } + +if (NUMBER_QNAN_PAIR (pws->w[1 ], pwt->w[1 ],32 , status)) { +MSA_FLOAT_MAXOP (pwx->w[1 ], min, pws->w[1 ], pws->w[1 ],32 ); + }else if (NUMBER_QNAN_PAIR (pwt->w[1 ], pws->w[1 ],32 , status)) { +MSA_FLOAT_MAXOP (pwx->w[1 ], min, pwt->w[1 ], pwt->w[1 ],32 ); + }else { +MSA_FLOAT_MAXOP (pwx->w[1 ], min, pws->w[1 ], pwt->w[1 ],32 ); } -break ; -default : + +if (NUMBER_QNAN_PAIR (pws->w[2 ], pwt->w[2 ],32 , status)) { +MSA_FLOAT_MAXOP (pwx->w[2 ], min, pws->w[2 ], pws->w[2 ],32 ); + }else if (NUMBER_QNAN_PAIR (pwt->w[2 ], pws->w[2 ],32 , status)) { +MSA_FLOAT_MAXOP (pwx->w[2 ], min, pwt->w[2 ], pwt->w[2 ],32 ); + }else { +MSA_FLOAT_MAXOP (pwx->w[2 ], min, pws->w[2 ], pwt->w[2 ],32 ); + } + +if (NUMBER_QNAN_PAIR (pws->w[3 ], pwt->w[3 ],32 , status)) { +MSA_FLOAT_MAXOP (pwx->w[3 ], min, pws->w[3 ], pws->w[3 ],32 ); + }else if (NUMBER_QNAN_PAIR (pwt->w[3 ], pws->w[3 ],32 , status)) { +MSA_FLOAT_MAXOP (pwx->w[3 ], min, pwt->w[3 ], pwt->w[3 ],32 ); + }else { +MSA_FLOAT_MAXOP (pwx->w[3 ], min, pws->w[3 ], pwt->w[3 ],32 ); + } + + }else if (df ==DF_DOUBLE ) { + +if (NUMBER_QNAN_PAIR (pws->d[0 ], pwt->d[0 ],64 , status)) { +MSA_FLOAT_MAXOP (pwx->d[0 ], min, pws->d[0 ], pws->d[0 ],64 ); + }else if (NUMBER_QNAN_PAIR (pwt->d[0 ], pws->d[0 ],64 , status)) { +MSA_FLOAT_MAXOP (pwx->d[0 ], min, pwt->d[0 ], pwt->d[0 ],64 ); + }else { +MSA_FLOAT_MAXOP (pwx->d[0 ], min, pws->d[0 ], pwt->d[0 ],64 ); + } + +if (NUMBER_QNAN_PAIR (pws->d[1 ], pwt->d[1 ],64 , status)) { +MSA_FLOAT_MAXOP (pwx->d[1 ], min, pws->d[1 ], pws->d[1 ],64 ); + }else if (NUMBER_QNAN_PAIR (pwt->d[1 ], pws->d[1 ],64 , status)) { +MSA_FLOAT_MAXOP (pwx->d[1 ], min, pwt->d[1 ], pwt->d[1 ],64 ); + }else { +MSA_FLOAT_MAXOP (pwx->d[1 ], min, pws->d[1 ], pwt->d[1 ],64 ); + } + + }else { +assert (0 ); + }check_msacsr_cause (env,GETPC ());
@@ -3894,22 +3924,18 @@ void helper_msa_fmin_a_df(CPUMIPSState *env, uint32_t df, uint32_t wd,wr_t *pwd = &(env->active_fpu.fpr[wd].wr);wr_t *pws = &(env->active_fpu.fpr[ws].wr);wr_t *pwt = &(env->active_fpu.fpr[wt].wr); -uint32_t i;clear_msacsr_cause (env); -switch (df) { -case DF_WORD : -for (i =0 ; i <DF_ELEMENTS (DF_WORD ); i++) { -FMAXMIN_A (min, max, pwx->w[i], pws->w[i], pwt->w[i],32 , status); - } -break ; -case DF_DOUBLE : -for (i =0 ; i <DF_ELEMENTS (DF_DOUBLE ); i++) { -FMAXMIN_A (min, max, pwx->d[i], pws->d[i], pwt->d[i],64 , status); - } -break ; -default : +if (df ==DF_WORD ) { +FMAXMIN_A (min, max, pwx->w[0 ], pws->w[0 ], pwt->w[0 ],32 , status); +FMAXMIN_A (min, max, pwx->w[1 ], pws->w[1 ], pwt->w[1 ],32 , status); +FMAXMIN_A (min, max, pwx->w[2 ], pws->w[2 ], pwt->w[2 ],32 , status); +FMAXMIN_A (min, max, pwx->w[3 ], pws->w[3 ], pwt->w[3 ],32 , status); + }else if (df ==DF_DOUBLE ) { +FMAXMIN_A (min, max, pwx->d[0 ], pws->d[0 ], pwt->d[0 ],64 , status); +FMAXMIN_A (min, max, pwx->d[1 ], pws->d[1 ], pwt->d[1 ],64 , status); + }else {assert (0 ); }
@@ -3921,40 +3947,70 @@ void helper_msa_fmin_a_df(CPUMIPSState *env, uint32_t df, uint32_t wd,void helper_msa_fmax_df (CPUMIPSState *env,uint32_t df,uint32_t wd,uint32_t ws,uint32_t wt) { -float_status *status = &env->active_tc.msa_fp_status; +float_status *status = &env->active_tc.msa_fp_status;wr_t wx, *pwx = &wx;wr_t *pwd = &(env->active_fpu.fpr[wd].wr);wr_t *pws = &(env->active_fpu.fpr[ws].wr);wr_t *pwt = &(env->active_fpu.fpr[wt].wr); -uint32_t i;clear_msacsr_cause (env); -switch (df) { -case DF_WORD : -for (i =0 ; i <DF_ELEMENTS (DF_WORD ); i++) { -if (NUMBER_QNAN_PAIR (pws->w[i], pwt->w[i],32 , status)) { -MSA_FLOAT_MAXOP (pwx->w[i], max, pws->w[i], pws->w[i],32 ); - }else if (NUMBER_QNAN_PAIR (pwt->w[i], pws->w[i],32 , status)) { -MSA_FLOAT_MAXOP (pwx->w[i], max, pwt->w[i], pwt->w[i],32 ); - }else { -MSA_FLOAT_MAXOP (pwx->w[i], max, pws->w[i], pwt->w[i],32 ); - } +if (df ==DF_WORD ) { + +if (NUMBER_QNAN_PAIR (pws->w[0 ], pwt->w[0 ],32 , status)) { +MSA_FLOAT_MAXOP (pwx->w[0 ], max, pws->w[0 ], pws->w[0 ],32 ); + }else if (NUMBER_QNAN_PAIR (pwt->w[0 ], pws->w[0 ],32 , status)) { +MSA_FLOAT_MAXOP (pwx->w[0 ], max, pwt->w[0 ], pwt->w[0 ],32 ); + }else { +MSA_FLOAT_MAXOP (pwx->w[0 ], max, pws->w[0 ], pwt->w[0 ],32 ); } -break ; -case DF_DOUBLE : -for (i =0 ; i <DF_ELEMENTS (DF_DOUBLE ); i++) { -if (NUMBER_QNAN_PAIR (pws->d[i], pwt->d[i],64 , status)) { -MSA_FLOAT_MAXOP (pwx->d[i], max, pws->d[i], pws->d[i],64 ); - }else if (NUMBER_QNAN_PAIR (pwt->d[i], pws->d[i],64 , status)) { -MSA_FLOAT_MAXOP (pwx->d[i], max, pwt->d[i], pwt->d[i],64 ); - }else { -MSA_FLOAT_MAXOP (pwx->d[i], max, pws->d[i], pwt->d[i],64 ); - } + +if (NUMBER_QNAN_PAIR (pws->w[1 ], pwt->w[1 ],32 , status)) { +MSA_FLOAT_MAXOP (pwx->w[1 ], max, pws->w[1 ], pws->w[1 ],32 ); + }else if (NUMBER_QNAN_PAIR (pwt->w[1 ], pws->w[1 ],32 , status)) { +MSA_FLOAT_MAXOP (pwx->w[1 ], max, pwt->w[1 ], pwt->w[1 ],32 ); + }else { +MSA_FLOAT_MAXOP (pwx->w[1 ], max, pws->w[1 ], pwt->w[1 ],32 ); } -break ; -default : + +if (NUMBER_QNAN_PAIR (pws->w[2 ], pwt->w[2 ],32 , status)) { +MSA_FLOAT_MAXOP (pwx->w[2 ], max, pws->w[2 ], pws->w[2 ],32 ); + }else if (NUMBER_QNAN_PAIR (pwt->w[2 ], pws->w[2 ],32 , status)) { +MSA_FLOAT_MAXOP (pwx->w[2 ], max, pwt->w[2 ], pwt->w[2 ],32 ); + }else { +MSA_FLOAT_MAXOP (pwx->w[2 ], max, pws->w[2 ], pwt->w[2 ],32 ); + } + +if (NUMBER_QNAN_PAIR (pws->w[3 ], pwt->w[3 ],32 , status)) { +MSA_FLOAT_MAXOP (pwx->w[3 ], max, pws->w[3 ], pws->w[3 ],32 ); + }else if (NUMBER_QNAN_PAIR (pwt->w[3 ], pws->w[3 ],32 , status)) { +MSA_FLOAT_MAXOP (pwx->w[3 ], max, pwt->w[3 ], pwt->w[3 ],32 ); + }else { +MSA_FLOAT_MAXOP (pwx->w[3 ], max, pws->w[3 ], pwt->w[3 ],32 ); + } + + }else if (df ==DF_DOUBLE ) { + +if (NUMBER_QNAN_PAIR (pws->d[0 ], pwt->d[0 ],64 , status)) { +MSA_FLOAT_MAXOP (pwx->d[0 ], max, pws->d[0 ], pws->d[0 ],64 ); + }else if (NUMBER_QNAN_PAIR (pwt->d[0 ], pws->d[0 ],64 , status)) { +MSA_FLOAT_MAXOP (pwx->d[0 ], max, pwt->d[0 ], pwt->d[0 ],64 ); + }else { +MSA_FLOAT_MAXOP (pwx->d[0 ], max, pws->d[0 ], pwt->d[0 ],64 ); + } + +if (NUMBER_QNAN_PAIR (pws->d[1 ], pwt->d[1 ],64 , status)) { +MSA_FLOAT_MAXOP (pwx->d[1 ], max, pws->d[1 ], pws->d[1 ],64 ); + }else if (NUMBER_QNAN_PAIR (pwt->d[1 ], pws->d[1 ],64 , status)) { +MSA_FLOAT_MAXOP (pwx->d[1 ], max, pwt->d[1 ], pwt->d[1 ],64 ); + }else { +MSA_FLOAT_MAXOP (pwx->d[1 ], max, pws->d[1 ], pwt->d[1 ],64 ); + } + + }else { +assert (0 ); + }check_msacsr_cause (env,GETPC ());
@@ -3970,22 +4026,18 @@ void helper_msa_fmax_a_df(CPUMIPSState *env, uint32_t df, uint32_t wd,wr_t *pwd = &(env->active_fpu.fpr[wd].wr);wr_t *pws = &(env->active_fpu.fpr[ws].wr);wr_t *pwt = &(env->active_fpu.fpr[wt].wr); -uint32_t i;clear_msacsr_cause (env); -switch (df) { -case DF_WORD : -for (i =0 ; i <DF_ELEMENTS (DF_WORD ); i++) { -FMAXMIN_A (max, min, pwx->w[i], pws->w[i], pwt->w[i],32 , status); - } -break ; -case DF_DOUBLE : -for (i =0 ; i <DF_ELEMENTS (DF_DOUBLE ); i++) { -FMAXMIN_A (max, min, pwx->d[i], pws->d[i], pwt->d[i],64 , status); - } -break ; -default : +if (df ==DF_WORD ) { +FMAXMIN_A (max, min, pwx->w[0 ], pws->w[0 ], pwt->w[0 ],32 , status); +FMAXMIN_A (max, min, pwx->w[1 ], pws->w[1 ], pwt->w[1 ],32 , status); +FMAXMIN_A (max, min, pwx->w[2 ], pws->w[2 ], pwt->w[2 ],32 , status); +FMAXMIN_A (max, min, pwx->w[3 ], pws->w[3 ], pwt->w[3 ],32 , status); + }else if (df ==DF_DOUBLE ) { +FMAXMIN_A (max, min, pwx->d[0 ], pws->d[0 ], pwt->d[0 ],64 , status); +FMAXMIN_A (max, min, pwx->d[1 ], pws->d[1 ], pwt->d[1 ],64 , status); + }else {assert (0 ); }
Signature · 1 line
2.7.4
PATCH 7/7 target/mips: Correct helper for MSA FCLASS.<W|D> instructions
In reply to Aleksandar MarkovicFrom: Aleksandar Markovic <[email protected]>
Correct helper for MSA FCLASS.<W|D> instructions.
--- target/mips/msa_helper.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
target/mips/msa_helper.c +3 -1
@@ -4058,9 +4058,11 @@ void helper_msa_fclass_df(CPUMIPSState *env, uint32_t df, pwd->w[1 ] =float_class_s (pws->w[1 ], status); pwd->w[2 ] =float_class_s (pws->w[2 ], status); pwd->w[3 ] =float_class_s (pws->w[3 ], status); - }else { + }else if (df ==DF_DOUBLE ) { pwd->d[0 ] =float_class_d (pws->d[0 ], status); pwd->d[1 ] =float_class_d (pws->d[1 ], status); + }else { +assert (0 ); } }
Signature · 1 line
2.7.4
Quoted 58 lines
From: Aleksandar Markovic <[email protected]>
Sent: Monday, July 1, 2019 1:04 PM
To: [email protected]; Aleksandar Rikalo
Cc: Aleksandar Markovic
Subject: [PATCH 0/7] target/mips: Mips improvements for 4.1From: Aleksandar Markovic <[email protected]>
A collection of misc MIPS improvements that would be nice to be integrated into 4.1.
Aleksandar Markovic (7):
tcg/tests: target/mips: Amend MSA fixed point multiply tests tcg/tests: target/mips: Amend MSA integer multiply tests target/mips: Correct comments inmsa_helper.ctarget/mips: Correct comments intranslate.c
tcg/tests: target/mips: Correct MSA test compilation and execution
order
target/mips: Unroll loops for MSA float max/min instructions target/mips: Correct helper for MSA FCLASS.<W|D> instructionstarget/mips/msa_helper.c | 244 ++++++++++----- target/mips/translate.c | 347 +++++++++++++-------- tests/tcg/mips/include/wrappers_msa.h | 16 + .../ase/msa/fixed-multiply/test_msa_madd_q_h.c | 216 +++++++++++++ .../ase/msa/fixed-multiply/test_msa_madd_q_w.c | 216 +++++++++++++ .../ase/msa/fixed-multiply/test_msa_maddr_q_h.c | 216 +++++++++++++ .../ase/msa/fixed-multiply/test_msa_maddr_q_w.c | 216 +++++++++++++ .../ase/msa/fixed-multiply/test_msa_msub_q_h.c | 216 +++++++++++++ .../ase/msa/fixed-multiply/test_msa_msub_q_w.c | 216 +++++++++++++ .../ase/msa/fixed-multiply/test_msa_msubr_q_h.c | 216 +++++++++++++ .../ase/msa/fixed-multiply/test_msa_msubr_q_w.c | 216 +++++++++++++ .../user/ase/msa/int-multiply/test_msa_maddv_b.c | 224 ++++++------- .../user/ase/msa/int-multiply/test_msa_maddv_d.c | 214 ++++++------- .../user/ase/msa/int-multiply/test_msa_maddv_h.c | 224 ++++++------- .../user/ase/msa/int-multiply/test_msa_maddv_w.c | 224 ++++++------- .../user/ase/msa/int-multiply/test_msa_msubv_b.c | 224 ++++++------- .../user/ase/msa/int-multiply/test_msa_msubv_d.c | 224 ++++++------- .../user/ase/msa/int-multiply/test_msa_msubv_h.c | 224 ++++++------- .../user/ase/msa/int-multiply/test_msa_msubv_w.c | 224 ++++++------- .../mips/user/ase/msa/test_msa_compile_32r6eb.sh | 32 +- .../mips/user/ase/msa/test_msa_compile_32r6el.sh | 32 +- .../mips/user/ase/msa/test_msa_compile_64r6eb.sh | 32 +- .../mips/user/ase/msa/test_msa_compile_64r6el.sh | 32 +- tests/tcg/mips/user/ase/msa/test_msa_run_32r6eb.sh | 16 +- tests/tcg/mips/user/ase/msa/test_msa_run_32r6el.sh | 16 +- tests/tcg/mips/user/ase/msa/test_msa_run_64r6eb.sh | 16 +- tests/tcg/mips/user/ase/msa/test_msa_run_64r6el.sh | 16 +- 27 files changed, 3165 insertions(+), 1144 deletions(-) create mode 100644 tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_madd_q_h.c create mode 100644 tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_madd_q_w.c create mode 100644 tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_maddr_q_h.c create mode 100644 tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_maddr_q_w.c create mode 100644 tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msub_q_h.c create mode 100644 tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msub_q_w.c create mode 100644 tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msubr_q_h.c create mode 100644 tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msubr_q_w.c
Quoted 2 lines
--
2.7.4
In patch on translate.c it would be nice to fix all comment-related warnings.
Anyway: