qemu/target/mips/tcg
Dragan Mladjenovic 5de4359b4f target/mips: Fix emulation of nanoMIPS BPOSGE32C instruction
There are currently two problems related to the emulation of the
instruction BPOSGE32C.

The nanoMIPS instruction BPOSGE32C belongs to DSP R3 instructions
(actually, as of now, it is the only instruction of DSP R3). The
presence of DSP R3 instructions in QEMU is indicated by the flag
MIPS_HFLAG_DSP_R3 (0x20000000). This flag is currently being properly
set in CPUMIPSState's hflags (for example, for I7200 nanoMIPS CPU).
However, it is not propagated to DisasContext's hflags, since the flag
MIPS_HFLAG_DSP_R3 is not set in MIPS_HFLAG_TMASK (while similar flags
MIPS_HFLAG_DSP_R2 and MIPS_HFLAG_DSP are set in this mask, and there
is no problem in functioning check_dsp_r2(), check_dsp()). This means
the function check_dsp_r3() currently does not work properly, and the
emulation of BPOSGE32C can not work properly as well.

Change MIPS_HFLAG_TMASK from 0x1F5807FF to 0x3F5807FF (logical OR
with 0x20000000) to fix this.

Additionally, check_cp1_enabled() is currently incorrectly called
while emulating BPOSGE32C. BPOSGE32C is in the same pool (P.BR1) as
FPU branch instruction BC1EQZC and BC1NEZC, but it not a part of FPU
(CP1) instructions, and check_cp1_enabled() should not be involved
while emulating BPOSGE32C.

Rearrange invocations of check_cp1_enabled() within P.BR1 pool
handling to affect only BC1EQZC and BC1NEZC emulation, and not
BPOSGE32C emulation.

Signed-off-by: Dragan Mladjenovic <dragan.mladjenovic@syrmia.com>
Signed-off-by: Stefan Pejic <stefan.pejic@syrmia.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220504110403.613168-4-stefan.pejic@syrmia.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
2022-06-11 11:35:40 +02:00
..
sysemu target/mips: Fix WatchHi.M handling 2022-06-11 11:34:12 +02:00
dsp_helper.c target/mips: Move TCG source files under tcg/ sub directory 2021-05-02 16:49:35 +02:00
exception.c exec/exec-all: Move 'qemu/log.h' include in units requiring it 2022-02-21 10:18:06 +01:00
fpu_helper.c target/mips: Move TCG source files under tcg/ sub directory 2021-05-02 16:49:35 +02:00
ldst_helper.c target/mips: Replace GET_LMASK64() macro by get_lmask(64) function 2021-08-25 13:02:14 +02:00
lmmi_helper.c Replace config-time define HOST_WORDS_BIGENDIAN 2022-04-06 10:50:37 +02:00
meson.build target/mips: Make mips_cpu_tlb_fill sysemu only 2021-11-02 07:00:52 -04:00
micromips_translate.c.inc target/mips: Extract trap code into env->error_code 2022-01-11 18:40:44 +01:00
mips16e_translate.c.inc target/mips: Extract break code into env->error_code 2022-01-11 18:40:44 +01:00
msa_helper.c target/mips: Fix store adress of high 64bit in helper_msa_st_b() 2022-06-11 11:34:12 +02:00
msa_helper.h.inc target/mips: Move TCG source files under tcg/ sub directory 2021-05-02 16:49:35 +02:00
msa_translate.c target/mips: Fix FTRUNC_S and FTRUNC_U trans helper 2022-06-11 11:34:12 +02:00
msa.decode target/mips: Remove one MSA unnecessary decodetree overlap group 2021-11-02 14:32:32 +01:00
mxu_translate.c target/mips: Fix gen_mxu_s32ldd_s32lddr 2021-06-29 10:04:57 -07:00
nanomips_translate.c.inc target/mips: Fix emulation of nanoMIPS BPOSGE32C instruction 2022-06-11 11:35:40 +02:00
op_helper.c target/mips: Extract NEC Vr54xx helpers to vr54xx_helper.c 2021-08-25 13:02:14 +02:00
rel6_translate.c target/mips: Rename 'rtype' as 'r' 2021-08-25 13:02:14 +02:00
rel6.decode target/mips: Rename 'rtype' as 'r' 2021-08-25 13:02:14 +02:00
sysemu_helper.h.inc target/mips: Move TLB management helpers to tcg/sysemu/tlb_helper.c 2021-05-02 16:49:35 +02:00
tcg-internal.h compiler.h: replace QEMU_NORETURN with G_NORETURN 2022-04-21 17:03:51 +04:00
trace-events target/mips: Move TCG trace events to tcg/ sub directory 2021-06-24 16:48:07 +02:00
trace.h target/mips: Move TCG trace events to tcg/ sub directory 2021-06-24 16:48:07 +02:00
translate_addr_const.c target/mips: Move TCG source files under tcg/ sub directory 2021-05-02 16:49:35 +02:00
translate.c exec/translator: Pass the locked filepointer to disas_log hook 2022-04-20 10:51:11 -07:00
translate.h exec/exec-all: Move 'qemu/log.h' include in units requiring it 2022-02-21 10:18:06 +01:00
tx79_translate.c exec/memop: Adding signedness to quad definitions 2022-01-08 15:46:10 +10:00
tx79.decode target/mips: Rename 'rtype' as 'r' 2021-08-25 13:02:14 +02:00
txx9_translate.c target/mips: Move TCG source files under tcg/ sub directory 2021-05-02 16:49:35 +02:00
vr54xx_helper.c target/mips: Extract NEC Vr54xx helpers to vr54xx_helper.c 2021-08-25 13:02:14 +02:00
vr54xx_helper.h.inc target/mips: Extract NEC Vr54xx helper definitions 2021-08-25 13:02:14 +02:00
vr54xx_translate.c target/mips: Convert Vr54xx MSA* opcodes to decodetree 2021-08-25 13:02:14 +02:00
vr54xx.decode target/mips: Convert Vr54xx MSA* opcodes to decodetree 2021-08-25 13:02:14 +02:00