summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Valle <subv2112@gmail.com>2017-05-22 19:16:53 +0200
committerGitHub <noreply@github.com>2017-05-22 19:16:53 +0200
commitc291db72e74fa1514bfe6706b8a2004bbe2b31e7 (patch)
treef0e29867eb0002a0efd09fbccef53bd212530b39
parentMerge pull request #2406 from Subv/session_disconnect (diff)
parentfixup! Dyncom/VFP: Convert denormal outputs into 0 when the FTZ flag is enabled. (diff)
downloadyuzu-c291db72e74fa1514bfe6706b8a2004bbe2b31e7.tar
yuzu-c291db72e74fa1514bfe6706b8a2004bbe2b31e7.tar.gz
yuzu-c291db72e74fa1514bfe6706b8a2004bbe2b31e7.tar.bz2
yuzu-c291db72e74fa1514bfe6706b8a2004bbe2b31e7.tar.lz
yuzu-c291db72e74fa1514bfe6706b8a2004bbe2b31e7.tar.xz
yuzu-c291db72e74fa1514bfe6706b8a2004bbe2b31e7.tar.zst
yuzu-c291db72e74fa1514bfe6706b8a2004bbe2b31e7.zip
-rw-r--r--src/core/arm/skyeye_common/vfp/vfpdouble.cpp13
-rw-r--r--src/core/arm/skyeye_common/vfp/vfpsingle.cpp13
2 files changed, 26 insertions, 0 deletions
diff --git a/src/core/arm/skyeye_common/vfp/vfpdouble.cpp b/src/core/arm/skyeye_common/vfp/vfpdouble.cpp
index 7b035f56a..735cf1a09 100644
--- a/src/core/arm/skyeye_common/vfp/vfpdouble.cpp
+++ b/src/core/arm/skyeye_common/vfp/vfpdouble.cpp
@@ -134,6 +134,19 @@ u32 vfp_double_normaliseround(ARMul_State* state, int dd, struct vfp_double* vd,
#endif
if (!(significand & ((1ULL << (VFP_DOUBLE_LOW_BITS + 1)) - 1)))
underflow = 0;
+
+ int type = vfp_double_type(vd);
+
+ if ((type & VFP_DENORMAL) && (fpscr & FPSCR_FLUSH_TO_ZERO)) {
+ // Flush denormal to positive 0
+ significand = 0;
+
+ vd->sign = 0;
+ vd->significand = significand;
+
+ underflow = 0;
+ exceptions |= FPSCR_UFC;
+ }
}
/*
diff --git a/src/core/arm/skyeye_common/vfp/vfpsingle.cpp b/src/core/arm/skyeye_common/vfp/vfpsingle.cpp
index 6b4cb8efa..1f9142abc 100644
--- a/src/core/arm/skyeye_common/vfp/vfpsingle.cpp
+++ b/src/core/arm/skyeye_common/vfp/vfpsingle.cpp
@@ -137,6 +137,19 @@ u32 vfp_single_normaliseround(ARMul_State* state, int sd, struct vfp_single* vs,
#endif
if (!(significand & ((1 << (VFP_SINGLE_LOW_BITS + 1)) - 1)))
underflow = 0;
+
+ int type = vfp_single_type(vs);
+
+ if ((type & VFP_DENORMAL) && (fpscr & FPSCR_FLUSH_TO_ZERO)) {
+ // Flush denormal to positive 0
+ significand = 0;
+
+ vs->sign = 0;
+ vs->significand = significand;
+
+ underflow = 0;
+ exceptions |= FPSCR_UFC;
+ }
}
/*