All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Desaulniers <ndesaulniers@google.com>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au,
	Nathan Chancellor <nathan@kernel.org>
Subject: Re: [PATCH v2 1/2] lib/xor: make xor prototypes more friendely to compiler vectorization
Date: Mon, 31 Jan 2022 10:13:02 -0800	[thread overview]
Message-ID: <CAKwvOdmW6cxMT_X9T+O98x55MY_b0zCaJWArU4OfTay6Ceyovg@mail.gmail.com> (raw)
In-Reply-To: <20220129224529.76887-2-ardb@kernel.org>

On Sat, Jan 29, 2022 at 2:45 PM Ard Biesheuvel <ardb@kernel.org> wrote:
>
> Modern compilers are perfectly capable of extracting parallelism from
> the XOR routines, provided that the prototypes reflect the nature of the
> input accurately, in particular, the fact that the input vectors are
> expected not to overlap. This is not documented explicitly, but is
> implied by the interchangeability of the various C routines, some of
> which use temporary variables while others don't: this means that these
> routines only behave identically for non-overlapping inputs.
>
> So let's decorate these input vectors with the __restrict modifier,
> which informs the compiler that there is no overlap. While at it, make
> the input-only vectors pointer-to-const as well.
>
> Tested-by: Nathan Chancellor <nathan@kernel.org>
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

Thanks for the patch!
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

I like how you renamed the parameters in
arch/powerpc/include/asm/xor_altivec.h, arch/powerpc/lib/xor_vmx.h,
and arch/powerpc/lib/xor_vmx_glue.c.  It's not befitting for the
suffix _in to be used when the first param is technically more of an
"inout" param.  Though, you might also want to update the parameter
names in arch/powerpc/lib/xor_vmx.c.
-- 
Thanks,
~Nick Desaulniers

  reply	other threads:[~2022-01-31 18:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-29 22:45 [PATCH v2 0/2] xor: enable auto-vectorization in Clang Ard Biesheuvel
2022-01-29 22:45 ` [PATCH v2 1/2] lib/xor: make xor prototypes more friendely to compiler vectorization Ard Biesheuvel
2022-01-31 18:13   ` Nick Desaulniers [this message]
2022-01-31 18:17     ` Nick Desaulniers
2022-02-05  4:33   ` Herbert Xu
2022-02-05  7:56     ` Ard Biesheuvel
2022-01-29 22:45 ` [PATCH v2 2/2] crypto: arm/xor - make vectorized C code Clang-friendly Ard Biesheuvel
2022-01-31 18:16   ` Nick Desaulniers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKwvOdmW6cxMT_X9T+O98x55MY_b0zCaJWArU4OfTay6Ceyovg@mail.gmail.com \
    --to=ndesaulniers@google.com \
    --cc=ardb@kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=nathan@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.