From: Jose Ricardo Ziviani <joserz@linux.vnet.ibm.com>
To: qemu-ppc@nongnu.org
Cc: david@gibson.dropbear.id.au, thuth@redhat.com,
qemu-devel@nongnu.org, 1643537@bugs.launchpad.net
Subject: [Qemu-devel] [PATCH] target-ppc: fix index array of national digits
Date: Mon, 21 Nov 2016 12:55:13 -0200 [thread overview]
Message-ID: <1479740113-26834-1-git-send-email-joserz@linux.vnet.ibm.com> (raw)
Fixes the big endian array access of national digits, from commits
b815587 and e2106d7.
Signed-off-by: Jose Ricardo Ziviani <joserz@linux.vnet.ibm.com>
---
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
next reply other threads:[~2016-11-21 14:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-21 14:55 Jose Ricardo Ziviani [this message]
2016-11-21 15:05 ` [Qemu-devel] [PATCH] target-ppc: fix index array of national digits Thomas Huth
2016-11-21 23:03 ` David Gibson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1479740113-26834-1-git-send-email-joserz@linux.vnet.ibm.com \
--to=joserz@linux.vnet.ibm.com \
--cc=1643537@bugs.launchpad.net \
--cc=david@gibson.dropbear.id.au \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).