Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DuxpS-0003VQ-Vv for qemu-devel@nongnu.org; Tue, 19 Jul 2005 15:32:35 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DuxpG-0003Ns-Uf for qemu-devel@nongnu.org; Tue, 19 Jul 2005 15:32:25 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DuxpG-0003MN-K9 for qemu-devel@nongnu.org; Tue, 19 Jul 2005 15:32:22 -0400 Received: from [64.4.56.37] (helo=hotmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Duxqg-0001P9-3A for qemu-devel@nongnu.org; Tue, 19 Jul 2005 15:33:50 -0400 Message-ID: From: "The Qube" Subject: Re: [Qemu-devel] x86 FPU Emulation, Date: Tue, 19 Jul 2005 12:24:15 -0700 Mime-Version: 1.0 Content-Type: text/plain; format=flowed 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 Okay, I figured out the problem. fscale should be defined as ST0*(2^int(ST1)). Here's the patch malc created, using ldexp: diff -u -u -r1.49 helper.c --- target-i386/helper.c 24 Apr 2005 18:04:33 -0000 1.49 +++ target-i386/helper.c 19 Jul 2005 19:00:16 -0000 @@ -2832,11 +2832,7 @@ void helper_fscale(void) { - CPU86_LDouble fpsrcop, fptemp; - - fpsrcop = 2.0; - fptemp = pow(fpsrcop,ST1); - ST0 *= fptemp; + ST0 = ldexp (ST0, ST1); } void helper_fsin(void) Both me and malc have verified that it corrects the problem with calc387.