Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4641224pxb; Tue, 28 Sep 2021 00:05:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxljH3SmxyC0pw5ycRY2l0cfRbg5h+Dl5Bza4utBbbiSdkTIcnPTTzkJM7hdr/DmHV82UWf X-Received: by 2002:a17:906:c1da:: with SMTP id bw26mr5001870ejb.253.1632812732204; Tue, 28 Sep 2021 00:05:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632812732; cv=none; d=google.com; s=arc-20160816; b=Fq9Ve5O2/bAfOu7oxH5WWrAbojWtQAb8qvaDzVeVApIqcoN+JJp/4IsVqd+FPf4gMY E7rA6VpllX5WARzP4upMZoZ2//1jaBnBFzaWOMxEnp1txXfjZykhxhIa35kWpWMHRuM4 Bhn52mmAlkTf64KnmoZmwD7b+1e2dAJrODebWENjtn2ZX//rrThLAwpXVDUFpflW9F+A gERntf31jYuW7p6oOWZJGAP773TXolUG1h5MAPp6LhtX/IuigQaUw0OrRWSXyofAxVFB UXpGL0/p42Hv3KSSuGG3oAqbq70r/B0ktKKQj6EBxcZH/ANQnK7clXbGKrnnN8ADuzsk vbEA== 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=gKnIAqOx2fpSsjafReu8T2u4xETk4bKWTRz3yCNHzjI=; b=Pm9RzP3jj8QVJYo75uD7YY9EG7jv8XqCPAqHall1cHBpte2NVt4c84k8IsuJOq1683 AZMt7X2idmdO8BQD7TRH6XrNqFxOA2XxHWCBFSTQ7FLni38EpoY9lINlOG76OiAeHF4D zIA5tkv8s3fNK9b4gqtuwSQJtzmiYe7mDlkiAAJYtfqkKKYlRgqLpF4/J5QeFmhMs0SS VNtnEAbk+ZIX9UDzdB3LYqB1iPBa3JISQXo7IH3on23GVdduoQbNKgNtsT06UBIVSRSu wBo+JgeuCU9D8BsmItLpVy8iJbfG6ZGyXZ97I5Meq9TuPXiieQdhMyfNT4Jx5KLVsl5U X6UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=E07Nv6MO; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 1si3202871ejb.87.2021.09.28.00.05.08; Tue, 28 Sep 2021 00:05:32 -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=@sifive.com header.s=google header.b=E07Nv6MO; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239161AbhI1HDP (ORCPT + 99 others); Tue, 28 Sep 2021 03:03:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239024AbhI1HDO (ORCPT ); Tue, 28 Sep 2021 03:03:14 -0400 Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E509C061575 for ; Tue, 28 Sep 2021 00:01:35 -0700 (PDT) Received: by mail-qv1-xf31.google.com with SMTP id a9so12870807qvf.0 for ; Tue, 28 Sep 2021 00:01:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=gKnIAqOx2fpSsjafReu8T2u4xETk4bKWTRz3yCNHzjI=; b=E07Nv6MOqKa+ILOhSg9aHDeaee684C+QGVF6V+5A/LJuZ+B/WigEII/4VQ3b8IUseA VAh2lFa6ABC6TrwArGEMXZ95rxiBq10EgdfK7HMZSXDBuaaXYxXP6LYfcsYEXBYBhDmd uHvxnwlSuRN/G+ZBnFeRD6pg4lz5L4XefYV0RMNEbLXTwl507zzlItF/MN+6Nr+t7ZHZ LH6hggV2uhQqhVH6pbHf7SoZuHjUASEwEbTSzkpoSx77Rc1ZvbjY4FliiqWA0wPpINZM FX9s6HmNIPKsGZYFoIblAPQpiAufS95bjSZvb7wJdV+ur0s24XXfeTWlDiFbI4pZ94Vt /QKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=gKnIAqOx2fpSsjafReu8T2u4xETk4bKWTRz3yCNHzjI=; b=AW9vNJhf2moltRisRIevqhMPZ+9ZFvtK4tDUkeAFUiIV4G7NHKgiEa2hgR5ff1sRSu kjaevlR/0rtUUWBVCRPnRwRwh+qGlVziq1aukORlvxVv3IUMXLCMPAbNlKJ92HSrWEuK 4us9LoebmNjTcTAITDkX7VZ/uuTT9dMplwBauxBhoh4dtK0f6altgljgKkNK7JnnW+lN ZeGhs+E1T8g1ZyT2QlIUZPqsox2FI5h6ShBaMwn/AVBWdA+awZ8pSsoO37c+fjYPcDJH TkMoD5UOqrld3ey/26Kl3WIyIEca+nKtMO6LRXb3Xo0fyQOUhKFFGLgFT8HC8PBRIrc0 SoVA== X-Gm-Message-State: AOAM531/SwBOg5bwmG7BMF/8FSkiL2M86V48YJbCUk1IfSqb4waq/iVb +AKiqI+C7wNvM8Ef8Ar+UqIGohzMsgk3+QsBRAt+bA== X-Received: by 2002:ad4:55af:: with SMTP id f15mr4054897qvx.32.1632812494336; Tue, 28 Sep 2021 00:01:34 -0700 (PDT) MIME-Version: 1.0 References: <33c485ee595aff1e19a0e43074da59779f58d105.1631121222.git.greentime.hu@sifive.com> In-Reply-To: From: Greentime Hu Date: Tue, 28 Sep 2021 15:01:22 +0800 Message-ID: Subject: Re: [RFC PATCH v8 15/21] riscv: Add vector extension XOR implementation To: Ley Foon Tan Cc: linux-riscv , Linux Kernel Mailing List , Albert Ou , Palmer Dabbelt , Paul Walmsley , Vincent Chen Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ley Foon Tan =E6=96=BC 2021=E5=B9=B49=E6=9C=8814=E6= =97=A5 =E9=80=B1=E4=BA=8C =E4=B8=8B=E5=8D=884:30=E5=AF=AB=E9=81=93=EF=BC=9A > > On Thu, Sep 9, 2021 at 1:49 AM Greentime Hu wro= te: > > > > This patch adds support for vector optimized XOR it is tested in spike = and > > qemu. > > > > Logs in spike: > > [ 0.008365] xor: measuring software checksum speed > > [ 0.048885] 8regs : 1719.000 MB/sec > > [ 0.089080] 32regs : 1717.000 MB/sec > > [ 0.129275] rvv : 7043.000 MB/sec > > [ 0.129525] xor: using function: rvv (7043.000 MB/sec) > > > > Logs in qemu: > > [ 0.098943] xor: measuring software checksum speed > > [ 0.139391] 8regs : 2911.000 MB/sec > > [ 0.181079] 32regs : 2813.000 MB/sec > > [ 0.224260] rvv : 45.000 MB/sec > > [ 0.225586] xor: using function: 8regs (2911.000 MB/sec) > > > > Co-developed-by: Han-Kuan Chen > > Signed-off-by: Han-Kuan Chen > > Signed-off-by: Greentime Hu > > --- > > arch/riscv/include/asm/xor.h | 74 ++++++++++++++++++++++++++++++++ > > arch/riscv/lib/Makefile | 1 + > > arch/riscv/lib/xor.S | 81 ++++++++++++++++++++++++++++++++++++ > > 3 files changed, 156 insertions(+) > > create mode 100644 arch/riscv/include/asm/xor.h > > create mode 100644 arch/riscv/lib/xor.S > > > > diff --git a/arch/riscv/include/asm/xor.h b/arch/riscv/include/asm/xor.= h > > new file mode 100644 > > index 000000000000..60ee0224913d > > --- /dev/null > > +++ b/arch/riscv/include/asm/xor.h > > @@ -0,0 +1,74 @@ > > > [...] > > > > > +extern bool has_vector; > > +#undef XOR_TRY_TEMPLATES > > +#define XOR_TRY_TEMPLATES \ > > + do { \ > > + xor_speed(&xor_block_8regs); \ > > + xor_speed(&xor_block_32regs); \ > > + if (has_vector) { \ > > + xor_speed(&xor_block_rvv);\ > > + } \ > > + } while (0) > > +#endif > > > bool has_vector is changed to has_vector() function now, should this > change as well? That's right. Thank you, LeyFoon. I'll merge the patch to fix the has_vector() issue in next version patchset= .