|
Mark Wielaard |
781a1f |
commit ae8c6de01417023e78763de145b1c0e6ddd87277
|
|
Mark Wielaard |
781a1f |
Author: Carl Love <cel@us.ibm.com>
|
|
Mark Wielaard |
781a1f |
Date: Wed Oct 20 20:40:13 2021 +0000
|
|
Mark Wielaard |
781a1f |
|
|
Mark Wielaard |
781a1f |
Fix for the prefixed stq instruction in PC relative mode.
|
|
Mark Wielaard |
781a1f |
|
|
Mark Wielaard |
781a1f |
The pstq instruction for R=1, was not using the correct effective address.
|
|
Mark Wielaard |
781a1f |
The EA_hi and EA_lo should have been based on the value of EA as calculated
|
|
Mark Wielaard |
781a1f |
by the function calculate_prefix_EA. Unfortuanely, the EA_hi and EA_lo
|
|
Mark Wielaard |
781a1f |
addresses were still using the previous code (not PC relative) to calculate
|
|
Mark Wielaard |
781a1f |
the address from the contants of RA plus the offset.
|
|
Mark Wielaard |
781a1f |
|
|
Mark Wielaard |
781a1f |
diff --git a/VEX/priv/guest_ppc_toIR.c b/VEX/priv/guest_ppc_toIR.c
|
|
Mark Wielaard |
781a1f |
index 8afd77490..543fa9574 100644
|
|
Mark Wielaard |
781a1f |
--- a/VEX/priv/guest_ppc_toIR.c
|
|
Mark Wielaard |
781a1f |
+++ b/VEX/priv/guest_ppc_toIR.c
|
|
Mark Wielaard |
781a1f |
@@ -9838,23 +9838,24 @@ static Bool dis_int_store_ds_prefix ( UInt prefix,
|
|
Mark Wielaard |
781a1f |
if (host_endness == VexEndnessBE) {
|
|
Mark Wielaard |
781a1f |
|
|
Mark Wielaard |
781a1f |
/* upper 64-bits */
|
|
Mark Wielaard |
781a1f |
- assign( EA_hi, ea_rAor0_simm( rA_addr, immediate_val ) );
|
|
Mark Wielaard |
781a1f |
+ assign( EA_hi, mkexpr(EA));
|
|
Mark Wielaard |
781a1f |
|
|
Mark Wielaard |
781a1f |
/* lower 64-bits */
|
|
Mark Wielaard |
781a1f |
- assign( EA_lo, ea_rAor0_simm( rA_addr, immediate_val+8 ) );
|
|
Mark Wielaard |
781a1f |
+ assign( EA_lo, binop(Iop_Add64, mkexpr(EA), mkU64(8)));
|
|
Mark Wielaard |
781a1f |
+
|
|
Mark Wielaard |
781a1f |
} else {
|
|
Mark Wielaard |
781a1f |
/* upper 64-bits */
|
|
Mark Wielaard |
781a1f |
- assign( EA_hi, ea_rAor0_simm( rA_addr, immediate_val+8 ) );
|
|
Mark Wielaard |
781a1f |
+ assign( EA_hi, binop(Iop_Add64, mkexpr(EA), mkU64(8)));
|
|
Mark Wielaard |
781a1f |
|
|
Mark Wielaard |
781a1f |
/* lower 64-bits */
|
|
Mark Wielaard |
781a1f |
- assign( EA_lo, ea_rAor0_simm( rA_addr, immediate_val ) );
|
|
Mark Wielaard |
781a1f |
+ assign( EA_lo, mkexpr(EA));
|
|
Mark Wielaard |
781a1f |
}
|
|
Mark Wielaard |
781a1f |
} else {
|
|
Mark Wielaard |
781a1f |
/* upper half of upper 64-bits */
|
|
Mark Wielaard |
781a1f |
- assign( EA_hi, ea_rAor0_simm( rA_addr, immediate_val+4 ) );
|
|
Mark Wielaard |
781a1f |
+ assign( EA_hi, binop(Iop_Add32, mkexpr(EA), mkU32(4)));
|
|
Mark Wielaard |
781a1f |
|
|
Mark Wielaard |
781a1f |
/* lower half of upper 64-bits */
|
|
Mark Wielaard |
781a1f |
- assign( EA_lo, ea_rAor0_simm( rA_addr, immediate_val+12 ) );
|
|
Mark Wielaard |
781a1f |
+ assign( EA_lo, binop(Iop_Add32, mkexpr(EA), mkU32(12)));
|
|
Mark Wielaard |
781a1f |
}
|
|
Mark Wielaard |
781a1f |
|
|
Mark Wielaard |
781a1f |
/* Note, the store order for stq instruction is the same for BE
|