From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQ9c9-0004H9-29 for qemu-devel@nongnu.org; Thu, 21 Jul 2016 04:45:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQ9c5-0004XY-0C for qemu-devel@nongnu.org; Thu, 21 Jul 2016 04:45:53 -0400 Received: from indium.canonical.com ([91.189.90.7]:34231) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQ9c4-0004XU-QQ for qemu-devel@nongnu.org; Thu, 21 Jul 2016 04:45:48 -0400 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.76 #1 (Debian)) id 1bQ9c4-0003iW-0a for ; Thu, 21 Jul 2016 08:45:48 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id F38F32E80AE for ; Thu, 21 Jul 2016 08:45:47 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Thu, 21 Jul 2016 08:36:16 -0000 From: Lenard Szolnoki <1605123@bugs.launchpad.net> Reply-To: Bug 1605123 <1605123@bugs.launchpad.net> Sender: bounces@canonical.com Message-Id: <20160721083616.745.90271.malonedeb@gac.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 1605123] [NEW] PEXT returns wrong values, seemingly switches arguments List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Public bug reported: Hi, I fiddled with BMI2 instructions and discovered that pext instructions emulated with "qemu-x86_64 -cpu Haswell" return the wrong value. It seemingly switches up its arguments. I suspect that the error is around the gen_helper_pext(...) call in target-i386/translate.c. I checked helper_pext in target-i386/int_helper.c and it works fine. I ran my program on a CPU with BMI2 instruction set too, and it indeed returns different values. I didn't check pdep, it could have the same problem. $ qemu-x86_64 --version qemu-x86_64 version 2.6.50 (v2.6.0-2095-ge66b05e-dirty), Copyright (c) 2003= -2008 Fabrice Bellard $ uname -a Linux lenard-hp 4.3.0-1-amd64 #1 SMP Debian 4.3.5-1 (2016-02-06) x86_64 GNU= /Linux I compiled the attached file with the command line "gcc -o main -g -mbmi2 main.c". $ gcc --version gcc (Debian 5.4.0-6) 5.4.0 20160609 Best regards, L=C3=A9n=C3=A1rd Szolnoki ** Affects: qemu Importance: Undecided Status: New ** Attachment added: "main.c" https://bugs.launchpad.net/bugs/1605123/+attachment/4704470/+files/main.c -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1605123 Title: PEXT returns wrong values, seemingly switches arguments Status in QEMU: New Bug description: Hi, I fiddled with BMI2 instructions and discovered that pext instructions emulated with "qemu-x86_64 -cpu Haswell" return the wrong value. It seemingly switches up its arguments. I suspect that the error is around t= he gen_helper_pext(...) call in target-i386/translate.c. I checked helper_pe= xt in target-i386/int_helper.c and it works fine. I ran my program on a CPU with BMI2 instruction set too, and it indeed returns different values. I didn't check pdep, it could have the same problem. $ qemu-x86_64 --version qemu-x86_64 version 2.6.50 (v2.6.0-2095-ge66b05e-dirty), Copyright (c) 20= 03-2008 Fabrice Bellard $ uname -a Linux lenard-hp 4.3.0-1-amd64 #1 SMP Debian 4.3.5-1 (2016-02-06) x86_64 G= NU/Linux I compiled the attached file with the command line "gcc -o main -g -mbmi2 main.c". $ gcc --version gcc (Debian 5.4.0-6) 5.4.0 20160609 Best regards, L=C3=A9n=C3=A1rd Szolnoki To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1605123/+subscriptions