Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2905888ybe; Sun, 8 Sep 2019 03:14:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqxl2MJSUsKS+gkL3wlwDlE2oSDwdWktr/9OLLwcVPbezpbwxEeR6buCg2RPDBH1ktrtmF5G X-Received: by 2002:a17:902:bd06:: with SMTP id p6mr18831899pls.67.1567937684797; Sun, 08 Sep 2019 03:14:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567937684; cv=none; d=google.com; s=arc-20160816; b=CzwGhsybb43l4NKri/CXGyUtd18qGBCvPDrR15zkm1ohTXnEMwivfLb+5hBzMrC+Jv L59ZL+lwhSi3Wb+iJdx0U/jzxbHL3YfDgNcFtcfOQBXaa/lbTIVqSy+c60dWlM2MptCL XCS0ojaHv/WKf3dBf0Ycbe38n7Ooa+U+PydWazXHn5491lczcsH6x0p69nFwewrg+nZV kVklJSHuPBctcr56gmK6LWL6UE124iDT9yeWWdlxC+UhzKIhfLFzPFMOTaGx5FCKJJJv cJAA4MPWhL83khdQb99KVaGhwadkZbP86Z3owq94jZk9iPeH6v73LZm3elBexsXg7nrN COiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Zo5YswUAz6JsJFVtIEd53vHJMhrVmB8v1kbjcYdOKCQ=; b=z7jzPVMv5Q/JhaNc7VJ6IJTzP0oi93NLxvP/bMJpowUccq8zB1pEMcx9RmODCfpCLG yOhJOd80paYVXIkmd6AsV+kikI2P2vjFUUUiv17CAr88i4Jf3TMxPhWqcLKreMpgEv3b dDJBgN0wIC+dy4QCMyJhZnwkhbVdk/18tdgJgaQh9qSaBQ2dr3yELiAKfgeWW+1nG17B dx6H6k98m/f5JdugM/C6XbVw8iot1DACg5SZDF1F9FJUeM0QxigI0AsbFjEC4YnVL0ao 7Et/tWcZt4t0S3BWMFqf2u7sKL6PgFyoCgpMu4ALsObQyROVYtLtakuIZqxIeVba3DMM 9BLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=QluWeNZe; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b20si9465118pgl.533.2019.09.08.03.14.28; Sun, 08 Sep 2019 03:14: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=@google.com header.s=20161025 header.b=QluWeNZe; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406086AbfIFXnM (ORCPT + 99 others); Fri, 6 Sep 2019 19:43:12 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:43334 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406033AbfIFXnM (ORCPT ); Fri, 6 Sep 2019 19:43:12 -0400 Received: by mail-pl1-f195.google.com with SMTP id 4so3900031pld.10 for ; Fri, 06 Sep 2019 16:43:11 -0700 (PDT) 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:content-transfer-encoding; bh=Zo5YswUAz6JsJFVtIEd53vHJMhrVmB8v1kbjcYdOKCQ=; b=QluWeNZeNy7EH782UDhVcTdZvd8NAM/qrdYZSCCSRfgWUdGBBv9IdaKMnhr2fN7Ax0 fjbP+fflks+czLRgkGwYZwhk/PnwkfMbr+bdbQGOEnNoR2YILTom8pgDBp5QCNDS8Kn/ hVHLqv6o8O6hX+dnDmf4GYeOWfH0WtuwtE5iq5FKCwHVj4hD4owTcuNQ+vTmQ/OxRuHA G9aobEQ82itoSEk4fYqhXPq/NiIx5mEwlt3dzNNDzHjmYEAchtGb4eSplS3RAav7k0Ni vgC+BeeKEweRvkpiz2BMDH+fKTYnO8xNsYU4EFKvcs6l5CkbJs1CHpq6qOnJSNLL83jG QKBg== 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:content-transfer-encoding; bh=Zo5YswUAz6JsJFVtIEd53vHJMhrVmB8v1kbjcYdOKCQ=; b=QgbdYPTwH0mj/KHBehXDFafMXpgYgz8A0xVCB+PpanUeceVJ+uUbr49PSdDTZSwgUV ITT4nUTUD7VR2tL4PXY1gMKhSHZZt3jyqyXp0dZNxaOOlomllEL2p3g+GUsPtb2yCOCS Pc5yw6jqkQOD7NkL+yQOJzq+dsFKMEJNcubahPZHEZpxRTNFyV20Arof3AJC+TW7rGyF mFYXyDmK80LClFpSiaIaTN3+dHcrd0+ioCzjsYWKPZviRL+reiF96bNW6lCF6DezQyvL BZjMG/VHhGXq0PvWwxj142pFSShuaFtatFJ0l1pvJsaGrd5cHHkTnHPuqHVaDm3G8RwB ivPQ== X-Gm-Message-State: APjAAAXwoVHHT6bhBtslDc1mcgQchirQvJenFqMfDHZ/kyVoeKvnUGX1 4JTGtBMSaDiQmdYUMZR0c98YB4FdFEiXW67nmmNS+g== X-Received: by 2002:a17:902:7296:: with SMTP id d22mr11780120pll.179.1567813390944; Fri, 06 Sep 2019 16:43:10 -0700 (PDT) MIME-Version: 1.0 References: <20190905134535.GP9749@gate.crashing.org> <20190906122349.GZ9749@gate.crashing.org> <20190906163028.GC9749@gate.crashing.org> <20190906163918.GJ2120@tucnak> <20190906220347.GD9749@gate.crashing.org> <20190906225606.GF9749@gate.crashing.org> In-Reply-To: <20190906225606.GF9749@gate.crashing.org> From: Nick Desaulniers Date: Fri, 6 Sep 2019 16:42:58 -0700 Message-ID: Subject: Re: [PATCH v2 4/6] compiler-gcc.h: add asm_inline definition To: Segher Boessenkool Cc: Jakub Jelinek , Rasmus Villemoes , Miguel Ojeda , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , LKML , "gcc-patches@gcc.gnu.org" , clang-built-linux Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 6, 2019 at 3:56 PM Segher Boessenkool wrote: > > On Fri, Sep 06, 2019 at 03:35:02PM -0700, Nick Desaulniers wrote: > > On Fri, Sep 6, 2019 at 3:03 PM Segher Boessenkool > > wrote: > > > And if instead you tested whether the actual feature you need works a= s > > > you need it to, it would even work fine if there was a bug we fixed t= hat > > > breaks things for the kernel. Without needing a new compiler. > > > > That assumes a feature is broken out of the gate and is putting the > > cart before the horse. If a feature is available, it should work. > > GCC currently has 91696 bug reports. Fair. > > > > Or as another example, if we added support for some other flags. (x86 > > > has only a few flags; many other archs have many more, and in some ca= ses > > > newer hardware actually has more flags than older). > > > > I think compiler flags are orthogonal to GNU C extensions we're discuss= ing here. > > No, I am talking exactly about what you brought up. The flags output > for inline assembler, using the =3D@ syntax. If I had implemented that > for Power when it first came up, I would by now have had to add support > for another flag (the CA32 flag). Oh, and I would not have implemented > support for OV or SO at all originally, but perhaps they are useful, so > let's add that as well. And there is OV32 now as well. Oh, I misunderstood. I see your point. Define the symbol as a number for what level of output flags you support (ie. the __cplusplus macro). > > > > With the "macro" scheme we would need to add new macros in all these > > > cases. And since those are target-specific macros, that quickly expa= nds > > > beyond reasonable bounds. > > > > I don't think so. Can you show me an example codebase that proves me w= rong? > > No, of course not, because we aren't silly enough to implement something > like that. I still don't think feature detection is worse than version detection (until you find your feature broken in a way that forces the use of version detection). Just to prove my point about version checks being brittle, it looks like Rasmus' version check isn't even right. GCC supported `asm inline` back in the 8.3 release, not 9.1 as in this patch: https://godbolt.org/z/1woitS . So users of gcc-8.2 and gcc-8.3 wouldn't be able to take advantage of `asm inline` even though their compiler supported it. Or was it "broken" until 9.1? Lord knows, as `asm inline` wasn't in any release notes or bug reports I can find: 8: https://gcc.gnu.org/gcc-8/changes.html 9: https://gcc.gnu.org/gcc-9/changes.html Bug tracker query: https://gcc.gnu.org/bugzilla/buglist.cgi?bug_status=3DUNCONFIRMED&bug_statu= s=3DNEW&bug_status=3DASSIGNED&bug_status=3DSUSPENDED&bug_status=3DWAITING&b= ug_status=3DREOPENED&cf_known_to_fail_type=3Dallwords&cf_known_to_work_type= =3Dallwords&query_format=3Dadvanced&short_desc=3Dasm%20inline&short_desc_ty= pe=3Danywordssubstr Ah, here it is: https://github.com/gcc-mirror/gcc/commit/6de46ad5326fc5e6b730a2feb8c62d09c1= 561f92 Which looks like the qualifier was added to this page: https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html I like many of the GNU C extensions, and I want to help support them in Clang so that they can be used in more places, but the current process (and questions I have when I implement some of them) leaves me with the sense that there's probably room for improvement on some of these things before they go out the door. Segher, next time there's discussion about new C extensions for the kernel, can you please include me in the discussions? --=20 Thanks, ~Nick Desaulniers