From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by sourceware.org (Postfix) with ESMTPS id 8F6A73857415 for ; Wed, 28 Sep 2022 19:18:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8F6A73857415 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-pg1-x52b.google.com with SMTP id q9so13059046pgq.8 for ; Wed, 28 Sep 2022 12:18:22 -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=8bjNgyIcfuhdtD7rS5CbYqreHmnHjGYxhlQbjUWyMlo=; b=ReHMxxnbtyn6M1NX2kWNU+rKRe8CEyV83TEcP0W14pCfWOaXVrZSTka/3uN4SghNPd Ka92o87kt4nv779YT0+7YTH8sNYRvzvw/5rZxfExzhm3ZQE8hTeuf99wRxcCY5iJd03Q CJe8pTY/vuEJkepVL2nbKjTx0PMA3/SzCZ6qVv+9FpSrZG3d9PCzORxCFzG0jiUS2xxA i0R/MMLEPl893PbhKpyprQs+uKZpswsFcAn8LBCv+Zyfxj4ZCVjNDWiLDsPbiSAJHEJj cYQID843p1SG8ECKQp1iUnqvvWXjtqWGPXSMKcxNI3XkDE/gWgLtio12cMCuxFxma+lO t/cg== 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=8bjNgyIcfuhdtD7rS5CbYqreHmnHjGYxhlQbjUWyMlo=; b=MLVaY4TWHySzEy5FEAMAXMk/2OVtCijp4StqlIAit6ZUfNqm8Kuxe+cXbAHLczKfoM 0rex2b7LGWrYCFjkQpzjpxncccOMrxVekgACQzf7zUbZgEB9eGNCFSk9Ebbv5FsZBxpx jCS3DkS69wTNZMpU/4mrBId+4+QVkdJA09lG3nAvVCeCsEl+QHArioAamwVrh68u/A/n EuWQOgI2YiuMN+4k0mZ2jTMOD7C+YwDtyofwneCG/zdMSjO0GSO2c4Yn6FYpl6jCXbZU +BMREgL4BHtLJPup5qj2WK1os+xmuacDeYzdo8dqBvHtKaED8bbhK8EQpdxwhWJ/NWoj ksAw== X-Gm-Message-State: ACrzQf1m6pH5FB977HIxHFO1IhZlxnFuvMwIfwpqdhxzdThhy7dpM2kK 50CllUtxIgxPrFyCbZWIPOyDbA== X-Google-Smtp-Source: AMsMyM4U+7Im0390UPRWWpV/ptpmUNhf20N/5xGB+txFci+Ghxuf95+7TwiGc3FwYl5DZOqQCCyi7Q== X-Received: by 2002:a63:e513:0:b0:42b:d733:602d with SMTP id r19-20020a63e513000000b0042bd733602dmr29054051pgh.549.1664392701566; Wed, 28 Sep 2022 12:18:21 -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 s22-20020a170902b19600b0015e8d4eb1f7sm4085222plr.65.2022.09.28.12.18.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Sep 2022 12:18:21 -0700 (PDT) Message-ID: Date: Wed, 28 Sep 2022 12:18:19 -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 , Lulu Cheng 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> <1679af30-ee17-3016-1bd3-192f744ad8ef@linaro.org> <6afb2b9136ff6c96d5b729340427f59e24ebf268.camel@xry111.site> From: Richard Henderson In-Reply-To: <6afb2b9136ff6c96d5b729340427f59e24ebf268.camel@xry111.site> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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/28/22 09:42, Xi Ruoyao wrote: >> 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. > > Added GCC LoongArch port maintainer into Cc:. > > It's actually more complicated. Without the inline assembly in > repeat_bytes(), the compiler does not hoist the 4-instruction 64-bit > immediate load sequence out of a loop for "some reason I don't know > yet". Oh that's interesting. I suspect that adding a REG_EQUAL note for each (or perhaps just the last) insn emitted by loongarch_move_integer would fix that. >> 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. > > No, it does not. By default longlong.h uses a table driven approach for > count_{trailing,leading}_zeros. I can add __loongarch__ (or > __loongarch_lp64) into longlong.h though. That would best, as that header is used many more places. > IIUC I need to submit the change to GCC, then Glibc merges longlong.h from GCC, right? I believe that's correct. r~