From 08cee2a464f614a6d4275b5af6c52481f1aa16e6 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Tue, 27 Jan 2015 13:16:39 -0500 Subject: powerpc: Fix fsqrt build in libm [BZ#16576] Some powerpc64 processors (e5500 core for instance) does not provide the fsqrt instruction, however current check to use in math_private.h is __WORDSIZE and _ARCH_PWR4 (ISA 2.02). This is patch change it to use the compiler flag _ARCH_PPCSQ (which is the same condition GCC uses to decide whether to generate fsqrt instruction). It fixes BZ#16576. --- sysdeps/powerpc/powerpc64/fpu/e_sqrt.c | 30 ------------------------------ sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c | 30 ------------------------------ 2 files changed, 60 deletions(-) delete mode 100644 sysdeps/powerpc/powerpc64/fpu/e_sqrt.c delete mode 100644 sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c (limited to 'sysdeps/powerpc/powerpc64') diff --git a/sysdeps/powerpc/powerpc64/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/fpu/e_sqrt.c deleted file mode 100644 index 796388e776..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/e_sqrt.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Double-precision floating point square root. - Copyright (C) 1997-2015 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include - -#undef __ieee754_sqrt -double -__ieee754_sqrt (double x) -{ - double z; - __asm __volatile ("fsqrt %0,%1" : "=f" (z) : "f" (x)); - return z; -} -strong_alias (__ieee754_sqrt, __sqrt_finite) diff --git a/sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c deleted file mode 100644 index 5502525d4d..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Single-precision floating point square root. - Copyright (C) 1997-2015 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include - -#undef __ieee754_sqrtf -float -__ieee754_sqrtf (float x) -{ - double z; - __asm ("fsqrts %0,%1" : "=f" (z) : "f" (x)); - return z; -} -strong_alias (__ieee754_sqrtf, __sqrtf_finite) -- cgit 1.4.1