mirror of
https://github.com/citra-emu/citra.git
synced 2024-12-18 20:00:05 +00:00
Dyncom/VFP: Convert denormal outputs into 0 when the FTZ flag is enabled.
Inputs are still not flushed to 0 if they are denormals.
This commit is contained in:
parent
e33558c6ce
commit
b1a29371c9
@ -135,6 +135,21 @@ u32 vfp_double_normaliseround(ARMul_State* state, int dd, struct vfp_double* vd,
|
|||||||
#endif
|
#endif
|
||||||
if (!(significand & ((1ULL << (VFP_DOUBLE_LOW_BITS + 1)) - 1)))
|
if (!(significand & ((1ULL << (VFP_DOUBLE_LOW_BITS + 1)) - 1)))
|
||||||
underflow = 0;
|
underflow = 0;
|
||||||
|
|
||||||
|
int type = vfp_double_type(vd);
|
||||||
|
|
||||||
|
if ((type & VFP_DENORMAL) && (fpscr & FPSCR_FLUSH_TO_ZERO)) {
|
||||||
|
// Flush denormal to positive 0
|
||||||
|
exponent = 0;
|
||||||
|
significand = 0;
|
||||||
|
|
||||||
|
vd->sign = 0;
|
||||||
|
vd->exponent = exponent;
|
||||||
|
vd->significand = significand;
|
||||||
|
|
||||||
|
underflow = 0;
|
||||||
|
exceptions |= FPSCR_UFC;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -138,6 +138,21 @@ u32 vfp_single_normaliseround(ARMul_State* state, int sd, struct vfp_single* vs,
|
|||||||
#endif
|
#endif
|
||||||
if (!(significand & ((1 << (VFP_SINGLE_LOW_BITS + 1)) - 1)))
|
if (!(significand & ((1 << (VFP_SINGLE_LOW_BITS + 1)) - 1)))
|
||||||
underflow = 0;
|
underflow = 0;
|
||||||
|
|
||||||
|
int type = vfp_single_type(vs);
|
||||||
|
|
||||||
|
if ((type & VFP_DENORMAL) && (fpscr & FPSCR_FLUSH_TO_ZERO)) {
|
||||||
|
// Flush denormal to positive 0
|
||||||
|
exponent = 0;
|
||||||
|
significand = 0;
|
||||||
|
|
||||||
|
vs->sign = 0;
|
||||||
|
vs->exponent = exponent;
|
||||||
|
vs->significand = significand;
|
||||||
|
|
||||||
|
underflow = 0;
|
||||||
|
exceptions |= FPSCR_UFC;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user