From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LCH0y-0004go-FT for qemu-devel@nongnu.org; Mon, 15 Dec 2008 12:13:52 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LCH0w-0004fa-9M for qemu-devel@nongnu.org; Mon, 15 Dec 2008 12:13:51 -0500 Received: from [199.232.76.173] (port=38773 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LCH0w-0004fG-2r for qemu-devel@nongnu.org; Mon, 15 Dec 2008 12:13:50 -0500 Received: from savannah.gnu.org ([199.232.41.3]:48397 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 1LCH0v-0004f1-P3 for qemu-devel@nongnu.org; Mon, 15 Dec 2008 12:13:49 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LCH0u-0002on-W8 for qemu-devel@nongnu.org; Mon, 15 Dec 2008 17:13:49 +0000 Received: from aurel32 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LCH0u-0002oj-MT for qemu-devel@nongnu.org; Mon, 15 Dec 2008 17:13:48 +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: Mon, 15 Dec 2008 17:13:48 +0000 Subject: [Qemu-devel] [6046] target-ppc: use a correct value to represent 1.0 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: 6046 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6046 Author: aurel32 Date: 2008-12-15 17:13:48 +0000 (Mon, 15 Dec 2008) Log Message: ----------- target-ppc: use a correct value to represent 1.0 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-15 17:13:39 UTC (rev 6045) +++ trunk/target-ppc/op_helper.c 2008-12-15 17:13:48 UTC (rev 6046) @@ -1517,7 +1517,8 @@ /* fre - fre. */ uint64_t helper_fre (uint64_t arg) { - CPU_DoubleU farg; + CPU_DoubleU fone, farg; + fone.ll = 0x3FF0000000000000ULL; farg.ll = arg; if (unlikely(float64_is_signaling_nan(farg.d))) { @@ -1525,9 +1526,9 @@ farg.ll = fload_invalid_op_excp(POWERPC_EXCP_FP_VXSNAN); } else if (unlikely(iszero(farg.d))) { /* Zero reciprocal */ - farg.ll = float_zero_divide_excp(1.0, farg.d); + farg.ll = float_zero_divide_excp(fone.d, farg.d); } else if (likely(isnormal(farg.d))) { - farg.d = float64_div(1.0, farg.d, &env->fp_status); + farg.d = float64_div(fone.d, farg.d, &env->fp_status); } else { if (farg.ll == 0x8000000000000000ULL) { farg.ll = 0xFFF0000000000000ULL; @@ -1547,7 +1548,8 @@ /* fres - fres. */ uint64_t helper_fres (uint64_t arg) { - CPU_DoubleU farg; + CPU_DoubleU fone, farg; + fone.ll = 0x3FF0000000000000ULL; farg.ll = arg; if (unlikely(float64_is_signaling_nan(farg.d))) { @@ -1555,13 +1557,13 @@ farg.ll = fload_invalid_op_excp(POWERPC_EXCP_FP_VXSNAN); } else if (unlikely(iszero(farg.d))) { /* Zero reciprocal */ - farg.ll = float_zero_divide_excp(1.0, farg.d); + farg.ll = float_zero_divide_excp(fone.d, farg.d); } else if (likely(isnormal(farg.d))) { #if USE_PRECISE_EMULATION - farg.d = float64_div(1.0, farg.d, &env->fp_status); + farg.d = float64_div(fone.d, farg.d, &env->fp_status); farg.d = float64_to_float32(farg.d, &env->fp_status); #else - farg.d = float32_div(1.0, farg.d, &env->fp_status); + farg.d = float32_div(fone.d, farg.d, &env->fp_status); #endif } else { if (farg.ll == 0x8000000000000000ULL) { @@ -1582,7 +1584,8 @@ /* frsqrte - frsqrte. */ uint64_t helper_frsqrte (uint64_t arg) { - CPU_DoubleU farg; + CPU_DoubleU fone, farg; + fone.ll = 0x3FF0000000000000ULL; farg.ll = arg; if (unlikely(float64_is_signaling_nan(farg.d))) { @@ -1593,7 +1596,7 @@ farg.ll = fload_invalid_op_excp(POWERPC_EXCP_FP_VXSQRT); } else if (likely(isnormal(farg.d))) { farg.d = float64_sqrt(farg.d, &env->fp_status); - farg.d = float32_div(1.0, farg.d, &env->fp_status); + farg.d = float32_div(fone.d, farg.d, &env->fp_status); } else { if (farg.ll == 0x8000000000000000ULL) { farg.ll = 0xFFF0000000000000ULL;