From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:51460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qtn7a-0003No-0T for qemu-devel@nongnu.org; Wed, 17 Aug 2011 16:53:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qtn7Y-0007n0-UU for qemu-devel@nongnu.org; Wed, 17 Aug 2011 16:53:53 -0400 Received: from mail-iy0-f171.google.com ([209.85.210.171]:44139) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qtn7Y-0007ku-QD for qemu-devel@nongnu.org; Wed, 17 Aug 2011 16:53:52 -0400 Received: by mail-iy0-f171.google.com with SMTP id 13so2653863iyf.30 for ; Wed, 17 Aug 2011 13:53:52 -0700 (PDT) From: Bryce Lanham Date: Wed, 17 Aug 2011 15:53:30 -0500 Message-Id: <1313614410-29359-10-git-send-email-blanham@gmail.com> In-Reply-To: <1313614410-29359-1-git-send-email-blanham@gmail.com> References: <1313614410-29359-1-git-send-email-blanham@gmail.com> Subject: [Qemu-devel] [PATCH 099/111] m68k: use logl() to compute ln_FP0() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Laurent Vivier From: Laurent Vivier Signed-off-by: Laurent Vivier --- target-m68k/helper.c | 21 +++++++-------------- 1 files changed, 7 insertions(+), 14 deletions(-) diff --git a/target-m68k/helper.c b/target-m68k/helper.c index 979c8e5..f67a2d8 100644 --- a/target-m68k/helper.c +++ b/target-m68k/helper.c @@ -1355,22 +1355,15 @@ void HELPER(sqrt_FP0)(CPUState *env) void HELPER(ln_FP0)(CPUState *env) { - float64 f, log2; - floatx80 res; - - /* ln(x) = log2(x) / log2(e) */ - - res = FP0_to_floatx80(env); - DBG_FPUH("ln_FP0 %Lg", floatx80_to_ldouble(res)); - - f = floatx80_to_float64(res, &env->fp_status); + floatx80 val; + long double res; - log2 = float64_log2(f, &env->fp_status); - res = floatx80_div(float64_to_floatx80(log2, &env->fp_status), - floatx80_log2e, &env->fp_status); - DBG_FPU(" = %Lg\n", floatx80_to_ldouble(res)); + val = FP0_to_floatx80(env); + DBG_FPUH("ln_FP0 %Lg", floatx80_to_ldouble(val)); + res = logl(floatx80_to_ldouble(val)); + DBG_FPU(" = %Lg\n", res); - floatx80_to_FP0(env, res); + floatx80_to_FP0(env, ldouble_to_floatx80(res)); } void HELPER(log10_FP0)(CPUState *env) -- 1.7.2.3