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=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 1589 invoked from network); 25 Sep 2023 22:39:26 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 25 Sep 2023 22:39:26 -0000 Received: (qmail 32696 invoked by uid 550); 25 Sep 2023 22:39:19 -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 32661 invoked from network); 25 Sep 2023 22:39:18 -0000 Date: Tue, 26 Sep 2023 00:39:06 +0200 From: Robert Clausecker To: musl@lists.openwall.com Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [musl] SIMD-enhanced libc string functions Greetings, I'm currently working on implementing various libc string functions using SIMD techniques for the FreeBSD libc. This is a project sponsored by the FreeBSD Foundation, the resulting code is available under a 2-clause BSD license. Currently, this encompasses implementations for amd64 in scalar code or using SSE/SSE2 (two functions also make use of SSE4.2). Is there interest in adding such implementations to musl? Would this be permitted by your license policy? If so, I can prepare change sets to add these new implementations to musl once the project has concluded. Functions that have been implemented include: - stpcpy (thence strcpy) - strchrnul (thence index, strchr) - strcspn (using SSE4.2, thence strpbrk) - strspn - strcmp - memchr (thence strnlen) - strlen - memcmp (thence bcmp) - timingsafe_bcmp - timingsafe_memcmp On FreeBSD, I have added an ifunc-based dispatch framework to select the appropriate function for the user's CPU. This anticipates additional implementations using AVX and AVX-512. The implementations are easy to use without the framework though. Please let me know if there is interest. Yours, Robert Clausecker -- () ascii ribbon campaign - for an 8-bit clean world /\ - against html email - against proprietary attachments