From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60554) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKrrK-0001xx-NC for qemu-devel@nongnu.org; Mon, 09 Feb 2015 12:10:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YKrrF-0005kR-Nq for qemu-devel@nongnu.org; Mon, 09 Feb 2015 12:10:54 -0500 Received: from mailapp01.imgtec.com ([195.59.15.196]:44756) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKrrF-0005jy-EU for qemu-devel@nongnu.org; Mon, 09 Feb 2015 12:10:49 -0500 Message-ID: <54D8EA12.3030004@imgtec.com> Date: Mon, 9 Feb 2015 17:10:42 +0000 From: Leon Alrae MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 7/7] target-mips: Add IEEE 754-2008 features support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Maciej W. Rozycki" , qemu-devel@nongnu.org Cc: Thomas Schwinge , Aurelien Jarno On 09/12/2014 01:56, Maciej W. Rozycki wrote: > + if (info->elf_flags & EF_MIPS_NAN2008) > + env->active_fpu.fcr31 |= > + (1 << FCR31_NAN2008) & env->active_fpu.fcr31_rw_bitmask; > + else > + env->active_fpu.fcr31 &= > + ~((1 << FCR31_NAN2008) & env->active_fpu.fcr31_rw_bitmask); braces are needed here > +uint64_t helper_float_chs_d(CPUMIPSState *env, uint64_t fdt0) > +{ > + uint64_t fdt1; > + > + fdt1 = float64_sub(0, fdt0, &env->active_fpu.fp_status); > + update_fcr31(env, GETPC()); > + return fdt1; > +} > + > +uint32_t helper_float_chs_s(CPUMIPSState *env, uint32_t fst0) > +{ > + uint32_t fst1; > + > + fst1 = float32_sub(0, fst0, &env->active_fpu.fp_status); > + update_fcr31(env, GETPC()); > + return fst1; > +} I think there is one case where helper_float_chs_{d,s,ps} are not correct -- when we have zero. In this case in subFloat32Sigs() we call: return packFloat32(status->float_rounding_mode == float_round_down, 0, 0); and the packFloat32() definition: static inline float32 packFloat32(flag zSign, int_fast16_t zExp, uint32_t zSig) { return make_float32( ( ( (uint32_t) zSign )<<31 ) + ( ( (uint32_t) zExp )<<23 ) + zSig); } Which means that the sign may not get changed, whereas I believe NEG.fmt is supposed to reverse the sign bit of positive/negative zero regardless of rounding mode. > > enum { > @@ -8718,7 +8719,10 @@ static void gen_farith (DisasContext *ct > TCGv_i32 fp0 = tcg_temp_new_i32(); > > gen_load_fpr32(fp0, fs); > - gen_helper_float_abs_s(fp0, fp0); > + if (ctx->abs2008) > + gen_helper_float_abs2008_s(fp0, fp0); > + else > + gen_helper_float_abs_s(fp0, cpu_env, fp0); braces are needed here too (and also in a few other places in this patch). Thanks, Leon