From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LBTdc-0007z3-TT for qemu-devel@nongnu.org; Sat, 13 Dec 2008 07:30:29 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LBTdZ-0007ya-RV for qemu-devel@nongnu.org; Sat, 13 Dec 2008 07:30:27 -0500 Received: from [199.232.76.173] (port=52615 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LBTdZ-0007yQ-0u for qemu-devel@nongnu.org; Sat, 13 Dec 2008 07:30:25 -0500 Received: from savannah.gnu.org ([199.232.41.3]:41055 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LBTdY-00017Q-Oi for qemu-devel@nongnu.org; Sat, 13 Dec 2008 07:30:24 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LBTdX-00072k-Sr for qemu-devel@nongnu.org; Sat, 13 Dec 2008 12:30:24 +0000 Received: from aurel32 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LBTdX-00072g-8n for qemu-devel@nongnu.org; Sat, 13 Dec 2008 12:30:23 +0000 MIME-Version: 1.0 Errors-To: aurel32 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Aurelien Jarno Message-Id: Date: Sat, 13 Dec 2008 12:30:23 +0000 Subject: [Qemu-devel] [6007] target-ppc: keep only the table version for mfrom Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 6007 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6007 Author: aurel32 Date: 2008-12-13 12:30:21 +0000 (Sat, 13 Dec 2008) Log Message: ----------- target-ppc: keep only the table version for mfrom Signed-off-by: Aurelien Jarno Modified Paths: -------------- trunk/target-ppc/op_helper.c Modified: trunk/target-ppc/op_helper.c =================================================================== --- trunk/target-ppc/op_helper.c 2008-12-13 12:13:33 UTC (rev 6006) +++ trunk/target-ppc/op_helper.c 2008-12-13 12:30:21 UTC (rev 6007) @@ -1865,30 +1865,16 @@ /* 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; }