From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J1hSv-0003i7-Aw for qemu-devel@nongnu.org; Mon, 10 Dec 2007 07:10:29 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J1hSt-0003gl-DT for qemu-devel@nongnu.org; Mon, 10 Dec 2007 07:10:28 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J1hSs-0003gf-VM for qemu-devel@nongnu.org; Mon, 10 Dec 2007 07:10:27 -0500 Received: from honiara.magic.fr ([195.154.193.36]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1J1hSs-00027M-FY for qemu-devel@nongnu.org; Mon, 10 Dec 2007 07:10:26 -0500 Received: from [172.17.17.137] (gw.netgem.com [195.68.2.34]) by honiara.magic.fr (8.13.1/8.13.1) with ESMTP id lBACAGjL031218 for ; Mon, 10 Dec 2007 13:10:16 +0100 Subject: Re: [Qemu-devel] [PATCH][PPC] mtfsf: fix FPSCR_VX and FPSCR_FEX computation From: Jocelyn Mayer In-Reply-To: <20071210091318.GA3937@hall.aurel32.net> References: <20071210091318.GA3937@hall.aurel32.net> Content-Type: text/plain Date: Mon, 10 Dec 2007 13:10:38 +0100 Message-Id: <1197288638.20253.45.camel@jma4.dev.netgem.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Reply-To: l_indien@magic.fr, 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 On Mon, 2007-12-10 at 10:13 +0100, Aurelien Jarno wrote: > Hi all, Hi, > The patch below fix the computation of FPSCR_VX and FPSCR_FEX when > using the mtfsf instruction. As stated in the PowerPC manual the mtfsf > instruction can't alter those bit, and thus it should always be > computed. You're right, the values are not computed properly. I'll commit your fix. > Index: target-ppc/op_helper.c > =================================================================== > RCS file: /sources/qemu/qemu/target-ppc/op_helper.c,v > retrieving revision 1.73 > diff -u -d -p -r1.73 op_helper.c > --- target-ppc/op_helper.c 24 Nov 2007 02:03:55 -0000 1.73 > +++ target-ppc/op_helper.c 10 Dec 2007 09:10:30 -0000 > @@ -888,12 +888,16 @@ void do_store_fpscr (uint32_t mask) > /* Update VX and FEX */ > if (fpscr_ix != 0) > env->fpscr |= 1 << FPSCR_VX; > + else > + env->fpscr &= ~(1 << FPSCR_VX); > if ((fpscr_ex & fpscr_eex) != 0) { > env->fpscr |= 1 << FPSCR_FEX; > env->exception_index = POWERPC_EXCP_PROGRAM; > /* XXX: we should compute it properly */ > env->error_code = POWERPC_EXCP_FP; > } > + else > + env->fpscr &= ~(1 << FPSCR_FEX); > fpscr_set_rounding_mode(); > } > #undef WORD0 -- Jocelyn Mayer