From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39832) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrlYQ-0000IP-G7 for qemu-devel@nongnu.org; Tue, 03 Jun 2014 06:02:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WrlYJ-0006q9-Fp for qemu-devel@nongnu.org; Tue, 03 Jun 2014 06:02:50 -0400 Message-ID: <538D9D40.2080105@suse.de> Date: Tue, 03 Jun 2014 12:02:40 +0200 From: Alexander Graf MIME-Version: 1.0 References: <1401786860-32216-1-git-send-email-gingold@adacore.com> In-Reply-To: <1401786860-32216-1-git-send-email-gingold@adacore.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] powerpc: use float64 for frsqrte List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Tristan Gingold Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org On 06/03/2014 11:14 AM, Tristan Gingold wrote: > Remove the code that reduce the result to float32 as the frsqrte > instruction is defined to return a double-precision estimate of > the reciprocal square root. > > Although reducing the fractional part is harmless (as the estimation > must have at least 12 bits of precision according to the old PEM), > reducing the exponent range is not correct. > > Signed-off-by: Tristan Gingold I couldn't find a reference to doubles in ISA 2.07. Is frsqrte supposed to return doubles on all cores? Or is this implementation specific? Also, is frsqrte the only instruction affected? Alex > --- > target-ppc/fpu_helper.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/target-ppc/fpu_helper.c b/target-ppc/fpu_helper.c > index cd8f015..da93d12 100644 > --- a/target-ppc/fpu_helper.c > +++ b/target-ppc/fpu_helper.c > @@ -977,7 +977,6 @@ uint64_t helper_fres(CPUPPCState *env, uint64_t arg) > uint64_t helper_frsqrte(CPUPPCState *env, uint64_t arg) > { > CPU_DoubleU farg; > - float32 f32; > > farg.ll = arg; > > @@ -991,8 +990,6 @@ uint64_t helper_frsqrte(CPUPPCState *env, uint64_t arg) > } > farg.d = float64_sqrt(farg.d, &env->fp_status); > farg.d = float64_div(float64_one, farg.d, &env->fp_status); > - f32 = float64_to_float32(farg.d, &env->fp_status); > - farg.d = float32_to_float64(f32, &env->fp_status); > } > return farg.ll; > }