Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4314834pxj; Mon, 21 Jun 2021 19:41:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXnqb8D7GKhOXALURqdD/faV9fS8pVoCLOTLXbvnatlUZUTxyGWtysjg3tBsERxIEkU20f X-Received: by 2002:a17:906:af0f:: with SMTP id lx15mr1379372ejb.324.1624329688552; Mon, 21 Jun 2021 19:41:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624329688; cv=none; d=google.com; s=arc-20160816; b=c+dgjJGCaLIPYD52LXN7DphFM/ozmhvHKaDKsWKXA0puJfNOio80BIpRPjukTY9Evh D0pX7ShCggOwuF5HGq9/WvHc/cbPiRqkU1sPME2+yA0hw6M+AhZG/+F9kwDck/dX4CKT l4A3b4e3Z+bOHM1FIlTRmppfJiuyRc5HDtmQJa6f3Cvjyf/PvlsJhgvrRT5sj/YVdLWK 2xAdUrnRqxr8igQhPIow5Qz86mT61APQ80Liw6Cpuqw0LmNv6267rr5p6ONSeQneEE8Z uGoJ1roNSUQlAip1EkqfkQ1QJcpJNh7ptcspubuzSsagk/Pz3jzBTkf7OcS5YZnHdTFZ wYCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=5kf0xaAD8wEWnNmPDX+5RNxnyxXPsxVMT9o9aiq6skU=; b=Psovnj1td79lfjlPI0y0Asn+cn5FI9W2VWJxvotx2cfQKyZHNj2WI6NL8DMTDgs/Hg hYdCeryYc8uxyV1WIUCBMYXhg5hiPLNwaUaXickhdv/I01PTBaWdhgYA4N1P2jN9Q6Qa oPlfiY9Z7eUzh8YRB4yGjVs2yOkiQwxPiTxR+FZDtRufmlgXbZZEshuna9TAaiCspWDK lckje8fY8hIhes/lYqMS49A88ojXWQXQ/OwuHvBIGSMOxJWT/JiFQQ9XAlUe2aHjKEjs w+Egqb3x51H8yQxYkeB32aoDRv8BNELfWPTwQ6eVkz3E113z5HS0f4RbkQnfnriRqpCA m2Ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Lqghe0x9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e5si5494243ejm.62.2021.06.21.19.41.04; Mon, 21 Jun 2021 19:41:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Lqghe0x9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231566AbhFVCmR (ORCPT + 99 others); Mon, 21 Jun 2021 22:42:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:43668 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231196AbhFVCmQ (ORCPT ); Mon, 21 Jun 2021 22:42:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 75D256120D; Tue, 22 Jun 2021 02:40:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624329601; bh=5kf0xaAD8wEWnNmPDX+5RNxnyxXPsxVMT9o9aiq6skU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Lqghe0x9BT/w83E/LU5mo8iJbvWbgZSuit/45gevMKYaIXtSWZ/1z705+A6bQhEat xkRQR7HUE+7CN9KvPBB5ZRcLu0WKesOuEzP6rMYjiOhi75FPbsEr8ifB01W3Kl3ds8 IoWvtCJWa53gIyaKDG2O/khrACMUdSdqKUkpO8hs9jyWLONtQOthac+izHLq9/xv06 bbmYkvKYulcBjof7L3wsOP5jGrKXxxZcan7gtoQhE1tiKFN30BOXeJ4Ab/Rc4NE203 Q12rNELllrKm2QvYbMREzw9b9dMPFLhN7TMRnnVKjukGiTC00VfjY/4QO7IrPsLBof aVLTH9f3CoqLQ== Received: by mail-lj1-f173.google.com with SMTP id a16so6435183ljq.3; Mon, 21 Jun 2021 19:40:01 -0700 (PDT) X-Gm-Message-State: AOAM533ZjHLPI+LWRhpMavZy3NgYfvLU9yHGFnq9NpzQVjM8AiFEZcDf kcV+3iJWmm89+SL9CUW8fzGYVFOL/NqXBgI9EmU= X-Received: by 2002:a05:651c:211d:: with SMTP id a29mr1068278ljq.115.1624329599798; Mon, 21 Jun 2021 19:39:59 -0700 (PDT) MIME-Version: 1.0 References: <20210617152754.17960-1-mcroce@linux.microsoft.com> In-Reply-To: From: Guo Ren Date: Tue, 22 Jun 2021 10:39:48 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 0/3] riscv: optimized mem* functions To: Nick Kossifidis Cc: Matteo Croce , linux-riscv , Linux Kernel Mailing List , linux-arch , Paul Walmsley , Palmer Dabbelt , Albert Ou , Atish Patra , Emil Renner Berthing , Akira Tsukamoto , Drew Fustini , Bin Meng , David Laight Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 22, 2021 at 9:09 AM Nick Kossifidis wrote: > > Hello Matteo, > > =CE=A3=CF=84=CE=B9=CF=82 2021-06-17 18:27, Matteo Croce =CE=AD=CE=B3=CF= =81=CE=B1=CF=88=CE=B5: > > From: Matteo Croce > > > > Replace the assembly mem{cpy,move,set} with C equivalent. > > > > Try to access RAM with the largest bit width possible, but without > > doing unaligned accesses. > > > > Tested on a BeagleV Starlight with a SiFive U74 core, where the > > improvement is noticeable. > > > > There are already generic C implementations for memcpy/memmove/memset at > https://elixir.bootlin.com/linux/v5.13-rc7/source/lib/string.c#L871 but > are doing one byte at a time, I suggest you update them to do > word-by-word copy instead of introducing yet another memcpy/memmove C > implementation on arch/riscv/. Yes, I've tried to copy the Glibc version into arch/csky/abiv1, and Arnd suggested putting them into generic. ref: https://lore.kernel.org/linux-arch/20190629053641.3iBfk9-I_D29cDp9yJnI= dIg7oMtHNZlDmhLQPTumhEc@z/#t > > > -- Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/