[5823] target-ppc: convert mfrom instruction to TCG
Revision: 5823
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5823 Author: aurel32 Date: 2008-11-30 16:23:35 +0000 (Sun, 30 Nov 2008)
Log Message:
-----------
target-ppc: convert mfrom instruction to TCG
Signed-off-by Aurelien Jarno <[email protected]>
Modified Paths:
--------------
trunk/target-ppc/helper.h
trunk/target-ppc/op.c
trunk/target-ppc/op_helper.c
trunk/target-ppc/translate.c
Modified: trunk/target-ppc/helper.h
===================================================================
target-ppc/helper.h +2 -0
@@ -144,6 +144,8 @@ DEF_HELPER_1(load_6xx_tlbi, void, tl) DEF_HELPER_1(load_74xx_tlbd, void, tl) DEF_HELPER_1(load_74xx_tlbi, void, tl) + +DEF_HELPER_1(602_mfrom, tl, tl)#endif #include "def-helper.h"
Modified: trunk/target-ppc/op.c
===================================================================
target-ppc/op.c +0 -9
@@ -684,15 +684,6 @@ }#endif -/* PowerPC 602 specific instruction */ -#if !defined(CONFIG_USER_ONLY ) -void OPPROTO op_602_mfrom (void) -{ -do_op_602_mfrom (); -RETURN (); -} -#endif -/* PowerPC 4xx specific micro-ops */ void OPPROTO op_load_dcr (void) {
Modified: trunk/target-ppc/op_helper.c
===================================================================
target-ppc/op_helper.c +8 -8
@@ -1645,19 +1645,19 @@/* mfrom is the most crazy instruction ever seen, imho ! */ /* Real implementation uses a ROM table. Do the same */ #define USE_MFROM_ROM_TABLE -void do_op_602_mfrom (void ) +target_ulong helper_602_mfrom (target_ulong arg) { -if (likely (T0 <602 )) { +if (likely (arg <602 )) {#if defined(USE_MFROM_ROM_TABLE )#include "mfrom_table.c" -T0 = mfrom_ROM_table[T0 ]; +return mfrom_ROM_table[T0 ];#else double d;/* Extremly decomposed: -* -T0 / 256 -* T0 = 256 * log10(10 + 1.0) + 0.5 +* -arg / 256 +* return 256 * log10(10 + 1.0) + 0.5 */ - d =T0 ; + d = arg; d =float64_div (d,256 , &env->fp_status); d =float64_chs (d); d =exp10 (d);// XXX: use float emulation function
@@ -1665,10 +1665,10 @@ 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); -T0 =float64_round_to_int (d, &env->fp_status); +return float64_round_to_int (d, &env->fp_status);#endif }else { -T0 =0 ; +return 0 ; } }
Modified: trunk/target-ppc/translate.c
===================================================================
target-ppc/translate.c +1 -3
@@ -4948,9 +4948,7 @@GEN_EXCP_PRIVOPC (ctx); return; } -tcg_gen_mov_tl (cpu_T[0 ], cpu_gpr[rA (ctx->opcode)]); -gen_op_602_mfrom (); -tcg_gen_mov_tl (cpu_gpr[rD (ctx->opcode)], cpu_T[0 ]); +gen_helper_602_mfrom (cpu_gpr[rD (ctx->opcode)], cpu_gpr[rA (ctx->opcode)]);#endif }