On 3/3/24 16:18, Bibo Mao wrote:
@@ -696,11 +700,15 @@ void loongarch_cpu_dump_state(CPUState *cs, FILE
*f, int flags)
{
LoongArchCPU *cpu = LOONGARCH_CPU(cs);
CPULoongArchState *env = &cpu->env;
- int i;
+ int i, fp_status;
+#ifdef CONFIG_TCG
+ fp_status = get_float_exception_flags(&env->fp_status);
+#else
+ fp_status = 0;
+#endif
qemu_fprintf(f, " PC=%016" PRIx64 " ", env->pc);
- qemu_fprintf(f, " FCSR0 0x%08x fp_status 0x%02x\n", env->fcsr0,
- get_float_exception_flags(&env->fp_status));
+ qemu_fprintf(f, " FCSR0 0x%08x fp_status 0x%02x\n", env->fcsr0,
fp_status);
fp_status, I think, is unnecessary to print all of the time.
In update_fcsr0_mask, we ensure that fcsr0 is updated and
fp_status.exception_flags is 0. So I would expect this field to be 0 all
of the time -- anything else is a bug.