summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2017-05-08 21:34:16 +0200
committerSubv <subv2112@gmail.com>2017-05-08 21:34:16 +0200
commitb1a29371c9955a79bb9353043532316516512334 (patch)
tree43ad3f9af9574cb4f615c06a2ac483820be3149d
parentMerge pull request #2682 from nicoboss/filter (diff)
downloadyuzu-b1a29371c9955a79bb9353043532316516512334.tar
yuzu-b1a29371c9955a79bb9353043532316516512334.tar.gz
yuzu-b1a29371c9955a79bb9353043532316516512334.tar.bz2
yuzu-b1a29371c9955a79bb9353043532316516512334.tar.lz
yuzu-b1a29371c9955a79bb9353043532316516512334.tar.xz
yuzu-b1a29371c9955a79bb9353043532316516512334.tar.zst
yuzu-b1a29371c9955a79bb9353043532316516512334.zip
-rw-r--r--src/core/arm/skyeye_common/vfp/vfpdouble.cpp15
-rw-r--r--src/core/arm/skyeye_common/vfp/vfpsingle.cpp15
2 files changed, 30 insertions, 0 deletions
diff --git a/src/core/arm/skyeye_common/vfp/vfpdouble.cpp b/src/core/arm/skyeye_common/vfp/vfpdouble.cpp
index 2886f351f..49c192dd3 100644
--- a/src/core/arm/skyeye_common/vfp/vfpdouble.cpp
+++ b/src/core/arm/skyeye_common/vfp/vfpdouble.cpp
@@ -135,6 +135,21 @@ 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
+ exponent = 0;
+ significand = 0;
+
+ vd->sign = 0;
+ vd->exponent = exponent;
+ 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 1590d89a4..85dd0c6a0 100644
--- a/src/core/arm/skyeye_common/vfp/vfpsingle.cpp
+++ b/src/core/arm/skyeye_common/vfp/vfpsingle.cpp
@@ -138,6 +138,21 @@ 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
+ exponent = 0;
+ significand = 0;
+
+ vs->sign = 0;
+ vs->exponent = exponent;
+ vs->significand = significand;
+
+ underflow = 0;
+ exceptions |= FPSCR_UFC;
+ }
}
/*