From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=1.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 Authentication-Results: gnuweeb.org; dmarc=none (p=none dis=none) header.from=1wt.eu Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=163.172.96.212; helo=1wt.eu; envelope-from=w@1wt.eu; receiver= Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by gnuweeb.org (Postfix) with ESMTP id C30F324B407 for ; Mon, 4 Sep 2023 04:19:54 +0700 (WIB) Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 383LJga1031746; Sun, 3 Sep 2023 23:19:42 +0200 Date: Sun, 3 Sep 2023 23:19:42 +0200 From: Willy Tarreau To: David Laight Cc: "'Ammar Faizi'" , Thomas =?iso-8859-1?Q?Wei=DFschuh?= , Nicholas Rosenberg , Alviro Iskandar Setiawan , Michael William Jonathan , GNU/Weeb Mailing List , Linux Kernel Mailing List Subject: Re: [RFC PATCH v3 0/4] nolibc x86-64 string functions Message-ID: <20230903211942.GA31739@1wt.eu> References: <20230902133505.2176434-1-ammarfaizi2@gnuweeb.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: On Sun, Sep 03, 2023 at 08:38:22PM +0000, David Laight wrote: > From: Ammar Faizi > > Sent: 02 September 2023 14:35 > > > > This is an RFC patchset v3 for nolibc x86-64 string functions. > > > > There are 4 patches in this series: > > > > ## Patch 1-2: Use `rep movsb`, `rep stosb` for: > > - memcpy() and memmove() > > - memset() > > respectively. They can simplify the generated ASM code. > > It is worth pointing out that while the code size for 'rep xxxb' > is smaller, the performance is terrible. > The only time it is ever good is for the optimised forwards > copies on cpu that support it. > > reverse, stos and scas are always horrid. It's terrible compared to other approaches but not *that* bad. Also we absolutely don't care about performance here, rather about correctness and compact size. Regards, Willy