[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKv+Gu_TXtSBhTOuucw+6ULEGMkiFS2TBZ7gQ-EJqC7wxC7nrA@mail.gmail.com>
Date: Tue, 26 Feb 2019 21:52:33 +0100
From: Ard Biesheuvel <ard.biesheuvel@...aro.org>
To: Nick Desaulniers <ndesaulniers@...gle.com>
Cc: Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will.deacon@....com>,
Arnd Bergmann <arnd@...db.de>, Mark Brown <broonie@...nel.org>,
Russell King <linux@...linux.org.uk>,
linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
Nathan Chancellor <natechancellor@...il.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] lib/raid6: use vdupq_n_u8 to avoid endianness warnings
On Tue, 26 Feb 2019 at 21:44, Nick Desaulniers <ndesaulniers@...gle.com> wrote:
>
> On Mon, Feb 25, 2019 at 11:19 PM Ard Biesheuvel
> <ard.biesheuvel@...aro.org> wrote:
> >
> > On Tue, 26 Feb 2019 at 05:03, <ndesaulniers@...gle.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@...il.com>
> > > Signed-off-by: Nick Desaulniers <ndesaulniers@...gle.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!
My pleasure.
> 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?
Basically, yes. One example is right there in the NEON recovery code,
guarded by #ifdef CONFIG_ARM.
New intrinsics were also introduced for the crypto instructions,
although I think those were also added to the 32-bit version of
arm_neon.h
> Is there a doc that lists them?
Not that I know of.
> 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?).
Yes, it appears that the 32-bit arm_neon.h header on my box defines
this intrinsic, so this should be fine.
Powered by blists - more mailing lists