From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x335.google.com (mail-ot1-x335.google.com [IPv6:2607:f8b0:4864:20::335]) by sourceware.org (Postfix) with ESMTPS id 6BE9C3858C54 for ; Fri, 2 Sep 2022 12:27:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6BE9C3858C54 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ot1-x335.google.com with SMTP id d18-20020a9d72d2000000b0063934f06268so1359394otk.0 for ; Fri, 02 Sep 2022 05:27:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date; bh=ZPQJ745ydMDvyMOmwAgMCsxLYjgzamU8OMp3sgCasBc=; b=VbRdC+rFWpOKoP2oHuDCybigImfbFisgfhMLFDwceCH3qBvJ4IB4ohuTkaPkxy94/b rI+wmVg8VhXHhKdnOLSlfFWrD/2hwZNuaxcuIoP1OGVPAKf8t31jcFixiNN2BkursmV/ x4uLiBvspnsX2ZtVVl6aIrpoHnKS/7PqxQjWhAZytQHpxKF6RLXshBio7Ptda/+vnGgV YChZ5bfgbpHePCsCQernRx/AT/ja4lff73zmKSl9nQqXQWEkOv7S1TwlxvfV1Jn4yeVj /qc6tIJ3uxtyf8tR0cb4URKf0uPgpLUyB2R3yuvPWSdMMUvjZNEr+Q3SSnU/YyH2wizX 5Bvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date; bh=ZPQJ745ydMDvyMOmwAgMCsxLYjgzamU8OMp3sgCasBc=; b=PHT0Y5CDC/PFFVIgPDEFqntg1ydxp0G3v8j6s7uM5F3Lwd494rGTs6W/Q07M/rITAD qNP+DqT/YY/2E+Y9XGCRbSs6agpZXXwwxPr5DqDriqeWy7hD7A5lsk7hz3hi0VzqNeeq LiCdFjRCNxEmWy2nvbvs8yFMIGy2L9yHhLMN6pUy9fAsOUmC2AxCrHI1UK5OR3NfDFmU G9LY9rrEgUmK3vy+6Qt+2XcaR7G6OAoROdEB6ITsD7gjE+gONNOCHz7Fvw8JNjEz9Vzs x75Bwt5O0J3e5hJBB4NGPkqmc/FhTq7UtZMzmTVPEP7HyzYkOTND7Q7TAGofUKij4LQ5 JFrg== X-Gm-Message-State: ACgBeo0xEaPtyj5h42rkuMs3ouvH5klsgFPk2/KPaDcIDkEDPfaqUl3C CgIrkSasb6fU/Aq1iDzlji4+ZA== X-Google-Smtp-Source: AA6agR7SgOtTCjUmJIb+UgfaZkncFRxws6TlsbOC4bVyHV9RdmrOm670U9xEwg2aHO9G2bmt/YUhEw== X-Received: by 2002:a05:6830:10b:b0:636:e86d:ffed with SMTP id i11-20020a056830010b00b00636e86dffedmr14396770otp.245.1662121656576; Fri, 02 Sep 2022 05:27:36 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c0:dfed:6168:b02a:5b73:f2ce? ([2804:1b3:a7c0:dfed:6168:b02a:5b73:f2ce]) by smtp.gmail.com with ESMTPSA id b1-20020a4ad881000000b0042313f42b26sm589322oov.39.2022.09.02.05.27.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 02 Sep 2022 05:27:36 -0700 (PDT) Message-ID: Date: Fri, 2 Sep 2022 09:27:33 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH 0/2] LoongArch: Add optimized functions. Content-Language: en-US To: Joseph Myers , Carlos O'Donell Cc: caiyinyu , libc-alpha@sourceware.org, i.swmail@xen0n.name, xuchenghua@loongson.cn References: <20220815085718.4110353-1-caiyinyu@loongson.cn> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham 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 15/08/22 17:46, Joseph Myers wrote: > On Mon, 15 Aug 2022, Carlos O'Donell via Libc-alpha wrote: > >> On 8/15/22 04:57, caiyinyu wrote: >>> Tested on LoongArch machine: gcc 13.0.0, Linux kernel 5.19.0 rc2, >>> binutils branch master 2eb132bdfb9. >> >> Could you please post microbenchmark results for these changes? >> >> How much faster are they from the generic versions? > > Note that so far we haven't merged the improved generic string functions > that were posted a while back > (https://sourceware.org/legacy-ml/libc-alpha/2018-01/msg00318.html is the > version linked from https://sourceware.org/glibc/wiki/NewPorts - don't > know if it's the most recent version). So even if assembly versions are > better than the current generic string functions, they might not be better > than improved generic versions with architecture-specific implementations > of the headers to provide per-architecture tuning. > And it seems that some of this newer implementations does what my patch basically does. The memmove is an improvement since the generic code we have does a internal libcall to memcpy (which some architecture optimizes it by implementing memcpy and memmove on some TU to just do a branch instead of a function call). I will rebase and resend my improved generic string, I think it would yield very similar numbers to the str* assembly implementations proposed.