Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J1ehZ-0008J3-3Q for qemu-devel@nongnu.org; Mon, 10 Dec 2007 04:13:25 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J1ehY-0008Ht-6P for qemu-devel@nongnu.org; Mon, 10 Dec 2007 04:13:24 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J1ehY-0008Hi-02 for qemu-devel@nongnu.org; Mon, 10 Dec 2007 04:13:24 -0500 Received: from hall.aurel32.net ([88.191.38.19]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1J1ehX-0003O6-N8 for qemu-devel@nongnu.org; Mon, 10 Dec 2007 04:13:23 -0500 Received: from aurel32 by hall.aurel32.net with local (Exim 4.63) (envelope-from ) id 1J1ehS-000129-OX for qemu-devel@nongnu.org; Mon, 10 Dec 2007 10:13:18 +0100 Date: Mon, 10 Dec 2007 10:13:18 +0100 From: Aurelien Jarno Message-ID: <20071210091318.GA3937@hall.aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Sender: "aurel32,,," Subject: [Qemu-devel] [PATCH][PPC] mtfsf: fix FPSCR_VX and FPSCR_FEX computation 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 Hi all, 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. Bye, Aurelien 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 -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' aurel32@debian.org | aurelien@aurel32.net `- people.debian.org/~aurel32 | www.aurel32.net