* modules/totalorderl (Files): Add m4/signbit.m4.
* m4/totalorder.m4 (gl_FUNC_TOTALORDERL): Invoke
gl_LONG_DOUBLE_SIGN_LOCATION.
* lib/totalorderl.c (totalorderl): If LDBL_SIGNBIT_WORD is known,
use it, so that 'bigendian' becomes a constant.
+2023-10-04 Bruno Haible <bruno@clisp.org>
+
+ totalorderl: Optimize.
+ * modules/totalorderl (Files): Add m4/signbit.m4.
+ * m4/totalorder.m4 (gl_FUNC_TOTALORDERL): Invoke
+ gl_LONG_DOUBLE_SIGN_LOCATION.
+ * lib/totalorderl.c (totalorderl): If LDBL_SIGNBIT_WORD is known,
+ use it, so that 'bigendian' becomes a constant.
+
2023-10-04 Bruno Haible <bruno@clisp.org>
totalorderl: Work around Solaris cc bug.
/* Determine in which of the two 'unsigned long long' words the sign bit
is located. */
+ bool bigendian;
+#if defined LDBL_SIGNBIT_WORD
+ /* We have already determined the sign bit location at configure time. */
+ bigendian = (LDBL_SIGNBIT_WORD < 2);
+#else
zu.f = -zu.f;
- bool bigendian = !!zu.i[0];
+ bigendian = !!zu.i[0];
+#endif
unsigned long long
xhi = xu.i[!bigendian] ^ extended_sign,
else
REPLACE_TOTALORDERL=1
fi
- TOTALORDERL_LIBM='$(ISNANL_LIBM)'])
+ TOTALORDERL_LIBM='$(ISNANL_LIBM)'
+ dnl Prerequisite of lib/totalorderl.c.
+ gl_LONG_DOUBLE_SIGN_LOCATION
+ ])
AC_SUBST([TOTALORDERL_LIBM])
])
lib/totalorderl.c
m4/mathfunc.m4
m4/totalorder.m4
+m4/signbit.m4
Depends-on:
math