From patchwork Wed Jun 28 05:39:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajalakshmi Srinivasaraghavan X-Patchwork-Id: 781456 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 3wyBSh3SHKz9s71 for ; Wed, 28 Jun 2017 15:39:48 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="dYQMJEmk"; 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:cc:subject:date:message-id; q=dns; s= default; b=iTGi/n2reEYquibO80i6Oi5tgiu3C39i3Ncn3WsYoITlszR5aTpRb rD/OuuKR7CtgIP9W7dCKZgx6C1ndKAK2sfbTvVxfdIIReE7AtihI+DMBDO03otQM WXR65Ya+zSFAB3rjvarXcD0rSaBoAJJg/+BU9Dza5BOfXWKzzd60ss= 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=yvTO5Qc+EEYL2qAyuBPDvfvSp08=; b=dYQMJEmklkG65HKb1OlfmpEprLxf anxR55vf5KAZtpQ+Sz1NPg/wGZnhtH25i4ZTH2y05n56CZOKOLgnmREQns8jXk9V deUV1HKXZLn73IvBST0lpQPnkzI4CVgT1AgMcg3epYqLoUtm6weF894LlhEJgGkd A4/fYQH/GfcH5sg= Received: (qmail 36349 invoked by alias); 28 Jun 2017 05:39:39 -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 36334 invoked by uid 89); 28 Jun 2017 05:39:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.0 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=ldu X-HELO: mx0a-001b2d01.pphosted.com From: Rajalakshmi Srinivasaraghavan To: libc-alpha@sourceware.org Cc: Rajalakshmi Srinivasaraghavan Subject: [PATCH] powerpc: Clean up strlen and strnlen for power8 Date: Wed, 28 Jun 2017 11:09:26 +0530 X-TM-AS-MML: disable x-cbid: 17062805-0008-0000-0000-0000014840CB X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17062805-0009-0000-0000-000009781823 Message-Id: <1498628366-26658-1-git-send-email-raji@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-06-28_02:, , 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-1703280000 definitions=main-1706280089 To align a quadword aligned address to 64 bytes, maximum of three 16 bytes load is needed for worst case instead of loading four times. 2017-06-28 Rajalakshmi Srinivasaraghavan * sysdeps/powerpc/powerpc64/power8/strlen.S: Remove unreachable code. * sysdeps/powerpc/powerpc64/power8/strnlen.S: Likewise. --- sysdeps/powerpc/powerpc64/power8/strlen.S | 11 ----------- sysdeps/powerpc/powerpc64/power8/strnlen.S | 10 +--------- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/sysdeps/powerpc/powerpc64/power8/strlen.S b/sysdeps/powerpc/powerpc64/power8/strlen.S index 8fdb6f5..5691d1d 100644 --- a/sysdeps/powerpc/powerpc64/power8/strlen.S +++ b/sysdeps/powerpc/powerpc64/power8/strlen.S @@ -144,17 +144,6 @@ L(align64): or r5,r10,r11 cmpdi cr7,r5,0 addi r9,r9,16 - bne cr7,L(dword_zero) - - andi. r10,r9,63 - beq cr0,L(preloop) - ld r6,8(r4) - ldu r5,16(r4) - cmpb r10,r6,r0 - cmpb r11,r5,r0 - or r5,r10,r11 - cmpdi cr7,r5,0 - addi r9,r9,16 /* At this point, we are necessarily 64-byte aligned. If no zeroes were found, jump to the vectorized loop. */ diff --git a/sysdeps/powerpc/powerpc64/power8/strnlen.S b/sysdeps/powerpc/powerpc64/power8/strnlen.S index 07608ff..6d669d4 100644 --- a/sysdeps/powerpc/powerpc64/power8/strnlen.S +++ b/sysdeps/powerpc/powerpc64/power8/strnlen.S @@ -141,15 +141,7 @@ ENTRY_TOCLESS (__strnlen) addi r4,r4,-16 /* Decrement maxlen in 16 bytes. */ bne cr6,L(found_aligning64B) /* If found null bytes. */ - /* Unroll 3x above code block until aligned or find null bytes. */ - andi. r7,r5,63 - beq cr0,L(preloop_64B) - lvx v1,r5,r6 - vcmpequb. v1,v1,v0 - addi r5,r5,16 - addi r4,r4,-16 - bne cr6,L(found_aligning64B) - + /* Unroll 2x above code block until aligned or find null bytes. */ andi. r7,r5,63 beq cr0,L(preloop_64B) lvx v1,r5,r6