From patchwork Mon Nov 21 14:55:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jose Ricardo Ziviani X-Patchwork-Id: 9439505 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9F290606DB for ; Mon, 21 Nov 2016 14:56:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8612528AAF for ; Mon, 21 Nov 2016 14:56:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7AC3628B12; Mon, 21 Nov 2016 14:56:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 12A1028AAF for ; Mon, 21 Nov 2016 14:56:15 +0000 (UTC) Received: from localhost ([::1]:49855 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c8q10-0005Rm-NY for patchwork-qemu-devel@patchwork.kernel.org; Mon, 21 Nov 2016 09:56:14 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40281) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c8q0X-0005FL-FD for qemu-devel@nongnu.org; Mon, 21 Nov 2016 09:55:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c8q0U-0008Pu-B8 for qemu-devel@nongnu.org; Mon, 21 Nov 2016 09:55:45 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:41936) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c8q0U-0008PX-0S for qemu-devel@nongnu.org; Mon, 21 Nov 2016 09:55:42 -0500 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uALEsffH015295 for ; Mon, 21 Nov 2016 09:55:40 -0500 Received: from e24smtp02.br.ibm.com (e24smtp02.br.ibm.com [32.104.18.86]) by mx0a-001b2d01.pphosted.com with ESMTP id 26v02kd36n-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 21 Nov 2016 09:55:40 -0500 Received: from localhost by e24smtp02.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 21 Nov 2016 12:55:37 -0200 Received: from d24dlp02.br.ibm.com (9.18.248.206) by e24smtp02.br.ibm.com (10.172.0.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 21 Nov 2016 12:55:35 -0200 Received: from d24relay01.br.ibm.com (d24relay01.br.ibm.com [9.8.31.16]) by d24dlp02.br.ibm.com (Postfix) with ESMTP id 8A62C1DC0054; Mon, 21 Nov 2016 09:55:34 -0500 (EST) Received: from d24av04.br.ibm.com (d24av04.br.ibm.com [9.8.31.97]) by d24relay01.br.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id uALEtYKD5136618; Mon, 21 Nov 2016 12:55:34 -0200 Received: from d24av04.br.ibm.com (localhost [127.0.0.1]) by d24av04.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id uALEtXfo028961; Mon, 21 Nov 2016 12:55:34 -0200 Received: from pacoca.ibm.com ([9.85.164.141]) by d24av04.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id uALEtTwK028869; Mon, 21 Nov 2016 12:55:31 -0200 From: Jose Ricardo Ziviani To: qemu-ppc@nongnu.org Date: Mon, 21 Nov 2016 12:55:13 -0200 X-Mailer: git-send-email 2.7.4 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16112114-0020-0000-0000-00000265BCC8 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16112114-0021-0000-0000-0000307AF181 Message-Id: <1479740113-26834-1-git-send-email-joserz@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-11-21_13:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611210258 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH] 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: 1643537@bugs.launchpad.net, thuth@redhat.com, qemu-devel@nongnu.org, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Fixes the big endian array access of national digits, from commits b815587 and e2106d7. Signed-off-by: Jose Ricardo Ziviani Reviewed-by: Thomas Huth --- 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