From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 41889398B17F for ; Thu, 22 Apr 2021 12:31:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 41889398B17F Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 13MC5HLa103447 for ; Thu, 22 Apr 2021 08:31:02 -0400 Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com with ESMTP id 3835faq8y3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 22 Apr 2021 08:31:02 -0400 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.0.43/8.16.0.43) with SMTP id 13MCQqHp025687 for ; Thu, 22 Apr 2021 12:31:01 GMT Received: from b03cxnp07027.gho.boulder.ibm.com (b03cxnp07027.gho.boulder.ibm.com [9.17.130.14]) by ppma02dal.us.ibm.com with ESMTP id 37yqaav9nc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 22 Apr 2021 12:31:01 +0000 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp07027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 13MCUxEV32637314 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Apr 2021 12:30:59 GMT Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 72476BE054; Thu, 22 Apr 2021 12:30:59 +0000 (GMT) Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6B014BE058; Thu, 22 Apr 2021 12:30:58 +0000 (GMT) Received: from TP480.linux.ibm.com (unknown [9.65.241.178]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTPS; Thu, 22 Apr 2021 12:30:58 +0000 (GMT) References: <20210416212440.75292-1-msc@linux.ibm.com> User-agent: mu4e 1.4.10; emacs 27.2 From: Matheus Castanho To: Paul E Murphy Cc: libc-alpha@sourceware.org Subject: Re: [PATCH] powerpc: Add optimized strlen for POWER10 In-reply-to: Date: Thu, 22 Apr 2021 09:30:56 -0300 Message-ID: <87eef21oxr.fsf@linux.ibm.com> Content-Type: text/plain X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: baTAvuf0sXXEAs2Vx02CCP4FxsYN9P3H X-Proofpoint-GUID: baTAvuf0sXXEAs2Vx02CCP4FxsYN9P3H X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-04-22_04:2021-04-21, 2021-04-22 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 spamscore=0 suspectscore=0 mlxlogscore=999 clxscore=1015 bulkscore=0 phishscore=0 adultscore=0 malwarescore=0 lowpriorityscore=0 impostorscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104220102 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 12:31:04 -0000 Paul E Murphy writes: > On 4/16/21 4:24 PM, Matheus Castanho via Libc-alpha wrote: > >> diff --git a/sysdeps/powerpc/powerpc64/le/power10/strlen.S b/sysdeps/powerpc/powerpc64/le/power10/strlen.S >> new file mode 100644 >> index 0000000000..5218a2277c >> --- /dev/null >> +++ b/sysdeps/powerpc/powerpc64/le/power10/strlen.S >> @@ -0,0 +1,219 @@ >> +/* Optimized strlen implementation for POWER10 LE. >> + Copyright (C) 2021 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 >> + >> +#ifndef STRLEN >> +# define STRLEN __strlen >> +# define DEFINE_STRLEN_HIDDEN_DEF 1 >> +#endif >> + >> +#define VEXTRACTBM(rt,vrb) \ >> + .long(((4)<<(32-6)) \ >> + | ((rt)<<(32-11)) \ >> + | ((8)<<(32-16)) \ >> + | ((vrb)<<(32-21)) \ >> + | 1602) >> + >> +#define LXVP(xtp,dq,ra) \ >> + .long(((6)<<(32-6)) \ >> + | ((((xtp)-32)>>1)<<(32-10)) \ >> + | ((1)<<(32-11)) \ >> + | ((ra)<<(32-16)) \ >> + | dq) > > Can you add a comment to these noting the minimum version of binutils > which supports these instructions? > >> + >> +#define CHECK16(reg,offset,addr,label) \ >> + lxv reg+32,offset(addr); \ >> + vcmpequb. reg,reg,v18; \ >> + bne cr6,L(label); > > Maybe rename reg to vreg for clarity? > > With the trivial comments above addressed, I think this patch is OK. Thanks for the review. Just posted v2 [1] with the suggested fixes. [1] https://sourceware.org/pipermail/libc-alpha/2021-April/125307.html -- Matheus Castanho