* lib/snan.h: Update comment.
* lib/totalorderf.c (totalorderf): On sh4, invert bit 22 before
comparing two NaNs.
* lib/totalorder.c (totalorder): On sh4, invert bit 51 before comparing
two NaNs.
* lib/totalorderl.c (totalorderl): On sh4, invert bit 51 or 47 of the
xhi, yhi parts before comparing two NaNs.
2023-10-14 Bruno Haible <bruno@clisp.org>
+ totalorder*: Fix test failures on SH4.
+ * lib/snan.h: Update comment.
+ * lib/totalorderf.c (totalorderf): On sh4, invert bit 22 before
+ comparing two NaNs.
+ * lib/totalorder.c (totalorder): On sh4, invert bit 51 before comparing
+ two NaNs.
+ * lib/totalorderl.c (totalorderl): On sh4, invert bit 51 or 47 of the
+ xhi, yhi parts before comparing two NaNs.
+
totalorder*: Fix test failures on PA-RISC and MIPS CPUs.
* lib/totalorderf.c (totalorderf): On hppa and mips, invert bit 22
before comparing two NaNs.
This bit is
* == 0 to indicate a quiet NaN or Infinity,
== 1 to indicate a signalling NaN,
- on these CPUs: hppa, mips.
+ on these CPUs: hppa, mips, sh4.
* == 1 to indicate a quiet NaN,
== 0 to indicate a signalling NaN or Infinity,
on all other CPUs.
/* At this point, *X and *Y are NaNs with the same sign bit. */
unsigned long long extended_sign = -!!xs;
-#if defined __hppa || defined __mips__
+#if defined __hppa || defined __mips__ || defined __sh__
/* Invert the most significant bit of the mantissa field. Cf. snan.h. */
extended_sign ^= (1ULL << 51);
#endif
/* At this point, *X and *Y are NaNs with the same sign bit. */
unsigned int extended_sign = -!!xs;
-#if defined __hppa || defined __mips__
+#if defined __hppa || defined __mips__ || defined __sh__
/* Invert the most significant bit of the mantissa field. Cf. snan.h. */
extended_sign ^= (1U << 22);
#endif
if (sizeof (long double) <= sizeof (unsigned long long))
{
-#if defined __hppa || defined __mips__
+#if defined __hppa || defined __mips__ || defined __sh__
/* Invert the most significant bit of the mantissa field. Cf. snan.h. */
extended_sign ^= (1ULL << 51);
#endif
}
unsigned long long extended_sign_hi = extended_sign;
-#if defined __hppa || defined __mips__
+#if defined __hppa || defined __mips__ || defined __sh__
/* Invert the most significant bit of the mantissa field. Cf. snan.h. */
extended_sign_hi ^=
(1ULL << (LDBL_MANT_DIG == 106