@@ -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 {
@@ -20,5 +20,9 @@ int main(void)
printf("FAIL: pseudo-denormal add\n");
ret = 1;
}
+ if (ld_pseudo_m16382.ld != 0x1p-16382L) {
+ printf("FAIL: pseudo-denormal compare\n");
+ ret = 1;
+ }
return ret;
}