target/riscv: Only set TB flags with FP status if enabled

Backports commit e28eaed87902c5e852c3ed043b27204e879aa4e2 from qemu
This commit is contained in:
Alistair Francis 2020-03-22 01:45:30 -04:00 committed by Lioncash
parent 1e17cbc52c
commit 0d488f3a76

View file

@ -332,7 +332,10 @@ static inline void cpu_get_tb_cpu_state(CPURISCVState *env, target_ulong *pc,
#ifdef CONFIG_USER_ONLY
*flags = TB_FLAGS_MSTATUS_FS;
#else
*flags = cpu_mmu_index(env, 0) | (env->mstatus & MSTATUS_FS);
*flags = cpu_mmu_index(env, 0);
if (riscv_cpu_fp_enabled(env)) {
*flags |= env->mstatus & MSTATUS_FS;
}
#endif
}