Dyncom/VFP: Properly pack QNaN values.

vfp_*_normaliseround was previously converting qnans into numbers, ie, 7fc00000 (qnan) into 7f000000 (1.7014118e+38).

Closes #2680
This commit is contained in:
Subv 2017-05-08 14:25:33 -05:00
parent e33558c6ce
commit 3cc693df0b
2 changed files with 6 additions and 2 deletions

View File

@ -90,10 +90,12 @@ u32 vfp_double_normaliseround(ARMul_State* state, int dd, struct vfp_double* vd,
vfp_double_dump("pack: in", vd);
int td = vfp_double_type(vd);
/*
* Infinities and NaNs are a special case.
*/
if (vd->exponent == 2047 && (vd->significand == 0 || exceptions))
if (td & (VFP_NAN | VFP_INFINITY))
goto pack;
/*

View File

@ -90,10 +90,12 @@ u32 vfp_single_normaliseround(ARMul_State* state, int sd, struct vfp_single* vs,
vfp_single_dump("pack: in", vs);
int ts = vfp_single_type(vs);
/*
* Infinities and NaNs are a special case.
*/
if (vs->exponent == 255 && (vs->significand == 0 || exceptions))
if (ts & (VFP_NAN | VFP_INFINITY))
goto pack;
/*