[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 03/14] target-mips: fix FPU exceptions
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH 03/14] target-mips: fix FPU exceptions |
Date: |
Wed, 10 Oct 2012 13:05:30 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1 |
On 10/09/2012 01:27 PM, Aurelien Jarno wrote:
> - return float64_sqrt(fdt0, &env->active_fpu.fp_status);
> + set_float_exception_flags(0, &env->active_fpu.fp_status);
> + fdt0 = float64_sqrt(fdt0, &env->active_fpu.fp_status);
> + update_fcr31(env);
> + return fdt0;
While accurate, I can't help but think there'd be less memory traffic
if the invariant "fp_status == 0" is maintained between insns. Thus
you don't need to reset the flags to 0 in each insn, merely change
static inline void update_fcr31(CPUMIPSState *env)
{
int tmp =
ieee_ex_to_mips(get_float_exception_flags(&env->active_fpu.fp_status));
if (tmp) {
set_float_exception_flags(0, &env->active_fpu.fp_status);
SET_FP_CAUSE(env->active_fpu.fcr31, tmp);
if (GET_FP_ENABLE(env->active_fpu.fcr31) & tmp) {
helper_raise_exception(env, EXCP_FPE);
} else {
UPDATE_FP_FLAGS(env->active_fpu.fcr31, tmp);
}
}
}
I'll also note that we don't get the proper PC for the trap there.
We don't save the PC in the translator before the insn, or, more
properly invoke do_restore_state. That clearly ought to be a
separate change, however.
r~
- [Qemu-devel] [PATCH 00/14] target-mips: misc fixes and optimizations, Aurelien Jarno, 2012/10/09
- [Qemu-devel] [PATCH 09/14] target-mips: don't use local temps for store conditional, Aurelien Jarno, 2012/10/09
- [Qemu-devel] [PATCH 07/14] target-mips: simplify load/store microMIPS helpers, Aurelien Jarno, 2012/10/09
- [Qemu-devel] [PATCH 01/14] softfloat: implement fused multiply-add NaN propagation for MIPS, Aurelien Jarno, 2012/10/09
- [Qemu-devel] [PATCH 03/14] target-mips: fix FPU exceptions, Aurelien Jarno, 2012/10/09
- Re: [Qemu-devel] [PATCH 03/14] target-mips: fix FPU exceptions,
Richard Henderson <=
- [Qemu-devel] [PATCH 14/14] target-mips: don't flush extra TLB on permissions upgrade, Aurelien Jarno, 2012/10/09
- [Qemu-devel] [PATCH 12/14] target-mips: use deposit instead of hardcoded version, Aurelien Jarno, 2012/10/09
- [Qemu-devel] [PATCH 13/14] target-mips: fix TLBR wrt SEGMask, Aurelien Jarno, 2012/10/09
- [Qemu-devel] [PATCH 04/14] target-mips: use softfloat constants when possible, Aurelien Jarno, 2012/10/09
- [Qemu-devel] [PATCH 05/14] target-mips: cleanup load/store operations, Aurelien Jarno, 2012/10/09