diff --git a/src/core/arm/skyeye_common/vfp/vfpdouble.cpp b/src/core/arm/skyeye_common/vfp/vfpdouble.cpp index 2886f351f..452d16049 100644 --- a/src/core/arm/skyeye_common/vfp/vfpdouble.cpp +++ b/src/core/arm/skyeye_common/vfp/vfpdouble.cpp @@ -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; /* diff --git a/src/core/arm/skyeye_common/vfp/vfpsingle.cpp b/src/core/arm/skyeye_common/vfp/vfpsingle.cpp index 1590d89a4..3b51f4f9c 100644 --- a/src/core/arm/skyeye_common/vfp/vfpsingle.cpp +++ b/src/core/arm/skyeye_common/vfp/vfpsingle.cpp @@ -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; /*