From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by sourceware.org (Postfix) with ESMTPS id 8C4B03858016 for ; Wed, 28 Sep 2022 14:22:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8C4B03858016 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-pj1-x1029.google.com with SMTP id x1-20020a17090ab00100b001fda21bbc90so2474480pjq.3 for ; Wed, 28 Sep 2022 07:22: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:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=zZwx9F/4FvzUCMZ3Pw3uXDUuZIuEWkTHbsHgKNPVxXE=; b=myqERp4qVaQyv+lvmEghi6iaC8sxSAa8ld7iGYmb7lMwqJuFnQtJJHa7TDPWIZekWU YpwG2/uyD69Sc2pOn1T5CupSMM+d9tJJ/G0zQa7pMFebeDu3kKry6PEMHkEOYdJF6eYP ZWTeKv8vAgtWQI0nUA/VD5K3UBzNOC0Sm2dAnQrUrEDbuhI+b/C7YzPUBmVaHJa4kQJH pEqyXIjU8c0smX8JP3FW+eqyX/LYciG/yRpx0v2WGx5crshI1zvzDb2q9bwia9OVrd7w peX+YvDNNvVaibg4FNhh7M4jNJWYCRSPu7pJb2erAXE0waZII9p/ag8h8zfg0PzaTOBu 8R2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=zZwx9F/4FvzUCMZ3Pw3uXDUuZIuEWkTHbsHgKNPVxXE=; b=YZlqq/Z+ou+wDCPEzvK3+UWjq40X1FbOoN9RL8eY8LZGcc8LWT+kVPp92pud6oqzu1 GIh/MLLeU5mAzJmGhqzJ3e1DWzd4067UBOQSfdAoxB1Arf7yRpLoTbw00lciuBCH/2Gx awboH8RJhj2x5uCrl7BvmnZ6maCZUemixDuiP6o0lC8XAFqwiG83egmkkuLqmYPJnb+w JziVyGy1Yb6QcjAzxDsEyHg6a8HF+LMEx+eoUyKVEby0N+lHbN2OlbejdToKEpQGqdqK rhbyhsKAwX4JLmfSN4Hy3c09lrX7yBcEIASD6Lm7hDgNmoH6XRW4mLptOZ22rlX499LJ Z+2A== X-Gm-Message-State: ACrzQf3cBErOBS5C56ggNwwoD465PBdj7pC+N6mip5r8Jq1aB0qWa7KO DuKkspYVyt+jRIPtp4BBvslt1Q== X-Google-Smtp-Source: AMsMyM4alrokdPlfLPnO7aFzLODxaxQ/l19t0/4Ghm2PjizvTV5d0egKbUrcmv3heiHHPaY5KXFYSg== X-Received: by 2002:a17:903:44b:b0:17a:d3:e238 with SMTP id iw11-20020a170903044b00b0017a00d3e238mr79792plb.23.1664374956553; Wed, 28 Sep 2022 07:22:36 -0700 (PDT) Received: from ?IPV6:2602:47:d49d:ec01:986f:cb56:6709:4057? ([2602:47:d49d:ec01:986f:cb56:6709:4057]) by smtp.gmail.com with ESMTPSA id bn18-20020a056a02031200b00429b6e6c539sm3496318pgb.61.2022.09.28.07.22.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Sep 2022 07:22:35 -0700 (PDT) Message-ID: <1679af30-ee17-3016-1bd3-192f744ad8ef@linaro.org> Date: Wed, 28 Sep 2022 07:22:33 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH 0/2] LoongArch: Add optimized functions. Content-Language: en-US To: Xi Ruoyao , Adhemerval Zanella Netto , "dengjianbo@loongson.cn" Cc: xuchenghua , "i.swmail" , libc-alpha , joseph , caiyinyu References: <403f78f0-55d9-48cf-c62a-4a0462a76987@loongson.cn> <2022091910031722091613@loongson.cn> <0172d70e-e939-31d4-bcd8-b47f274f97d9@linaro.org> <9cbcd3541c903aaba8038237befee5e3720d144e.camel@xry111.site> <1fec4245-9eb4-108d-722e-ba36a1df0023@linaro.org> <8411c465e01de9608633f8b1fd2d82d3ef16f001.camel@xry111.site> From: Richard Henderson In-Reply-To: <8411c465e01de9608633f8b1fd2d82d3ef16f001.camel@xry111.site> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.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 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 9/26/22 06:49, Xi Ruoyao via Libc-alpha wrote: > Hi Adhemerval and Jianbo, > > I've customized string-fzi.h and string-maskoff.h for LoongArch (see > attachment). With them on top of Adhermerval's v5 "Improve generic > string routines" patch and GCC & Binutils trunk, the benchmark result > seems comparable with the assembly version for strchr, strcmp, and > strchrnul. There is nothing in string-maskoff.h that the compiler should not be able to produce itself from the generic version. Having a brief look, the compiler simply needs to be improved to unify two current AND patterns (which is an existing bug) and add the additional case for bstrins.d. Similarly, there is nothing in string-fzi.h that should not be gotten from longlong.h; your only changes are to use __builtin_clz, which longlong.h exports as count_trailing_zeros. r~