Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LA5ZW-0003mJ-68 for qemu-devel@nongnu.org; Tue, 09 Dec 2008 11:36:30 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LA5ZU-0003lj-NF for qemu-devel@nongnu.org; Tue, 09 Dec 2008 11:36:29 -0500 Received: from [199.232.76.173] (port=34397 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LA5ZU-0003lg-CZ for qemu-devel@nongnu.org; Tue, 09 Dec 2008 11:36:28 -0500 Received: from gate.lvk.cs.msu.su ([158.250.17.1]:58433 helo=lvk.cs.msu.su) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LA5ZT-00069S-QM for qemu-devel@nongnu.org; Tue, 09 Dec 2008 11:36:28 -0500 Received: from Debian-exim by zigzag.lvk.cs.msu.su with spam-scanned (Exim 4.63) (envelope-from ) id 1LA5ZL-0002xt-Ci for qemu-devel@nongnu.org; Tue, 09 Dec 2008 19:36:22 +0300 Received: from desktopvm.lvknet ([192.168.132.1] helo=ip6-localhost) by zigzag.lvk.cs.msu.su with esmtp (Exim 4.63) (envelope-from ) id 1LA5ZL-0002xp-99 for qemu-devel@nongnu.org; Tue, 09 Dec 2008 19:36:19 +0300 From: Vladimir Prus Date: Tue, 09 Dec 2008 19:36:19 +0300 References: <200812012022.02276.vladimir@codesourcery.com> <20081207224734.GD3591@volta.aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit Message-Id: Subject: [Qemu-devel] Re: SH4: Implement FD bit 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 Aurelien Jarno wrote: >> >> SH4 manual say that if a floating point instruction is executed while >> FD bit in the status register is 1, an exception should be raised. QEMU >> presently does not do that, so the kernel does not initialize FP state >> for any thread, nor does it save/restore FP state. The most apparent >> consequence is that while recent gcc/libc expect double-precision mode >> to be set by kernel, they run in single-precision mode, and all FP code >> produces wrong values. >> >> This patch fixes this. It also fixes a couple of places where PC was >> not updated before handling an exception, although both those places >> deal with invalid instruction and don't lead to any user-visible bugs. >> >> - Volodya > > Thanks, applied. Thanks, but it looks like one bit of the patch somehow did not make it into SVN. Specifically, this: @@ -504,6 +523,13 @@ static void _decode_opc(DisasContext * ctx) } } + /* The 0xfffd instruction is underfined, so we don't want to + raise fpu disable exception on it. */ + if (((ctx->opcode & 0xf000) == 0xf000) + && (ctx->opcode != 0xfffd)) + { + CHECK_FPU_ENABLED + } Is present in my post, and is not present in: http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5937 Maybe some merge issue? Thanks, Volodya