From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:51484) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qtn7l-00045Z-VF for qemu-devel@nongnu.org; Wed, 17 Aug 2011 16:54:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qtn7f-0007ne-UG for qemu-devel@nongnu.org; Wed, 17 Aug 2011 16:54:00 -0400 Received: from mail-gw0-f45.google.com ([74.125.83.45]:41749) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qtn7f-0007mh-Mq for qemu-devel@nongnu.org; Wed, 17 Aug 2011 16:53:59 -0400 Received: by gwb19 with SMTP id 19so557741gwb.4 for ; Wed, 17 Aug 2011 13:53:49 -0700 (PDT) From: Bryce Lanham Date: Wed, 17 Aug 2011 15:53:28 -0500 Message-Id: <1313614410-29359-8-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 097/111] m68k: use expl() to compute exp_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 | 12 ++++-------- 1 files changed, 4 insertions(+), 8 deletions(-) diff --git a/target-m68k/helper.c b/target-m68k/helper.c index 17f2d48..d4364f7 100644 --- a/target-m68k/helper.c +++ b/target-m68k/helper.c @@ -1442,20 +1442,16 @@ void HELPER(tan_FP0)(CPUState *env) void HELPER(exp_FP0)(CPUState *env) { floatx80 f; - float32 res; - - /* exp(x) = exp2(x * log2(e)) */ + long double res; f = FP0_to_floatx80(env); DBG_FPUH("exp_FP0 %Lg", floatx80_to_ldouble(f)); - f = floatx80_mul(f, floatx80_log2e, &env->fp_status); - res = float32_exp2(floatx80_to_float32(f, &env->fp_status), - &env->fp_status); + res = expl(floatx80_to_ldouble(f)); - DBG_FPU(" = %f\n", FLOAT(res)); - floatx80_to_FP0(env, float32_to_floatx80(res, &env->fp_status)); + DBG_FPU(" = %Lg\n", res); + floatx80_to_FP0(env, ldouble_to_floatx80(res)); } void HELPER(exp2_FP0)(CPUState *env) -- 1.7.2.3