From patchwork Thu Oct 26 19:06:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 117266 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1126677qgn; Thu, 26 Oct 2017 12:10:20 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SHIcLF5CJLWEP8emkW45tryRnC2YhPdfssLRn6gwGcNs5Emgdhb4PFp5ARaJOoViG4+Zcb X-Received: by 10.99.96.15 with SMTP id u15mr5961234pgb.424.1509045020467; Thu, 26 Oct 2017 12:10:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509045020; cv=none; d=google.com; s=arc-20160816; b=f8w9QCjAsLmI2etbb91AItnMWKHYhK/tG6BwhRh+WyvDPiaoupeAY5IPpwnNMO8rJe ACX0PRwzDKBB+74HqzBDekkLLGUKSijvqmpcVYVVG0hxri3dc9SXzy2MTds0RSf39bzK /b4ppTI0itWVbDKMpti2ykJqyx9AQ7f0XTsFdXQrqA1yMw6/q3JzkeDbO63v8hkbKW7s L8bGYv3x2cb3llirNMJYcfPXdwfzufLaDge6rDYgpkeKFEV5EWiyy7sfJoKRAwPbm38Y cNzdUtVH0PVxWJT82K9FFuQXGKvR+PRrdkKtrqe0BVzkRs3FAjIiK47A3jhnFYLM7tJO tnVQ== 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=WdStCT72VSRqRueTjZUYSZNtE4gOWOdPhZJpMSiq050=; b=gTVhyq5+X40XbzZbS2EJs3iaab8rUwrHUX/IT9+tOszAtoViqxse7ZE17ZBKsrDt1G 0myKyjky17ORyfTiFLdQLoR9142Ekv5qt1SU0MogTaPj5htfN1AsI8j2dhRt3sTBnlpg sHE27VIatrXj2WZPnrC7DEasNhS45PRIERQiCfqb40lETMadINhR8Ha5yfz36pnquZNK x7fBzqKuBa2wOTICy4bBhPzfgeBDc1LA2+jAynKv4ahWj/zzQ4LA6DX5R6sMGQ1k+X8F OGdQTaEEYgIVPpDI2GW9I2IY9R36/nX2/rl3lRZK8gGV6jVK23z2ILJXyJf8we4kSOi2 NtNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=sdisCh7u; spf=pass (google.com: domain of libc-alpha-return-86416-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-86416-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 g12si3341469pla.762.2017.10.26.12.10.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Oct 2017 12:10:20 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-86416-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=sdisCh7u; spf=pass (google.com: domain of libc-alpha-return-86416-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-86416-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=nfJVUr0LrtopKt8S9zEDWDguoxBDH2d cux9UFN3y+Ui/voBt72b02uv+BoZ17tISwalG6/IBvsmHN7qPe+5BsA/FNbSkG9f 8f2aL/BYEhuP5b+vTDQKP7sE7/m/mCIeQwKVPxXOepI+VSpAqaWVHWBjVfYNAB0X qeuUGs5msyg4= 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=BVSQ8NZmjcBXDmUvCENAQ0BY1c4=; b=sdisC h7uF8/ylJCiCtTWrruC9JR+0vPDO2VRmzYQ/Wn5A2mNhHWMpHj+ONme9baLYATIK 7AHT/LQLVJBsi2tfUIzzehVFLDGGW/k+aofQWU9CBbBrPc+VeM63CeUjHn+ExoJh UgLTrcFsj0fgV7cYxoxNTR454K0fHDjgfmjUhI= Received: (qmail 99197 invoked by alias); 26 Oct 2017 19:07:25 -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 99058 invoked by uid 89); 26 Oct 2017 19:07:24 -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-f195.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=WdStCT72VSRqRueTjZUYSZNtE4gOWOdPhZJpMSiq050=; b=kjAbNBoOxy1NVI7zwBJ6QnlayHCwA+E8A9mDVhQ72f8aNy7EmjwqSCWb5eM8stry8L qLBBKkcowRIz85OeJdKnJGxUqhK0HoE+XnSljb1l2YS1JJcYGxhs7sTX9c886Xk4MqJf edXNr6vq1psI4vewpE5vJAzg41IMltSg9+6usGcSA0EoCFygmT1ZupMearl6QscwQi1m ldvBzOqQAZHnNoUFRpGGoOQSeKKqMGSUiB1WnH9hCUuyxgrLd66kCuyrqai2CUnuVJq/ VurfWVrMhCyCD+93ypSs+A1HTSCqy7pnO6pUP/yakvk5Q7VJvO28lAhDpX1uFE04omb0 9XAQ== X-Gm-Message-State: AMCzsaWaAnyVZSaXmeYsKwAQ4J+5D7whiRz/eH9hcR5ICDNJjf21W2RI iCsUtn1xhFQzwyKk30nG5nNJhGkqck0= X-Received: by 10.55.174.129 with SMTP id x123mr9755718qke.61.1509044840254; Thu, 26 Oct 2017 12:07:20 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 14/25] sparc: refactor sparc64 __mpn_sub_n selector to C Date: Thu, 26 Oct 2017 17:06:42 -0200 Message-Id: <1509044813-9951-15-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 sub_n-generic.S). Checked on sparc64-linux-gnu and sparcv9-linux-gnu. * sysdeps/sparc/sparc64/multiarch/Makefile (sysdep_routines): Add sub_n-generic. * sysdeps/sparc/sparc64/multiarch/sub_n-generic.S: New file. * sysdeps/sparc/sparc64/multiarch/sub_n.c: Likewise. * sysdeps/sparc/sparc64/multiarch/sub_n.S: Remove file. Signed-off-by: Adhemerval Zanella --- ChangeLog | 6 +++ sysdeps/sparc/sparc64/multiarch/Makefile | 2 +- sysdeps/sparc/sparc64/multiarch/sub_n-generic.S | 2 + sysdeps/sparc/sparc64/multiarch/sub_n.S | 56 ------------------------- sysdeps/sparc/sparc64/multiarch/sub_n.c | 28 +++++++++++++ 5 files changed, 37 insertions(+), 57 deletions(-) create mode 100644 sysdeps/sparc/sparc64/multiarch/sub_n-generic.S delete mode 100644 sysdeps/sparc/sparc64/multiarch/sub_n.S create mode 100644 sysdeps/sparc/sparc64/multiarch/sub_n.c -- 2.7.4 diff --git a/sysdeps/sparc/sparc64/multiarch/Makefile b/sysdeps/sparc/sparc64/multiarch/Makefile index 2338213..10fe54f 100644 --- a/sysdeps/sparc/sparc64/multiarch/Makefile +++ b/sysdeps/sparc/sparc64/multiarch/Makefile @@ -14,7 +14,7 @@ endif ifeq ($(subdir),stdlib) sysdep_routines += mul_1-vis3 mul_1-generic addmul_1-vis3 submul_1-vis3 \ - add_n-vis3 sub_n-vis3 + add_n-vis3 sub_n-vis3 sub_n-generic endif ifeq ($(subdir),math) diff --git a/sysdeps/sparc/sparc64/multiarch/sub_n-generic.S b/sysdeps/sparc/sparc64/multiarch/sub_n-generic.S new file mode 100644 index 0000000..7cece93 --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/sub_n-generic.S @@ -0,0 +1,2 @@ +#define __mpn_sub_n __mpn_sub_n_generic +#include diff --git a/sysdeps/sparc/sparc64/multiarch/sub_n.S b/sysdeps/sparc/sparc64/multiarch/sub_n.S deleted file mode 100644 index d20a286..0000000 --- a/sysdeps/sparc/sparc64/multiarch/sub_n.S +++ /dev/null @@ -1,56 +0,0 @@ -/* Multiple versions of sub_n - - Copyright (C) 2013-2017 Free Software Foundation, Inc. - Contributed by David S. Miller (davem@davemloft.net) - 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 - -ENTRY(__mpn_sub_n) - .type __mpn_sub_n, @gnu_indirect_function -# ifdef SHARED - SETUP_PIC_REG_LEAF(o3, o5) -# endif - set HWCAP_SPARC_VIS3, %o1 - andcc %o0, %o1, %g0 - be 1f - nop -# ifdef SHARED - sethi %gdop_hix22(__mpn_sub_n_vis3), %o1 - xor %o1, %gdop_lox10(__mpn_sub_n_vis3), %o1 -# else - set __mpn_sub_n_vis3, %o1 -# endif - ba 10f - nop -1: -# ifdef SHARED - sethi %gdop_hix22(__mpn_sub_n_generic), %o1 - xor %o1, %gdop_lox10(__mpn_sub_n_generic), %o1 -# else - set __mpn_sub_n_generic, %o1 -# endif -10: -# ifdef SHARED - add %o3, %o1, %o1 -# endif - retl - mov %o1, %o0 -END(__mpn_sub_n) - -#define __mpn_sub_n __mpn_sub_n_generic -#include "../sub_n.S" diff --git a/sysdeps/sparc/sparc64/multiarch/sub_n.c b/sysdeps/sparc/sparc64/multiarch/sub_n.c new file mode 100644 index 0000000..838d901 --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/sub_n.c @@ -0,0 +1,28 @@ +/* __mpn_sub_n 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 + . */ + +#include +#include + +extern __typeof (mpn_sub_n) __mpn_sub_n_vis3 attribute_hidden; +extern __typeof (mpn_sub_n) __mpn_sub_n_generic attribute_hidden; + +sparc_libm_ifunc (__mpn_sub_n, + hwcap & HWCAP_SPARC_VIS3 + ? __mpn_sub_n_vis3 + : __mpn_sub_n_generic)