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 {