target-arm: Fix TCG temp leaks for WI and UNDEF VFP sysreg writes

Fix a leak of a TCG temporary in code paths for VFP system register
writes for cases which UNDEF or are write-ignored.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2013-01-30 16:01:56 +00:00
parent 0893d46014
commit e4c1cfa5cb
1 changed files with 4 additions and 1 deletions

View File

@ -2737,7 +2737,6 @@ static int disas_vfp_insn(CPUARMState * env, DisasContext *s, uint32_t insn)
} }
} else { } else {
/* arm->vfp */ /* arm->vfp */
tmp = load_reg(s, rd);
if (insn & (1 << 21)) { if (insn & (1 << 21)) {
rn >>= 1; rn >>= 1;
/* system register */ /* system register */
@ -2748,6 +2747,7 @@ static int disas_vfp_insn(CPUARMState * env, DisasContext *s, uint32_t insn)
/* Writes are ignored. */ /* Writes are ignored. */
break; break;
case ARM_VFP_FPSCR: case ARM_VFP_FPSCR:
tmp = load_reg(s, rd);
gen_helper_vfp_set_fpscr(cpu_env, tmp); gen_helper_vfp_set_fpscr(cpu_env, tmp);
tcg_temp_free_i32(tmp); tcg_temp_free_i32(tmp);
gen_lookup_tb(s); gen_lookup_tb(s);
@ -2757,18 +2757,21 @@ static int disas_vfp_insn(CPUARMState * env, DisasContext *s, uint32_t insn)
return 1; return 1;
/* TODO: VFP subarchitecture support. /* TODO: VFP subarchitecture support.
* For now, keep the EN bit only */ * For now, keep the EN bit only */
tmp = load_reg(s, rd);
tcg_gen_andi_i32(tmp, tmp, 1 << 30); tcg_gen_andi_i32(tmp, tmp, 1 << 30);
store_cpu_field(tmp, vfp.xregs[rn]); store_cpu_field(tmp, vfp.xregs[rn]);
gen_lookup_tb(s); gen_lookup_tb(s);
break; break;
case ARM_VFP_FPINST: case ARM_VFP_FPINST:
case ARM_VFP_FPINST2: case ARM_VFP_FPINST2:
tmp = load_reg(s, rd);
store_cpu_field(tmp, vfp.xregs[rn]); store_cpu_field(tmp, vfp.xregs[rn]);
break; break;
default: default:
return 1; return 1;
} }
} else { } else {
tmp = load_reg(s, rd);
gen_vfp_msr(tmp); gen_vfp_msr(tmp);
gen_mov_vreg_F0(0, rn); gen_mov_vreg_F0(0, rn);
} }