mirror of
https://github.com/dingusdev/dingusppc.git
synced 2025-01-10 13:29:38 +00:00
Implement VX and FEX updates for mtfsfi
This commit is contained in:
parent
2c94cfee03
commit
9c95bc17fe
@ -127,6 +127,24 @@ static void fpresult_update(double set_result) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void ppc_update_vx() {
|
||||||
|
uint32_t fpscr_check = ppc_state.fpscr & 0x1F80700U;
|
||||||
|
if (fpscr_check)
|
||||||
|
ppc_state.fpscr |= VX;
|
||||||
|
else
|
||||||
|
ppc_state.fpscr &= ~VX;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ppc_update_fex() {
|
||||||
|
uint32_t fpscr_check = (((ppc_state.fpscr >> 25) & 0x1F) &
|
||||||
|
((ppc_state.fpscr >> 3) & 0x1F));
|
||||||
|
|
||||||
|
if (fpscr_check)
|
||||||
|
ppc_state.fpscr |= VX;
|
||||||
|
else
|
||||||
|
ppc_state.fpscr &= ~VX;
|
||||||
|
}
|
||||||
|
|
||||||
// Floating Point Arithmetic
|
// Floating Point Arithmetic
|
||||||
template <field_rc rec>
|
template <field_rc rec>
|
||||||
void dppc_interpreter::ppc_fadd() {
|
void dppc_interpreter::ppc_fadd() {
|
||||||
@ -879,7 +897,9 @@ void dppc_interpreter::ppc_mtfsfi() {
|
|||||||
// copy imm to FPSCR[crf_d] under control of the field mask
|
// copy imm to FPSCR[crf_d] under control of the field mask
|
||||||
ppc_state.fpscr = (ppc_state.fpscr & ~mask) | ((imm >> crf_d) & mask);
|
ppc_state.fpscr = (ppc_state.fpscr & ~mask) | ((imm >> crf_d) & mask);
|
||||||
|
|
||||||
// TODO: update FEX and VX according to the "usual rule"
|
// Update FEX and VX according to the "usual rule"
|
||||||
|
ppc_update_vx();
|
||||||
|
ppc_update_fex();
|
||||||
|
|
||||||
if (rec)
|
if (rec)
|
||||||
ppc_update_cr1();
|
ppc_update_cr1();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user