From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TM2bI-0003e2-WD for qemu-devel@nongnu.org; Wed, 10 Oct 2012 16:09:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TM2bH-0006gn-Mi for qemu-devel@nongnu.org; Wed, 10 Oct 2012 16:09:52 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:63898) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TM2bH-0006gi-Eg for qemu-devel@nongnu.org; Wed, 10 Oct 2012 16:09:51 -0400 Received: by mail-pa0-f45.google.com with SMTP id fb10so972692pad.4 for ; Wed, 10 Oct 2012 13:09:50 -0700 (PDT) Sender: Richard Henderson Message-ID: <5075D60D.5090700@twiddle.net> Date: Wed, 10 Oct 2012 13:09:49 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1349814458-21739-1-git-send-email-aurelien@aurel32.net> <1349814458-21739-5-git-send-email-aurelien@aurel32.net> In-Reply-To: <1349814458-21739-5-git-send-email-aurelien@aurel32.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 04/14] target-mips: use softfloat constants when possible List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: qemu-devel@nongnu.org On 10/09/2012 01:27 PM, Aurelien Jarno wrote: > softfloat already has a few constants defined, use them instead of > redefining them in target-mips. > > Rename FLOAT_SNAN32 and FLOAT_SNAN64 to FP_TO_INT32_OVERFLOW and > FP_TO_INT64_OVERFLOW as even if they have the same value, they are > technically different (and defined differently in the MIPS ISA). > > Remove the unused constants. > > Signed-off-by: Aurelien Jarno Reviewed-by: Richard Henderson > @@ -2495,8 +2491,9 @@ uint64_t helper_float_cvtl_d(CPUMIPSState *env, uint64_t fdt0) > set_float_exception_flags(0, &env->active_fpu.fp_status); > dt2 = float64_to_int64(fdt0, &env->active_fpu.fp_status); > update_fcr31(env); > - if (GET_FP_CAUSE(env->active_fpu.fcr31) & (FP_OVERFLOW | FP_INVALID)) > - dt2 = FLOAT_SNAN64; > + if (GET_FP_CAUSE(env->active_fpu.fcr31) & (FP_OVERFLOW | FP_INVALID)) { > + dt2 = FP_TO_INT64_OVERFLOW; > + } > return dt2; That said, the existing code you're patching is incorrect. This code will fold to OVERFLOW if any previous operation caused an overflow, not checking that the *current* operation caused an overflow. r~