Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6720677rwr; Tue, 9 May 2023 20:56:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7p7WowagrZz2bpuE77EFeYTNiF5uNT40XMakHVR9CGM/uO6TnSvmtQM3tDIEG3yvTzusJ3 X-Received: by 2002:a17:902:e852:b0:1a9:433e:41e7 with SMTP id t18-20020a170902e85200b001a9433e41e7mr12102318plg.43.1683690978838; Tue, 09 May 2023 20:56:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683690978; cv=none; d=google.com; s=arc-20160816; b=bMaD65xopiIgmqxRDCAe9Z9Fn7j/D3iQAE107lTan67nY1qrJFjXjF7cUg86UrrDUF vijvuBpOiWRryhF8gvIphgDn7aOrxYXimhBPe66rlUYhbRO2hUctY84TbkYnZJdjGfTT GNhwAjfpDlzrExUNFc4ZVcNfEnJVIcdfHpSIfcLeKcHu4JiGGwB1XT9efu2w55F5PagP dz0eYCn81ZetpUPaWrDw3edMTzZAcCneRXILS+EEbH1U6f2F7w0X0MwtAZfbqzDHCaKp ENhy6Zq+b5QXt/H5Ir60HFUn79pMHMjjMe5ae8h9nIVXdlFIvy6CXlJos5GAsyT/yJ63 tn7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=p9uHmCC4GlxQ1KU1bCyXbYnX5kCC6wGpCXGXt/a9UPs=; b=LBo6pVmygVDigE1eYyrODHaLmSfhx5qB8eUuzGiuynQ08mVvWt0bM23Glf+RyHCrt7 lgIFWjuWs+IfmyXhx4eh6F7wE0ECiEtyTZVyC70W5eJ4GsrAwqAzXS5RCp2YekeHa1XJ QPbbOAUAGSZ9bg5FNNa+fBHDZGVZhSAxOt9XgcB8NAxV6S8jicTOp6Rte+LQTVRbXvvd tVwsdggwBOJHxYt5HnoLaZEQMciCKtMA8dyoUPT2jTO+RX5DFgQXsrNG0lOfg9w9XjYQ 02pL5EkE8HkLMu57oyGUsU+G5kn8zzBRuEWL91Pid9EuVK/G6HYtMsysn2zhJQwdFc2V GpbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=aLE2OGyM; 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=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w1-20020a170902e88100b001a6c524c18asi3386695plg.40.2023.05.09.20.56.05; Tue, 09 May 2023 20:56:18 -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=@163.com header.s=s110527 header.b=aLE2OGyM; 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=NONE sp=NONE dis=NONE) header.from=163.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230316AbjEJDx3 (ORCPT + 99 others); Tue, 9 May 2023 23:53:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235708AbjEJDxV (ORCPT ); Tue, 9 May 2023 23:53:21 -0400 Received: from m12.mail.163.com (m12.mail.163.com [220.181.12.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AB80C40FD for ; Tue, 9 May 2023 20:53:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=p9uHm CC4GlxQ1KU1bCyXbYnX5kCC6wGpCXGXt/a9UPs=; b=aLE2OGyMktksauQZV60GQ 2juJOIJXrU0JD9B222ZqcM6sR9AJIsiwXQdhRxvNNfmViY9XXBkX0uN4/pRMaMCW sYEc17UWX9zcfKiEN+TUnoE9LbYZ5tkM0VtuMayg8y4slJ9Zfi0+2sT7HQ+l6XR2 kLBJQo/m4iAIYAeutBnIkk= Received: from zhangf-virtual-machine.localdomain (unknown [180.111.102.183]) by zwqz-smtp-mta-g3-4 (Coremail) with SMTP id _____wBHlVQOFVtk+zPWBQ--.60792S5; Wed, 10 May 2023 11:52:59 +0800 (CST) From: zhangfei To: ajones@ventanamicro.com Cc: aou@eecs.berkeley.edu, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, palmer@dabbelt.com, paul.walmsley@sifive.com, zhang_fei_0403@163.com, zhangfei@nj.iscas.ac.cn Subject: Re: [PATCH] riscv: Optimize memset Date: Wed, 10 May 2023 11:52:43 +0800 Message-Id: <20230510035243.8586-4-zhang_fei_0403@163.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230510035243.8586-1-zhang_fei_0403@163.com> References: <20230509-b0dc346928ddc8d2b5690f67@orel> <20230510035243.8586-1-zhang_fei_0403@163.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: _____wBHlVQOFVtk+zPWBQ--.60792S5 X-Coremail-Antispam: 1Uf129KBjvdXoW7Jr4fCw18Ww4rtF4DtFW7twb_yoWfCwb_G3 yUJrnYkwn8ArZakFs3Kr45WrWqy34DArW5Wr18Xw12gr9YqrWDZ3yvkr9Yva48G3WI9Fnx CFyYqayUAr1S9jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRiBHqJUUUUU== X-Originating-IP: [180.111.102.183] X-CM-SenderInfo: x2kd0w5bihxsiquqjqqrwthudrp/xtbCfBBrl2DcJd-5swAAsc X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SORTED_RECIPS, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 From: zhangfei On Tue, May 09, 2023 11:16:33AM +0200, Andrew Jones wrote: > On Tue, May 09, 2023 at 10:22:07AM +0800, zhangfei wrote: > > > > Hi, > > > > I filled head and tail with minimal branching. Each conditional ensures that > > all the subsequently used offsets are well-defined and in the dest region. > > I know. You trimmed my comment, so I'll quote myself, here > > """ > After the check of a2 against 6 above we know that offsets 6(t0) > and -7(a3) are safe. Are we trying to avoid too may redundant > stores with these additional checks? > """ > > So, again. Why the additional check against 8 above and, the one you > trimmed, checking 10? Hi, These additional checks are to avoid too many redundant stores. Adding a check for more than 8 bytes is because after the loop segment '3' comes out, the remaining bytes are less than 8 bytes, which also avoids redundant stores. Thanks, Fei Zhang