Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4211773rwl; Mon, 10 Apr 2023 07:46:06 -0700 (PDT) X-Google-Smtp-Source: AKy350agsypMQi0/VHKVNoyQvuAfUHTfXMLgwK4ezyWhzZlNhH0PBoEBXP2yulj7+tbebDxUySdw X-Received: by 2002:a17:907:2447:b0:94a:6f1d:54df with SMTP id yw7-20020a170907244700b0094a6f1d54dfmr4406269ejb.67.1681137965748; Mon, 10 Apr 2023 07:46:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681137965; cv=none; d=google.com; s=arc-20160816; b=Szv7v4zqzP29rlRJjjRrqnFmtliFL4HefoTdtu2Q6Rj1PEkSi6gE7Km+wxXCknqsN0 xFKaRiCZ+e0IHeI9jfvxGRtogmX9LSrz10n6fkyZrCQRMTbATaQl5HEU07yrd+GeeWAC dZ93JNC0I3ik9tXW+JlZEvEK3uaboS0dUYJ9pBAXJuBF2ItuNRwEHNoB1m8Ax5kA7RpA czFJGsa9QsMKk/sstlW/e0qfbkiIgvSaksbIHkAv5CRWlaoxHo2w/D6ZcJ9s+5ApGVKa vvTc23QVUPeXfNJIH733WApbvyfmC/P3Suh/sSHKhK8jwZGNBH7H0Qyi+9huwStBVnDP GFRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=he6UU8yYdaTIql9YV8y79tAkMBS2BT8Bu40h6/N3/Zw=; b=tTtHFIktyE1MalhDq8nzkOJOcY9Kb6Hhi34rzLSpF2rlgGus7AO6bYD+MnbuNXnS35 2DMn13tNVhl4jImSMPl68lICj2BoSgDgv4DhcNkUtCOzsHqto0HbQkvZmrhtQ0I3cptj rD3fnOKBXXvpYP1YMKlAv21USmvt8BzANtFDMm6YN3GVH6ekegmFPV9QSWBorydou3JA kSM/ilkDKeYQiHzuf8MulFaGgNugFLKrZj2gApTkl5edxwjFs7fgrZt0WZo5YV2KVeRi +edZyMfKPPF6vNHLljubAyeZ3bWeK8mnLH6kBqlvrOYzjZ7Han+o3rFKzeOrdh9X0nXU 0BGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b=nKObKDzr; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g11-20020a1709065d0b00b0094a871e4ac0si2313302ejt.507.2023.04.10.07.45.41; Mon, 10 Apr 2023 07:46:05 -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; dkim=pass header.i=@xry111.site header.s=default header.b=nKObKDzr; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229808AbjDJOiN (ORCPT + 99 others); Mon, 10 Apr 2023 10:38:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229748AbjDJOiM (ORCPT ); Mon, 10 Apr 2023 10:38:12 -0400 Received: from xry111.site (xry111.site [89.208.246.23]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDF4A2D70 for ; Mon, 10 Apr 2023 07:38:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1681137491; bh=he6UU8yYdaTIql9YV8y79tAkMBS2BT8Bu40h6/N3/Zw=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=nKObKDzrur0ahiZcC/8m24MvI8iuzzJtZrcsd38bT/ivqJJ9neg4fX3WCmaGx4S1u QQCCuZrDNUi6311xdYDpSeUGN7O8LogRURLzUu+E6s6Cw4miG6knYC6syLYzKNMSey nth0/bKAobvVTNKyF35swi4G3/p9J+wSgaDS95QE= Received: from [IPv6:240e:358:1117:7c00:dc73:854d:832e:5] (unknown [IPv6:240e:358:1117:7c00:dc73:854d:832e:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id D136A65A39; Mon, 10 Apr 2023 10:38:06 -0400 (EDT) Message-ID: Subject: Re: [PATCH] LoongArch: Improve memory ops From: Xi Ruoyao To: Rui Wang Cc: Huacai Chen , WANG Xuerui , loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn Date: Mon, 10 Apr 2023 22:37:56 +0800 In-Reply-To: References: <20230410115734.93365-1-wangrui@loongson.cn> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.0 MIME-Version: 1.0 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 Mon, 2023-04-10 at 22:19 +0800, Rui Wang wrote: > On Mon, Apr 10, 2023 at 8:20=E2=80=AFPM Xi Ruoyao wr= ote: > >=20 > > On Mon, 2023-04-10 at 19:57 +0800, WANG rui wrote: > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* align up address */ > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 andi=C2=A0=C2=A0=C2=A0 t1, a0, = 7 > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 sub.d=C2=A0=C2=A0 a0, a0, t1 > >=20 > > bstrins.d a0, zero, 2, 0 > >=20 > > Likewise for other aligning operations if the temporary is not used. >=20 > I think we're on the same page. I had previously tested this on the > user-space version[1], but it's not a performance-critical area. The point is "if you can reduce one instruction and one register usage with no harm, why not do it?" :) AFAIK bstrins.d should be available on all 64-bit LoongArch CPUs. --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University