From patchwork Wed Nov 23 02:49:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 698012 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tNn0m03yrz9snk for ; Wed, 23 Nov 2016 13:51:36 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.b="LPXZ1QOi"; dkim-atps=neutral Received: from localhost ([::1]:59103 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c9Nek-0006mW-EC for incoming@patchwork.ozlabs.org; Tue, 22 Nov 2016 21:51:30 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54883) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c9NdI-0005VW-26 for qemu-devel@nongnu.org; Tue, 22 Nov 2016 21:50:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c9NdH-0001wP-2D for qemu-devel@nongnu.org; Tue, 22 Nov 2016 21:50:00 -0500 Received: from ozlabs.org ([103.22.144.67]:34665) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c9NdG-0001uC-NV; Tue, 22 Nov 2016 21:49:59 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 3tNmyj2qD2z9t80; Wed, 23 Nov 2016 13:49:49 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1479869389; bh=JBAsy04HDSo3pFUGSZF4MZ+kZQqNlEXYYNeJeGSOk5Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LPXZ1QOit9GkPPKs1amWdeVEfqKQOpW9faRE1p5GjMnREE7WvAcbvXFZJ1An61tuf lrIybZJDnr0a9YWzldcKo9q2A1DRTDUR5+lTWCeZx9O2mQ1o0R/9L66v8Cna16jM5c zFlshfVf2rQR5k6SKZg6pEwlouCttLpg0pfeQ6Po= From: David Gibson To: peter.maydell@linaro.org, stefanha@redhat.com Date: Wed, 23 Nov 2016 13:49:37 +1100 Message-Id: <1479869383-16162-6-git-send-email-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1479869383-16162-1-git-send-email-david@gibson.dropbear.id.au> References: <1479869383-16162-1-git-send-email-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 103.22.144.67 Subject: [Qemu-devel] [PULL 05/11] target-ppc: fix index array of national digits X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mdroth@linux.vnet.ibm.com, Jose Ricardo Ziviani , qemu-devel@nongnu.org, agraf@suse.de, qemu-ppc@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Jose Ricardo Ziviani Fixes the big endian array access of national digits, from commits b815587 and e2106d7. Signed-off-by: Jose Ricardo Ziviani Reviewed-by: Thomas Huth Signed-off-by: David Gibson --- target-ppc/int_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target-ppc/int_helper.c b/target-ppc/int_helper.c index 9ac204a..2d57c9a 100644 --- a/target-ppc/int_helper.c +++ b/target-ppc/int_helper.c @@ -2572,7 +2572,7 @@ static int bcd_cmp_zero(ppc_avr_t *bcd) static uint16_t get_national_digit(ppc_avr_t *reg, int n) { #if defined(HOST_WORDS_BIGENDIAN) - return reg->u16[8 - n]; + return reg->u16[7 - n]; #else return reg->u16[n]; #endif @@ -2581,7 +2581,7 @@ static uint16_t get_national_digit(ppc_avr_t *reg, int n) static void set_national_digit(ppc_avr_t *reg, uint8_t val, int n) { #if defined(HOST_WORDS_BIGENDIAN) - reg->u16[8 - n] = val; + reg->u16[7 - n] = val; #else reg->u16[n] = val; #endif