From: Aleksandar Rikalo Date: Tue, 15 Jun 2021 17:22:35 +0000 (+0000) Subject: target/mips: fix emulation of nanoMIPS BPOSGE32 instruction X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e5e6f00c3154055dba99eb3b789c38dc70578111;p=qemu.git target/mips: fix emulation of nanoMIPS BPOSGE32 instruction Per the "MIPS® Architecture Extension: nanoMIPS32 DSP Technical Reference Manual — Revision 0.04" p. 88 "BPOSGE32C", offset argument (imm) should be left-shifted first. This change was tested against test_dsp_r1_bposge32.c DSP test. Reported-by: Philippe Mathieu-Daudé Reviewed-by: Aleksandar Rikalo Signed-off-by: Filip Vidojevic Reviewed-by: Philippe Mathieu-Daudé Message-Id: Signed-off-by: Philippe Mathieu-Daudé --- diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index 1ff0b098bc..d248b5e5d2 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -21137,7 +21137,7 @@ static int decode_nanomips_32_48_opc(CPUMIPSState *env, DisasContext *ctx) extract32(ctx->opcode, 0, 1) << 13; gen_compute_branch_nm(ctx, OPC_BPOSGE32, 4, -1, -2, - imm); + imm << 1); } break; default: