poweropcodes: Fix rrib.

It is redundant to test bit 0 of rS and then use bit 0 of rS in the case when bit 0 of rS is set.
In the case when bit 0 of rS is not set, using bit 0 or rS is incorrect since it results in no change of rA.
This commit is contained in:
joevt 2024-04-09 02:17:03 -07:00 committed by dingusdev
parent d897acfd3c
commit e1f31a2da3
1 changed files with 3 additions and 2 deletions

View File

@ -365,11 +365,12 @@ void dppc_interpreter::power_rlmi() {
template <field_rc rec>
void dppc_interpreter::power_rrib() {
ppc_grab_regssab(ppc_cur_instruction);
unsigned rot_sh = ppc_result_b & 0x1F;
if (int32_t(ppc_result_d) < 0) {
ppc_result_a |= ((ppc_result_d & 0x80000000) >> ppc_result_b);
ppc_result_a |= (0x80000000U >> rot_sh);
} else {
ppc_result_a &= ~((ppc_result_d & 0x80000000) >> ppc_result_b);
ppc_result_a &= ~(0x80000000U >> rot_sh);
}
if (rec)