From patchwork Thu Oct 26 19:06:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 117270 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1127305qgn; Thu, 26 Oct 2017 12:11:00 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SnGmxYx2YrzehgvEpDDYF/Y+t89HCGdH0tzUMnlD9RRZ2F0sFl2p0gXpKbwfyBM/g6/Iq/ X-Received: by 10.101.74.4 with SMTP id s4mr5732283pgq.259.1509045060157; Thu, 26 Oct 2017 12:11:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509045060; cv=none; d=google.com; s=arc-20160816; b=s5Uo+mXjahVyOiwg//eloejZ5n3rhAcjtbLyXrCqqGCb7DsyjYwcMLXFrIIMW68X+v hWX6XBbYABSkpT/8c8rJY2APRyhWtLqRBwlhnGWgKW9O2/RBClXI6RtW9xlsTsZU24AM IvBVjDbcObhqtyglZsqE32sVu3ACJ8z2SYhNN4Yktpt7hnjsV6DiGVEUC41j3HhqMb+J f9p0K1FP+Wp50NvY7Ft2qZeNH8kqeI763BMYlWOYDbbT/2cOb726nO9rW+2+MeT4Vdvx cB5yUd3r0yvUb1P73GAuu9RRf7UuC78m5ViTRQsp8zoxG8/WtAZbUrROKmePf+36DLDa 3IfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:to:from:delivered-to :sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=nKECLNmOGar9NHx0Lf5bxbOaf/fKAVHDzjXh4a6ed+o=; b=kVFsu4/vIVQatZu14aeTSO2CvqGR3Bd7Dyt8yfjQ0SrQ18Eq+ZboSvcitPzNgMyfnH MyHLu4ZbGoV5jKiUegfHFxzCxG0ve2dsbSUIzh49sL5UeNdHoKXRrlH/w7daZIvpGwOI +7ASkiSO9WCBkZVHJpwXI++XvoLVYVCyjIJbf4h0vaGPH28mDp7NLbxOYNqVqGh7vmVA HJyMm3YqGluCRpYRGUmemf1kAW3LTtSnfQtzv4kcq5AEUj6U6UXpzRUoJGVg1i3g5Prp ODR9GN7ukhXg1iBBK5awLe7nKh514ZuYZRZtjOKQZgkmdYrtnJua3TcnVc3C8RxA+U6e 7Pzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=TKBKho5W; spf=pass (google.com: domain of libc-alpha-return-86420-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-86420-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 1si3328222plm.565.2017.10.26.12.10.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Oct 2017 12:11:00 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-86420-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=TKBKho5W; spf=pass (google.com: domain of libc-alpha-return-86420-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-86420-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=CtDPALBWB3/mBSqzh95tB742OC8Iiu4 kymWDGMUkVm6x3xd0PD216yquzdiy5hgR1+oe+Sl/FnGK4IH2KYD1Ot2ClRern5C JmuJ4iGHxeer7hxkLLBvQqWhhudsjknYM5WXb1mlaj0TtgTvblpvZTxmeuEyE3BV GOUN3JXzaOB4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; s=default; bh=hfxnqCm47ToflEic4feBNmLqu6Y=; b=TKBKh o5WQKf7Kfn0BEeVEqDwgI1grQXmGF5Ftaygo1Q06IxExL7cffVRvjiD2yfqaQwSP Axt7Fq+a39Ax3GofbSIff/V8f8H11qCYWg6+QopdOvGEKv725tVe6EtQWFOh8ppw ARnl2oZAmrWHfZTjePPKA9m1dJekJbBRIdpSLA= Received: (qmail 100187 invoked by alias); 26 Oct 2017 19:07:34 -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 99749 invoked by uid 89); 26 Oct 2017 19:07:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-qt0-f196.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=nKECLNmOGar9NHx0Lf5bxbOaf/fKAVHDzjXh4a6ed+o=; b=O0KPmmvtQjau4WD9o+1YkrpmJ2au6zaWMCOPc+Ng6ZgaQZtAFgzwv8++xPpM4lwthb 3qDiQDS6l5oVejCpUSgv+Djja18LIXdQtwiAJqOoRonIqbDmScduFsi9shAPd18P/LmG VR2c2SgsYoacjfQc76X96Ihz78OStdkk3uVWkzIIzHPQQovxy0RwiQUh4PuGLje4tv2g 50lxhzUPpplJfxWNPmYnBXxrG85IgQPRd9+hdzDeqKFunoleWW78aQ2LrHz6ZZENTwlM +NGb249oYlQ/rky/BcSa5VSaSp+g1Qn+/ZKsFr7+Qe8r/LnHu1zH3pSr5LQ1DCqS3snu WGbw== X-Gm-Message-State: AMCzsaUdpuoQp3eHPxqfG5k8TbM9IMQy4vvCNn1vdv9aS6XLlgme+eSZ GvNXo/7AZbVFIi2XtSfLJCWNTGTXDow= X-Received: by 10.200.63.109 with SMTP id w42mr38206345qtk.128.1509044846095; Thu, 26 Oct 2017 12:07:26 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 18/25] sparc: refactor sparc32 copysign selector to C Date: Thu, 26 Oct 2017 17:06:46 -0200 Message-Id: <1509044813-9951-19-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1509044813-9951-1-git-send-email-adhemerval.zanella@linaro.org> References: <1509044813-9951-1-git-send-email-adhemerval.zanella@linaro.org> This patch refactors the sparc32 ifunc selector to a C implementation. Also, the generic symbol is moved to its own implementation file s_copysign{f}-generic.S). Checked on sparc64-linux-gnu and sparcv9-linux-gnu. * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile (sysdep_calls): New rule. (sysdep_routines): Use sysdep_calls as base. (libm-sysdep_routines): Add generic rule for symbols shared with libc. Add s_copysign-generic and s_copysign-generic objects. * sysdeps/sparc/sparcv9/fpu/multiarch/s_copysign-generic.S: New file. * sysdeps/sparc32/sparcv9/fpu/multiarch/s_copysign.c: Likewise. * sysdeps/sparc/sparcv9/fpu/multiarch/s_copysignf-generic.S: Likewise. * sysdeps/sparc32/sparcv9/fpu/multiarch/s_copysignf.c: Likewise. * sysdeps/sparc32/sparcv9/fpu/multiarch/s_copysign.S: Remove file. * sysdeps/sparc32/sparcv9/fpu/multiarch/s_copysignf.S: Likewise. Signed-off-by: Adhemerval Zanella --- ChangeLog | 14 ++++++++ .../sparc/sparc32/sparcv9/fpu/multiarch/Makefile | 15 ++++++--- .../sparcv9/fpu/multiarch/s_copysign-generic.S | 8 +++++ .../sparc32/sparcv9/fpu/multiarch/s_copysign.S | 21 ------------ .../sparc32/sparcv9/fpu/multiarch/s_copysign.c | 38 ++++++++++++++++++++++ .../sparcv9/fpu/multiarch/s_copysignf-generic.S | 4 +++ .../sparc32/sparcv9/fpu/multiarch/s_copysignf.S | 12 ------- .../sparc32/sparcv9/fpu/multiarch/s_copysignf.c | 11 +++++++ 8 files changed, 86 insertions(+), 37 deletions(-) create mode 100644 sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign-generic.S delete mode 100644 sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.S create mode 100644 sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.c create mode 100644 sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf-generic.S delete mode 100644 sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.S create mode 100644 sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.c -- 2.7.4 diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile index 62bf6f1..b8d1126 100644 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile +++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile @@ -1,12 +1,19 @@ ifeq ($(subdir),math) -libm-sysdep_routines += m_copysignf-vis3 m_copysign-vis3 s_fabs-vis3 \ - s_fabsf-vis3 s_llrintf-vis3 s_llrint-vis3 \ + +# These functions are built both for libc and libm because they're required +# by printf. While the libc objects have the prefix s_, the libm ones are +# prefixed with m_. +sysdep_calls := s_copysignf-vis3 s_copysign-vis3 s_copysignf-generic \ + s_copysign-generic + +sysdep_routines += $(sysdep_calls) +libm-sysdep_routines += s_fabs-vis3 s_fabsf-vis3 s_llrintf-vis3 s_llrint-vis3 \ s_rintf-vis3 s_rint-vis3 \ s_fmaf-vis3 s_fma-vis3 s_fma-generic s_fmaf-generic \ s_nearbyint-vis3 s_nearbyintf-vis3 \ s_fdimf-vis3 s_fdim-vis3 s_fdim-generic \ - s_fdimf-generic -sysdep_routines += s_copysignf-vis3 s_copysign-vis3 + s_fdimf-generic \ + $(sysdep_calls:s_%=m_%) CFLAGS-s_fdimf-vis3.c += -Wa,-Av9d -mvis3 CFLAGS-s_fdim-vis3.c += -Wa,-Av9d -mvis3 diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign-generic.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign-generic.S new file mode 100644 index 0000000..55fb0ed --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign-generic.S @@ -0,0 +1,8 @@ +#include + +#define __copysign __copysign_generic +#undef weak_alias +#define weak_alias(a, b) +#undef compat_symbol +#define compat_symbol(a, b, c, d) +#include diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.S deleted file mode 100644 index 5d26430..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.S +++ /dev/null @@ -1,21 +0,0 @@ -#include -#include - -SPARC_ASM_VIS3_IFUNC(copysign) - -weak_alias (__copysign, copysign) -#if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0) -compat_symbol (libm, __copysign, copysignl, GLIBC_2_0); -#endif -#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0) -compat_symbol (libc, __copysign, copysignl, GLIBC_2_0); -#endif - -# undef weak_alias -# define weak_alias(a, b) -# undef compat_symbol -# define compat_symbol(a, b, c, d) - -#define __copysign __copysign_generic - -#include "../../../fpu/s_copysign.S" diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.c new file mode 100644 index 0000000..f11181b --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.c @@ -0,0 +1,38 @@ +/* copysign ifunc resolver, Linux/sparc32 version. + Copyright (C) 2017 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 + . */ + +#define __copysign __redirect_copysign +#include +#include +#undef __copysign +#include + +extern __typeof (__redirect_copysign) __copysign_vis3 attribute_hidden; +extern __typeof (__redirect_copysign) __copysign_generic attribute_hidden; + +sparc_libm_ifunc_redirected (__redirect_copysign, __copysign, + hwcap & HWCAP_SPARC_VIS3 + ? __copysign_vis3 + : __copysign_generic); +weak_alias (__copysign, copysign) +#if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0) +compat_symbol (libm, __copysign, copysignl, GLIBC_2_0); +#endif +#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0) +compat_symbol (libc, __copysign, copysignl, GLIBC_2_0); +#endif diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf-generic.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf-generic.S new file mode 100644 index 0000000..ebe0759 --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf-generic.S @@ -0,0 +1,4 @@ +#define __copysignf __copysignf_generic +#undef weak_alias +#define weak_alias(a, b) +#include diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.S deleted file mode 100644 index cd40955..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.S +++ /dev/null @@ -1,12 +0,0 @@ -#include - -SPARC_ASM_VIS3_IFUNC(copysignf) - -weak_alias (__copysignf, copysignf) - -# undef weak_alias -# define weak_alias(a, b) - -#define __copysignf __copysignf_generic - -#include "../../../fpu/s_copysignf.S" diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.c new file mode 100644 index 0000000..573c14d --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.c @@ -0,0 +1,11 @@ +#include +#include + +extern __typeof (copysignf) __copysignf_vis3 attribute_hidden; +extern __typeof (copysignf) __copysignf_generic attribute_hidden; + +sparc_libm_ifunc (__copysignf, + hwcap & HWCAP_SPARC_VIS3 + ? __copysignf_vis3 + : __copysignf_generic); +weak_alias (__copysignf, copysignf)