mirror of https://gitee.com/openkylin/qemu.git
target-ppc: fix index array of national digits
Fixes the big endian array access of national digits, from commitsb815587
ande2106d7
. Signed-off-by: Jose Ricardo Ziviani <joserz@linux.vnet.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
8a273cbe53
commit
a813fe7362
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue