Re: [PATCH] lib/raid6: use vdupq_n_u8 to avoid endianness warnings

From: Catalin Marinas
Date: Thu Feb 28 2019 - 12:47:35 EST


On Mon, Feb 25, 2019 at 08:03:42PM -0800, ndesaulniers@xxxxxxxxxx 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@xxxxxxxxx>
> Signed-off-by: Nick Desaulniers <ndesaulniers@xxxxxxxxxx>
> ---
> lib/raid6/neon.uc | 5 ++---
> lib/raid6/recov_neon_inner.c | 7 ++-----
> 2 files changed, 4 insertions(+), 8 deletions(-)

Queued for 5.1. Thanks.

--
Catalin