From eab021a5cb6c4e9e8855ef7b1b7c53212038b5fb Mon Sep 17 00:00:00 2001 From: dingusdev <52434309+dingusdev@users.noreply.github.com> Date: Sun, 24 Mar 2024 16:34:42 -0700 Subject: [PATCH] Regression fixes --- cpu/ppc/ppcmacros.h | 2 +- cpu/ppc/ppcopcodes.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cpu/ppc/ppcmacros.h b/cpu/ppc/ppcmacros.h index 4f40f95..2b8f059 100644 --- a/cpu/ppc/ppcmacros.h +++ b/cpu/ppc/ppcmacros.h @@ -94,7 +94,7 @@ along with this program. If not, see . uint32_t ppc_result_b = ppc_state.gpr[reg_b]; #define ppc_store_iresult_reg(reg, ppc_result)\ - ppc_state.gpr[(reg)] = ppc_result; + ppc_state.gpr[reg] = ppc_result; #define ppc_store_sfpresult_int(reg, ppc_result64_d)\ ppc_state.fpr[(reg)].int64_r = ppc_result64_d; diff --git a/cpu/ppc/ppcopcodes.cpp b/cpu/ppc/ppcopcodes.cpp index e96dfdd..294a07d 100644 --- a/cpu/ppc/ppcopcodes.cpp +++ b/cpu/ppc/ppcopcodes.cpp @@ -512,7 +512,7 @@ void dppc_interpreter::ppc_mulli() { } void dppc_interpreter::ppc_divw() { - uint32_t ppc_result_d; + uint32_t ppc_result_d = 0; ppc_grab_regsdab(ppc_cur_instruction); if (!ppc_result_b) { /* handle the "anything / 0" case */ @@ -542,7 +542,7 @@ void dppc_interpreter::ppc_divw() { } void dppc_interpreter::ppc_divwu() { - uint32_t ppc_result_d; + uint32_t ppc_result_d = 0; ppc_grab_regsdab(ppc_cur_instruction); if (!ppc_result_b) { /* division by zero */ @@ -604,7 +604,7 @@ void dppc_interpreter::ppc_sraw() { if (ppc_result_b & 0x20) { // fill rA with the sign bit of rS - uint32_t ppc_result_a = int32_t(ppc_result_d) >> 31; + ppc_result_a = int32_t(ppc_result_d) >> 31; if (ppc_result_a) // if rA is negative ppc_state.spr[SPR::XER] |= XER::CA; } else {