ppcopcodes: fix creqv emulation.

This commit is contained in:
Maxim Poliakovski 2022-01-21 16:32:07 +01:00
parent 2442bd17b3
commit c8d39d5ee5

View File

@ -1261,10 +1261,11 @@ void dppc_interpreter::ppc_crandc() {
}
void dppc_interpreter::ppc_creqv() {
ppc_grab_regsdab();
if (!((ppc_state.cr & (0x80000000UL >> reg_a)) ^ (ppc_state.cr & (0x80000000UL >> reg_b)))) {
ppc_state.cr |= (0x80000000UL >> reg_d);
} else {
uint8_t ir = (ppc_state.cr >> (31 - reg_a)) ^ (ppc_state.cr >> (31 - reg_b));
if (ir & 1) { // compliment is implemented by swapping the following if/else bodies
ppc_state.cr &= ~(0x80000000UL >> reg_d);
} else {
ppc_state.cr |= (0x80000000UL >> reg_d);
}
}
void dppc_interpreter::ppc_crnand() {