Patchwork [089/111] m68k: add ftentox instruction

login
register
mail settings
Submitter Bryce Lanham
Date Aug. 17, 2011, 8:53 p.m.
Message ID <1313614385-29324-1-git-send-email-blanham@gmail.com>
Download mbox | patch
Permalink /patch/110353/
State New
Headers show

Comments

Bryce Lanham - Aug. 17, 2011, 8:53 p.m.
From: Laurent Vivier <laurent@vivier.eu>

allow gnome-background-properties to run

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 target-m68k/helper.c    |   15 +++++++++++++++
 target-m68k/helpers.h   |    1 +
 target-m68k/translate.c |    3 +++
 3 files changed, 19 insertions(+), 0 deletions(-)

Patch

diff --git a/target-m68k/helper.c b/target-m68k/helper.c
index 6cc4202..533f33b 100644
--- a/target-m68k/helper.c
+++ b/target-m68k/helper.c
@@ -1411,6 +1411,21 @@  void HELPER(exp2_FP0)(CPUState *env)
     floatx80_to_FP0(env, float32_to_floatx80(res, &env->fp_status));
 }
 
+void HELPER(exp10_FP0)(CPUState *env)
+{
+    floatx80 res;
+    long double val;
+
+    res = FP0_to_floatx80(env);
+    val = LDOUBLE(res);
+
+    DBG_FPUH("exp2_FP0 %Lg", val);
+    val = exp10l(val);
+    DBG_FPU(" = %Lg", val);
+    res = FLOATx80(val);
+    floatx80_to_FP0(env, res);
+}
+
 void HELPER(abs_FP0)(CPUState *env)
 {
     floatx80 res;
diff --git a/target-m68k/helpers.h b/target-m68k/helpers.h
index 46e71d2..88a047b 100644
--- a/target-m68k/helpers.h
+++ b/target-m68k/helpers.h
@@ -70,6 +70,7 @@  DEF_HELPER_1(sin_FP0, void, env)
 DEF_HELPER_1(tan_FP0, void, env)
 DEF_HELPER_1(exp_FP0, void, env)
 DEF_HELPER_1(exp2_FP0, void, env)
+DEF_HELPER_1(exp10_FP0, void, env)
 DEF_HELPER_1(ln_FP0, void, env)
 DEF_HELPER_1(log10_FP0, void, env)
 DEF_HELPER_1(abs_FP0, void, env)
diff --git a/target-m68k/translate.c b/target-m68k/translate.c
index 52df274..70eba1a 100644
--- a/target-m68k/translate.c
+++ b/target-m68k/translate.c
@@ -3704,6 +3704,9 @@  DISAS_INSN(fpu)
     case 0x11:                       /* ftwotox */
         gen_helper_exp2_FP0(cpu_env);
         break;
+    case 0x12:                       /* ftentox */
+        gen_helper_exp10_FP0(cpu_env);
+        break;
     case 0x14:                       /* flogn */
         gen_helper_ln_FP0(cpu_env);
         break;