From patchwork Wed Mar 13 14:03:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 160226 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp14356546jad; Wed, 13 Mar 2019 07:03:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqysTBRfHMWmkCPb4nSyTkvJIrhaNqy8CN1axBCwJh6yp9BN1CjT5yeFPSGRguwBP0MINXHi X-Received: by 2002:a17:902:8a8b:: with SMTP id p11mr9764345plo.162.1552485827242; Wed, 13 Mar 2019 07:03:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552485827; cv=none; d=google.com; s=arc-20160816; b=aLIfTmRMIL1Cozwz8IqUnVU4p/Z2yh/VeO2IYdgPB6c2sEp2pJsm96Xvez8+6HZFnz rRIkZ2Dk8w+dj4qayfiU+8LNsoMp5xfqPT+ibrBaEyoT94oW6ez01aRfSb2LADjmSzUs P8cuhidD4TIRb2jyPIRqp7W04gisZBUlTpRzlEF3zEw3HT32bDzOnWlwe90WfNhqyPjg zmHDr60fx9JmbJGijXMk2YSLtZVvo43OSNiLJUjW6FA/5Qj0tmgFqgh7CgagGvDyFQTO ezt9YSCoBAzZExJcwrC7WyPO+v99qJCp5MRg4AUXRxZg2LOqB+d27yMRe6evhUq7QPYA qvJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature:delivered-to :sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=4HGcriFPU19zsB9uj/BGBhFP6+SX/hPLwXKmIgtVk9M=; b=ITVN8MotFDeXJ6b+CkVo/K1iw3tk734DI5od203eg2HGufqsePtChXWGkxfbY8OuWf iKy/mIY+i9Jg8E3x4RJiCaw1ezMJUmi+rfFFotQZK9Ftp3VkKyj7CFXEpvb5HlB3zTIu FZ0bcoqPBB6Wv9jsNvjwmUzKddG+sgkDFA8X4IpBod5xF2daZuthMRa025qNYBbykM1/ lWJklVxEQNAP7ISbV6q14Emt/qqg13ULwYowSEkQXYXCNStaB88KdXjhdx0PwpE2drL/ O6lXME6XXBFb44Q7o9PNJX4Nt1/qSvREh3+DfvPjAi4j0eP+H0rXmOCFfdfTDXueYAx0 +RZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=r9P9MmSP; dkim=pass header.i=@linaro.org header.s=google header.b=WKh0mVqj; spf=pass (google.com: domain of libc-alpha-return-100599-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-100599-patch=linaro.org@sourceware.org"; dmarc=pass (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 186si11029800pfe.262.2019.03.13.07.03.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Mar 2019 07:03:47 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-100599-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=r9P9MmSP; dkim=pass header.i=@linaro.org header.s=google header.b=WKh0mVqj; spf=pass (google.com: domain of libc-alpha-return-100599-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-100599-patch=linaro.org@sourceware.org"; dmarc=pass (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:cc:subject:date:message-id; q=dns; s= default; b=WNjmBa7tHJEpS0Pwct/k7RtXTHdtIWJSXKygZNc7N3Oa4e5Q9wkkK xA2V76Op4TMQvZDMX0VZY2NbDsJgH8m+Xl7Zx91jw596PCj26AYMTSslChq4Sq3Q IHy0dnv2zdnfS39gKCZ7mYWKC31su4gZgPol8YrIWj1V1kD2pt20wg= 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:cc:subject:date:message-id; s=default; bh=KyMmJZysZUSi+34sVLTUmJh5Lns=; b=r9P9MmSPx9697Nv0aaIFmUSMvmfV 7DLP8XjP6s23uiAJJpX/yh0KOmI7YVqhmBwALjB0BEmJ6oo46BBg2rBQRhv+WuNC NZicMwBy832kYSyfGxOVO8QSsIO9Xxu7HyjqMR4DJNr55j3Zxsoni5a+Tv/M2i+z AkPAR3DJ+pDqm18= Received: (qmail 51441 invoked by alias); 13 Mar 2019 14:03:32 -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 51298 invoked by uid 89); 13 Mar 2019 14:03:31 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=sk:unroll_, unrolled, distributed X-HELO: mail-vs1-f65.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=4HGcriFPU19zsB9uj/BGBhFP6+SX/hPLwXKmIgtVk9M=; b=WKh0mVqjY4hMID8vPXuiwa1OMVtwHiilAImcl+yVGHQb/5lshsqR0Sl9JcB8fGYlWz /G6irZSREplND7vuM+RVgjrDC7x0n02Ut6K4X1TZk+4BV3ZXhYpCsdxwhUoecuuKCvFa 9TRbxKwPtuwjFbCABtITBeE8Gp9njl51k2JooHrJwCD7XQ15BXG6zD8r7QSrdf/pU1jj 6lOivxBWcY/H6H0kjgZCN6Yg8DjkWI/f9C99FwwW//wBRF902H4JGBzzN1viFLe3IhkT MalqtPdf/wZ+Nbkbho7hIIK7gaSx4xWjS7iQEQcahPSSlxyjYkfDSfjP1bzdIUmRE+n5 8kJQ== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: "Gabriel F . T . Gomes" Subject: [PATCH v2 1/6] wcsmbs: Add wcscpy loop unroll option Date: Wed, 13 Mar 2019 11:03:12 -0300 Message-Id: <20190313140317.8894-1-adhemerval.zanella@linaro.org> This allows an architecture the use the old generic implementation and also set explicit loop unrolling. Checked on aarch64-linux-gnu. * include/loop_unroll.h: New file. * wcsmbs/wcscpy (__wcscpy): Add option to use loop unrolling besides generic implementation. --- include/loop_unroll.h | 78 +++++++++++++++++++++++++++++++++++++++++++ wcsmbs/wcscpy.c | 19 +++++++++++ 2 files changed, 97 insertions(+) create mode 100644 include/loop_unroll.h -- 2.17.1 Reviewed-by: Gabriel F. T. Gomes diff --git a/include/loop_unroll.h b/include/loop_unroll.h new file mode 100644 index 0000000000..f40d375257 --- /dev/null +++ b/include/loop_unroll.h @@ -0,0 +1,78 @@ +/* Macro for explicit loop unrolling. + Copyright (C) 2019 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 + . */ + +#ifndef _LOOP_UNROLL_H +#define _LOOP_UNROLL_H + +/* Loop unroll macro to be used for explicity force loop unrolling with a + configurable number or iterations. The idea is to make the loop unrolling + independent of whether compiler is able to unrolling through specific + optimizations options (-funroll-loops or -funroll-all-loops). + + For instance, to implement strcpy with SRC being the source input and + DEST the destination buffer, it is expected the macro to be used in this + way: + + #define ITERATION(index) \ + ({ char c = *str++; *dest++ = c; c != '\0' }) + + while (1) + UNROLL_REPEAT (4, ITERATION) + + The loop will be manually unrolled 4 times. Another option is to do + the index update after the tests: + + #define ITERATION(index) \ + ({ char c = *(str + index); *(dest + index) = c; c != '\0' }) + #define UPDATE(n) \ + str += n; dst += n + + while (1) + UNROLL_REPEAT_UPDATE (4, ITERATION, UPDATE) + + The loop will be manually unrolled 4 times and the SRC and DEST pointers + will be update only after last iteration. + + Currently both macros unrolls the loop 8 times at maximum. */ + +#define UNROLL_REPEAT_1(X) if (!X(0)) break; +#define UNROLL_REPEAT_2(X) UNROLL_REPEAT_1(X) if (!X(1)) break; +#define UNROLL_REPEAT_3(X) UNROLL_REPEAT_2(X) if (!X(2)) break; +#define UNROLL_REPEAT_4(X) UNROLL_REPEAT_3(X) if (!X(3)) break; +#define UNROLL_REPEAT_5(X) UNROLL_REPEAT_4(X) if (!X(4)) break; +#define UNROLL_REPEAT_6(X) UNROLL_REPEAT_5(X) if (!X(5)) break; +#define UNROLL_REPEAT_7(X) UNROLL_REPEAT_6(X) if (!X(6)) break; +#define UNROLL_REPEAT_8(X) UNROLL_REPEAT_7(X) if (!X(7)) break; + +#define UNROLL_EXPAND(...) __VA_ARGS__ + +#define UNROLL_REPEAT__(N, X) UNROLL_EXPAND(UNROLL_REPEAT_ ## N) (X) +#define UNROLL_REPEAT_(N, X) UNROLL_REPEAT__ (N, X) + +#define UNROLL_REPEAT(N, X) \ + (void) ({ \ + UNROLL_REPEAT_(UNROLL_EXPAND(N), X); \ + }) + +#define UNROLL_REPEAT_UPDATE(N, X, U) \ + (void) ({ \ + UNROLL_REPEAT_ (UNROLL_EXPAND(N), X); \ + UPDATE (N); \ + }) + +#endif diff --git a/wcsmbs/wcscpy.c b/wcsmbs/wcscpy.c index 6fb2969513..8e8719744e 100644 --- a/wcsmbs/wcscpy.c +++ b/wcsmbs/wcscpy.c @@ -17,6 +17,7 @@ . */ #include +#include #ifdef WCSCPY @@ -27,7 +28,25 @@ wchar_t * __wcscpy (wchar_t *dest, const wchar_t *src) { +#ifndef UNROLL_NTIMES return __wmemcpy (dest, src, __wcslen (src) + 1); +#else + /* Some architectures might have costly tail function call (powerpc + for instance) where wmemcpy call overhead for smalls sizes might + be costly than just unroll the main loop. */ + wchar_t *wcp = dest; + +#define ITERATION(index) \ + ({ \ + wchar_t c = *src++; \ + *wcp++ = c; \ + c != L'\0'; \ + }) + + while (1) + UNROLL_REPEAT(UNROLL_NTIMES, ITERATION); + return dest; +#endif } #ifndef WCSCPY weak_alias (__wcscpy, wcscpy) From patchwork Wed Mar 13 14:03:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 160228 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp14356919jad; Wed, 13 Mar 2019 07:04:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqz7U8Xvjz37QHSXQCRFmZveuNrgVK1cYfmAUdjMVPfjqNwXKogLmap2hC+JEQgw/NaneSW3 X-Received: by 2002:a62:b248:: with SMTP id x69mr43931466pfe.256.1552485845153; Wed, 13 Mar 2019 07:04:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552485845; cv=none; d=google.com; s=arc-20160816; b=bYLD+xi+KIqoM3uLlL9kkvgK5+3RHvG4SDGEZl3mmW8PpBYxfkW2vAbIdz4Wdh/b5c KrzJtY4gapLeRyKlyN8KAqfwU9dZtqa/UU9IszCjUDsfxC/Prr+dSQJuSseazs8emmOd QB9QlIuR9qfFreh1j/XhsaxNpk6y88M8kEv3G3+XamCIhPYtGTL7DZE7CbyI3H4q9MEx 36KFr2IQEYRA6GqsgdpsF46nOZsAcm0mL6yvHkIK/3c9RGm1AXGqnZqa47Ozx/pztTSG v1dwrRccLxG69PWWWalXOAVp/GLmJ2+CpC3UnuN7T2G6uHo672tVzo4lyPjcRJtgki8e q0PA== 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:cc:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=F6h/E2Y4wI/ZaYEaTDqC3GDOTeHetwcZlkXGu16fb2k=; b=afWH6axLaF9VVlUoDrrPphjB8tnLxWbqoQw3ANzj/85lWl6ZgALOsb55veVFJnXWOn P0gS400lx1Hh5kAtObYmQbvztiOJGiegDInvtRpzgaENSUJzuDJT3eTkdiGiH6L0Ylcu BeM/18xG70f6VkQFS20lK3uPY0f9dkzqLUKke0CMbo6lLEOH5hRPZg0QimnZ9+WAdvUa X7q2vYx4FPrdkdiibYAz5CQKuRZw9IenL6SAYqOmrlzDE/9fLJnAh+F8bJzi94Ep8aM/ DdfiBziF3CZZkMkEj+dXJrsCBcO2ZYdwq99INTNfDAMdIqPqYEpZzppOBQqxVtYzwRDk c74Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=AkxVUjs+; dkim=pass header.i=@linaro.org header.s=google header.b=J2+o1JbX; spf=pass (google.com: domain of libc-alpha-return-100601-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-100601-patch=linaro.org@sourceware.org"; dmarc=pass (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 p19si10938046plq.29.2019.03.13.07.04.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Mar 2019 07:04:05 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-100601-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=AkxVUjs+; dkim=pass header.i=@linaro.org header.s=google header.b=J2+o1JbX; spf=pass (google.com: domain of libc-alpha-return-100601-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-100601-patch=linaro.org@sourceware.org"; dmarc=pass (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:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=ILU0FxZlUeZBAn8UE8KO/EGKaWViaAQ sqA9oE9DfDKjdAf2UctvwIJq8AwjOeXLJBqi/hvI0So7KfXYx7ykB4Pjx/3W6rEn FR/eup8jkqLHDgdDxAoSlAKO7r7ikA062TLJ3IQmmCJOUX3Fz67wQokCdVC+g1yX Ehn+4tKtM7jY= 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:cc:subject:date:message-id:in-reply-to :references; s=default; bh=rhlvYnps79lBndFuJEBEVWJ0tDc=; b=AkxVU js+4gWhp4qZrSkHOYwvdbziHdkFG2L0AgTn+72l04m9XlgJiOcn+lwPr/W5DGfsu nTce70XT72GXK2gIa1qJrcY8hFb/GV7fWzQIZskdxkVZAYtdrGQXO7aV4sB5f6kg WFJhjQ75IeGORvMLaUThxNOnMBN8Rxr9jEDAnk= Received: (qmail 51832 invoked by alias); 13 Mar 2019 14:03: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 51751 invoked by uid 89); 13 Mar 2019 14:03:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-vs1-f68.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=F6h/E2Y4wI/ZaYEaTDqC3GDOTeHetwcZlkXGu16fb2k=; b=J2+o1JbXtwB98eL8IeTWKvAydSrFNnTfdTp2b+42Ymu9csILqrW5ZXC6DacCevZAiA 2ml4cV0emcMzHXO0HGmkpb4yMMdi+vbp0OQhW89U6yQsxi1HIrFAYh00jZqADri2V9I3 ztU2kyJMvCG5Si2+gNHxlb6dpihjkXUNOmo1ZkeSBX7UlVOYxjz8I3h8x9PICFtstpHM 9pLrJNCcLi5s37KaLCkbsdb8ptV725LydlsxKWhUE8WUH5ag8SLkW0AWxK7Fq3MCkbeY DK5Ns2KSdi3UBdqT5+i64JO7hGxnKBmxym8rQy1dKFdnb46OHoK0jL0bxgeI5sbHMG44 KeSQ== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: "Gabriel F . T . Gomes" Subject: [PATCH v2 2/6] powerpc: Use generic wcscpy optimization Date: Wed, 13 Mar 2019 11:03:13 -0300 Message-Id: <20190313140317.8894-2-adhemerval.zanella@linaro.org> In-Reply-To: <20190313140317.8894-1-adhemerval.zanella@linaro.org> References: <20190313140317.8894-1-adhemerval.zanella@linaro.org> This patch removes the power6 wcscpy optimization and use generic implementation instead. Currently both power6 and power7 ifunc variant resulting binary are essentially the same and the generic implementation with unrolling loop set to 8 also results in similar performance. Checked on powerpc64-linux-gnu. * sysdeps/powerpc/Makefile [$(subdir) == wcsmbs] (CFLAGS-wcscpy.c): New rule. * sysdeps/powerpc/power6/wcscpy.c: Remove file. * sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-power6.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-power7.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-ppc32.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wcscpy-power6.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wcscpy-power7.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wcscpy-ppc64.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wcscpy.c: Likewise. * sysdeps/powerpc/powerpc64/power6/wcscpy.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/Makefile [$(subdir) == wcsmbs] (sysdeps_routines): Remove wcscpy-power6 and wcscpy-power7. (CFLAGS-wcscpy-power7.c, CFLAGS-wcscpy-power6.c): Remove rule. * sysdeps/powerpc/powerpc64/multiarch/Makefile: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c: Remove wcscpy optimizations. --- sysdeps/powerpc/Makefile | 4 + sysdeps/powerpc/power6/wcscpy.c | 105 ------------------ .../powerpc32/power4/multiarch/Makefile | 5 +- .../power4/multiarch/ifunc-impl-list.c | 11 -- .../power4/multiarch/wcscpy-power6.c | 22 ---- .../power4/multiarch/wcscpy-power7.c | 22 ---- .../powerpc32/power4/multiarch/wcscpy-ppc32.c | 27 ----- .../powerpc32/power4/multiarch/wcscpy.c | 36 ------ sysdeps/powerpc/powerpc64/multiarch/Makefile | 5 +- .../powerpc64/multiarch/ifunc-impl-list.c | 11 -- .../powerpc64/multiarch/wcscpy-power6.c | 19 ---- .../powerpc64/multiarch/wcscpy-power7.c | 19 ---- .../powerpc64/multiarch/wcscpy-ppc64.c | 18 --- sysdeps/powerpc/powerpc64/multiarch/wcscpy.c | 35 ------ sysdeps/powerpc/powerpc64/power6/wcscpy.c | 4 - 15 files changed, 6 insertions(+), 337 deletions(-) delete mode 100644 sysdeps/powerpc/power6/wcscpy.c delete mode 100644 sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-power6.c delete mode 100644 sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-power7.c delete mode 100644 sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-ppc32.c delete mode 100644 sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c delete mode 100644 sysdeps/powerpc/powerpc64/multiarch/wcscpy-power6.c delete mode 100644 sysdeps/powerpc/powerpc64/multiarch/wcscpy-power7.c delete mode 100644 sysdeps/powerpc/powerpc64/multiarch/wcscpy-ppc64.c delete mode 100644 sysdeps/powerpc/powerpc64/multiarch/wcscpy.c delete mode 100644 sysdeps/powerpc/powerpc64/power6/wcscpy.c -- 2.17.1 Reviewed-by: Gabriel F. T. Gomes diff --git a/sysdeps/powerpc/Makefile b/sysdeps/powerpc/Makefile index bac5a3a73c..ba137e4cad 100644 --- a/sysdeps/powerpc/Makefile +++ b/sysdeps/powerpc/Makefile @@ -46,3 +46,7 @@ sysdep_headers += sys/platform/ppc.h tests += test-gettimebase tests += tst-set_ppr endif + +ifeq ($(subdir),wcsmbs) +CFLAGS-wcscpy.c += -DUNROLL_NTIMES=8 +endif diff --git a/sysdeps/powerpc/power6/wcscpy.c b/sysdeps/powerpc/power6/wcscpy.c deleted file mode 100644 index 11c04b081a..0000000000 --- a/sysdeps/powerpc/power6/wcscpy.c +++ /dev/null @@ -1,105 +0,0 @@ -/* wcscpy.c - Wide Character Copy for POWER6+. - Copyright (C) 2012-2019 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; see the file COPYING.LIB. If - not, see . */ - -#include -#include - -#ifndef WCSCPY -# define WCSCPY wcscpy -#endif - -/* Copy SRC to DEST. */ -wchar_t * -WCSCPY (wchar_t *dest, const wchar_t *src) -{ - wint_t c,d; - wchar_t *wcp, *wcp2; - - if (__alignof__ (wchar_t) >= sizeof (wchar_t)) - { - const ptrdiff_t off = dest - src; - - wcp = (wchar_t *) src; - wcp2 = wcp + 1 ; - - do - { - d = *wcp; - wcp[off] = d; - if (d == L'\0') - return dest; - wcp += 2; - - c = *wcp2; - wcp2[off] = c; - if (c == L'\0') - return dest; - wcp2 += 2; - - d = *wcp; - wcp[off] = d; - if (d == L'\0') - return dest; - wcp += 2; - - c = *wcp2; - wcp2[off] = c; - if (c == L'\0') - return dest; - wcp2 += 2; - - d = *wcp; - wcp[off] = d; - if (d == L'\0') - return dest; - wcp += 2; - - c = *wcp2; - wcp2[off] = c; - if (c == L'\0') - return dest; - wcp2 += 2; - - d = *wcp; - wcp[off] = d; - if (d == L'\0') - return dest; - wcp += 2; - - c = *wcp2; - wcp2[off] = c; - if (c == L'\0') - return dest; - wcp2 += 2; - } - while (c != L'\0'); - - } - else - { - wcp = dest; - - do - { - c = *src++; - *wcp++ = c; - } - while (c != L'\0'); - } - return dest; -} diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/Makefile b/sysdeps/powerpc/powerpc32/power4/multiarch/Makefile index bd9d360efa..f5141bc5b5 100644 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/Makefile +++ b/sysdeps/powerpc/powerpc32/power4/multiarch/Makefile @@ -18,13 +18,10 @@ endif ifeq ($(subdir),wcsmbs) sysdep_routines += wcschr-power7 wcschr-power6 wcschr-ppc32 \ - wcsrchr-power7 wcsrchr-power6 wcsrchr-ppc32 \ - wcscpy-power7 wcscpy-power6 wcscpy-ppc32 + wcsrchr-power7 wcsrchr-power6 wcsrchr-ppc32 CFLAGS-wcschr-power7.c += -mcpu=power7 CFLAGS-wcschr-power6.c += -mcpu=power6 CFLAGS-wcsrchr-power7.c += -mcpu=power7 CFLAGS-wcsrchr-power6.c += -mcpu=power6 -CFLAGS-wcscpy-power7.c += -mcpu=power7 -CFLAGS-wcscpy-power6.c += -mcpu=power6 endif diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c index bcd38e0f79..ae581d62f8 100644 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c +++ b/sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c @@ -209,16 +209,5 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, wcsrchr, 1, __wcsrchr_ppc)) - /* Support sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c. */ - IFUNC_IMPL (i, name, wcscpy, - IFUNC_IMPL_ADD (array, i, wcscpy, - hwcap & PPC_FEATURE_HAS_VSX, - __wcscpy_power7) - IFUNC_IMPL_ADD (array, i, wcscpy, - hwcap & PPC_FEATURE_ARCH_2_05, - __wcscpy_power6) - IFUNC_IMPL_ADD (array, i, wcscpy, 1, - __wcscpy_ppc)) - return i; } diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-power6.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-power6.c deleted file mode 100644 index 5bb0c82462..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-power6.c +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright (C) 2013-2019 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 - -#define WCSCPY __wcscpy_power6 - -#include diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-power7.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-power7.c deleted file mode 100644 index 5375094b60..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-power7.c +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright (C) 2013-2019 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 - -#define WCSCPY __wcscpy_power7 - -#include diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-ppc32.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-ppc32.c deleted file mode 100644 index 31e0d81ef0..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-ppc32.c +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright (C) 2013-2019 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 - -extern __typeof (wcscpy) __wcscpy_ppc; - -#define WCSCPY __wcscpy_ppc -#include - -#ifdef SHARED -__hidden_ver1 (__wcscpy_ppc, __GI___wcscpy, __wcscpy_ppc); -#endif diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c deleted file mode 100644 index 0daf55cf70..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Multiple versions of wcscpy - Copyright (C) 2013-2019 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 - . */ - -#if IS_IN (libc) -# define __wcscpy __redirect_wcscpy -# include -# undef __wcscpy -# include "init-arch.h" - -extern __typeof (__redirect_wcscpy) __wcscpy_ppc attribute_hidden; -extern __typeof (__redirect_wcscpy) __wcscpy_power6 attribute_hidden; -extern __typeof (__redirect_wcscpy) __wcscpy_power7 attribute_hidden; - -libc_ifunc_redirected (__redirect_wcscpy, __wcscpy, - (hwcap & PPC_FEATURE_HAS_VSX) - ? __wcscpy_power7 : - (hwcap & PPC_FEATURE_ARCH_2_05) - ? __wcscpy_power6 - : __wcscpy_ppc); -weak_alias (__wcscpy, wcscpy) -#endif diff --git a/sysdeps/powerpc/powerpc64/multiarch/Makefile b/sysdeps/powerpc/powerpc64/multiarch/Makefile index 963ea84dbf..3913ef580e 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/Makefile +++ b/sysdeps/powerpc/powerpc64/multiarch/Makefile @@ -40,13 +40,10 @@ endif ifeq ($(subdir),wcsmbs) sysdep_routines += wcschr-power7 wcschr-power6 wcschr-ppc64 \ - wcsrchr-power7 wcsrchr-power6 wcsrchr-ppc64 \ - wcscpy-power7 wcscpy-power6 wcscpy-ppc64 \ + wcsrchr-power7 wcsrchr-power6 wcsrchr-ppc64 CFLAGS-wcschr-power7.c += -mcpu=power7 CFLAGS-wcschr-power6.c += -mcpu=power6 CFLAGS-wcsrchr-power7.c += -mcpu=power7 CFLAGS-wcsrchr-power6.c += -mcpu=power6 -CFLAGS-wcscpy-power7.c += -mcpu=power7 -CFLAGS-wcscpy-power6.c += -mcpu=power6 endif diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c index 8d91d9abb9..06d33d71e0 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c +++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c @@ -282,17 +282,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, wcsrchr, 1, __wcsrchr_ppc)) - /* Support sysdeps/powerpc/powerpc64/multiarch/wcscpy.c. */ - IFUNC_IMPL (i, name, wcscpy, - IFUNC_IMPL_ADD (array, i, wcscpy, - hwcap & PPC_FEATURE_HAS_VSX, - __wcscpy_power7) - IFUNC_IMPL_ADD (array, i, wcscpy, - hwcap & PPC_FEATURE_ARCH_2_05, - __wcscpy_power6) - IFUNC_IMPL_ADD (array, i, wcscpy, 1, - __wcscpy_ppc)) - /* Support sysdeps/powerpc/powerpc64/multiarch/strrchr.c. */ IFUNC_IMPL (i, name, strrchr, IFUNC_IMPL_ADD (array, i, strrchr, diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcscpy-power6.c b/sysdeps/powerpc/powerpc64/multiarch/wcscpy-power6.c deleted file mode 100644 index abe2e0f073..0000000000 --- a/sysdeps/powerpc/powerpc64/multiarch/wcscpy-power6.c +++ /dev/null @@ -1,19 +0,0 @@ -/* wcscpy.c - Wide Character Search for powerpc64/power6. - Copyright (C) 2013-2019 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; see the file COPYING.LIB. If - not, see . */ - -#include diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcscpy-power7.c b/sysdeps/powerpc/powerpc64/multiarch/wcscpy-power7.c deleted file mode 100644 index be95cd9074..0000000000 --- a/sysdeps/powerpc/powerpc64/multiarch/wcscpy-power7.c +++ /dev/null @@ -1,19 +0,0 @@ -/* wcscpy.c - Wide Character Search for powerpc64/power7. - Copyright (C) 2013-2019 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; see the file COPYING.LIB. If - not, see . */ - -#include diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcscpy-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/wcscpy-ppc64.c deleted file mode 100644 index faa3c1614f..0000000000 --- a/sysdeps/powerpc/powerpc64/multiarch/wcscpy-ppc64.c +++ /dev/null @@ -1,18 +0,0 @@ -/* Copyright (C) 2013-2019 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 diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcscpy.c b/sysdeps/powerpc/powerpc64/multiarch/wcscpy.c deleted file mode 100644 index 3f918b27c6..0000000000 --- a/sysdeps/powerpc/powerpc64/multiarch/wcscpy.c +++ /dev/null @@ -1,35 +0,0 @@ -/* Multiple versions of wcscpy. - Copyright (C) 2013-2019 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 __wcscpy __redirect___wcscpy -#include -#undef __wcscpy -#include -#include "init-arch.h" - -extern __typeof (wcscpy) __wcscpy_ppc attribute_hidden; -extern __typeof (wcscpy) __wcscpy_power6 attribute_hidden; -extern __typeof (wcscpy) __wcscpy_power7 attribute_hidden; - -libc_ifunc_redirected (__redirect___wcscpy, __wcscpy, - (hwcap & PPC_FEATURE_HAS_VSX) - ? __wcscpy_power7 : - (hwcap & PPC_FEATURE_ARCH_2_05) - ? __wcscpy_power6 - : __wcscpy_ppc); -weak_alias (__wcscpy, wcscpy) diff --git a/sysdeps/powerpc/powerpc64/power6/wcscpy.c b/sysdeps/powerpc/powerpc64/power6/wcscpy.c deleted file mode 100644 index 59cfb28832..0000000000 --- a/sysdeps/powerpc/powerpc64/power6/wcscpy.c +++ /dev/null @@ -1,4 +0,0 @@ -#define WCSCPY __wcscpy -#include -libc_hidden_def (__wcscpy) -weak_alias (__wcscpy, wcscpy) From patchwork Wed Mar 13 14:03:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 160225 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp14356360jad; Wed, 13 Mar 2019 07:03:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqyEA/NfChOGJbdfgLv/ERty3EUf5Z/9ngEGsyglpeQBWsXTmG3jOsexO14E5ihDL0gWQ5FB X-Received: by 2002:a17:902:bb94:: with SMTP id m20mr28151539pls.255.1552485818786; Wed, 13 Mar 2019 07:03:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552485818; cv=none; d=google.com; s=arc-20160816; b=D+pqnT36SHrz8FWsjqDefQbXOFp9rEneIITEQ6ZFG5LOhNh6LL+VVarFzWfF5SdWU3 YMcx9tNiotLbG94eQhue2kDzFUUa351+iErmQYeuBrfCLLIrJLiR/Rz6IrNDQlh64IT/ R/qfSnPqZMZjj4Xl7Rvq2gU28IBgFDbhi+0dZr0yOcn5iSb0raaWxJmnyJFc5/nHJnG+ h5pfALFqt4n/D1Eo1kL6izLtLoBa52/+smvGPOEj7o3tw+UiBr2YS4LxN9DeBw5iVhXR +dXKu2uGno33Mj8LOiGQJpUdTm6A3iHnHcC+HUISqZgN9OsoVqRdMFu6xvwu99KDyah9 /46A== 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:cc:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=jG1CqdlcTGnjtCkG3W0BkSrbbCiCMm7705l1Lj0MZDo=; b=lwn5eSlJKIPKJJ0EqxZjBTsszSIwsxkJQMyLq9M0BJDJJS1nqXFy794lkHOSpZM6pL YxyaqZEcEi02DCr1VXrjXGC/ba1j2RJBvR9ho5INjz/ylZyZ78CcVUz5Aj/V9UANs+P/ BGXmHJMdb7nWmZS6Ktc1vQGey5NNx10GoSz8aSyLjzMDjjxkuRnDBcQr73IHjCI33XVD S4CRmi4h7ZngkQsGqJT9huRiSJZq2WzSgcZIRUpzamFkQgKL2d2fF0GhZFNGjF6S3n+b +UyQmO4ifi8r2JJfEmEeGnkBuTvUrmHQkyhjsmFTQloo80wuANCrxWK/d977+Fu26O1G letQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=kIpVySMI; dkim=pass header.i=@linaro.org header.s=google header.b=yfrERmFZ; spf=pass (google.com: domain of libc-alpha-return-100598-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-100598-patch=linaro.org@sourceware.org"; dmarc=pass (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 101si6261133pld.334.2019.03.13.07.03.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Mar 2019 07:03:38 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-100598-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=kIpVySMI; dkim=pass header.i=@linaro.org header.s=google header.b=yfrERmFZ; spf=pass (google.com: domain of libc-alpha-return-100598-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-100598-patch=linaro.org@sourceware.org"; dmarc=pass (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:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=cFabiI4qkpoeUbNqf8SGwcde7ncWN09 AAy/TOZCNBSo22P1b5425GfIDXWQkfaWmJW2pMzllFjM4I6KPYfgJdUyv2ctGfAx +gjcFsd2w1vPVItoHv1XxONQBj26/4bbFSqXggGPDy7srOvPlrVzObaMgZyvSUiv aYIWcOSb9dCw= 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:cc:subject:date:message-id:in-reply-to :references; s=default; bh=xCSNuHktyLFwnRx1y4J8h3LC1eY=; b=kIpVy SMIvATc/5ipyOUiIEoZ3tm3yhcgFv51w1Rck+81LnPBo8q+DgUoPYl8hJPGOcKfM abxL363k2zvluf4ntATuq2Sl1D4h8j32J9bR+PiIG0kBTK1qQCpx7ZETrgX5nf7e ppqUOQpv0i59eXSAK3r63znVFptHdWbzj6H57U= Received: (qmail 50985 invoked by alias); 13 Mar 2019 14:03:29 -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 50976 invoked by uid 89); 13 Mar 2019 14:03:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1108, H*MI:sk:2019031 X-HELO: mail-ua1-f67.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=jG1CqdlcTGnjtCkG3W0BkSrbbCiCMm7705l1Lj0MZDo=; b=yfrERmFZxrApiarYCQ/ulr7go1CEVsC2ZMPM+lFVB3ELf4DG9DqmhmTZbWjsPFe/ae ESV5J1U1tsqoEArvVMeMuqZ6oJOa+SehOjKwN4vjqkZHxH74ZFbZ/hjYaO3H0Xd3USSl fmWjHxRT+5er5n0PIDs644K0lpBXotqpwjCCxRZz84udFGpQkvvg6JQLR9RILleb8jUR mzNABKom2gIiVaSFwJ7D5/veWAi/cgjIV+vwEqQ75dMFE1w3wc8Xr248yCDOUVmPdhaF 1OZEv1ZfBDYYNdELqI16tDh2W71Y8cSpQBACW4GnBrG81kzfMF1xOgo1/zWwxh7gMlk3 ONjw== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: "Gabriel F . T . Gomes" Subject: [PATCH v2 3/6] wcsmbs: Use loop_unroll on wcschr Date: Wed, 13 Mar 2019 11:03:14 -0300 Message-Id: <20190313140317.8894-3-adhemerval.zanella@linaro.org> In-Reply-To: <20190313140317.8894-1-adhemerval.zanella@linaro.org> References: <20190313140317.8894-1-adhemerval.zanella@linaro.org> This allows an architecture to set explicit loop unrolling. Checked on aarch64-linux-gnu. * wcsmbs/wcschr.c (WCSCHR): Use loop_unroll.h to parametrize the loop unroll. --- wcsmbs/wcschr.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) -- 2.17.1 Reviewed-by: Gabriel F. T. Gomes diff --git a/wcsmbs/wcschr.c b/wcsmbs/wcschr.c index cd66b2a58c..9de302298d 100644 --- a/wcsmbs/wcschr.c +++ b/wcsmbs/wcschr.c @@ -16,6 +16,7 @@ . */ #include +#include #ifndef WCSCHR # define WCSCHR __wcschr @@ -25,12 +26,23 @@ wchar_t * WCSCHR (const wchar_t *wcs, const wchar_t wc) { - do - if (*wcs == wc) - return (wchar_t *) wcs; - while (*wcs++ != L'\0'); + wchar_t *dest = NULL; - return NULL; +#define ITERATION(index) \ + ({ \ + if (*wcs == wc) \ + dest = (wchar_t*) wcs; \ + dest == NULL && *wcs++ != L'\0'; \ + }) + +#ifndef UNROLL_NTIMES +# define UNROLL_NTIMES 1 +#endif + + while (1) + UNROLL_REPEAT(UNROLL_NTIMES, ITERATION); + + return dest; } libc_hidden_def (__wcschr) weak_alias (__wcschr, wcschr) From patchwork Wed Mar 13 14:03:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 160229 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp14357117jad; Wed, 13 Mar 2019 07:04:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqzf3fAKs9vUNtdqJi+pXe315AjsoRjkkdav2t06wpxx1VdZx25382SIF5aK1o88jSiniTAp X-Received: by 2002:a63:cc01:: with SMTP id x1mr19287347pgf.221.1552485854063; Wed, 13 Mar 2019 07:04:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552485854; cv=none; d=google.com; s=arc-20160816; b=yQMTxc40lenTkzLNHILT2iFwk+ZCyOYI070BFbCJgKWc8JiMSEDbl/iI/kMAWTBaoa Wbu7lliXVNMypLcr9L4N4BTLggALOyYgVyPqfu/r4mSK9Izg9T1LRBfIFj3QJZUCCXcw bX9UvcBxWWCtmrUBoSYc5nWVvfO6OV1wjcMnk49FvY+926Z/L8C+X9HEKwKLmuvCrnit k6zllmfswHo4/jYzdvkSQzowg292jixQ3XSzzZF837Mi7AAFqyh36VzdFfX6dy2bVid+ tx/MYcVmkJKCaoRw6cmUk2lSgk/Q0hyeZsv4Dk0T7DYIAHcQi3m90lHtwbden/AIA/us jlZw== 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:cc:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=TC+39X1loajxgHNRQCooikrKukjw2xX+iNKPxiWhU1Y=; b=zcjvHrT34sVwx1DNwxQp5hbdKIts+5o64nSU5NauI8H+j41+Tl6nsVYlKnGbmFK7Bw +PHKajC8g0wmE4HNe54kUkTEIZzzWNFDjpI9N1Cvat5eV54Pu+MV4Y90S4Tp2yArndqC iT4hhwZJlbPkQ/ICrLTkpSnyHSHC+Uo4WaOIvsGNVvCDg7OKGF/x1+/rsl1asasACisF GO7N5oagWGTMZWcoyCS04wdqLs8t/JQFpkRQNrKfxu+vvNgRjdCs1c//KKdp7TotHxBV OPzmmXF4f84Qng7IlR7fP3OD4n6Njgm1J50zzwYOsyXrfUTEvg2howI4QxEJjjAbyKSN TnHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=vJ0nocL5; dkim=pass header.i=@linaro.org header.s=google header.b=EurqsOXj; spf=pass (google.com: domain of libc-alpha-return-100602-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-100602-patch=linaro.org@sourceware.org"; dmarc=pass (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 n7si10150719pgp.400.2019.03.13.07.04.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Mar 2019 07:04:14 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-100602-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=vJ0nocL5; dkim=pass header.i=@linaro.org header.s=google header.b=EurqsOXj; spf=pass (google.com: domain of libc-alpha-return-100602-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-100602-patch=linaro.org@sourceware.org"; dmarc=pass (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:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=LuclQ+fR6slCFE8RNhdb8DthzkTMwPH TlEReS59hqUrmIqg/MLZITqW1UT3y4YGou1EOG+QGjekyhOu+YbzCQDIOHgB0vFo /m8shdWleBLczzt+TEVkJkS8eP4wv0OXvd9A6g+cxCRz3W5yHJqxluQ4pDdile+k eH0atlJvccIM= 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:cc:subject:date:message-id:in-reply-to :references; s=default; bh=XHeuIDWbloUmvyI4j0PjrRidzbI=; b=vJ0no cL53C5SRJUGaisyRJWDrFT31ntI+T1poNSDVCLPOua+9RmUrMY8xNgYD+FiwOICC i+HqDNBux5CmqZppkAGQoXm3NsyRUMgyC/d5viRQikmAlHk4CKSeDH2iWR8gtlYh i7RXsX1KFWtCpr3CoiJJHxpT2xCqt3bAS4xoxA= Received: (qmail 51917 invoked by alias); 13 Mar 2019 14:03: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 51811 invoked by uid 89); 13 Mar 2019 14:03:35 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-ua1-f65.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TC+39X1loajxgHNRQCooikrKukjw2xX+iNKPxiWhU1Y=; b=EurqsOXjfocBgLbr+mO1g4XaiHrs6dK+IdNhIf9+ss4W33HTbdzmjc9kTHLWpM5Wpy /IILF8AMOY8wnA4XIcTEh9tlbvPp2Qhteo4Vihty0HGLswrXJ9KSvkyYQ5VhvYmr1Ay1 xbR7jbVwRRHlQHnHwNRW1zESd1HBj4F+PZp7zIuGsEAg64+Vbecfe1HHUx0YeCAurUK9 aAurb1+4QJ6FkTmFCm8Sg9Lqt2tdoKBMj5IKvToLV521fzGxidsncZnPbxmZ66lZQuOb 4YxIceV3ws+G9+ViALxY699E9Y/aF/A4gcZOtMIYksA8KOWVrBKRuNo/O6k0yC4tCwIQ hxzg== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: "Gabriel F . T . Gomes" Subject: [PATCH v2 4/6] powerpc: Use generic wcschr optimization Date: Wed, 13 Mar 2019 11:03:15 -0300 Message-Id: <20190313140317.8894-4-adhemerval.zanella@linaro.org> In-Reply-To: <20190313140317.8894-1-adhemerval.zanella@linaro.org> References: <20190313140317.8894-1-adhemerval.zanella@linaro.org> This patch removes the power6 wcschr optimization and use generic implementation instead. Currently both power6 and power7 ifunc variant resulting binary are essentially the same and the generic implementation with unrolling loop set to 8 also results in similar performance. Checked on powerpc64-linux-gnu. * sysdeps/powerpc/Makefile [$(subdir) == wcsmbs] (CFLAGS-wcschr.c): New rule. * sysdeps/powerpc/power6/wcschr.c: Remove file. * sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-power6.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-power7.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc32.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/wcschr.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wcschr-power6.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wcschr-power7.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wcschr-ppc64.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wcschr.c: Likewise. * sysdeps/powerpc/powerpc64/power6/wcschr.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/Makefile [$(subdir) == wcsmbs] (sysdeps_routines): Remove wcschr-power6 and wcschr-power7. (CFLAGS-wcschr-power7.c, CFLAGS-wcschr-power6.c): Remove rule. * sysdeps/powerpc/powerpc64/multiarch/Makefile: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c: Remove wcschr optimizations. --- sysdeps/powerpc/Makefile | 1 + sysdeps/powerpc/power6/wcschr.c | 96 ------------------- .../powerpc32/power4/multiarch/Makefile | 5 +- .../power4/multiarch/ifunc-impl-list.c | 11 --- .../power4/multiarch/wcschr-power6.c | 26 ----- .../power4/multiarch/wcschr-power7.c | 26 ----- .../powerpc32/power4/multiarch/wcschr-ppc32.c | 43 --------- .../powerpc32/power4/multiarch/wcschr.c | 41 -------- sysdeps/powerpc/powerpc64/multiarch/Makefile | 5 +- .../powerpc64/multiarch/ifunc-impl-list.c | 11 --- .../powerpc64/multiarch/wcschr-power6.c | 19 ---- .../powerpc64/multiarch/wcschr-power7.c | 19 ---- .../powerpc64/multiarch/wcschr-ppc64.c | 18 ---- sysdeps/powerpc/powerpc64/multiarch/wcschr.c | 43 --------- sysdeps/powerpc/powerpc64/power6/wcschr.c | 1 - 15 files changed, 3 insertions(+), 362 deletions(-) delete mode 100644 sysdeps/powerpc/power6/wcschr.c delete mode 100644 sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-power6.c delete mode 100644 sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-power7.c delete mode 100644 sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc32.c delete mode 100644 sysdeps/powerpc/powerpc32/power4/multiarch/wcschr.c delete mode 100644 sysdeps/powerpc/powerpc64/multiarch/wcschr-power6.c delete mode 100644 sysdeps/powerpc/powerpc64/multiarch/wcschr-power7.c delete mode 100644 sysdeps/powerpc/powerpc64/multiarch/wcschr-ppc64.c delete mode 100644 sysdeps/powerpc/powerpc64/multiarch/wcschr.c delete mode 100644 sysdeps/powerpc/powerpc64/power6/wcschr.c -- 2.17.1 Reviewed-by: Gabriel F. T. Gomes diff --git a/sysdeps/powerpc/Makefile b/sysdeps/powerpc/Makefile index ba137e4cad..35cf1c624b 100644 --- a/sysdeps/powerpc/Makefile +++ b/sysdeps/powerpc/Makefile @@ -49,4 +49,5 @@ endif ifeq ($(subdir),wcsmbs) CFLAGS-wcscpy.c += -DUNROLL_NTIMES=8 +CFLAGS-wcschr.c += -DUNROLL_NTIMES=8 endif diff --git a/sysdeps/powerpc/power6/wcschr.c b/sysdeps/powerpc/power6/wcschr.c deleted file mode 100644 index e3f93569dd..0000000000 --- a/sysdeps/powerpc/power6/wcschr.c +++ /dev/null @@ -1,96 +0,0 @@ -/* wcschr.c - Wide Character Search for POWER6+. - Copyright (C) 2012-2019 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; see the file COPYING.LIB. If - not, see . */ - -#include - -#ifndef WCSCHR -# define WCSCHR __wcschr -# define DEFAULT_WCSCHR -#endif - -/* Find the first occurrence of WC in WCS. */ -wchar_t * -WCSCHR (const wchar_t *wcs, const wchar_t wc) -{ - const wchar_t *wcs2 = wcs + 1; - - if (*wcs == wc) - return (wchar_t *) wcs; - if (*wcs == L'\0') - return NULL; - - do - { - wcs += 2; - - if (*wcs2 == wc) - return (wchar_t *) wcs2; - if (*wcs2 == L'\0') - return NULL; - wcs2 += 2; - - if (*wcs == wc) - return (wchar_t *) wcs; - if (*wcs == L'\0') - return NULL; - wcs += 2; - - if (*wcs2 == wc) - return (wchar_t *) wcs2; - if (*wcs2 == L'\0') - return NULL; - wcs2 += 2; - - if (*wcs == wc) - return (wchar_t *) wcs; - if (*wcs == L'\0') - return NULL; - wcs += 2; - - if (*wcs2 == wc) - return (wchar_t *) wcs2; - if (*wcs2 == L'\0') - return NULL; - wcs2 += 2; - - if (*wcs == wc) - return (wchar_t *) wcs; - if (*wcs == L'\0') - return NULL; - wcs += 2; - - if (*wcs2 == wc) - return (wchar_t *) wcs2; - if (*wcs2 == L'\0') - return NULL; - wcs2 += 2; - - if (*wcs == wc) - return (wchar_t *) wcs; - } - while (*wcs != L'\0'); - - return NULL; -} -#ifdef DEFAULT_WCSCHR -libc_hidden_def (__wcschr) -weak_alias (__wcschr, wcschr) -libc_hidden_weak (wcschr) -#else -libc_hidden_def (wcschr) -#endif diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/Makefile b/sysdeps/powerpc/powerpc32/power4/multiarch/Makefile index f5141bc5b5..bb87c56b4d 100644 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/Makefile +++ b/sysdeps/powerpc/powerpc32/power4/multiarch/Makefile @@ -17,11 +17,8 @@ CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops endif ifeq ($(subdir),wcsmbs) -sysdep_routines += wcschr-power7 wcschr-power6 wcschr-ppc32 \ - wcsrchr-power7 wcsrchr-power6 wcsrchr-ppc32 +sysdep_routines += wcsrchr-power7 wcsrchr-power6 wcsrchr-ppc32 -CFLAGS-wcschr-power7.c += -mcpu=power7 -CFLAGS-wcschr-power6.c += -mcpu=power6 CFLAGS-wcsrchr-power7.c += -mcpu=power7 CFLAGS-wcsrchr-power6.c += -mcpu=power6 endif diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c index ae581d62f8..7624c3d5f0 100644 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c +++ b/sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c @@ -187,17 +187,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, strchr, 1, __strchr_ppc)) - /* Support sysdeps/powerpc/powerpc32/power4/multiarch/wcschr.c. */ - IFUNC_IMPL (i, name, wcschr, - IFUNC_IMPL_ADD (array, i, wcschr, - hwcap & PPC_FEATURE_HAS_VSX, - __wcschr_power7) - IFUNC_IMPL_ADD (array, i, wcschr, - hwcap & PPC_FEATURE_ARCH_2_05, - __wcschr_power6) - IFUNC_IMPL_ADD (array, i, wcschr, 1, - __wcschr_ppc)) - /* Support sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr.c. */ IFUNC_IMPL (i, name, wcsrchr, IFUNC_IMPL_ADD (array, i, wcsrchr, diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-power6.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-power6.c deleted file mode 100644 index 516f0f8584..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-power6.c +++ /dev/null @@ -1,26 +0,0 @@ -/* wcschr.c - Wide Character Search for powerpc32/power6. - Copyright (C) 2013-2019 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; see the file COPYING.LIB. If - not, see . */ - -#include - -#define WCSCHR __wcschr_power6 - -#undef libc_hidden_def -#define libc_hidden_def(name) - -#include diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-power7.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-power7.c deleted file mode 100644 index 5dc52659e8..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-power7.c +++ /dev/null @@ -1,26 +0,0 @@ -/* wcschr.c - Wide Character Search for powerpc32/power7. - Copyright (C) 2013-2019 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; see the file COPYING.LIB. If - not, see . */ - -#include - -#define WCSCHR __wcschr_power7 - -#undef libc_hidden_def -#define libc_hidden_def(name) - -#include diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc32.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc32.c deleted file mode 100644 index 55873fbcf4..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc32.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright (C) 2013-2019 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 - -#if IS_IN (libc) -# undef libc_hidden_weak -# define libc_hidden_weak(name) - -# undef weak_alias -# undef libc_hidden_def - -# ifdef SHARED -# define libc_hidden_def(name) \ - __hidden_ver1 (__wcschr_ppc, __GI_wcschr, __wcschr_ppc); \ - strong_alias (__wcschr_ppc, __wcschr_ppc_1); \ - __hidden_ver1 (__wcschr_ppc_1, __GI___wcschr, __wcschr_ppc_1); -# define weak_alias(name,alias) -# else -# define weak_alias(name, alias) \ - _weak_alias(__wcschr_ppc, __wcschr) -# define libc_hidden_def(name) -# endif /* SHARED */ -#endif - -extern __typeof (wcschr) __wcschr_ppc; - -#define WCSCHR __wcschr_ppc -#include diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr.c deleted file mode 100644 index c8379a2dca..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcschr.c +++ /dev/null @@ -1,41 +0,0 @@ -/* Multiple versions of wcschr - Copyright (C) 2013-2019 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 - . */ - -#if IS_IN (libc) -# define wcschr __redirect_wcschr -# include -# include -# include "init-arch.h" - -extern __typeof (__redirect_wcschr) __wcschr_ppc attribute_hidden; -extern __typeof (__redirect_wcschr) __wcschr_power6 attribute_hidden; -extern __typeof (__redirect_wcschr) __wcschr_power7 attribute_hidden; - -extern __typeof (__redirect_wcschr) __libc_wcschr; - -libc_ifunc (__libc_wcschr, - (hwcap & PPC_FEATURE_HAS_VSX) - ? __wcschr_power7 : - (hwcap & PPC_FEATURE_ARCH_2_05) - ? __wcschr_power6 - : __wcschr_ppc); -#undef wcschr -weak_alias (__libc_wcschr, wcschr) -#else -#include -#endif diff --git a/sysdeps/powerpc/powerpc64/multiarch/Makefile b/sysdeps/powerpc/powerpc64/multiarch/Makefile index 3913ef580e..c70f4a2b5a 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/Makefile +++ b/sysdeps/powerpc/powerpc64/multiarch/Makefile @@ -39,11 +39,8 @@ CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops endif ifeq ($(subdir),wcsmbs) -sysdep_routines += wcschr-power7 wcschr-power6 wcschr-ppc64 \ - wcsrchr-power7 wcsrchr-power6 wcsrchr-ppc64 +sysdep_routines += wcsrchr-power7 wcsrchr-power6 wcsrchr-ppc64 -CFLAGS-wcschr-power7.c += -mcpu=power7 -CFLAGS-wcschr-power6.c += -mcpu=power6 CFLAGS-wcsrchr-power7.c += -mcpu=power7 CFLAGS-wcsrchr-power6.c += -mcpu=power6 endif diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c index 06d33d71e0..9b1e4d141d 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c +++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c @@ -260,17 +260,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, strncasecmp_l, 1, __strncasecmp_l_ppc)) - /* Support sysdeps/powerpc/powerpc64/multiarch/wcschr.c. */ - IFUNC_IMPL (i, name, wcschr, - IFUNC_IMPL_ADD (array, i, wcschr, - hwcap & PPC_FEATURE_HAS_VSX, - __wcschr_power7) - IFUNC_IMPL_ADD (array, i, wcschr, - hwcap & PPC_FEATURE_ARCH_2_05, - __wcschr_power6) - IFUNC_IMPL_ADD (array, i, wcschr, 1, - __wcschr_ppc)) - /* Support sysdeps/powerpc/powerpc64/multiarch/wcschr.c. */ IFUNC_IMPL (i, name, wcsrchr, IFUNC_IMPL_ADD (array, i, wcsrchr, diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcschr-power6.c b/sysdeps/powerpc/powerpc64/multiarch/wcschr-power6.c deleted file mode 100644 index 029608c512..0000000000 --- a/sysdeps/powerpc/powerpc64/multiarch/wcschr-power6.c +++ /dev/null @@ -1,19 +0,0 @@ -/* wcschr.c - Wide Character Search for powerpc64/power6. - Copyright (C) 2013-2019 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; see the file COPYING.LIB. If - not, see . */ - -#include diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcschr-power7.c b/sysdeps/powerpc/powerpc64/multiarch/wcschr-power7.c deleted file mode 100644 index 9b11103976..0000000000 --- a/sysdeps/powerpc/powerpc64/multiarch/wcschr-power7.c +++ /dev/null @@ -1,19 +0,0 @@ -/* wcschr.c - Wide Character Search for powerpc64/power7. - Copyright (C) 2013-2019 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; see the file COPYING.LIB. If - not, see . */ - -#include diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcschr-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/wcschr-ppc64.c deleted file mode 100644 index f956fc0aa2..0000000000 --- a/sysdeps/powerpc/powerpc64/multiarch/wcschr-ppc64.c +++ /dev/null @@ -1,18 +0,0 @@ -/* Copyright (C) 2013-2019 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 diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcschr.c b/sysdeps/powerpc/powerpc64/multiarch/wcschr.c deleted file mode 100644 index 0a279f0dd2..0000000000 --- a/sysdeps/powerpc/powerpc64/multiarch/wcschr.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Multiple versions of wcschr - Copyright (C) 2013-2019 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 - . */ - -#if IS_IN (libc) -# define wcschr __redirect_wcschr -# define __wcschr __redirect___wcschr -# include -# include -# include "init-arch.h" - -extern __typeof (wcschr) __wcschr_ppc attribute_hidden; -extern __typeof (wcschr) __wcschr_power6 attribute_hidden; -extern __typeof (wcschr) __wcschr_power7 attribute_hidden; -# undef wcschr -# undef __wcschr - -libc_ifunc_redirected (__redirect___wcschr, __wcschr, - (hwcap & PPC_FEATURE_HAS_VSX) - ? __wcschr_power7 - : (hwcap & PPC_FEATURE_ARCH_2_05) - ? __wcschr_power6 - : __wcschr_ppc); -weak_alias (__wcschr, wcschr) -#else -#undef libc_hidden_def -#define libc_hidden_def(a) -#include -#endif diff --git a/sysdeps/powerpc/powerpc64/power6/wcschr.c b/sysdeps/powerpc/powerpc64/power6/wcschr.c deleted file mode 100644 index ae04a130cc..0000000000 --- a/sysdeps/powerpc/powerpc64/power6/wcschr.c +++ /dev/null @@ -1 +0,0 @@ -#include From patchwork Wed Mar 13 14:03:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 160227 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp14356717jad; Wed, 13 Mar 2019 07:03:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqxklic1ArKGLBGRcSrg7EXBokmiJL1bjPH1ULn4HRsvWw1QMI3TFdmZEKv35+M3UT9QU2O2 X-Received: by 2002:a65:4844:: with SMTP id i4mr39115879pgs.347.1552485835387; Wed, 13 Mar 2019 07:03:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552485835; cv=none; d=google.com; s=arc-20160816; b=BDni5XN3/54W2lwCficJqegJKrWceUvHCk6Bhntsc/KtvDtaqaRTJUbWF4fQEvVtPw xLztaIbf3q16OwpOEn/Rk2/aFEA2etmnHbnhOEbcdXlajuI/Tv/d/gumf/93s8s6Osu8 xn35fcn0wk9QYO7f515r/NARhAfnimf6ga+YN2rAtggKCI6tMWlCLxkGaWCqcnnb459s T/1SdBdQUyamjcE+/jgHlzA2FuUZUWlmpZ7j8uzBrItjT8yZ87w6eKW/MvwP7rjQnN+u /k4z/6d/i2BMErb1c92Aa68gr7LoGsDaox91pjGQHtTvHciC/WChWK/Y7Ni4v32jgDF2 Z6oQ== 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:cc:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=KNrpbzpBrZvGtGrOIdkVTTMiuW1TDfvWHPcrpBf6qzo=; b=wc2grFUZx+e2TfcsSoTxYatoeMNjJ4Xxy3ImePD0vrL1iapcEUng+R4mxNDgtYK7PO MYipluNpJ3v/zPM1VjAYYZ8QDYp4F4gHCjx0MMpgAlnhwc8WK3WtxJSqd+z+JFUZstlP UR/ii0f9RB5YNDo7EktfgQj8QUajT87KONNi7gpY3lYuFUGJw1OPoYTOU3Gxo1KojQwN 4kMeCO1uuG0jQQqnlXnZNyp5aqPoOC15V+1wJp3vXubbQXzOqOZV6nzGtVfjHS8gyRde TGcU0psXW2ghbAUS+F0LTv6t5ynYiRgMrZcuOLAkr2aKjeRe5780GPbbLOiekE0a1u3H ZifQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=Jaod15O+; dkim=pass header.i=@linaro.org header.s=google header.b=aRpXDFL0; spf=pass (google.com: domain of libc-alpha-return-100600-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-100600-patch=linaro.org@sourceware.org"; dmarc=pass (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 l27si10439249pfb.258.2019.03.13.07.03.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Mar 2019 07:03:55 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-100600-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=Jaod15O+; dkim=pass header.i=@linaro.org header.s=google header.b=aRpXDFL0; spf=pass (google.com: domain of libc-alpha-return-100600-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-100600-patch=linaro.org@sourceware.org"; dmarc=pass (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:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=GWgWRW76BMlVlTF7Bl0MbX6K7nncKZy 5/9b8eWKUng/DjQW6OvvZq63POeI46WPLvy60h+x8l2pGbYCV7awMUWAoU7lAoZY m2HBgZt/O4bcSYSKaZ8dX1sAOpDyUYsxkEAe1Kl2rXSyQDIQ90wyKNqWzFAmDBRP FmEiSyUwpeFI= 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:cc:subject:date:message-id:in-reply-to :references; s=default; bh=/QaCmere3hZ55JhHJCn5q8R7j2M=; b=Jaod1 5O+ehJYD0PCwgbjIyztSy0T6viHJvcuE9fN2P2VMHXWQoxR/8r4Hf4iFfLtecBee s2AEf+vBQvhkPaAbPdCdGhNVq9U/cRW6+j1dFrq8A+3b+VMVRv8i+GT54PfoIDxZ 3b/0Fb11c+S4jinft1Sk6xrZk51Fg4F1PdpTmU= Received: (qmail 51631 invoked by alias); 13 Mar 2019 14:03:33 -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 51544 invoked by uid 89); 13 Mar 2019 14:03:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1086, H*MI:sk:2019031 X-HELO: mail-vs1-f46.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KNrpbzpBrZvGtGrOIdkVTTMiuW1TDfvWHPcrpBf6qzo=; b=aRpXDFL07PSFBO3/xCxGV07lB4dHfoB3GXvdoLLrf/vDb6vDeoEJKK7RzihXciulw1 jdgjklJYAAH8LRera3kdb4iGtvHNsOAuIJvUouA2QZvb6t8F1qwneTZFJNg0xP1ZyO6p 20y5XuH8L4nhipWDbhDH3TRanZlwH/LmhdbxfILdtLircsvTNWuRfhqgO4K7cMrJBDIt hW0zJ7/n/z8bpDt+Cn80uLqe3R3/5tDyZxE24CpdjgAHG52BfyRZWt0bjcfihoJ4sGlG kwWZP39QJpJSEkpZ1bhenHPPc8N9BszMkMuGBzfPXUMEbpIS5DDRK3rb6HIUqC1LGUYa R2Ow== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: "Gabriel F . T . Gomes" Subject: [PATCH v2 5/6] wcsmbs: Use loop_unroll on wcsrchr Date: Wed, 13 Mar 2019 11:03:16 -0300 Message-Id: <20190313140317.8894-5-adhemerval.zanella@linaro.org> In-Reply-To: <20190313140317.8894-1-adhemerval.zanella@linaro.org> References: <20190313140317.8894-1-adhemerval.zanella@linaro.org> This allows an architecture to set explicit loop unrolling. Checked on aarch64-linux-gnu. * wcsmbs/wcsrchr.c (WCSRCHR): Use loop_unroll.h to parametrize the loop unroll. --- wcsmbs/wcsrchr.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) -- 2.17.1 Reviewed-by: Gabriel F. T. Gomes diff --git a/wcsmbs/wcsrchr.c b/wcsmbs/wcsrchr.c index 0d4bad0704..3175df357d 100644 --- a/wcsmbs/wcsrchr.c +++ b/wcsmbs/wcsrchr.c @@ -17,6 +17,7 @@ . */ #include +#include #ifndef WCSRCHR # define WCSRCHR wcsrchr @@ -26,12 +27,21 @@ wchar_t * WCSRCHR (const wchar_t *wcs, const wchar_t wc) { - const wchar_t *retval = NULL; + wchar_t *retval = NULL; - do - if (*wcs == wc) - retval = wcs; - while (*wcs++ != L'\0'); +#define ITERATION(index) \ + ({ \ + if (*wcs == wc) \ + retval = (wchar_t*) wcs; \ + *wcs++ != L'\0'; \ + }) - return (wchar_t *) retval; +#ifndef UNROLL_NTIMES +# define UNROLL_NTIMES 1 +#endif + + while (1) + UNROLL_REPEAT(UNROLL_NTIMES, ITERATION); + + return retval; } From patchwork Wed Mar 13 14:03:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 160230 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp14357385jad; Wed, 13 Mar 2019 07:04:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqy4mjbHYoqRWpJrjRNp8AdRJMplE79ySNErlj9AeUF2O7oSAvkAXIHf83wL+23gXHIOaZPO X-Received: by 2002:a65:64cc:: with SMTP id t12mr31868514pgv.438.1552485866093; Wed, 13 Mar 2019 07:04:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552485866; cv=none; d=google.com; s=arc-20160816; b=gOk8k5Tj2Gvu7CSSbcyOfgk+AzKGXVzWTNWdhaf7680D0IYQF5gOc+2E+m/fLjLZ9C g9c4zNiI7gls3jBqvpcfiRcnPl6ul3t2k2JUGO4hrUfSHqrQLvB+0rvyd0vFGtqm8lt0 YEKuizDcl/W4Jejs1Qd4xcNrUqCTCaMJA/GBNSPIYdQsgESekYDEVVCfmerEr9+lVlIl nsHPB/e7cv0PeTY6/j4pu+IRsou0VSwKcXyrqSvq2DcwWZvhdOO2PKytwYZMOTVg3D09 L751/9Fvrflhifr1gFY6Gb6sp+Qm18awAfHKhakbOtexvEUoe95VnOxBovX/sDx4ZEI2 OmGw== 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:cc:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=0GQBLrjZqD6EAJOBcu5wZERYjF/L4WWAgzpY+5CgR0A=; b=isioj7+QedwVrYYUZnsgfQZSyZ6GjkjiElW6sL+nFicJxjD12PJGrc/GHf7Fl5Fi1Q hu+Hw4h0tjvYhyPShtIGsDUMF/AEqVOlhlauk6tWEk/SpAesVDEsUyVG/jG7UoNXc10K exAw5HdLT4X3q/ZOTlnJ37pfbSLIxR2i5D5AYaswoqZTNZum1275IFJ0v9+G7eNwEZ6E XmnEXk/+kGcpT+W0Q5LW5CMR0OxQXZEWZUYDtDS2lWIQX55QwJOEabc34KJ5C8t+fD0y 6X8x/Q9kfDn6wRvH5ya6uyjHOkohziBjsui1NL8bZ3p63O+apAvOvvGhCTeML9jVUHnV gX+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=VJehoamP; dkim=pass header.i=@linaro.org header.s=google header.b=ebjLQsCj; spf=pass (google.com: domain of libc-alpha-return-100603-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-100603-patch=linaro.org@sourceware.org"; dmarc=pass (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 q13si10648302pll.175.2019.03.13.07.04.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Mar 2019 07:04:26 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-100603-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=VJehoamP; dkim=pass header.i=@linaro.org header.s=google header.b=ebjLQsCj; spf=pass (google.com: domain of libc-alpha-return-100603-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-100603-patch=linaro.org@sourceware.org"; dmarc=pass (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:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=FCkquc2BoZzSotrvjXrZSQHQJttf73Z ATQ936amb3tYQY4RyKmQKoklPLKKiTZUyhOdTZ7asGwBYVrBcD+MA4d/T/xmZy5Y av0jCHYGctMkSfiBpwAlzM0odrBDy+7aAZO6ainRPTi3zOQcYm/P/8/f3ywx4fLa Py229mM18e5I= 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:cc:subject:date:message-id:in-reply-to :references; s=default; bh=KifjerLg2pevPc8hvcqHcdeUcNE=; b=VJeho amPhvcT9Cw34/GdJ61pEnIPBUvycXeBqh0+2FjcprOdr6ygtSTMYLExcDu9NeKUc Dm1SCasVsqrezjpk1IwvKJ97lfDCLaXZ212pKdzj84Nwzk1Hw8mHISjN1tRt0Ya/ LjyBlSQpgcA34m72xEbGJDjTplkPxaE3SMn0Bk= Received: (qmail 52388 invoked by alias); 13 Mar 2019 14:03:38 -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 52304 invoked by uid 89); 13 Mar 2019 14:03:38 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=1510 X-HELO: mail-vs1-f68.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0GQBLrjZqD6EAJOBcu5wZERYjF/L4WWAgzpY+5CgR0A=; b=ebjLQsCjyK9W+HjmnmEot0OUfbKGg321DZPZLcKrPvtpWT4dwqbS+YtT645bs7YaaN QhpZuvMduHLVRnOkVqCpAhUNCh6c2SFCjGTVBwWLbBgBIAuOEnXsVOsSuqvNpCIPF4q1 zF2jgJpQShAj+5ZF4cXschSv8smf3zIeiKbXVhZMG3QORrvsXtewFPtYwNj50NToi1Hd NIjECvM8UazVEd6Y9EsPAwrzwiFxri97b6HYNXm9uqQkkN/LwVPrcTy0UH1LUgwyfvzK TjqSPuZ80CvHaBg6JPto0zPEnwcXNPW+TmQVXcDhBmXsJvTRqJPGcrGETIr7iHuJZk3w c6vA== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: "Gabriel F . T . Gomes" Subject: [PATCH v2 6/6] powerpc: Use generic wcscpy optimization Date: Wed, 13 Mar 2019 11:03:17 -0300 Message-Id: <20190313140317.8894-6-adhemerval.zanella@linaro.org> In-Reply-To: <20190313140317.8894-1-adhemerval.zanella@linaro.org> References: <20190313140317.8894-1-adhemerval.zanella@linaro.org> This patch removes the power6 wcsrchr optimization and use generic implementation instead. Currently both power6 and power7 ifunc variant resulting binary are essentially the same and the generic implementation with unrolling loop set to 8 also results in similar performance. Checked on powerpc64-linux-gnu. * sysdeps/powerpc/Makefile [$(subdir) == wcsmbs] (CFLAGS-wcschr.c): New rule. * sysdeps/powerpc/power6/wcsrchr.c: Remove file. * sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-power6.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-power7.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-ppc32.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power6.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power7.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wcsrchr-ppc64.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c: Likewise. * sysdeps/powerpc/powerpc64/power6/wcsrchr.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/Makefile [$(subdir) == wcsmbs] (sysdeps_routines): Remove wcsrchr-power6 and wcsrchr-power7. (CFLAGS-wcsrchr-power7.c, CFLAGS-wcsrchr-power6.c): Remove rule. * sysdeps/powerpc/powerpc64/multiarch/Makefile: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c: Remove wcsrchr optimizations. --- sysdeps/powerpc/Makefile | 1 + sysdeps/powerpc/power6/wcsrchr.c | 89 ------------------- .../powerpc32/power4/multiarch/Makefile | 7 -- .../power4/multiarch/ifunc-impl-list.c | 11 --- .../power4/multiarch/wcsrchr-power6.c | 20 ----- .../power4/multiarch/wcsrchr-power7.c | 20 ----- .../power4/multiarch/wcsrchr-ppc32.c | 26 ------ .../powerpc32/power4/multiarch/wcsrchr.c | 36 -------- sysdeps/powerpc/powerpc64/multiarch/Makefile | 7 -- .../powerpc64/multiarch/ifunc-impl-list.c | 11 --- .../powerpc64/multiarch/wcsrchr-power6.c | 19 ---- .../powerpc64/multiarch/wcsrchr-power7.c | 19 ---- .../powerpc64/multiarch/wcsrchr-ppc64.c | 18 ---- sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c | 36 -------- sysdeps/powerpc/powerpc64/power6/wcsrchr.c | 1 - 15 files changed, 1 insertion(+), 320 deletions(-) delete mode 100644 sysdeps/powerpc/power6/wcsrchr.c delete mode 100644 sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-power6.c delete mode 100644 sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-power7.c delete mode 100644 sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-ppc32.c delete mode 100644 sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr.c delete mode 100644 sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power6.c delete mode 100644 sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power7.c delete mode 100644 sysdeps/powerpc/powerpc64/multiarch/wcsrchr-ppc64.c delete mode 100644 sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c delete mode 100644 sysdeps/powerpc/powerpc64/power6/wcsrchr.c -- 2.17.1 Reviewed-by: Gabriel F. T. Gomes diff --git a/sysdeps/powerpc/Makefile b/sysdeps/powerpc/Makefile index 35cf1c624b..05675bc8ae 100644 --- a/sysdeps/powerpc/Makefile +++ b/sysdeps/powerpc/Makefile @@ -50,4 +50,5 @@ endif ifeq ($(subdir),wcsmbs) CFLAGS-wcscpy.c += -DUNROLL_NTIMES=8 CFLAGS-wcschr.c += -DUNROLL_NTIMES=8 +CFLAGS-wcsrchr.c += -DUNROLL_NTIMES=8 endif diff --git a/sysdeps/powerpc/power6/wcsrchr.c b/sysdeps/powerpc/power6/wcsrchr.c deleted file mode 100644 index 1762bd276c..0000000000 --- a/sysdeps/powerpc/power6/wcsrchr.c +++ /dev/null @@ -1,89 +0,0 @@ -/* wcsrchr.c - Wide Character Reverse Search for POWER6+. - Copyright (C) 2012-2019 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; see the file COPYING.LIB. If - not, see . */ - -#include - -#ifndef WCSRCHR -# define WCSRCHR wcsrchr -#endif - -/* Find the last occurrence of WC in WCS. */ -wchar_t * -WCSRCHR (const wchar_t *wcs, const wchar_t wc) -{ - const wchar_t *wcs2 = wcs + 1; - const wchar_t *retval = NULL; - - if (*wcs == wc) - retval = wcs; - - if (*wcs == L'\0') return (wchar_t *) retval; - - do - { - wcs+=2; - - if (*wcs2 == wc) - retval = wcs2; - if (*wcs2 == L'\0') - return (wchar_t *) retval; - wcs2+=2; - - if (*wcs == wc) - retval = wcs; - if (*wcs == L'\0') - return (wchar_t *) retval; - wcs+=2; - - if (*wcs2 == wc) - retval = wcs2; - if (*wcs2 == L'\0') - return (wchar_t *) retval; - wcs2+=2; - - if (*wcs == wc) - retval = wcs; - if (*wcs == L'\0') - return (wchar_t *) retval; - wcs+=2; - - if (*wcs2 == wc) - retval = wcs2; - if (*wcs2 == L'\0') - return (wchar_t *) retval; - wcs2+=2; - - if (*wcs == wc) - retval = wcs; - if (*wcs == L'\0') - return (wchar_t *) retval; - wcs+=2; - - if (*wcs2 == wc) - retval = wcs2; - if (*wcs2 == L'\0') - return (wchar_t *) retval; - wcs2+=2; - - if (*wcs == wc) - retval = wcs; - } - while (*wcs != L'\0'); - - return (wchar_t *) retval; -} diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/Makefile b/sysdeps/powerpc/powerpc32/power4/multiarch/Makefile index bb87c56b4d..5c68f07d19 100644 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/Makefile +++ b/sysdeps/powerpc/powerpc32/power4/multiarch/Makefile @@ -15,10 +15,3 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \ CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops endif - -ifeq ($(subdir),wcsmbs) -sysdep_routines += wcsrchr-power7 wcsrchr-power6 wcsrchr-ppc32 - -CFLAGS-wcsrchr-power7.c += -mcpu=power7 -CFLAGS-wcsrchr-power6.c += -mcpu=power6 -endif diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c index 7624c3d5f0..16a64beb33 100644 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c +++ b/sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c @@ -187,16 +187,5 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, strchr, 1, __strchr_ppc)) - /* Support sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr.c. */ - IFUNC_IMPL (i, name, wcsrchr, - IFUNC_IMPL_ADD (array, i, wcsrchr, - hwcap & PPC_FEATURE_HAS_VSX, - __wcsrchr_power7) - IFUNC_IMPL_ADD (array, i, wcsrchr, - hwcap & PPC_FEATURE_ARCH_2_05, - __wcsrchr_power6) - IFUNC_IMPL_ADD (array, i, wcsrchr, 1, - __wcsrchr_ppc)) - return i; } diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-power6.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-power6.c deleted file mode 100644 index 93c8bde9ba..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-power6.c +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright (C) 2013-2019 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 WCSRCHR __wcsrchr_power6 - -#include diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-power7.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-power7.c deleted file mode 100644 index a32a9845b7..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-power7.c +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright (C) 2013-2019 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 WCSRCHR __wcsrchr_power7 - -#include diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-ppc32.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-ppc32.c deleted file mode 100644 index 690faf48b8..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-ppc32.c +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright (C) 2013-2019 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 - -#if IS_IN (libc) -# define WCSRCHR __wcsrchr_ppc -#endif - -extern __typeof (wcsrchr) __wcsrchr_ppc; - -#include diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr.c b/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr.c deleted file mode 100644 index 80adc7bcd1..0000000000 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Multiple versions of wcsrchr - Copyright (C) 2013-2019 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 - . */ - -#if IS_IN (libc) -# include -# include -# include "init-arch.h" - -extern __typeof (wcsrchr) __wcsrchr_ppc attribute_hidden; -extern __typeof (wcsrchr) __wcsrchr_power6 attribute_hidden; -extern __typeof (wcsrchr) __wcsrchr_power7 attribute_hidden; - -libc_ifunc (wcsrchr, - (hwcap & PPC_FEATURE_HAS_VSX) - ? __wcsrchr_power7 : - (hwcap & PPC_FEATURE_ARCH_2_05) - ? __wcsrchr_power6 - : __wcsrchr_ppc); -#else -#include -#endif diff --git a/sysdeps/powerpc/powerpc64/multiarch/Makefile b/sysdeps/powerpc/powerpc64/multiarch/Makefile index c70f4a2b5a..ea936bf9ed 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/Makefile +++ b/sysdeps/powerpc/powerpc64/multiarch/Makefile @@ -37,10 +37,3 @@ endif CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops endif - -ifeq ($(subdir),wcsmbs) -sysdep_routines += wcsrchr-power7 wcsrchr-power6 wcsrchr-ppc64 - -CFLAGS-wcsrchr-power7.c += -mcpu=power7 -CFLAGS-wcsrchr-power6.c += -mcpu=power6 -endif diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c index 9b1e4d141d..c0a927d73e 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c +++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c @@ -260,17 +260,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, strncasecmp_l, 1, __strncasecmp_l_ppc)) - /* Support sysdeps/powerpc/powerpc64/multiarch/wcschr.c. */ - IFUNC_IMPL (i, name, wcsrchr, - IFUNC_IMPL_ADD (array, i, wcsrchr, - hwcap & PPC_FEATURE_HAS_VSX, - __wcsrchr_power7) - IFUNC_IMPL_ADD (array, i, wcsrchr, - hwcap & PPC_FEATURE_ARCH_2_05, - __wcsrchr_power6) - IFUNC_IMPL_ADD (array, i, wcsrchr, 1, - __wcsrchr_ppc)) - /* Support sysdeps/powerpc/powerpc64/multiarch/strrchr.c. */ IFUNC_IMPL (i, name, strrchr, IFUNC_IMPL_ADD (array, i, strrchr, diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power6.c b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power6.c deleted file mode 100644 index a68569d30c..0000000000 --- a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power6.c +++ /dev/null @@ -1,19 +0,0 @@ -/* wcsrchr.c - Wide Character Search for powerpc64/power6. - Copyright (C) 2013-2019 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; see the file COPYING.LIB. If - not, see . */ - -#include diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power7.c b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power7.c deleted file mode 100644 index f27553f4ab..0000000000 --- a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power7.c +++ /dev/null @@ -1,19 +0,0 @@ -/* wcsrchr.c - Wide Character Search for powerpc64/power7. - Copyright (C) 2013-2019 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; see the file COPYING.LIB. If - not, see . */ - -#include diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-ppc64.c deleted file mode 100644 index b6504ebaef..0000000000 --- a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-ppc64.c +++ /dev/null @@ -1,18 +0,0 @@ -/* Copyright (C) 2013-2019 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 diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c deleted file mode 100644 index 52371a18b7..0000000000 --- a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Multiple versions of wcsrchr. - Copyright (C) 2013-2019 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 - . */ - -#if IS_IN (libc) -# include -# include -# include "init-arch.h" - -extern __typeof (wcsrchr) __wcsrchr_ppc attribute_hidden; -extern __typeof (wcsrchr) __wcsrchr_power6 attribute_hidden; -extern __typeof (wcsrchr) __wcsrchr_power7 attribute_hidden; - -libc_ifunc (wcsrchr, - (hwcap & PPC_FEATURE_HAS_VSX) - ? __wcsrchr_power7 : - (hwcap & PPC_FEATURE_ARCH_2_05) - ? __wcsrchr_power6 - : __wcsrchr_ppc); -#else -#include -#endif diff --git a/sysdeps/powerpc/powerpc64/power6/wcsrchr.c b/sysdeps/powerpc/powerpc64/power6/wcsrchr.c deleted file mode 100644 index b86472d7bd..0000000000 --- a/sysdeps/powerpc/powerpc64/power6/wcsrchr.c +++ /dev/null @@ -1 +0,0 @@ -#include