Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp1158449rdb; Mon, 4 Sep 2023 05:06:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFplEFIkRVdmUuSiIQX/6fMqZMgvbap+Zsd24lyQ8KKluNJ+XSmhDo0rFFpzTMlOewoAZZ1 X-Received: by 2002:aa7:c602:0:b0:525:6cc7:8092 with SMTP id h2-20020aa7c602000000b005256cc78092mr7217172edq.13.1693829191925; Mon, 04 Sep 2023 05:06:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693829191; cv=none; d=google.com; s=arc-20160816; b=eHLEvkPo/w77Lt09W8HlhUkyuPTX0uGHj+Q4aDuZIs/+OQTkOnUqgVOhuCAfKSyNin Wflo4wmMccH4IOAk04Hnn+Lk0uk3AGxtP5bKH72yfHt98gQd+adGrHYXkjSPlUtpZM5d fiy9vVCXojiD3q0wepSzYwqjDOZtKFGhsOLVHZouWOPyAOHpetXkKTul4LVB1XMHitP2 m6G5Q61cLMSQWSfr0UETX8Bwc/s6cgarpRDtKyR+AuRl8TPv29EhLcZb7jk2bAqzvmYl JihsdgiXLvX0CtnY3nnoffailAne86D1s/pQiRWmcg98oJ8w9acTThM0qnvgFQ9R+gJI akPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=sgyt50QKxjqYJw6ky5dK83h4xjnxdafgs4ErCvlaHC0=; fh=WCB/ESb4MKd6m2sbQBrr31a4bQ4VFBWtFQTnZOiBgjc=; b=y71irHCC71kGP1ZcpoYYSauYHCw3dPmDSB2/Qmbc+huqJPMdE0ZUYC6MZPusBF7wvD RRrpMQg9r4S39rgPU1zLsi4Xyn1DiFhmGYFQ7e6m1UXT1dS9SHC+RUJx69e7Va+mJ53f amzphlDwD68Eqvf2KlKkIubF7K5pE7gYgpebuab4Tpxp9+HL4+MdD1Zwgqi6syEBQWTF 8/frSJCgN+Dlz1OCfGSA3B9mtNK7Iwk2AlM9stjcbL6oWM6ksJAyQLVjohJTqpjQRYyN /RTihmuJMWZiMykE1VFUEZQ3rhuxdjD19KkuhYTnObPVFEPwtmuPhg3b7mfn5dn2e6nv eDYw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r18-20020aa7cfd2000000b00525590a3d71si6016082edy.266.2023.09.04.05.06.02; Mon, 04 Sep 2023 05:06:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348437AbjICVUJ (ORCPT + 99 others); Sun, 3 Sep 2023 17:20:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229495AbjICVUJ (ORCPT ); Sun, 3 Sep 2023 17:20:09 -0400 Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4878AAD for ; Sun, 3 Sep 2023 14:20:04 -0700 (PDT) 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) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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