From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 27551 invoked from network); 11 Apr 2023 12:48:40 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 11 Apr 2023 12:48:40 -0000 Received: (qmail 20443 invoked by uid 550); 11 Apr 2023 12:48:35 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 20404 invoked from network); 11 Apr 2023 12:48:34 -0000 Date: Tue, 11 Apr 2023 14:48:22 +0200 From: Szabolcs Nagy To: =?utf-8?B?5byg6aOe?= Cc: musl@lists.openwall.com Message-ID: <20230411124822.GK3630668@port70.net> Mail-Followup-To: =?utf-8?B?5byg6aOe?= , musl@lists.openwall.com References: <3e056826.7b26.18707fad3e2.Coremail.zhangfei@nj.iscas.ac.cn> <27cfcd14.778c.18769bf603d.Coremail.zhangfei@nj.iscas.ac.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <27cfcd14.778c.18769bf603d.Coremail.zhangfei@nj.iscas.ac.cn> Subject: Re: Re: [musl] [PATCH]Implementation of strlen function in riscv64 architecture * =E5=BC=A0=E9=A3=9E [2023-04-10 13:59:22 +0800]: > I have made modifications to the assembly implementation of the riscv64 s= trlen function, mainly=20 > focusing on address alignment processing to avoid the problem of data cro= ssing=20 > pages during vector instruction memory access. >=20 > I think the assembly implementation of strlen is necessary. In glibc,=20 if the c definition is not correct then you have to explain why. if it's very slow then please tell us so. > X86_64, aarch64, alpha, and others all have assembly implementations of t= his function,=20 > while for riscv64, it is blank. > I have also analyzed the test sets of Spec2006 and Spec2017, and the strl= en function is also a hot topic. an asm implementation has significant maintenance cost so you should provide some benchmark data or other evidence/reasoning for us to decide if it's worth the cost. it seems you replaced the c strlen code with a slower one except when musl is built for "#ifdef __riscv_vector" isa extension. what cpus does this affect? are linux distros expected to use this as baseline? do different riscv cpus have similar simd performance properties? who will tweak the asm if not? in principle what you did can be done by the compiler auto vectorizer so maybe contributing to the compiler is more useful. note that glibc has cpu specific implementations that it can select at runtime, but musl uses one generic implementation for all cpus.