mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-30 00:31:08 +00:00
e8dab9477f
The versions of llrint and llrintf for older powerpc32 processors convert the results of __rint / __rintf to long long int, resulting in spurious exceptions from such casts in certain cases. This patch makes glibc work around the problems with the libgcc conversions when the compiler used to build glibc doesn't use the fctidz instruction for them. Tested for powerpc. [BZ #16422] * sysdeps/powerpc/powerpc32/fpu/configure.ac (libc_cv_ppc_fctidz): New configure test. * sysdeps/powerpc/powerpc32/fpu/configure: Regenerated. * config.h.in [_LIBC] (HAVE_PPC_FCTIDZ): New macro. * sysdeps/powerpc/powerpc32/fpu/s_llrint.c: Include <limits.h>, <math_private.h> and <stdint.h>. (__llrint): Avoid conversions to long long int where those might raise spurious exceptions. * sysdeps/powerpc/powerpc32/fpu/s_llrintf.c: Include <math_private.h> and <stdint.h>. (__llrintf): Avoid conversions to long long int where those might raise spurious exceptions.
35 lines
1.2 KiB
Plaintext
35 lines
1.2 KiB
Plaintext
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
|
|
# Local configure fragment for sysdeps/powerpc/powerpc32/fpu.
|
|
|
|
# Test whether integer to floating point conversions use fcfid.
|
|
AC_CACHE_CHECK([for fcfid use], [libc_cv_ppc_fcfid], [dnl
|
|
echo 'double foo (int x) { return (double) x; }' > conftest.c
|
|
libc_cv_ppc_fcfid=no
|
|
if AC_TRY_COMMAND(${CC-cc} -S $CFLAGS conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
|
|
changequote(,)dnl
|
|
if grep '[ ]fcfid' conftest.s > /dev/null 2>&1; then
|
|
libc_cv_ppc_fcfid=yes
|
|
fi
|
|
changequote([,])dnl
|
|
fi
|
|
rm -rf conftest*])
|
|
if test $libc_cv_ppc_fcfid = yes; then
|
|
AC_DEFINE([HAVE_PPC_FCFID])
|
|
fi
|
|
|
|
# Test whether floating point to long long conversions use fctidz.
|
|
AC_CACHE_CHECK([for fctidz use], [libc_cv_ppc_fctidz], [dnl
|
|
echo 'long long int foo (double x) { return (long long int) x; }' > conftest.c
|
|
libc_cv_ppc_fctidz=no
|
|
if AC_TRY_COMMAND(${CC-cc} -S $CFLAGS conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
|
|
changequote(,)dnl
|
|
if grep '[ ]fctidz' conftest.s > /dev/null 2>&1; then
|
|
libc_cv_ppc_fctidz=yes
|
|
fi
|
|
changequote([,])dnl
|
|
fi
|
|
rm -rf conftest*])
|
|
if test $libc_cv_ppc_fctidz = yes; then
|
|
AC_DEFINE([HAVE_PPC_FCTIDZ])
|
|
fi
|