mirror of
https://github.com/dingusdev/dingusppc.git
synced 2025-08-07 17:25:08 +00:00
ppcfpopcodes: fabs fix.
fabs clears the sign bit regardless of nan status.
This commit is contained in:
@@ -767,18 +767,11 @@ template <field_rc rec>
|
|||||||
void dppc_interpreter::ppc_fabs() {
|
void dppc_interpreter::ppc_fabs() {
|
||||||
ppc_grab_regsfpdb(ppc_cur_instruction);
|
ppc_grab_regsfpdb(ppc_cur_instruction);
|
||||||
|
|
||||||
double ppc_dblresult64_d = abs(GET_FPR(reg_b));
|
uint64_t ppc_result64_d = FPR_INT(reg_b) & ~0x8000000000000000U;
|
||||||
|
|
||||||
if (std::isnan(GET_FPR(reg_b))) {
|
ppc_store_fpresult_int(reg_d, ppc_result64_d);
|
||||||
ppc_dblresult64_d = std::numeric_limits<double>::quiet_NaN();
|
|
||||||
}
|
snan_single_check(reg_d);
|
||||||
|
|
||||||
if (snan_single_check(reg_b)) {
|
|
||||||
uint64_t qnan = 0x7FFC000000000000;
|
|
||||||
ppc_store_fpresult_int(reg_d, qnan);
|
|
||||||
} else {
|
|
||||||
ppc_store_fpresult_flt(reg_d, ppc_dblresult64_d);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rec)
|
if (rec)
|
||||||
ppc_update_cr1();
|
ppc_update_cr1();
|
||||||
|
Reference in New Issue
Block a user