From patchwork Tue Nov 11 21:03:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 3659 X-Patchwork-Delegate: azanella@linux.vnet.ibm.com Received: (qmail 13020 invoked by alias); 11 Nov 2014 21:03:30 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 12969 invoked by uid 89); 11 Nov 2014 21:03:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e24smtp04.br.ibm.com Message-ID: <54627994.3030705@linux.vnet.ibm.com> Date: Tue, 11 Nov 2014 19:03:16 -0200 From: Adhemerval Zanella User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: "GNU C. Library" Subject: PATCH 3/3] powerpc: fmod multiarch X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14111121-0013-0000-0000-000001FFD8B5 This patch adds a multiarch symbol for __ieee754_fmod to select over POWER8 and default ppc64 version. Tested on powerpc64 and powerpc64le. --- * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile [libm-sysdep_routines]: Add fmod implementations. * sysdeps/powerpc/powerpc64/fpu/multiarch/e_fmod-power8.S: New file. * sysdeps/powerpc/powerpc64/fpu/multiarch/e_fmod-ppc64.c: New file. * sysdeps/powerpc/powerpc64/fpu/multiarch/e_fmod.c: New file. * sysdeps/powerpc/powerpc64/fpu/multiarch/e_fmodf-power8.S: New file. * sysdeps/powerpc/powerpc64/fpu/multiarch/e_fmodf-ppc64.c: New file. * sysdeps/powerpc/powerpc64/fpu/multiarch/e_fmodf.c: New file. --- diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile index 0e3eac7..a3af924 100644 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile @@ -24,7 +24,9 @@ libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \ s_modff-power5+ s_modff-ppc64 e_hypot-ppc64 \ e_hypot-power7 e_hypotf-ppc64 e_hypotf-power7 \ s_isnan-power8 s_isinf-power8 s_finite-power8 \ - s_llrint-power8 s_llround-power8 + s_llrint-power8 s_llround-power8 \ + e_fmod-power8 e_fmodf-power8 e_fmod-ppc64 \ + e_fmodf-ppc64 CFLAGS-s_logbf-power7.c = -mcpu=power7 CFLAGS-s_logbl-power7.c = -mcpu=power7 diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_fmod-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_fmod-power8.S new file mode 100644 index 0000000..ee3aca9 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_fmod-power8.S @@ -0,0 +1,26 @@ +/* __ieee754_fmod POWER8 version. + Copyright (C) 2014 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 + +#undef strong_alias +#define strong_alias(name, alias) + +#define __ieee754_fmod __ieee754_fmod_power8 + +#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_fmod-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_fmod-ppc64.c new file mode 100644 index 0000000..d2c30eb --- /dev/null +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_fmod-ppc64.c @@ -0,0 +1,26 @@ +/* __ieee754_fmod PowerPC64 version. + Copyright (C) 2013-2014 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 + +#undef strong_alias +#define strong_alias(a, b) + +#define __ieee754_fmod __ieee754_fmod_ppc64 + +#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_fmod.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_fmod.c new file mode 100644 index 0000000..b01b3ee --- /dev/null +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_fmod.c @@ -0,0 +1,31 @@ +/* Multiple versions of ieee754_fmod. + Copyright (C) 2013-2014 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 +#include "init-arch.h" + +extern __typeof (__ieee754_fmod) __ieee754_fmod_ppc64 attribute_hidden; +extern __typeof (__ieee754_fmod) __ieee754_fmod_power8 attribute_hidden; + +libc_ifunc (__ieee754_fmod, + (hwcap2 & PPC_FEATURE2_ARCH_2_07) + ? __ieee754_fmod_power8 + : __ieee754_fmod_ppc64); + +strong_alias (__ieee754_fmod, __fmod_finite) diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_fmodf-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_fmodf-power8.S new file mode 100644 index 0000000..5caf392 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_fmodf-power8.S @@ -0,0 +1,26 @@ +/* __ieee_fmodf POWER8 version. + Copyright (C) 2014 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 + +#undef strong_alias +#define strong_alias(name, alias) + +#define __ieee754_fmodf __ieee754_fmodf_power8 + +#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_fmodf-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_fmodf-ppc64.c new file mode 100644 index 0000000..8b1d387 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_fmodf-ppc64.c @@ -0,0 +1,26 @@ +/* __ieee754_fmodf PowerPC64 version. + Copyright (C) 2013-2014 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 + +#undef strong_alias +#define strong_alias(a, b) + +#define __ieee754_fmodf __ieee754_fmodf_ppc64 + +#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_fmodf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_fmodf.c new file mode 100644 index 0000000..a11f9bf --- /dev/null +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_fmodf.c @@ -0,0 +1,31 @@ +/* Multiple versions of ieee754_fmodf. + Copyright (C) 2013-2014 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 +#include "init-arch.h" + +extern __typeof (__ieee754_fmodf) __ieee754_fmodf_ppc64 attribute_hidden; +extern __typeof (__ieee754_fmodf) __ieee754_fmodf_power8 attribute_hidden; + +libc_ifunc (__ieee754_fmodf, + (hwcap2 & PPC_FEATURE2_ARCH_2_07) + ? __ieee754_fmodf_power8 + : __ieee754_fmodf_ppc64); + +strong_alias (__ieee754_fmodf, __fmodf_finite)