From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from albireo.enyo.de (albireo.enyo.de [37.24.231.21]) by sourceware.org (Postfix) with ESMTPS id 333C83858409 for ; Fri, 31 Dec 2021 21:02:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 333C83858409 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=deneb.enyo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=deneb.enyo.de Received: from [172.17.203.2] (port=41331 helo=deneb.enyo.de) by albireo.enyo.de ([172.17.140.2]) with esmtps (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) id 1n3P30-000MZH-5I; Fri, 31 Dec 2021 21:02:46 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.94.2) (envelope-from ) id 1n3P2z-000EVV-RB; Fri, 31 Dec 2021 22:02:45 +0100 From: Florian Weimer To: "H.J. Lu" Cc: "H.J. Lu via Libc-alpha" , Noah Goldstein , GCC Development , Arjan van de Ven Subject: Re: [PATCH] x86-64: Optimize memset for zeroing References: <20211231182010.107040-1-hjl.tools@gmail.com> <87h7aofqtx.fsf@mid.deneb.enyo.de> Date: Fri, 31 Dec 2021 22:02:45 +0100 In-Reply-To: (H. J. Lu's message of "Fri, 31 Dec 2021 12:52:52 -0800") Message-ID: <878rw0fpxm.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=unavailable autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Dec 2021 21:02:50 -0000 * H. J. Lu: > On Fri, Dec 31, 2021 at 12:43 PM Florian Weimer wrote: >> >> * H. J. Lu via Libc-alpha: >> >> > bzero is an alias of SSE2 memset in glibc. Should we add __memsetzero >> > like __memcmpeq? It should be almost free in glibc. GCC can use >> > __memsetzero if it is available. >> >> bzero does not have the interface ambiguity that bcmp has. So the >> only reason for not using it would be namespace cleanliness. > > bzero isn't a standard C function and it isn't optimized like memset > in glibc. GCC already uses non-standard functions whose names are not implementation-defined for optimization purposes if a suitable prototype is available. stpcpy is an example, for: strcpy (a, b); return a + strlen (a);