ppcopcodes: fix crxor.

This commit is contained in:
Maxim Poliakovski 2022-01-08 04:21:09 +01:00
parent 7bdad7703c
commit 9cd7ca0077

View File

@ -1302,7 +1302,8 @@ void dppc_interpreter::ppc_crorc() {
}
void dppc_interpreter::ppc_crxor() {
ppc_grab_regsdab();
if ((ppc_state.cr & (0x80000000UL >> reg_a)) ^ (ppc_state.cr & (0x80000000UL >> reg_b))) {
uint8_t ir = (ppc_state.cr >> (31 - reg_a)) ^ (ppc_state.cr >> (31 - reg_b));
if (ir & 1) {
ppc_state.cr |= (0x80000000UL >> reg_d);
} else {
ppc_state.cr &= ~(0x80000000UL >> reg_d);