From e8dab9477f33ab7a67405f4e147cbaa1a4bb443b Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Tue, 13 Oct 2015 00:52:54 +0000 Subject: Fix powerpc32 llrint, llrintf bad exceptions (bug 16422). 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 , and . (__llrint): Avoid conversions to long long int where those might raise spurious exceptions. * sysdeps/powerpc/powerpc32/fpu/s_llrintf.c: Include and . (__llrintf): Avoid conversions to long long int where those might raise spurious exceptions. --- config.h.in | 3 +++ 1 file changed, 3 insertions(+) (limited to 'config.h.in') diff --git a/config.h.in b/config.h.in index 7c851c97fe..5fd4897428 100644 --- a/config.h.in +++ b/config.h.in @@ -251,4 +251,7 @@ /* PowerPC32 uses fcfid for integer to floating point conversions. */ #define HAVE_PPC_FCFID 0 +/* PowerPC32 uses fctidz for floating point to long long conversions. */ +#define HAVE_PPC_FCTIDZ 0 + #endif -- cgit v1.2.3