From patchwork Thu Oct 26 19:06:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 117269 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1127186qgn; Thu, 26 Oct 2017 12:10:52 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TgQRa/Erssk5KDKaABKEYH6Z0znds1IDb2evwKdMRBfqE32j9VkzZiBI1KYK6vBPawLCIY X-Received: by 10.98.31.14 with SMTP id f14mr6325661pff.235.1509045052099; Thu, 26 Oct 2017 12:10:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509045052; cv=none; d=google.com; s=arc-20160816; b=Focyt0PpHViGjcA9G/rVysnBclQAOsK5uSa40L89tGbtx1yB16YhKeE/9gpczY5QJS KlL2oPeC79sOmzw3hQSIqPc31zGhZtR8EJ1gGrZ47RugoUqkXH59p/qyWgOX1WbR1lf4 koh1Y96Yd4gLRSCCbAisXE4dQVeOYvCn+oq45PQr+7tCupw93Q1ce8cF+m9ZbEwFVqQq BaXYdhZCSPDFLtw76e9xdjLjY+kmodu77aPpbp2tx3N0cDLXN9/dRFq+5e5IzYFUARwi 1osgVNHsn/t34wYmHedpuz6rlxVfJJZbegK9Tw6Q8YV7tbX3vvUg9m2yuohD6Nkt+wIf vdQQ== 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=nM8T03wb05Mmaz4OxcI7boIrCnIVOajS6CJjWvFiFms=; b=prkspoxduaaa0WARTChPDKvA64mJwhqWuvFPUM2Pe4PmcFYgYTszTIK6z1UuwLuvcC ctbtV5WY9cqU6X77rVTfzNSmSyKeEn/woyyQVEM+rnkHyVbi+ZLByvCCNVH1vdH/OnPs fY8dIH3Nifx3AvHVFGP7EaER7MOLfvfcDBV4L4vVm3ecVp1yi+ScxPBnZmmcz6xz0Gwe GIbFjFV8xRshIfS9bY4sOrmDJ1tgQRvHrrwT8oItsL5yBStd+cCYnRFF2fVkr3aRLuP8 uHK+MqXVIBy91OO1/24MUl6DL8QZeYLcNTYPmJGT7jVGd6UrgjkRDsmOiswntjG89cGK TYhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=vhwS3jgH; spf=pass (google.com: domain of libc-alpha-return-86419-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-86419-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 c67si3304542pfl.172.2017.10.26.12.10.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Oct 2017 12:10:52 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-86419-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=vhwS3jgH; spf=pass (google.com: domain of libc-alpha-return-86419-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-86419-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=JGmMU5tN5gHHngDqOlUbE9+f78lo8va ivtK4x7iOoAmUrg1KQo6/emKLhWPfE5bea90+rVyG1Byz6WS8YYTYbJbgiLncd/G xm2VMEwW3t+sZJhvm6pGEJb7oQCJdhmN4l5w/Yqtm/JzWMZHw3oYMdSC/AQ3g2/V uLGgLiT9tIbY= 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=Wo6svQjU2dUF8kl3JhjgwOr6sPI=; b=vhwS3 jgHvkpAUyT7lQ4tlxCi5WAvbJjbG3EMipEoWoAmRaYtfUk+6a/An+D3pLcnEeZQO NsngW7b1fVz6Su61h0qNl8eqSvEZn/GZ88Dr72NUvscZQC8F0y+FyuBdOhoM0Yog c2L+N/DJVpkVcA/agcHP3/o6+61dGYcHPnf0LA= Received: (qmail 99812 invoked by alias); 26 Oct 2017 19:07: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 99598 invoked by uid 89); 26 Oct 2017 19:07:28 -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-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=nM8T03wb05Mmaz4OxcI7boIrCnIVOajS6CJjWvFiFms=; b=aNeyym70DxM6r/F2z/ysJX5A4RqSlTKJ80VSzYi0PIg4gAYijwOXgSpZWuL9oKBSnq 8obsGcQEP6/USQYR1kTLlyVBtW1o87GJu00HLs1XTXgd8rCl2Lu1Qq0UY2uFhH+/Fsld R3hcOs6PWdlXo853LklJi4Ia0CGJ7KTF1xZnQ18CyrLKxkqcEt+FPxWCfvHe/q8W1/he 05hU+hN66vwyLAkCN3PhdkLMI5AVqZt4r0w7ERFIXx4uU0mbDDpao+5MdxDTIWtb+Qe9 DU0wLHb+sHmlaLq+4lzj3sr4NwvOU5iTAnLtm3sbHfi2Y//8iTxfQHOy9YqZI/ALduqy a01Q== X-Gm-Message-State: AMCzsaVlift83sPnyXdVORXSYmjl5F/ke/rsuqKKQ/OjZj6zAshjf3Uf xnXVyTSu3UaZcR9eTuZEeGvRx6uFh/4= X-Received: by 10.237.60.249 with SMTP id e54mr37339415qtf.23.1509044844661; Thu, 26 Oct 2017 12:07:24 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 17/25] sparc: refactor sparc64 __mpn_add_n selector to C Date: Thu, 26 Oct 2017 17:06:45 -0200 Message-Id: <1509044813-9951-18-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 add_n-generic.S). Checked on sparc64-linux-gnu and sparcv9-linux-gnu. * sysdeps/sparc/sparc64/multiarch/Makefile (sysdep_routines): Add add_n-generic. * sysdeps/sparc/sparc64/multiarch/add_n-generic.S: New file. * sysdeps/sparc/sparc64/multiarch/add_n.c: Likewise. * sysdeps/sparc/sparc64/multiarch/add_n.S: Remove file. Signed-off-by: Adhemerval Zanella --- ChangeLog | 6 +++ sysdeps/sparc/sparc64/multiarch/Makefile | 4 +- sysdeps/sparc/sparc64/multiarch/add_n-generic.S | 2 + sysdeps/sparc/sparc64/multiarch/add_n.S | 56 ------------------------- sysdeps/sparc/sparc64/multiarch/add_n.c | 28 +++++++++++++ 5 files changed, 38 insertions(+), 58 deletions(-) create mode 100644 sysdeps/sparc/sparc64/multiarch/add_n-generic.S delete mode 100644 sysdeps/sparc/sparc64/multiarch/add_n.S create mode 100644 sysdeps/sparc/sparc64/multiarch/add_n.c -- 2.7.4 diff --git a/sysdeps/sparc/sparc64/multiarch/Makefile b/sysdeps/sparc/sparc64/multiarch/Makefile index d62a509..ba8ede1 100644 --- a/sysdeps/sparc/sparc64/multiarch/Makefile +++ b/sysdeps/sparc/sparc64/multiarch/Makefile @@ -14,8 +14,8 @@ endif ifeq ($(subdir),stdlib) sysdep_routines += mul_1-vis3 mul_1-generic addmul_1-vis3 addmul_1-generic \ - submul_1-vis3 submul_1-generic add_n-vis3 sub_n-vis3 \ - sub_n-generic + submul_1-vis3 submul_1-generic add_n-vis3 add_n-generic \ + sub_n-vis3 sub_n-generic endif ifeq ($(subdir),math) diff --git a/sysdeps/sparc/sparc64/multiarch/add_n-generic.S b/sysdeps/sparc/sparc64/multiarch/add_n-generic.S new file mode 100644 index 0000000..a16e709 --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/add_n-generic.S @@ -0,0 +1,2 @@ +#define __mpn_add_n __mpn_add_n_generic +#include diff --git a/sysdeps/sparc/sparc64/multiarch/add_n.S b/sysdeps/sparc/sparc64/multiarch/add_n.S deleted file mode 100644 index 9ffaf78..0000000 --- a/sysdeps/sparc/sparc64/multiarch/add_n.S +++ /dev/null @@ -1,56 +0,0 @@ -/* Multiple versions of add_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_add_n) - .type __mpn_add_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_add_n_vis3), %o1 - xor %o1, %gdop_lox10(__mpn_add_n_vis3), %o1 -# else - set __mpn_add_n_vis3, %o1 -# endif - ba 10f - nop -1: -# ifdef SHARED - sethi %gdop_hix22(__mpn_add_n_generic), %o1 - xor %o1, %gdop_lox10(__mpn_add_n_generic), %o1 -# else - set __mpn_add_n_generic, %o1 -# endif -10: -# ifdef SHARED - add %o3, %o1, %o1 -# endif - retl - mov %o1, %o0 -END(__mpn_add_n) - -#define __mpn_add_n __mpn_add_n_generic -#include "../add_n.S" diff --git a/sysdeps/sparc/sparc64/multiarch/add_n.c b/sysdeps/sparc/sparc64/multiarch/add_n.c new file mode 100644 index 0000000..6b509d1 --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/add_n.c @@ -0,0 +1,28 @@ +/* __mpn_add_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_add_n) __mpn_add_n_vis3 attribute_hidden; +extern __typeof (mpn_add_n) __mpn_add_n_generic attribute_hidden; + +sparc_libm_ifunc (__mpn_add_n, + hwcap & HWCAP_SPARC_VIS3 + ? __mpn_add_n_vis3 + : __mpn_add_n_generic)