From patchwork Thu Oct 26 19:06:48 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: 117272 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1127681qgn; Thu, 26 Oct 2017 12:11:21 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Rv/7KMWlp3/XS+lgMLCoWCdYPY3GRuLaBf7o2Qfal79196tET41y5ckSL8rVa7uKHCj6oT X-Received: by 10.159.207.149 with SMTP id z21mr5280670plo.164.1509045081087; Thu, 26 Oct 2017 12:11:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509045081; cv=none; d=google.com; s=arc-20160816; b=NS4tgjpqnI+gP9FE7sPPAOxkNZGZ0vE1o2Y6eO0f71l3jOINqCVejxwOBQrtCy4X7o Ps3d+F8Cu2Wgl6UODtdffHfQ4hTNz37/hLfbDp1FBBi6j0y+IcMkYsLRTpDrmmjWo32I 6In9Z9VoRvhSf7Xhl664I2QoqEM12UNywNT0NaNitNOj/YI1yOajeWFgWhfKHvqCKXUi ZKUxkuU8YdF9uL+/4rZLct6qZU5al6FoctPSSCvUPuQPRjx6qaUKW1Uqg+Ejdcv52Ryb LUQdEz7CVLkfuYy6iSahPeSs/vc/9rVfidSuIS/j68VRArSmxMlxacGQs0niMGHoEvZ9 dg9Q== 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=YzSk+aVhtBVCUh5mBCrYz/pkwidCsKLyyE/sgA/DQ5Y=; b=0zWseVWvCjcePk4NSHQjNqJNiJcX4PEtwOH3y+GUPexAVGNi+gVpDK7/wzhZVkdIId uabjdMXJqKbnlcu6UtXRdr9ACSE+h4zXDEOs6PCJA3Xk5nYa8k+hkBIqK4u/Hb5XNuqi p5rAOnRDQpjrWNJyNHKw4vfMzblIIa67xBYvLcfHt5OTsdKKNNibkn2ogRsVb9FINrIq ewqL70iHGF29LLOPEnyN+Iyyw4ITK873MgJrqiBDeG6261vUW5ZzziV++3ApbtMZMJ2C XYuI1GCw0IFU950GZNyHiDy47vNryQ5V91bvjgjU4l7b7xjKe86KecR+bAnxCXfSEH0E 341g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=po3WOuUW; spf=pass (google.com: domain of libc-alpha-return-86422-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-86422-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 z17si4106308pfk.52.2017.10.26.12.11.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Oct 2017 12:11:21 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-86422-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=po3WOuUW; spf=pass (google.com: domain of libc-alpha-return-86422-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-86422-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=kYis/g2U0mV2BGvVQdQVkvqu7LMVq/7 FEYxMqcc9iSKtAKAfmDD4u7hKRvYE/aHrohw1SxoRCS5xNJsFb5GIjZMWpxNTpvu DnIuUrN5dLmCttY+8utDFASrstIcko2AM2JRlKg91gbabuihDlB69X8PwRI+Kxfg caBSH7FhsqYg= 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=fdYu/oVtpsCjMQFGId782wJKXKk=; b=po3WO uUWSiBu5KXJGpyTAn2PeiI1ZVz70l9n5ObHkrYXjJwFXvg3VBAWEsIFDPrw0XKKG k/bfafz+BgcCI5Uflpc3PORuPXxoIJXfffGkw4d4EnxFTrwT41IlVMGT2kKWQo0X yI8r8kcU1X4Qo2945/kCBbwd6naV3bE5qiH5YU= Received: (qmail 100278 invoked by alias); 26 Oct 2017 19:07:35 -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 100094 invoked by uid 89); 26 Oct 2017 19:07:33 -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-qk0-f194.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=YzSk+aVhtBVCUh5mBCrYz/pkwidCsKLyyE/sgA/DQ5Y=; b=VipOPJM3Da+l32igA+2WRWIpnkB2EvVE6DuAJKUKULxxR5b0NFFe+sxOGjrneexybX PXTv66cJi5cP4u1i5C4ZOsF2pTMhlxL5JMJXtUfL2goiJ7OutkpB//q29qs3gAEkftxb gN5dqxm3a1IcSmlet4jymyPn8lYpwW5vZDOqe1J5oWw2fSyh9qcwb4dOL2CW4BoQPJaa bbuvkJTR6ty7MbchxzuMpUnaulCzGqN12s8ExTh5lL6of3cb0a5IyYgmjV8nXz2oAJQH 9zgoasHTT/8HJgu0cCyDXvheZkYcXS/VEej+opjD1N3L6CoxG1uhvYFT2H6DjLuPbMCI RUKA== X-Gm-Message-State: AMCzsaVAI/mW0V9FCL3xUOOb0zYQtZHY01T/TcPrCYfzBJw3REUqADq1 VfV/P2ee5pbRcAWUtCrir6GQnLA9k2s= X-Received: by 10.55.197.20 with SMTP id p20mr9711758qki.229.1509044848884; Thu, 26 Oct 2017 12:07:28 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 20/25] sparc: refactor sparc32 llrint{f} selector to C Date: Thu, 26 Oct 2017 17:06:48 -0200 Message-Id: <1509044813-9951-21-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_llrint{f}-generic.S). Checked on sparc64-linux-gnu and sparcv9-linux-gnu. * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile (libm-sysdep_routines): Add s_llrintf-generic and s_llrint-generic. * sysdeps/sparc/sparcv9/fpu/multiarch/s_llrint-generic.S: New file. * sysdeps/sparc32/sparcv9/fpu/multiarch/s_llrint.c: Likewise. * sysdeps/sparc32/sparcv9/fpu/multiarch/s_llrintf-generic.S: Likewise. * sysdeps/sparc32/sparcv9/fpu/multiarch/s_llrintf.c: Likewise. * sysdeps/sparc32/sparcv9/fpu/multiarch/s_llrint.S: Remove file. * sysdeps/sparc32/sparcv9/fpu/multiarch/s_llrintf.S: Likewise. Signed-off-by: Adhemerval Zanella --- ChangeLog | 11 +++++++ .../sparc/sparc32/sparcv9/fpu/multiarch/Makefile | 1 + .../sparcv9/fpu/multiarch/s_llrint-generic.S | 8 +++++ .../sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.S | 24 --------------- .../sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.c | 36 ++++++++++++++++++++++ .../sparcv9/fpu/multiarch/s_llrintf-generic.S | 4 +++ .../sparc32/sparcv9/fpu/multiarch/s_llrintf.S | 17 ---------- .../sparc32/sparcv9/fpu/multiarch/s_llrintf.c | 29 +++++++++++++++++ 8 files changed, 89 insertions(+), 41 deletions(-) create mode 100644 sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint-generic.S delete mode 100644 sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.S create mode 100644 sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.c create mode 100644 sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf-generic.S delete mode 100644 sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.S create mode 100644 sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.c -- 2.7.4 diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile index bd8e341..5b6e2a6 100644 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile +++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile @@ -9,6 +9,7 @@ sysdep_calls := s_copysignf-vis3 s_copysign-vis3 s_copysignf-generic \ sysdep_routines += $(sysdep_calls) libm-sysdep_routines += s_fabs-vis3 s_fabsf-vis3 s_fabs-generic \ s_fabsf-generic s_llrintf-vis3 s_llrint-vis3 \ + s_llrintf-generic s_llrint-generic \ s_rintf-vis3 s_rint-vis3 \ s_fmaf-vis3 s_fma-vis3 s_fma-generic s_fmaf-generic \ s_nearbyint-vis3 s_nearbyintf-vis3 \ diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint-generic.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint-generic.S new file mode 100644 index 0000000..ceb5d14 --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint-generic.S @@ -0,0 +1,8 @@ +#include + +#define __llrint __llrint_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_llrint.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.S deleted file mode 100644 index fd23041..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.S +++ /dev/null @@ -1,24 +0,0 @@ -#include -#include - -SPARC_ASM_VIS3_IFUNC(llrint) - -weak_alias (__llrint, llrint) - -strong_alias (__llrint, __lllrint) -weak_alias (__lllrint, lllrint) - -#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1) -compat_symbol (libm, __llrint, llrintl, GLIBC_2_1) -#endif - -# undef weak_alias -# define weak_alias(a, b) -# undef strong_alias -# define strong_alias(a, b) -# undef compat_symbol -# define compat_symbol(a, b, c, d) - -#define __llrint __llrint_generic - -#include "../s_llrint.S" diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.c new file mode 100644 index 0000000..b10cad4 --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.c @@ -0,0 +1,36 @@ +/* llrint 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 __llrint __redirect_llrint +#include +#undef __llrint +#include +#include + +extern __typeof (__redirect_llrint) __llrint_vis3 attribute_hidden; +extern __typeof (__redirect_llrint) __llrint_generic attribute_hidden; + +sparc_libm_ifunc_redirected (__redirect_llrint, __llrint, + hwcap & HWCAP_SPARC_VIS3 + ? __llrint_vis3 + : __llrint_generic); +weak_alias (__llrint, llrint) + +#if LONG_DOUBLE_COMPAT (libm, GLIBC_2_1) +compat_symbol (libm, __llrint, llrintl, GLIBC_2_1); +#endif diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf-generic.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf-generic.S new file mode 100644 index 0000000..83c462c --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf-generic.S @@ -0,0 +1,4 @@ +#define __llrintf __llrintf_generic +#undef weak_alias +#define weak_alias(a, b) +#include diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.S deleted file mode 100644 index 8af5244..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.S +++ /dev/null @@ -1,17 +0,0 @@ -#include - -SPARC_ASM_VIS3_IFUNC(llrintf) - -weak_alias (__llrintf, llrintf) - -strong_alias (__llrintf, __lllrintf) -weak_alias (__lllrintf, lllrintf) - -# undef weak_alias -# define weak_alias(a, b) -# undef strong_alias -# define strong_alias(a, b) - -#define __llrintf __llrintf_generic - -#include "../s_llrintf.S" diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.c new file mode 100644 index 0000000..0594a16 --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.c @@ -0,0 +1,29 @@ +/* llrintf 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 + . */ + +#include +#include + +extern __typeof (llrintf) __llrintf_vis3 attribute_hidden; +extern __typeof (llrintf) __llrintf_generic attribute_hidden; + +sparc_libm_ifunc (__llrintf, + hwcap & HWCAP_SPARC_VIS3 + ? __llrintf_vis3 + : __llrintf_generic); +weak_alias (__llrintf, llrintf)