linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Nick Desaulniers <ndesaulniers@google.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	Russell King <linux@armlinux.org.uk>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Mark Brown <broonie@kernel.org>,
	Nathan Chancellor <natechancellor@gmail.com>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] lib/raid6: use vdupq_n_u8 to avoid endianness warnings
Date: Tue, 26 Feb 2019 12:44:44 -0800	[thread overview]
Message-ID: <CAKwvOdmzb1WF6NU5LYWGXK_O2cbqwMjbWGAa5xk5x+EMz7A1yw@mail.gmail.com> (raw)
In-Reply-To: <CAKv+Gu-5DvWZL6ogLVNDEvgKe6TENX+5sF1U7QxiyYC8Wx0nXw@mail.gmail.com>

On Mon, Feb 25, 2019 at 11:19 PM Ard Biesheuvel
<ard.biesheuvel@linaro.org> wrote:
>
> On Tue, 26 Feb 2019 at 05:03, <ndesaulniers@google.com> wrote:
> >
> > Clang warns: vector initializers are not compatible with NEON intrinsics
> > in big endian mode [-Wnonportable-vector-initialization]
> >
> > While this is usually the case, it's not an issue for this case since
> > we're initializing the uint8x16_t (16x uint8_t's) with the same value.
> >
> > Instead, use vdupq_n_u8 which both compilers lower into a single movi
> > instruction: https://godbolt.org/z/vBrgzt
> >
> > This avoids the static storage for a constant value.
> >
> > Link: https://github.com/ClangBuiltLinux/linux/issues/214
> > Suggested-by: Nathan Chancellor <natechancellor@gmail.com>
> > Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
>
> Much better, thanks,
>
> Did you double check that the intrinsic exists on 32-bit ARM as well?
> I assume it does, but please make sure if you haven't yet.

Thanks for the review!
Looking through Clang's generated arm_neon.h, vdupq_n_u8 seems to have
2 definitions predicated on __LITTLE_ENDIAN__ (not __arch64__ or
__ARM_ARCH >= 8 like some of the other types and functions).

So NEON got some additions in v8?  Is there a doc that lists them?
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0491g/BABDBBJB.html
is where I found vdupq_n_u8, but it doesn't seem to mention
compatibility (so I assume it's been around since the introduction of
NEON?).
-- 
Thanks,
~Nick Desaulniers

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-02-26 20:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-26  4:03 [PATCH] lib/raid6: use vdupq_n_u8 to avoid endianness warnings ndesaulniers
2019-02-26  7:19 ` Ard Biesheuvel
2019-02-26 20:44   ` Nick Desaulniers [this message]
2019-02-26 20:52     ` Ard Biesheuvel
2019-02-28 18:00     ` Robin Murphy
2019-02-28 18:51       ` Nick Desaulniers
2019-02-28 17:47 ` Catalin Marinas

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=CAKwvOdmzb1WF6NU5LYWGXK_O2cbqwMjbWGAa5xk5x+EMz7A1yw@mail.gmail.com \
    --to=ndesaulniers@google.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=natechancellor@gmail.com \
    --cc=will.deacon@arm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).