qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 100/111] m68k: use log10l() to compute log10_FP0()
@ 2011-08-17 20:54 Bryce Lanham
  2011-08-17 20:54 ` [Qemu-devel] [PATCH 101/111] m68k: correctly load signed word into floating point register Bryce Lanham
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Bryce Lanham @ 2011-08-17 20:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier

From: Laurent Vivier <laurent@vivier.eu>

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 target-m68k/helper.c |   22 +++++++---------------
 1 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/target-m68k/helper.c b/target-m68k/helper.c
index f67a2d8..0c60093 100644
--- a/target-m68k/helper.c
+++ b/target-m68k/helper.c
@@ -1368,23 +1368,15 @@ void HELPER(ln_FP0)(CPUState *env)
 
 void HELPER(log10_FP0)(CPUState *env)
 {
-    float64 f, log2, log210;
-    floatx80 res;
-
-    /* log10(x) = log2(x) / log2(10) */
-
-    DBG_FPUH("log10_FP0 %Lg", floatx80_to_ldouble(FP0_to_floatx80(env)));
-    f = floatx80_to_float64(FP0_to_floatx80(env), &env->fp_status);
+    floatx80 val;
+    long double res;
 
-    log2 = float64_log2(f, &env->fp_status);
-    log210 = float64_log2(floatx80_to_float64(floatx80_10, &env->fp_status),
-                          &env->fp_status);
-    res = floatx80_div(float64_to_floatx80(log2, &env->fp_status),
-                       float64_to_floatx80(log210, &env->fp_status),
-                       &env->fp_status);
-    DBG_FPU(" = %Lg\n", floatx80_to_ldouble(res));
+    val = FP0_to_floatx80(env);
+    DBG_FPUH("log10_FP0 %Lg", floatx80_to_ldouble(val));
+    res = log10l(floatx80_to_ldouble(val));
+    DBG_FPU(" = %Lg\n", res);
 
-    floatx80_to_FP0(env, res);
+    floatx80_to_FP0(env, ldouble_to_floatx80(res));
 }
 
 void HELPER(atan_FP0)(CPUState *env)
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-08-17 20:56 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-17 20:54 [Qemu-devel] [PATCH 100/111] m68k: use log10l() to compute log10_FP0() Bryce Lanham
2011-08-17 20:54 ` [Qemu-devel] [PATCH 101/111] m68k: correctly load signed word into floating point register Bryce Lanham
2011-08-17 20:54 ` [Qemu-devel] [PATCH 102/111] m68k: add fcosh instruction Bryce Lanham
2011-08-17 20:54 ` [Qemu-devel] [PATCH 103/111] m68k: add fasin instruction Bryce Lanham
2011-08-17 20:54 ` [Qemu-devel] [PATCH 104/111] m68k: add fsincos instruction Bryce Lanham
2011-08-17 20:54 ` [Qemu-devel] [PATCH 105/111] m68k: add fsinh instruction Bryce Lanham
2011-08-17 20:54 ` [Qemu-devel] [PATCH 106/111] m68k: add ftanh instruction Bryce Lanham
2011-08-17 20:54 ` [Qemu-devel] [PATCH 107/111] m68k: add flognp1 instruction Bryce Lanham
2011-08-17 20:54 ` [Qemu-devel] [PATCH 108/111] m68k: add fatanh instruction Bryce Lanham
2011-08-17 20:54 ` [Qemu-devel] [PATCH 109/111] m68k: first draft of q800 emulation (not working) Bryce Lanham
2011-08-17 20:54 ` [Qemu-devel] [PATCH 110/111] m68k: add movec instruction Bryce Lanham
2011-08-17 20:54 ` [Qemu-devel] [PATCH 111/111] m68k: move from sr can use effective addresse on m68k Bryce Lanham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).