From patchwork Thu Oct 26 19:06:39 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: 117261 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1125723qgn; Thu, 26 Oct 2017 12:09:19 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TXaDM0F5UVeatUXA2MzJVc+KpeJ4TVr7ZUSjiQ+K8ELtwWxZpCCocmLDQy59LaeIvx49KJ X-Received: by 10.99.148.17 with SMTP id m17mr5893156pge.114.1509044959725; Thu, 26 Oct 2017 12:09:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509044959; cv=none; d=google.com; s=arc-20160816; b=FpiBMD9WGaFDcYCwu+X1KoymtyKER6Wsh61qpUc0RRbaFBNS3Yy3+I2MI/kiA1XnMg lPfhwX/8TecFL8FX5oL4B2NFfC1Fn7UmdttYvRMgNdUJTl/MO6FegaD0V2OYQYOM6n0J 8S3ENHt7ImiCYRwtyIDIZ6sluAf5sZsSXMCMnCZtoI76zWwHIGUenQg8bToEBAxRMXXv sippufWcprjy3dzSwuew6QFKXCmWSpexh6+KmaOmvVRefApYTwjNTkzXNB9ADWpTfDLl Zy2/kEGVMhkytGWHZusrT/42xwWjQUVMOQ39Mutp3sXLWkKDRVIGKpDaWu4jEMLx+mGR LLuQ== 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=qw9zl6jZJy21uW/65ia+qa221+q1P2fkm3kPBlNFGgY=; b=KxFOkqxbrOO1vRTj5iXnYXnHmKErdOL7vJutUnJ4bSZkmdIYVDeP5GLitMPb+9z/NM /F+i+4qwA0tMzY8+uwN+WjgvkLdCYFwvfNrJCmuY9WAuVf0bdCbK51w1GPx3wC3HoiCq FNlDWTilZLkpZ9lBA1qJKLrxyvGb9OgdG7z1GMmRDnBGMFnMRJA9G3gUrMfu0E3h6HsZ RI6zHqMvQhs7ruUlzhQ1irGB2mgsP8WCoHhumS3LQ6+6KjBbVu81Z/j43SY6/XLQBRkd Pmjn2wir/nEf51xg1gBn2bUns6GgO8nd/Ux6g6RMOwzbKb36gHDN3kzMCG6MRikbKfGO hvaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=e/GvmDAb; spf=pass (google.com: domain of libc-alpha-return-86411-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-86411-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 x23si3730071pgc.683.2017.10.26.12.09.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Oct 2017 12:09:19 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-86411-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=e/GvmDAb; spf=pass (google.com: domain of libc-alpha-return-86411-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-86411-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=BhXXiDxT7zN6y1Vk8/XXfBO/s6MMFxV 2h1RiiRi6tKO6ioepzXOcCNCPf1KbXhughP359PY9pX75ZEKqOkfQ7JbvFgVr51p 2EF5GwVX4vnhRaknF+M5YgT48T8+/RcLu8ud7wRJBhBrpWgGkOt/+zCndoYOUYhz hNN/v/hDhTHc= 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=O8OzChScR/ErOH5V8OxFYl+D5Po=; b=e/Gvm DAbF74BjIGXq5on/hh2aHVeNvFdSS9KD3rQHDd1prTmfz4TtytFW+7d91n/bgNI2 /AmWdZX7ZEnxXvB1kzubZHeETOHej2iz3PNgnKQnLSIhjDyjuIJv5ANpFnf1W0/o JHZJD4LKGIle/LPHz5Q2S9KL0llSu1HBuYYhHs= Received: (qmail 98600 invoked by alias); 26 Oct 2017 19:07:21 -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 98538 invoked by uid 89); 26 Oct 2017 19:07:20 -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=(unknown) X-HELO: mail-qt0-f193.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=qw9zl6jZJy21uW/65ia+qa221+q1P2fkm3kPBlNFGgY=; b=qkcy0nBM3admvSSKr13sPtXOSIoMCINlG/LQ5Wn+44TXHo7y9O+SpV+GPg8E3qq5Jj T19hvVlofpOcKtcRdSUqgbJzsvwtyenUTuhkkD9dP4iGW7aTGTO3DboMglPEeKQY6LIG FOSoNKZi+DkbXoLa1PUSk+ROoWbeRO7BUzUUtCOSywvclG8AhuoKVaoWc2T0C+8YrcLP LmP5zrKs2rNUDfLvUCr4XPOGbw+IbYUJAttujV7neYobwSKs3niEG2AP5i3NaX9yH4OY mgtdVExpireMLOZiikqXW/GwNQa5cQ+eaOhgZvoa8Akpqg4+ufQnd+UdNFUSXdIqXsQ9 +eTQ== X-Gm-Message-State: AMCzsaUYlwgh8cmFf6xdn/nhoM3WNhCLxbex6R0tfKGI53K0E/T4dF6X SfFOC95W78JbM7R3LGCbnwI5eKSVdQY= X-Received: by 10.200.49.21 with SMTP id g21mr38565762qtb.183.1509044836124; Thu, 26 Oct 2017 12:07:16 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 11/25] sparc: refactor sparc64 lrint{f} selector to C Date: Thu, 26 Oct 2017 17:06:39 -0200 Message-Id: <1509044813-9951-12-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 sparc64 ifunc selector to a C implementation. Also, the generic symbol is moved to its own implementation file s_lrint{f}-generic.S). Checked on sparc64-linux-gnu and sparcv9-linux-gnu. * sysdeps/sparc/sparc64/fpu/multiarch/Makefile (libm-sysdep_routines): Add s_lrint-generic and s_lrint-generic objects. * sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-generic.S: New file. * sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.c: Likewise. * sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-generic.S: Likewise. * sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.c: Likewise. * sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.S: Remove file. * sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.S: Likewise. Signed-off-by: Adhemerval Zanella --- ChangeLog | 10 ++++++ sysdeps/sparc/sparc64/fpu/multiarch/Makefile | 3 +- .../sparc/sparc64/fpu/multiarch/s_lrint-generic.S | 6 ++++ sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.S | 17 ---------- sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.c | 39 ++++++++++++++++++++++ .../sparc/sparc64/fpu/multiarch/s_lrintf-generic.S | 6 ++++ sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.S | 17 ---------- sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.c | 39 ++++++++++++++++++++++ 8 files changed, 102 insertions(+), 35 deletions(-) create mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-generic.S delete mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.S create mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.c create mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-generic.S delete mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.S create mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.c -- 2.7.4 diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/Makefile b/sysdeps/sparc/sparc64/fpu/multiarch/Makefile index 6062af0..d0a87d1 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/Makefile +++ b/sysdeps/sparc/sparc64/fpu/multiarch/Makefile @@ -9,7 +9,8 @@ sysdep_calls := s_signbitf-vis3 s_signbit-vis3 s_signbitf-generic \ s_isnanf-vis3 s_isnan-vis3 s_isnanf-generic s_isnan-generic sysdep_routines += $(sysdep_calls) -libm-sysdep_routines += s_lrintf-vis3 s_lrint-vis3 s_rintf-vis3 s_rint-vis3 \ +libm-sysdep_routines += s_lrintf-vis3 s_lrint-vis3 s_lrintf-generic \ + s_lrint-generic s_rintf-vis3 s_rint-vis3 \ s_fmaf-vis3 s_fma-vis3 s_fmaf-generic s_fma-generic \ s_nearbyint-vis3 s_nearbyintf-vis3 \ s_nearbyint-generic s_nearbyintf-generic \ diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-generic.S new file mode 100644 index 0000000..e6ab999 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-generic.S @@ -0,0 +1,6 @@ +#define __lrint __lrint_generic +#undef weak_alias +#define weak_alias(a,b) +#undef strong_alias +#define strong_alias(a,b) +#include diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.S deleted file mode 100644 index 94af8f0..0000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.S +++ /dev/null @@ -1,17 +0,0 @@ -#include - -SPARC_ASM_VIS3_IFUNC(lrint) - -weak_alias (__lrint, lrint) - -strong_alias (__lrint, __llrint) -weak_alias (__llrint, llrint) - -# undef weak_alias -# define weak_alias(a, b) -# undef strong_alias -# define strong_alias(a, b) - -#define __lrint __lrint_generic - -#include "../s_lrint.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.c new file mode 100644 index 0000000..557f0d6 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.c @@ -0,0 +1,39 @@ +/* lrint/llrint ifunc resolver, Linux/sparc64 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 lrint __redirect_lrint +#define llrint __redirect_llrint +#define __lrint __redirect___lrint +#define __llrint __redirect___llrint +#include +#undef lrint +#undef llrint +#undef __lrint +#undef __llrint +#include + +extern __typeof (__redirect_lrint) __lrint_vis3 attribute_hidden; +extern __typeof (__redirect_lrint) __lrint_generic attribute_hidden; + +sparc_libm_ifunc_redirected (__redirect_lrint, __lrint, + hwcap & HWCAP_SPARC_VIS3 + ? __lrint_vis3 + : __lrint_generic); +weak_alias (__lrint, lrint) +strong_alias (__lrint, __llrint) +weak_alias (__llrint, llrint) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-generic.S new file mode 100644 index 0000000..4cfbf4a --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-generic.S @@ -0,0 +1,6 @@ +#define __lrintf __lrintf_generic +#undef weak_alias +#define weak_alias(a,b) +#undef strong_alias +#define strong_alias(a,b) +#include diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.S deleted file mode 100644 index e6ea406..0000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.S +++ /dev/null @@ -1,17 +0,0 @@ -#include - -SPARC_ASM_VIS3_IFUNC(lrintf) - -weak_alias (__lrintf, lrintf) - -strong_alias (__lrintf, __llrintf) -weak_alias (__llrintf, llrintf) - -# undef weak_alias -# define weak_alias(a, b) -# undef strong_alias -# define strong_alias(a, b) - -#define __lrintf __lrintf_generic - -#include "../s_lrintf.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.c new file mode 100644 index 0000000..9b1a569 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.c @@ -0,0 +1,39 @@ +/* lrintf/llrintf ifunc resolver, Linux/sparc64 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 lrintf __redirect_lrintf +#define llrintf __redirect_llrintf +#define __lrintf __redirect_lrintf +#define __llrintf __redirect_llrintf +#include +#undef lrintf +#undef llrintf +#undef __lrintf +#undef __llrintf +#include + +extern __typeof (__redirect_lrintf) __lrintf_vis3 attribute_hidden; +extern __typeof (__redirect_lrintf) __lrintf_generic attribute_hidden; + +sparc_libm_ifunc_redirected (__redirect_lrintf, __lrintf, + hwcap & HWCAP_SPARC_VIS3 + ? __lrintf_vis3 + : __lrintf_generic); +weak_alias (__lrintf, lrintf) +strong_alias (__lrintf, __llrintf) +weak_alias (__llrintf, llrintf)