aboutsummaryrefslogtreecommitdiff
path: root/target-ppc/op_helper.c
diff options
context:
space:
mode:
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-12-13 12:30:21 +0000
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-12-13 12:30:21 +0000
commit5e9ae189f8c5331aff011d91c2f54bd830663975 (patch)
treee598587232c697007714e16af22a4aaae2de6cc8 /target-ppc/op_helper.c
parentbe94c952e4a695bf112a7745c9851ea4d7ddd756 (diff)
target-ppc: keep only the table version for mfrom
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6007 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-ppc/op_helper.c')
-rw-r--r--target-ppc/op_helper.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c
index 20496497f1..a9b7f73bb0 100644
--- a/target-ppc/op_helper.c
+++ b/target-ppc/op_helper.c
@@ -1865,30 +1865,16 @@ void helper_rfsvc (void)
/* 602 specific instructions */
/* mfrom is the most crazy instruction ever seen, imho ! */
/* Real implementation uses a ROM table. Do the same */
+/* Extremly decomposed:
+ * -arg / 256
+ * return 256 * log10(10 + 1.0) + 0.5
+ */
#if !defined (CONFIG_USER_ONLY)
-#define USE_MFROM_ROM_TABLE
target_ulong helper_602_mfrom (target_ulong arg)
{
if (likely(arg < 602)) {
-#if defined(USE_MFROM_ROM_TABLE)
#include "mfrom_table.c"
return mfrom_ROM_table[arg];
-#else
- double d;
- /* Extremly decomposed:
- * -arg / 256
- * return 256 * log10(10 + 1.0) + 0.5
- */
- d = arg;
- d = float64_div(d, 256, &env->fp_status);
- d = float64_chs(d);
- d = exp10(d); // XXX: use float emulation function
- d = float64_add(d, 1.0, &env->fp_status);
- d = log10(d); // XXX: use float emulation function
- d = float64_mul(d, 256, &env->fp_status);
- d = float64_add(d, 0.5, &env->fp_status);
- return float64_round_to_int(d, &env->fp_status);
-#endif
} else {
return 0;
}