aboutsummaryrefslogtreecommitdiff
path: root/fpu/softfloat.c
diff options
context:
space:
mode:
Diffstat (limited to 'fpu/softfloat.c')
-rw-r--r--fpu/softfloat.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fpu/softfloat.c b/fpu/softfloat.c
index 6094d26..c57f72e 100644
--- a/fpu/softfloat.c
+++ b/fpu/softfloat.c
@@ -7966,6 +7966,13 @@ static inline int floatx80_compare_internal(floatx80 a, floatx80 b,
return 1 - (2 * aSign);
}
} else {
+ /* Normalize pseudo-denormals before comparison. */
+ if ((a.high & 0x7fff) == 0 && a.low & UINT64_C(0x8000000000000000)) {
+ ++a.high;
+ }
+ if ((b.high & 0x7fff) == 0 && b.low & UINT64_C(0x8000000000000000)) {
+ ++b.high;
+ }
if (a.low == b.low && a.high == b.high) {
return float_relation_equal;
} else {