[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 11/44] target/ppc: Fix vslv and vsrv
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 11/44] target/ppc: Fix vslv and vsrv |
Date: |
Wed, 29 May 2019 16:49:44 +1000 |
From: Anton Blanchard <address@hidden>
vslv and vsrv are broken on little endian, we append 00 to the
high byte not the low byte. Fix it by using the VsrB() accessor.
Signed-off-by: Anton Blanchard <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
target/ppc/int_helper.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c
index 9af779ad38..2bad2d5620 100644
--- a/target/ppc/int_helper.c
+++ b/target/ppc/int_helper.c
@@ -1815,10 +1815,10 @@ void helper_vslv(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t
*b)
size = ARRAY_SIZE(r->u8);
for (i = 0; i < size; i++) {
- shift = b->u8[i] & 0x7; /* extract shift value */
- bytes = (a->u8[i] << 8) + /* extract adjacent bytes */
- (((i + 1) < size) ? a->u8[i + 1] : 0);
- r->u8[i] = (bytes << shift) >> 8; /* shift and store result */
+ shift = b->VsrB(i) & 0x7; /* extract shift value */
+ bytes = (a->VsrB(i) << 8) + /* extract adjacent bytes */
+ (((i + 1) < size) ? a->VsrB(i + 1) : 0);
+ r->VsrB(i) = (bytes << shift) >> 8; /* shift and store result */
}
}
@@ -1833,10 +1833,10 @@ void helper_vsrv(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t
*b)
* order will guarantee that computed result is not fed back.
*/
for (i = ARRAY_SIZE(r->u8) - 1; i >= 0; i--) {
- shift = b->u8[i] & 0x7; /* extract shift value */
- bytes = ((i ? a->u8[i - 1] : 0) << 8) + a->u8[i];
+ shift = b->VsrB(i) & 0x7; /* extract shift value */
+ bytes = ((i ? a->VsrB(i - 1) : 0) << 8) + a->VsrB(i);
/* extract adjacent bytes */
- r->u8[i] = (bytes >> shift) & 0xFF; /* shift and store result */
+ r->VsrB(i) = (bytes >> shift) & 0xFF; /* shift and store result */
}
}
--
2.21.0
- [Qemu-ppc] [PULL 08/44] target/ppc: Add ibm, purr and ibm, spurr device-tree properties, (continued)
- [Qemu-ppc] [PULL 08/44] target/ppc: Add ibm, purr and ibm, spurr device-tree properties, David Gibson, 2019/05/29
- [Qemu-ppc] [PULL 04/44] target/ppc/kvm: Fix trace typo, David Gibson, 2019/05/29
- [Qemu-ppc] [PULL 10/44] target/ppc: Fix xxbrq, xxbrw, David Gibson, 2019/05/29
- [Qemu-ppc] [PULL 14/44] spapr/xive: EQ page should be naturally aligned, David Gibson, 2019/05/29
- [Qemu-ppc] [PULL 13/44] target/ppc: Fix xxspltib, David Gibson, 2019/05/29
- [Qemu-ppc] [PULL 15/44] spapr/xive: fix EQ page addresses above 64GB, David Gibson, 2019/05/29
- [Qemu-ppc] [PULL 07/44] hw/ppc/40p: use 1900 as a base year, David Gibson, 2019/05/29
- [Qemu-ppc] [PULL 06/44] hw/ppc/40p: Move the MC146818 RTC to the board where it belongs, David Gibson, 2019/05/29
- [Qemu-ppc] [PULL 12/44] target/ppc: Fix vsum2sws, David Gibson, 2019/05/29
- [Qemu-ppc] [PULL 09/44] target/ppc: Fix xvxsigdp, David Gibson, 2019/05/29
- [Qemu-ppc] [PULL 11/44] target/ppc: Fix vslv and vsrv,
David Gibson <=
- [Qemu-ppc] [PULL 16/44] spapr/xive: print out the EQ page address in the monitor, David Gibson, 2019/05/29
- [Qemu-ppc] [PULL 26/44] spapr/xive: add KVM support, David Gibson, 2019/05/29
- [Qemu-ppc] [PULL 17/44] Fix typo on "info pic" monitor cmd output for xive, David Gibson, 2019/05/29
- [Qemu-ppc] [PULL 24/44] spapr: Fix phb_placement backwards compatibility, David Gibson, 2019/05/29
- [Qemu-ppc] [PULL 20/44] spapr/xive: Sanity checks of OV5 during CAS, David Gibson, 2019/05/29
- [Qemu-ppc] [PULL 28/44] spapr/xive: add state synchronization with KVM, David Gibson, 2019/05/29
- [Qemu-ppc] [PULL 18/44] target/ppc: Optimise VSX_LOAD_SCALAR_DS and VSX_VECTOR_LOAD_STORE, David Gibson, 2019/05/29
- [Qemu-ppc] [PULL 25/44] spapr: Print out extra hints when CAS negotiation of interrupt mode fails, David Gibson, 2019/05/29
- [Qemu-ppc] [PULL 23/44] target/ppc: Use vector variable shifts for VSL, VSR, VSRA, David Gibson, 2019/05/29
- [Qemu-ppc] [PULL 34/44] spapr: check for the activation of the KVM IRQ device, David Gibson, 2019/05/29