mirror of
https://github.com/dingusdev/dingusppc.git
synced 2025-01-12 11:31:16 +00:00
Refactor subfze.
This commit is contained in:
parent
1f3505f371
commit
593508df22
@ -385,23 +385,19 @@ void dppc_interpreter::ppc_subfme() {
|
|||||||
|
|
||||||
void dppc_interpreter::ppc_subfze() {
|
void dppc_interpreter::ppc_subfze() {
|
||||||
ppc_grab_regsda();
|
ppc_grab_regsda();
|
||||||
ppc_result_d = ~ppc_result_a + !!(ppc_state.spr[SPR::XER] & 0x20000000);
|
uint32_t grab_ca = !!(ppc_state.spr[SPR::XER] & XER::CA);
|
||||||
|
ppc_result_d = ~ppc_result_a + grab_ca;
|
||||||
|
|
||||||
if (ppc_result_d == ppc_result_a) {
|
if (!ppc_result_d && grab_ca) // special case: ppc_result_d = 0 and CA=1
|
||||||
// this only occurs when CA is 1 and ppc_result_a is 0x00000000 or 0x80000000
|
ppc_state.spr[SPR::XER] |= XER::CA;
|
||||||
if (ppc_result_d == 0) {
|
else
|
||||||
ppc_state.spr[SPR::XER] |= 0x20000000UL; // set CA
|
ppc_state.spr[SPR::XER] &= ~XER::CA;
|
||||||
if (oe_flag)
|
|
||||||
ppc_state.spr[SPR::XER] &= ~0x40000000UL; // clear OV
|
if (oe_flag) {
|
||||||
} else {
|
if (ppc_result_d && ppc_result_d == ppc_result_a)
|
||||||
ppc_state.spr[SPR::XER] &= ~0x20000000UL; // clear CA
|
ppc_state.spr[SPR::XER] |= XER::SO | XER::OV;
|
||||||
if (oe_flag)
|
else
|
||||||
ppc_state.spr[SPR::XER] |= 0xC0000000UL; // set SO,OV
|
ppc_state.spr[SPR::XER] &= ~XER::OV;
|
||||||
}
|
|
||||||
} else {
|
|
||||||
ppc_state.spr[SPR::XER] &= ~0x20000000UL; // clear CA
|
|
||||||
if (oe_flag)
|
|
||||||
ppc_state.spr[SPR::XER] &= ~0x40000000UL; // clear OV
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rc_flag)
|
if (rc_flag)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user