From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50C56C43381 for ; Thu, 28 Feb 2019 18:51:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 25213218B0 for ; Thu, 28 Feb 2019 18:51:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="jgmmlbRY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732388AbfB1Sv3 (ORCPT ); Thu, 28 Feb 2019 13:51:29 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:35134 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726810AbfB1Sv3 (ORCPT ); Thu, 28 Feb 2019 13:51:29 -0500 Received: by mail-pl1-f196.google.com with SMTP id p19so10178730plo.2 for ; Thu, 28 Feb 2019 10:51:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=V3WCfld6VGlFUzrYb6K+01b/si8ybvGNt+u8JPbK3d0=; b=jgmmlbRYnFGZKW4/fw45YyX0glSTiz7z1ONodAoiHBLvEUq+iPMZHW6njHTlfVGXMD bLxzw9sgHFRW3cjasNFcCeSodhduFBtrovkM0QjTmr+8qJ1jYrZZMEiwCyv5dfYq2TvG 5ideK6lwsKlX3IVSf/Rd2xjDvvH2iJLbe0DpViLR6x7E5PoR2KPsmZ5ILvQcmBhZoKru DBHmoEgeGvodBM6pE7j8Szj08X8Cfa3e2jzBy0WIb0mgbKv0/JNMQB+BCJ8s+EwDeHSv LHREjjYXotYdDpuWiF2GmwyqVM0Nrut/1fSSbENGEvBC04OBaDuxoGSNDvVCBJYEe7Ny Y9AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=V3WCfld6VGlFUzrYb6K+01b/si8ybvGNt+u8JPbK3d0=; b=OXAmyIurWpIOJ3wkLZc7MKGoJSraBbYTjpf5SJOdyMDUCzzgY5oHvfJGEAJSTR1Wou L8Z2JakbsyKHKisva1HHoa2Z+L5oPi976Kknq1cxO+F0Dv8Z1XOnmkHUElNk5Sg3Od3R lazoGcw8kXQAzPeflDpieHJ4J6TtQjeGECS+LJqgQAThR0VQC1EddG1QY7/qo/XGoJe3 PDKDhDig+VC+Rp2W74lDqNj3M0Fa4YCBkeAM1D/9+8wN+odOpU5o9VSnVj3isjFKBbr+ CgZcFZXqqljciWTL8H2YKubBUyZrBC+Tzwd47pP6MXTrk23FeLvwyiUp5oTPkniCAeCf 0Whg== X-Gm-Message-State: APjAAAUzmYI3PufF8gcZM2dpDiuxBAtXYzSK69Z0e9a6iTQNfpmPXHcA U3T4NuPKlp4Q1WQqkYUMICZSopxlZaqv3YmGmrXlXg== X-Google-Smtp-Source: APXvYqz6bcusX1/60rvdZpekr2aq1ji5EftAaMrW4Wk10ZkqN4DBKzwb/69C7gDI9xqjP4WcWbDmEf7gB6NXE5S1H8g= X-Received: by 2002:a17:902:e85:: with SMTP id 5mr866072plx.13.1551379888235; Thu, 28 Feb 2019 10:51:28 -0800 (PST) MIME-Version: 1.0 References: <20190226040345.202047-1-ndesaulniers@google.com> In-Reply-To: From: Nick Desaulniers Date: Thu, 28 Feb 2019 10:51:17 -0800 Message-ID: Subject: Re: [PATCH] lib/raid6: use vdupq_n_u8 to avoid endianness warnings To: Robin Murphy Cc: Ard Biesheuvel , Arnd Bergmann , Catalin Marinas , Will Deacon , Russell King , Linux Kernel Mailing List , Mark Brown , Nathan Chancellor , linux-arm-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 28, 2019 at 10:00 AM Robin Murphy wrote: > > On 26/02/2019 20:44, Nick Desaulniers wrote: > > On Mon, Feb 25, 2019 at 11:19 PM Ard Biesheuvel > > wrote: > >> > >> On Tue, 26 Feb 2019 at 05:03, 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 > >>> Signed-off-by: Nick Desaulniers > >> > >> 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?). > > FWIW the most recent 'proper' spec document I know of is this one: > > http://infocenter.arm.com/help/topic/com.arm.doc.ihi0073b/index.html Bookmarked, thanks! Ard, page 171 mentions armv7, armv8 for supported architectures for vdupq_n_u8. > > > Apparently we have a more interactive playground on the new site, too: > > https://developer.arm.com/technologies/neon/intrinsics Also bookmarked! I'm also super happy to see this; I'm familiar with Intel's equivalent: https://software.intel.com/sites/landingpage/IntrinsicsGuide/ Interactive sites like these are quite useful. Reading a post recently: https://www.sigarch.org/simd-instructions-considered-harmful/ "The IA-32 instruction set has grown from 80 to around 1400 instructions since 1978, largely fueled by SIMD." reminded me how useful and almost necessary the interactive sites are for navigating the large swathes of SIMD extensions. (no comment on the title of that article) -- Thanks, ~Nick Desaulniers From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 334A8C43381 for ; Thu, 28 Feb 2019 18:51:39 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0A9C6218B0 for ; Thu, 28 Feb 2019 18:51:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="KkbSHgia"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="jgmmlbRY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0A9C6218B0 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MNs/126HuWdG8U9nPN/FB4frMPX1sIGQZ9dJx1CYcts=; b=KkbSHgian9x8l6 jtSmBVZpDdK3KeWHTDYI4osxCH2APkLM83XoSZ4tLM97Yl8LMOVcEX/yIfUpfq5nUwqHxOA8yGvLG BAJTu0+YZqImjpw1LQwKYz8p7JoBSeUqW0IZLcxqS94L1dWux5Eq0GOwpRziZl0TBbSbKtCz9IeMY dn+/fZIgt6UtI9IPDmxe0rBdYlAkUMiFUJGc/XaDup2Kkw3A+Bm4p+3/YJ3fa8adaBTbI4wX3c0zT A1Kl7+g6E7yKssaxxxQ7ZcsRRIkGjnDsTgI0dqVxTotIbwROC4rxjf0OYx2W6Ze3k+JCtGr/4xm+b lF6mx4AwmtEcZuKXLreQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzQmN-0001yz-M1; Thu, 28 Feb 2019 18:51:35 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzQmJ-0001xg-Jy for linux-arm-kernel@lists.infradead.org; Thu, 28 Feb 2019 18:51:33 +0000 Received: by mail-pl1-x643.google.com with SMTP id q3so10175253pll.4 for ; Thu, 28 Feb 2019 10:51:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=V3WCfld6VGlFUzrYb6K+01b/si8ybvGNt+u8JPbK3d0=; b=jgmmlbRYnFGZKW4/fw45YyX0glSTiz7z1ONodAoiHBLvEUq+iPMZHW6njHTlfVGXMD bLxzw9sgHFRW3cjasNFcCeSodhduFBtrovkM0QjTmr+8qJ1jYrZZMEiwCyv5dfYq2TvG 5ideK6lwsKlX3IVSf/Rd2xjDvvH2iJLbe0DpViLR6x7E5PoR2KPsmZ5ILvQcmBhZoKru DBHmoEgeGvodBM6pE7j8Szj08X8Cfa3e2jzBy0WIb0mgbKv0/JNMQB+BCJ8s+EwDeHSv LHREjjYXotYdDpuWiF2GmwyqVM0Nrut/1fSSbENGEvBC04OBaDuxoGSNDvVCBJYEe7Ny Y9AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=V3WCfld6VGlFUzrYb6K+01b/si8ybvGNt+u8JPbK3d0=; b=cmZ1bb6FxHYu0KyN1HX4DdaKZeaARwmjflftsjLa/dqEmhNLR+b7jNqUoU3c1KHdLY ltDAFA+x70ZQSNobHFaGXl2giR8NPVLr7Fv59LWDh8KuedZoiLNsPwP6wZjwPuCTE093 qHLS7G/PfNqd8k/03lyGJHVY/u5pPGpT9MyxVgcCwPWpajEPskYyrK1kZREj4PnrItzv 9aLJ0sWP1eEnk5fPHBpwr6Z82hxbgumff5sHHTW/FLXsqAnIMwgpaiLr7UoLilFrzhwf cyK1fThhdHvg0UZ6kuYv/GVdM/r/s5inxANcyVTzqq0pIP/B6AfnElO8rhUP2ng+8ZiF UVPg== X-Gm-Message-State: APjAAAWwqY4rCapEqyeqsiTIubFV5VlzZu2iHSlCatU/KwVz1mmpY/or 97xJt2m6VLxvPI2s+yqULxC4mtTGtYmk2lkqQua8Cg== X-Google-Smtp-Source: APXvYqz6bcusX1/60rvdZpekr2aq1ji5EftAaMrW4Wk10ZkqN4DBKzwb/69C7gDI9xqjP4WcWbDmEf7gB6NXE5S1H8g= X-Received: by 2002:a17:902:e85:: with SMTP id 5mr866072plx.13.1551379888235; Thu, 28 Feb 2019 10:51:28 -0800 (PST) MIME-Version: 1.0 References: <20190226040345.202047-1-ndesaulniers@google.com> In-Reply-To: From: Nick Desaulniers Date: Thu, 28 Feb 2019 10:51:17 -0800 Message-ID: Subject: Re: [PATCH] lib/raid6: use vdupq_n_u8 to avoid endianness warnings To: Robin Murphy X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190228_105131_675193_D04FC07D X-CRM114-Status: GOOD ( 23.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Ard Biesheuvel , Catalin Marinas , Will Deacon , Linux Kernel Mailing List , Russell King , Mark Brown , Nathan Chancellor , linux-arm-kernel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Feb 28, 2019 at 10:00 AM Robin Murphy wrote: > > On 26/02/2019 20:44, Nick Desaulniers wrote: > > On Mon, Feb 25, 2019 at 11:19 PM Ard Biesheuvel > > wrote: > >> > >> On Tue, 26 Feb 2019 at 05:03, 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 > >>> Signed-off-by: Nick Desaulniers > >> > >> 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?). > > FWIW the most recent 'proper' spec document I know of is this one: > > http://infocenter.arm.com/help/topic/com.arm.doc.ihi0073b/index.html Bookmarked, thanks! Ard, page 171 mentions armv7, armv8 for supported architectures for vdupq_n_u8. > > > Apparently we have a more interactive playground on the new site, too: > > https://developer.arm.com/technologies/neon/intrinsics Also bookmarked! I'm also super happy to see this; I'm familiar with Intel's equivalent: https://software.intel.com/sites/landingpage/IntrinsicsGuide/ Interactive sites like these are quite useful. Reading a post recently: https://www.sigarch.org/simd-instructions-considered-harmful/ "The IA-32 instruction set has grown from 80 to around 1400 instructions since 1978, largely fueled by SIMD." reminded me how useful and almost necessary the interactive sites are for navigating the large swathes of SIMD extensions. (no comment on the title of that article) -- Thanks, ~Nick Desaulniers _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel