mirror of https://github.com/xqemu/xqemu.git
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
This commit is contained in:
parent
be94c952e4
commit
5e9ae189f8
|
@ -1865,30 +1865,16 @@ void helper_rfsvc (void)
|
||||||
/* 602 specific instructions */
|
/* 602 specific instructions */
|
||||||
/* mfrom is the most crazy instruction ever seen, imho ! */
|
/* mfrom is the most crazy instruction ever seen, imho ! */
|
||||||
/* Real implementation uses a ROM table. Do the same */
|
/* Real implementation uses a ROM table. Do the same */
|
||||||
#if !defined (CONFIG_USER_ONLY)
|
/* Extremly decomposed:
|
||||||
#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
|
* -arg / 256
|
||||||
* return 256 * log10(10 + 1.0) + 0.5
|
* return 256 * log10(10 + 1.0) + 0.5
|
||||||
*/
|
*/
|
||||||
d = arg;
|
#if !defined (CONFIG_USER_ONLY)
|
||||||
d = float64_div(d, 256, &env->fp_status);
|
target_ulong helper_602_mfrom (target_ulong arg)
|
||||||
d = float64_chs(d);
|
{
|
||||||
d = exp10(d); // XXX: use float emulation function
|
if (likely(arg < 602)) {
|
||||||
d = float64_add(d, 1.0, &env->fp_status);
|
#include "mfrom_table.c"
|
||||||
d = log10(d); // XXX: use float emulation function
|
return mfrom_ROM_table[arg];
|
||||||
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 {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue