From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=56329 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PZ2ZA-0000Ec-1v for qemu-devel@nongnu.org; Sat, 01 Jan 2011 09:36:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PZ2Z8-0003Dr-I5 for qemu-devel@nongnu.org; Sat, 01 Jan 2011 09:36:19 -0500 Received: from adelie.canonical.com ([91.189.90.139]:46115) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PZ2Z8-0003Cu-BE for qemu-devel@nongnu.org; Sat, 01 Jan 2011 09:36:18 -0500 Received: from loganberry.canonical.com ([91.189.90.37]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1PZ2Z4-0002cd-H4 for ; Sat, 01 Jan 2011 14:36:14 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id B71F22E80FB for ; Sat, 1 Jan 2011 14:35:53 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Sat, 01 Jan 2011 14:29:37 -0000 From: Aurelien Jarno Sender: bounces@canonical.com References: <20100813182831.6211.99844.malonedeb@palladium.canonical.com> Message-Id: <20110101142937.19993.5310.launchpad@palladium.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 617528] Re: Incorrect translation of unary PPC/SPE instructions (efdneg etc.) Reply-To: Bug 617528 <617528@bugs.launchpad.net> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org ** Changed in: qemu Status: New =3D> Fix Committed -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/617528 Title: Incorrect translation of unary PPC/SPE instructions (efdneg etc.) Status in QEMU: Fix Committed Bug description: The translation for the following PPC/SPE (e500) instructions is wrong in= QEMU git 6cbf4c8c: evfsabs, evfsnabs, evfsneg efdabs, efdnabs, efdneg efsabs, efsnabs, efsneg As you can see from the provided patch, these ought to write their result t= o the destination register (rD) and not modify the source register (rA) in-= place. It's rather hard to generate a test-case for this with GCC, since it likes = to put the input and output of a unary operation into the same registers (t= hat's probably also the reason why this went unnoticed). There is however a= broken code path in the EGLIBC function for sin() when compiled for e500v2= . It returns nonsense results for e.g. -1.0. Trivial test code follows: #include #include #include int main(int argc, char **argv) { double x =3D strtod(argv[1], NULL); printf("%.14g\n", sin(x)); return 0; } Result before the patch (WRONG): $ qemu-ppc -cpu e500v2 sintest -1.0 -1 Result after the patch (OK): $ qemu-ppc -cpu e500v2 sintest -1.0 -0.84147071838379 A self-contained test-case using inline assembler can be provided upon requ= est.