From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from xry111.site (xry111.site [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id AA98E3858D1E for ; Fri, 8 Sep 2023 14:22:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AA98E3858D1E Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xry111.site DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1694182946; bh=QZOLa46TAP9Q/SxAySBngAt0Crt578FE+gECFAxtiHk=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=TjgkaNo5Q+OXi67yDHCXmPTbtxMWSHue6/S1CYka+lJ2TOaZE3bpI7aQfjpSdoi/l 65psQpUvSeLbWb7nTF8bDrVhuV4AXkQMRB0G2wVxQFCZFXKwycgrLtuyylmVexXm+1 n3vy4U3qE0pR29VA9WPu7hOomzCZzHV4KQI+IL7c= Received: from localhost.localdomain (xry111.site [IPv6:2001:470:683e::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id D8049659C0; Fri, 8 Sep 2023 10:22:24 -0400 (EDT) Message-ID: <7246aa6f75703fd18f9a22e83d759dae1264797b.camel@xry111.site> Subject: Re: [PATCH 1/4] LoongArch: Add ifunc support for strcpy{aligned, unaligned, lsx, lasx} From: Xi Ruoyao To: dengjianbo , libc-alpha@sourceware.org Cc: adhemerval.zanella@linaro.org, caiyinyu@loongson.cn, xuchenghua@loongson.cn, huangpei@loongson.cn Date: Fri, 08 Sep 2023 22:22:23 +0800 In-Reply-To: <20230908093357.3119822-2-dengjianbo@loongson.cn> References: <20230908093357.3119822-1-dengjianbo@loongson.cn> <20230908093357.3119822-2-dengjianbo@loongson.cn> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 MIME-Version: 1.0 X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,LIKELY_SPAM_FROM,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, 2023-09-08 at 17:33 +0800, dengjianbo wrote: > According to glibc strcpy microbenchmark test results(changed to use > generic_strcpy instead of strlen + memcpy), comparing with generic_strcpy= , > this implementation could reduce the runtime as following: >=20 > Name=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 Percent of rutime reduced > strcpy-aligned=C2=A0=C2=A0=C2=A0 10%-45% > strcpy-unaligned=C2=A0 10%-49%, comparing with the aligned version,unalig= ned > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 version experience better performance in cas= e src and dest > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 cannot be both aligned with 8bytes > strcpy-lsx=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 20%-80% > strcpy-lasx=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 15%-86% Generic strcpy calls stpcpy, so if we've optimized stpcpy maybe it's not necessary to duplicate everything in strcpy. Is there a benchmark result comparing the timing with and without this patch, but both with the second patch (optimized stpcpy)? --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University