From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_HI,RDNS_DYNAMIC,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 6F8551F4B4 for ; Tue, 20 Apr 2021 21:42:17 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 383D5384BC21; Tue, 20 Apr 2021 21:42:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 383D5384BC21 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1618954936; bh=fMeKfrtP+gqyibI2LoeCbO6LA1Ql69GVX5oqLgqmTRU=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=mdcemvOj5iwk32QPIXbwswDHPFCiJJZIM4GiSv1Lu8M3dSyMCqg3HvYIpKE1KKaE8 RXJw8vNAlgv1LG3ZyYH5JDNgO0JC/XCvbhJVNEpBxkzoOYzMjw9BMi6C7zWFh42xDF /lAyyayhHEl5RgkB7kUTzC9LCOd4XTH59S8qq8cs= Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 8BAE43858020 for ; Tue, 20 Apr 2021 21:42:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8BAE43858020 Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 13KLYjaJ066283 for ; Tue, 20 Apr 2021 17:42:03 -0400 Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0a-001b2d01.pphosted.com with ESMTP id 3826pbgmn1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 20 Apr 2021 17:42:03 -0400 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.0.43/8.16.0.43) with SMTP id 13KLfTXl030988 for ; Tue, 20 Apr 2021 21:42:02 GMT Received: from b03cxnp07027.gho.boulder.ibm.com (b03cxnp07027.gho.boulder.ibm.com [9.17.130.14]) by ppma03dal.us.ibm.com with ESMTP id 37yqaachcw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 20 Apr 2021 21:42:02 +0000 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp07027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 13KLg1iA18809200 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 20 Apr 2021 21:42:01 GMT Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5240E6A04D; Tue, 20 Apr 2021 21:42:01 +0000 (GMT) Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 054BE6A051; Tue, 20 Apr 2021 21:42:00 +0000 (GMT) Received: from [9.85.202.211] (unknown [9.85.202.211]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP; Tue, 20 Apr 2021 21:42:00 +0000 (GMT) Subject: Re: [PATCH] powerpc: Add optimized strlen for POWER10 To: Matheus Castanho , libc-alpha@sourceware.org References: <20210416212440.75292-1-msc@linux.ibm.com> Message-ID: Date: Tue, 20 Apr 2021 16:42:00 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 In-Reply-To: <20210416212440.75292-1-msc@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US X-TM-AS-GCONF: 00 X-Proofpoint-GUID: vHe1Nf9CsOiAK9c-8WqGxeeoUsGP9ZeY X-Proofpoint-ORIG-GUID: vHe1Nf9CsOiAK9c-8WqGxeeoUsGP9ZeY Content-Transfer-Encoding: 7bit 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-20_11:2021-04-20, 2021-04-20 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 spamscore=0 bulkscore=0 suspectscore=0 adultscore=0 phishscore=0 mlxscore=0 malwarescore=0 priorityscore=1501 impostorscore=0 clxscore=1015 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104200150 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: , From: Paul E Murphy via Libc-alpha Reply-To: Paul E Murphy Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" 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.