Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1247673ybe; Thu, 5 Sep 2019 12:32:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqw4ZO+cgIPVMbPJE98cPfxJFFdNYNV1mAseY86S1zG0zcvO3tSx9D8SoEchtf2mfp5XqZ7b X-Received: by 2002:a17:90a:9907:: with SMTP id b7mr5758697pjp.101.1567711933976; Thu, 05 Sep 2019 12:32:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567711933; cv=none; d=google.com; s=arc-20160816; b=oX3up7jvRz6htn6PQcfrpjck4kyaSTYkPkGum/IicuzffXspOiKFOpeOdgFhpZjK5/ cs3Cx23sj9DOnIkGZwffFKp675LvsvFkJ2ETVcGLGsy116yyVXT2GQIiZbRZKAgYvACA ZHefe1kw/VIRfnGbtV26oYJjg6b9fKo4lY7pXOUz4I0yBfiLQbZc9Y1qN6/18uTr3JrD jIeGwVz4x48G1B12nXIxShe8YgW3piwo0OIlGNnU2H9Cscn+vvVhUY8MhHURn/dYtkbI M7MhxmWO0vScIxcmNAu8EMB2FIIQeUVdUe+VCFo80p9lDzc+tzVA+T1siWdT9OeLGC6F UPyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=qO3tgPCzETqVAhR0avzwP64CKSn7sV1cK3aUE4JDOt8=; b=meH2vWqXs1yzmSU46YtdP6RLuJOfFj97bL3IWhspgg4eS5IiBwpZGIlpm55jOXBhBw epCQyNACwkBZ54gIePHSJ7lsD/TpqJ6nhTsFDNvGq8R3RWviZYWSrSYQfRdm2qGlZ34t RI2OJurtUpWZRy3dXKNUwbkLIaYWqkmHS4t/NnFuksdiajP4aGEikRNFWFhDHOz5jQFA B+Q6MzYLPdPtDnE/r7CCgLGtQohPGPACJlR2tYmLyUjyJxJMmOLvGrD/siMpNOmNNuV+ YCYdpxEY/F3qk0Q3dtjF1k+/WFyCTa3N5cYD/yVgXCyc5Bh6dGdJKo82a5lm28cXVXW9 zf+w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z20si2841792plo.159.2019.09.05.12.31.57; Thu, 05 Sep 2019 12:32:13 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390006AbfIEOrj (ORCPT + 99 others); Thu, 5 Sep 2019 10:47:39 -0400 Received: from gate.crashing.org ([63.228.1.57]:48300 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728590AbfIEOri (ORCPT ); Thu, 5 Sep 2019 10:47:38 -0400 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id x85ElRDl031452; Thu, 5 Sep 2019 09:47:27 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id x85ElQoY031451; Thu, 5 Sep 2019 09:47:26 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Thu, 5 Sep 2019 09:47:25 -0500 From: Segher Boessenkool To: Rasmus Villemoes Cc: Nick Desaulniers , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , LKML , Miguel Ojeda , "gcc-patches@gcc.gnu.org" Subject: Re: [PATCH v2 4/6] compiler-gcc.h: add asm_inline definition Message-ID: <20190905144725.GQ9749@gate.crashing.org> References: <20190829083233.24162-1-linux@rasmusvillemoes.dk> <20190830231527.22304-1-linux@rasmusvillemoes.dk> <20190830231527.22304-5-linux@rasmusvillemoes.dk> <20190905134535.GP9749@gate.crashing.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 05, 2019 at 04:23:11PM +0200, Rasmus Villemoes wrote: > On 05/09/2019 15.45, Segher Boessenkool wrote: > > On Thu, Sep 05, 2019 at 01:07:11PM +0200, Rasmus Villemoes wrote: > >> Perhaps something like below, though that > >> won't affect the already released gcc 9.1 and 9.2, of course. > > > > That is one reason to not want such a predefined macro. Another reason > > is that you usually need to compile some test programs *anyway*, to see if > > some bug is present for example, or to see if the exact implementation of > > the feature is beneficial (or harmful) to your program in some way. > > OK, I think I'll just use a version check for now, and then switch to a > Kconfig test if and when clang grows support. > > >> gcc maintainers, WDYT? Can we add a feature test macro for asm inline()? > > > > Why would GCC want to have macros for all features it has? > > Well, gcc has implemented __has_attribute() which is similar - one could > detect support by compiling a trivial test program. It is not a macro, it doesn't spill over the place, and it is for detecting things that are already fixed strings, much easier to do :-) > Or the same could be > said for many of the predefined macros that are conditionally defined, > e.g. __HAVE_SPECULATION_SAFE_VALUE. That one happened because of the Great Security Scare of 2017/2018, it's not a good precedent. And, how it is set is target-specific, it can depend on CPU model selected, target code generation options, or whatnot. > But I was just throwing the question into the air, I won't pursue this > further. Maybe GCC should have a has_feature thing, it might fit in well there. As preprocessor macros, not so much, IMO. Segher