From patchwork Thu Aug 15 11:32:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 267356 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0C1C72C0247 for ; Thu, 15 Aug 2013 21:33:22 +1000 (EST) Received: from localhost ([::1]:52452 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9vnr-0004gc-2n for incoming@patchwork.ozlabs.org; Thu, 15 Aug 2013 07:33:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41946) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9vnY-0004WZ-S8 for qemu-devel@nongnu.org; Thu, 15 Aug 2013 07:33:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V9vnS-0000KC-71 for qemu-devel@nongnu.org; Thu, 15 Aug 2013 07:33:00 -0400 Received: from hall.aurel32.net ([2001:470:1f0b:4a8::1]:57860) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9vnS-0000H6-0T for qemu-devel@nongnu.org; Thu, 15 Aug 2013 07:32:54 -0400 Received: from [2001:470:d4ed:1:2db:dfff:fe14:52d] (helo=ohm.aurel32.net) by hall.aurel32.net with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1V9vnG-0006cO-NN; Thu, 15 Aug 2013 13:32:42 +0200 Received: from aurel32 by ohm.aurel32.net with local (Exim 4.80) (envelope-from ) id 1V9vnF-0002Lw-7L; Thu, 15 Aug 2013 13:32:41 +0200 From: Aurelien Jarno To: qemu-devel@nongnu.org Date: Thu, 15 Aug 2013 13:32:38 +0200 Message-Id: <1376566358-8989-1-git-send-email-aurelien@aurel32.net> X-Mailer: git-send-email 1.7.10.4 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:470:1f0b:4a8::1 Cc: qemu-stable@nongnu.org, qemu-ppc@nongnu.org, Khem Raj , Aurelien Jarno , Alexander Graf Subject: [Qemu-devel] [PATCH] target-ppc: fix bit extraction for FPBF and FPL X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Bit extraction for the FP BF and L field of the MTFSFI and MTFSF instructions is wrong and doesn't match the reference manual (which explain the bit number in big endian format). It has been broken in commit 7d08d85645def18eac2a9d672c1868a35e0bcf79. This patch fixes this, which in turn fixes the problem reported by Khem Raj about the floor() function of libm. Reported-by: Khem Raj Signed-off-by: Aurelien Jarno --- target-ppc/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) I don't know if we still have time to get this into 1.6, hence the Cc: to stable. In anycase it also needs to be fixed in 1.5. diff --git a/target-ppc/translate.c b/target-ppc/translate.c index f07d70d..41f4048 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -428,9 +428,9 @@ EXTRACT_HELPER(CRM, 12, 8); EXTRACT_HELPER(SR, 16, 4); /* mtfsf/mtfsfi */ -EXTRACT_HELPER(FPBF, 19, 3); +EXTRACT_HELPER(FPBF, 23, 3); EXTRACT_HELPER(FPIMM, 12, 4); -EXTRACT_HELPER(FPL, 21, 1); +EXTRACT_HELPER(FPL, 25, 1); EXTRACT_HELPER(FPFLM, 17, 8); EXTRACT_HELPER(FPW, 16, 1);