On 06/11/2017 04:16 PM, Laurent Vivier wrote:
@@ -95,8 +101,14 @@ static int cf_fpu_gdb_set_reg(CPUM68KState *env, uint8_t
*mem_buf, int n)
env->fregs[n].d = float64_to_floatx80(ldfq_p(mem_buf), &s);
return 8;
}
- if (n < 11) {
- /* FP control registers (not implemented) */
+ switch (n) {
+ case 8: /* fpcontrol */
+ env->fpcr = ldl_p(mem_buf);
+ return 4;
Should use cpu_m68k_set_fpcr.
+DEF_HELPER_2(set_fpcr, void, env, i32)
Hmm. I suppose the write to env->fpcr means you can't indicate
TCG_CALL_NO_RWG. I wonder if it's better as
uint32_t HELPER(set_fpcr)(CPUM68KState *env, uint32_t val)
{
cpu_m68k_set_fpcr(env, val);
return env->fpcr;
}
DEF_HELPER_FLAGS_2(set_fpcr, i32, env, i32)
gen_helper_set_fpcr(QEMU_FPCR, cpu_env, val);
This skirts the rules of TCG, but it'll work, since we disguise the (incorrect)
write to env->fpcr with a (correct but redundant) write to QEMU_FPCR.
Any time we can avoid spilling all globals we're better off.
As an alternative, is it really that important to represent FPSR and FPCR as
tcg registers? Perhaps it's better to just tcg_gen_ld/st instead?
r~