Commit 5e9ae189f8c5331aff011d91c2f54bd830663975

Authored by aurel32
1 parent be94c952

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
Showing 1 changed file with 4 additions and 18 deletions
target-ppc/op_helper.c
... ... @@ -1865,30 +1865,16 @@ void helper_rfsvc (void)
1865 1865 /* 602 specific instructions */
1866 1866 /* mfrom is the most crazy instruction ever seen, imho ! */
1867 1867 /* Real implementation uses a ROM table. Do the same */
  1868 +/* Extremly decomposed:
  1869 + * -arg / 256
  1870 + * return 256 * log10(10 + 1.0) + 0.5
  1871 + */
1868 1872 #if !defined (CONFIG_USER_ONLY)
1869   -#define USE_MFROM_ROM_TABLE
1870 1873 target_ulong helper_602_mfrom (target_ulong arg)
1871 1874 {
1872 1875 if (likely(arg < 602)) {
1873   -#if defined(USE_MFROM_ROM_TABLE)
1874 1876 #include "mfrom_table.c"
1875 1877 return mfrom_ROM_table[arg];
1876   -#else
1877   - double d;
1878   - /* Extremly decomposed:
1879   - * -arg / 256
1880   - * return 256 * log10(10 + 1.0) + 0.5
1881   - */
1882   - d = arg;
1883   - d = float64_div(d, 256, &env->fp_status);
1884   - d = float64_chs(d);
1885   - d = exp10(d); // XXX: use float emulation function
1886   - d = float64_add(d, 1.0, &env->fp_status);
1887   - d = log10(d); // XXX: use float emulation function
1888   - d = float64_mul(d, 256, &env->fp_status);
1889   - d = float64_add(d, 0.5, &env->fp_status);
1890   - return float64_round_to_int(d, &env->fp_status);
1891   -#endif
1892 1878 } else {
1893 1879 return 0;
1894 1880 }
... ...