From patchwork Mon Apr 3 21:19:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wainer dos Santos Moschetta X-Patchwork-Id: 746661 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vxlQL4vDNz9s80 for ; Tue, 4 Apr 2017 07:20:58 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="EV6Jktbr"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:in-reply-to:references :in-reply-to:references:message-id; q=dns; s=default; b=NLL4qhf/ DfkrtSM/pm45cR9FwPCJS+IW0Pr7iHypnTJ1h6fm44MN3Y5tV2FqGVioMayGOE16 iNHnbhhoa8DMGZGrhz94gZzYLMcvlnuxxFkA6xeVNddPdGWV9lKoi4DlTd4IKDvS yielPYFI/nxsfZYUCjYZrikBbplzgvxEbvs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:in-reply-to:references :in-reply-to:references:message-id; s=default; bh=lY63nHxTJj1uWE phx5ny0t+0llc=; b=EV6JktbrlJJPKc7f0EfN2a8n5Z44AXv/Ugnz7bKqBT8jKh hN+xfnG+PtR8HIVQRgWEaL3eWucYeJ9/kr68h4w9UDsbT1ljChm7NBckiGaYqIbK 26X0TsGfcy/YLQEdKlFlZouoQh/Qg9gfG/0MXsttrCE8F6nyXkkwb3ISkSiRA= Received: (qmail 93523 invoked by alias); 3 Apr 2017 21:20:27 -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 93455 invoked by uid 89); 3 Apr 2017 21:20:27 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=2710 X-HELO: mx0a-001b2d01.pphosted.com From: Wainer dos Santos Moschetta To: libc-alpha@sourceware.org Subject: [PATCH 5/9] powerpc: refactor strcasestr and strstr IFUNC. Date: Mon, 3 Apr 2017 18:19:15 -0300 In-Reply-To: References: In-Reply-To: References: X-TM-AS-MML: disable x-cbid: 17040321-1523-0000-0000-00000292581E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17040321-1524-0000-0000-00002A285A31 Message-Id: <3630a4d5b3ec5ad199f5733ad60ac15788d3de4f.1491252969.git.wainersm@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-04-03_19:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1704030189 2017-04-03 Wainer dos Santos Moschetta * sysdeps/powerpc/powerpc64/multiarch/strcasestr-power8.S: Define the strcasestr implementation name and remove unneeded macros definition. * sysdeps/powerpc/powerpc64/multiarch/strstr-power7.S: Define strstr implementation name and remove unneeded macros definition. * sysdeps/powerpc/powerpc64/power7/strstr.S: Set a default function name if not defined and pass as parameter to macros accordingly. * sysdeps/powerpc/powerpc64/power8/strcasestr.S: Likewise. --- sysdeps/powerpc/powerpc64/multiarch/strcasestr-power8.S | 16 +--------------- sysdeps/powerpc/powerpc64/multiarch/strstr-power7.S | 16 +--------------- sysdeps/powerpc/powerpc64/power7/strstr.S | 8 ++++++-- sysdeps/powerpc/powerpc64/power8/strcasestr.S | 8 ++++++-- 4 files changed, 14 insertions(+), 34 deletions(-) diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasestr-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strcasestr-power8.S index 5a0eb9c..2cfb5ae 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/strcasestr-power8.S +++ b/sysdeps/powerpc/powerpc64/multiarch/strcasestr-power8.S @@ -18,21 +18,7 @@ #include -#undef EALIGN -#define EALIGN(name, alignt, words) \ - .section ".text"; \ - ENTRY_2(__strcasestr_power8) \ - .align ALIGNARG(alignt); \ - EALIGN_W_##words; \ - BODY_LABEL(__strcasestr_power8): \ - cfi_startproc; \ - LOCALENTRY(__strcasestr_power8) - -#undef END -#define END(name) \ - cfi_endproc; \ - TRACEBACK(__strcasestr_power8) \ - END_2(__strcasestr_power8) +#define STRCASESTR __strcasestr_power8 #undef libc_hidden_builtin_def #define libc_hidden_builtin_def(name) diff --git a/sysdeps/powerpc/powerpc64/multiarch/strstr-power7.S b/sysdeps/powerpc/powerpc64/multiarch/strstr-power7.S index 5ac7b85..3991df7 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/strstr-power7.S +++ b/sysdeps/powerpc/powerpc64/multiarch/strstr-power7.S @@ -18,21 +18,7 @@ #include -#undef EALIGN -#define EALIGN(name, alignt, words) \ - .section ".text"; \ - ENTRY_2(__strstr_power7) \ - .align ALIGNARG(alignt); \ - EALIGN_W_##words; \ - BODY_LABEL(__strstr_power7): \ - cfi_startproc; \ - LOCALENTRY(__strstr_power7) - -#undef END -#define END(name) \ - cfi_endproc; \ - TRACEBACK(__strstr_power7) \ - END_2(__strstr_power7) +#define STRSTR __strstr_power7 #undef libc_hidden_builtin_def #define libc_hidden_builtin_def(name) diff --git a/sysdeps/powerpc/powerpc64/power7/strstr.S b/sysdeps/powerpc/powerpc64/power7/strstr.S index 2a79b8b..260db2e 100644 --- a/sysdeps/powerpc/powerpc64/power7/strstr.S +++ b/sysdeps/powerpc/powerpc64/power7/strstr.S @@ -25,6 +25,10 @@ #define ITERATIONS 64 +#ifndef STRSTR +# define STRSTR strstr +#endif + #ifndef STRLEN /* For builds with no IFUNC support, local calls should be made to internal GLIBC symbol (created by libc_hidden_builtin_def). */ @@ -55,7 +59,7 @@ #define FRAMESIZE (FRAME_MIN_SIZE+32) .machine power7 -EALIGN (strstr, 4, 0) +EALIGN (STRSTR, 4, 0) CALL_MCOUNT 2 mflr r0 /* Load link register LR to r0. */ std r31, -8(r1) /* Save callers register r31. */ @@ -513,5 +517,5 @@ L(end): ld r31, -8(r1) /* Restore callers save register r31. */ mtlr r0 /* Branch to link register. */ blr -END (strstr) +END (STRSTR) libc_hidden_builtin_def (strstr) diff --git a/sysdeps/powerpc/powerpc64/power8/strcasestr.S b/sysdeps/powerpc/powerpc64/power8/strcasestr.S index 86f1672..6ac6572 100644 --- a/sysdeps/powerpc/powerpc64/power8/strcasestr.S +++ b/sysdeps/powerpc/powerpc64/power8/strcasestr.S @@ -27,6 +27,10 @@ fallback to default. */ #define ITERATIONS 64 +#ifndef STRCASESTR +# define STRCASESTR __strcasestr +#endif + #ifndef STRLEN /* For builds without IFUNC support, local calls should be made to internal GLIBC symbol (created by libc_hidden_builtin_def). */ @@ -81,7 +85,7 @@ /* TODO: change this to .machine power8 when the minimum required binutils allows it. */ .machine power7 -EALIGN (__strcasestr, 4, 0) +EALIGN (STRCASESTR, 4, 0) CALL_MCOUNT 2 mflr r0 /* Load link register LR to r0. */ std r31, -8(r1) /* Save callers register r31. */ @@ -527,7 +531,7 @@ L(end): cfi_restore(r31) mtlr r0 /* Branch to link register. */ blr -END (__strcasestr) +END (STRCASESTR) weak_alias (__strcasestr, strcasestr) libc_hidden_def (__strcasestr)