From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: David Gibson Date: Wed, 23 Nov 2016 13:49:37 +1100 Message-Id: <1479869383-16162-6-git-send-email-david@gibson.dropbear.id.au> 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> Subject: [Qemu-devel] [PULL 05/11] target-ppc: fix index array of national digits List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org, stefanha@redhat.com Cc: agraf@suse.de, mdroth@linux.vnet.ibm.com, qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Jose Ricardo Ziviani , David Gibson 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 -- 2.7.4