Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1264695imc; Mon, 11 Mar 2019 09:51:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqwftQes4IROF7DManKC1FptMIOgQuebbml3E0Ai6ZCprPwPn2TtY/LEk3iEgaGQoetcmZpg X-Received: by 2002:a63:6a08:: with SMTP id f8mr31143053pgc.165.1552323104358; Mon, 11 Mar 2019 09:51:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552323104; cv=none; d=google.com; s=arc-20160816; b=kimadmVuZmBB2UBZUjDIQmNEEvKWbEJH6lIRQzfRZ1udyqFrNt1qgfSSW8824oulu3 CcvTBhrJigqOApns7gMTF0wBUWwT/VQ4wPy7wAZCRD0xH3/qNds7wKyN2RRP7N3B19Ow /MTThWeE8HSvIYiNis0pMRrJDHJ7AXI+Gvn0xTIaf5q9edw+KooMpslgaLu6uQi9HPDQ BdKF2BOUZB54F0utaNRdjo4xhMm1T6k9KoGNUMMUAJFIUHxNH3QzqmCi/dE1tsQmANlz T1nJtm3Npet7TIr516SKV9onuUqXCMN+jYvrTDcvUySMkShfJMbrYN2diy/rEKeDIx2j lUqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=wheW8ruAVLkED+IQx5lIuhsAFwray9LmcUkbx4VnGWg=; b=YyITU0cGfyLLqJlQrBEmTD9bvAnLALZsreA10/IW6q9cfLoodfPc1IR6WwlsKzRUzx ZdJ5o5/rMc4irNk87PoIpCjxKgZzWmngKj7pAwlcG1fS/KhT24xdzu+4qAHyA4SP2qhB CIzk66zPIy+N2oZi0DgTMbXsF2xBJ5tFmvGyYdd0waihHbAtF5do7xGvWfyJjf8Wsc3W jFmVNcXe/948PgY2zsVTGHE5R8KWIZrX97LF+CRl+KihfLX7R4uc6BLVIAk0nvkD0n5h rLGVdL23LmxvOpRPp8C2W2b7aWlUSSJry5CumFUqkvnZ9texDk7aTteAUF+knjarZgbs nk+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=anKR7d3m; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s68si379209pgb.199.2019.03.11.09.51.29; Mon, 11 Mar 2019 09:51:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=anKR7d3m; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727833AbfCKQtd (ORCPT + 99 others); Mon, 11 Mar 2019 12:49:33 -0400 Received: from mail-it1-f196.google.com ([209.85.166.196]:53409 "EHLO mail-it1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726675AbfCKQtd (ORCPT ); Mon, 11 Mar 2019 12:49:33 -0400 Received: by mail-it1-f196.google.com with SMTP id x189so1341618itd.3 for ; Mon, 11 Mar 2019 09:49:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wheW8ruAVLkED+IQx5lIuhsAFwray9LmcUkbx4VnGWg=; b=anKR7d3mbOMpLsfGpjU4FyFPreObgWL1efAgwNK8fiI4IDR3m9Nn4PBGZlrLaFOOfz k0xijHrhDgaCLRTos8yWw9LQ2jqXtK+CZ+AFGfIhxpSj9cyvrIkQNpPFAhXosARqD7re 6CJp7R8nP1T7m+XL4bP0z+ZDevfYoB7GpYXf9//FOfFryUE3b8ePevKMFMDbzPOYmK49 R5fiq3no1lOWLaiKNT7Wq/N60S4ssmpqJEQBGws7nc6SEtGBczyfZkPA41kwRssTt7pr vAtb2OMZvJfqrKGijZVY5Pv7rj11qdIGfdyhbSuDrJGo5C31B929wyZZJtbbQlv4H0UQ R3Og== 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=wheW8ruAVLkED+IQx5lIuhsAFwray9LmcUkbx4VnGWg=; b=Mtq3QbFsIqgnrmUpBxsUxgFmsS0EjxZ3STL8FOswqChngiw8BRMRaNxsfnYMIRaUDS QpvXMMEU380pPM/L7din14qJqALi8z3l6jbWAUHXKW0haKYvC8ja7Ut+SPjpRPPcXRb7 VESIkZwjaYPbThGfEUqVtczrvrtaTLrSIHkh84ztaVYZYlpJqcFUCTB3WYwkKb1bmR6i V07XFxOmNvMTuoLjx21uqs3voC1sQTSU3bIsU53V/mzr4PqcPhnlfgO0FB134Jg/R+dV CfdTwNklmOpM5YtWNMyOg53agB5At2MBOUMJx6wJawQ06nzbTQaSj+spQvgBK8rbfk7L z2gA== X-Gm-Message-State: APjAAAVCGbyQ7vWWJs6dZ/t1r+F6FiYdA3UGwU3ELQKtuL0wO2Xl8Gv4 6v1sioYtXaE+JUVm3d3yONr4toBDk0YpMjR5Bu/9RA== X-Received: by 2002:a24:32d0:: with SMTP id j199mr390920ita.71.1552322972201; Mon, 11 Mar 2019 09:49:32 -0700 (PDT) MIME-Version: 1.0 References: <20181215212304.19390-1-natechancellor@gmail.com> In-Reply-To: From: Ard Biesheuvel Date: Mon, 11 Mar 2019 17:49:21 +0100 Message-ID: Subject: Re: [PATCH] ARM: Ensure that NEON code always compiles with Clang To: Arnd Bergmann Cc: Nathan Chancellor , Russell King , Nicolas Pitre , Tri Vo , "open list:DOCUMENTATION" , Jonathan Corbet , Nick Desaulniers , Linux Kernel Mailing List , Linux ARM 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 Mon, 11 Mar 2019 at 17:22, Arnd Bergmann wrote: > > On Sat, Dec 15, 2018 at 10:24 PM Nathan Chancellor > wrote: > > endif > > diff --git a/arch/arm/lib/xor-neon.c b/arch/arm/lib/xor-neon.c > > index a6741a895189..4600b62d845f 100644 > > --- a/arch/arm/lib/xor-neon.c > > +++ b/arch/arm/lib/xor-neon.c > > @@ -14,7 +14,7 @@ > > MODULE_LICENSE("GPL"); > > > > #ifndef __ARM_NEON__ > > -#error You should compile this file with '-mfloat-abi=softfp -mfpu=neon' > > +#error You should compile this file with '-march=armv7-a -mfloat-abi=softfp -mfpu=neon' > > #endif > > > > I see this patch has made it in now, but I also see two other problems with the > same file that prevent it from working right with clang: > > - it triggers #warning This code requires at least version 4.6 of GCC What is currently the oldest GCC we support for ARM? > - As I reported in https://bugs.llvm.org/show_bug.cgi?id=40976, even > when it builds cleanly, it does not get vectorized. > > Has anyone actually managed to get this to do the right thing? > On my Cortex-A57 under KVM, I get this at boot [ 0.002287] xor: measuring software checksum speed [ 0.100054] arm4regs : 5212.800 MB/sec [ 0.200131] 8regs : 3472.800 MB/sec [ 0.300205] 32regs : 3282.000 MB/sec [ 0.400281] neon : 7011.600 MB/sec So that means that a) the cost model is inaccurate, at least for some cores, b) given that the code is only selected if it is faster, it would be nice if we could override the cost model based decisions made by the vectorizer.