Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp599521imm; Wed, 10 Oct 2018 00:56:39 -0700 (PDT) X-Google-Smtp-Source: ACcGV60Gu7KTPqrg9b+JGFCCtuWAs42KwsIaDWSOYQvJIbHNlcxpliUWbe5iWCkUBr0vBBdSlnrR X-Received: by 2002:a17:902:b287:: with SMTP id u7-v6mr31681478plr.123.1539158199697; Wed, 10 Oct 2018 00:56:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539158199; cv=none; d=google.com; s=arc-20160816; b=qxCY/eFUhYdaAQHNB5r6XynLqfsJxX54cmksI72SlKqzJox7+E/k3hSC7zlI3v+Dme B/2x3sIGX+ThlAJdozz/IqJspJoTs3D6OZppjTNN+da+h5ULtmL+BeTgIqZg9sJSQAbk 7XLVlC9nCXLMiDRIwdap2tvsuk9jS1CcoKLs5ECNnapDhpo1p9AgwIk8KDdwF2jRVwGF DSKAbN/9KLuEdGbvmz97z7hGIkhk8xi6wGN1hVt6UvQFJwcpsQx0kHY7cmVWQLthJlqU MO/0h+MhQ4e/cboMDd2dIseoMSykngQ5jPfFoiaKwQsDGnAcwZrBPxKeBgbAT4JMI8ag hpwA== 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=+F7rTj2YDk54YVmZ9tjU7KHclHxpqFrFKEtZR+ahSds=; b=r24GpgePlCivf8s8XfObpbFOaPlbH7+CFbZOFSzxR0xB8LEbdYF2/8c+D70G9hiDma PUHT3iAYBUosctr9Rc7KlaMNxr+ddg/dX3piFOQNZ+r/QyysTbbSbMoIlz86QKforuZd kSSyMt9ALr+KPQnuOQDbcMDSaSsJGfqvIbd29QkNWYIes1c3ztNjuRkBOp6gxkfP9CP9 fIyF6gG4kjYNG2X5mCZECJaRaJp2b1cMspYxEN/zzXvcHAko2+tnR+niYkf5H20DWjUU nNKR3oz1U8we2lgs3V2y24HCwjfpdxaCl7YxNGPg5P+IYOZ565GF+bFNTK0syWsV+K66 y6JQ== 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 j12-v6si26707131pfd.222.2018.10.10.00.56.24; Wed, 10 Oct 2018 00:56:39 -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 S1726810AbeJJPQX (ORCPT + 99 others); Wed, 10 Oct 2018 11:16:23 -0400 Received: from gate.crashing.org ([63.228.1.57]:34368 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726476AbeJJPQX (ORCPT ); Wed, 10 Oct 2018 11:16:23 -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 w9A7s3Fq020517; Wed, 10 Oct 2018 02:54:04 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id w9A7rsA7020412; Wed, 10 Oct 2018 02:53:54 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Wed, 10 Oct 2018 02:53:54 -0500 From: Segher Boessenkool To: Richard Biener Cc: Michael Matz , Borislav Petkov , gcc@gcc.gnu.org, Nadav Amit , Ingo Molnar , linux-kernel@vger.kernel.org, x86@kernel.org, Masahiro Yamada , Sam Ravnborg , Alok Kataria , Christopher Li , Greg Kroah-Hartman , "H. Peter Anvin" , Jan Beulich , Josh Poimboeuf , Juergen Gross , Kate Stewart , Kees Cook , linux-sparse@vger.kernel.org, Peter Zijlstra , Philippe Ombredanne , Thomas Gleixner , virtualization@lists.linux-foundation.org, Linus Torvalds , Chris Zankel , Max Filippov , linux-xtensa@linux-xtensa.org Subject: Re: PROPOSAL: Extend inline asm syntax with size spec Message-ID: <20181010075353.GU29268@gate.crashing.org> References: <20181003213100.189959-1-namit@vmware.com> <20181007091805.GA30687@zn.tnic> <20181007132228.GJ29268@gate.crashing.org> <20181008073128.GL29268@gate.crashing.org> <20181009145330.GT29268@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 Wed, Oct 10, 2018 at 09:12:48AM +0200, Richard Biener wrote: > On Tue, 9 Oct 2018, Segher Boessenkool wrote: > > On Mon, Oct 08, 2018 at 11:07:46AM +0200, Richard Biener wrote: > > > On Mon, 8 Oct 2018, Segher Boessenkool wrote: > > > > On Sun, Oct 07, 2018 at 03:53:26PM +0000, Michael Matz wrote: > > > > > On Sun, 7 Oct 2018, Segher Boessenkool wrote: > > > > > > On Sun, Oct 07, 2018 at 11:18:06AM +0200, Borislav Petkov wrote: > > > > > > > Now, Richard suggested doing something like: > > > > > > > > > > > > > > 1) inline asm ("...") > > > > > > > > > > > > What would the semantics of this be? > > > > > > > > > > The size of the inline asm wouldn't be counted towards the inliner size > > > > > limits (or be counted as "1"). > > > > > > > > That sounds like a good option. > > > > > > Yes, I also like it for simplicity. It also avoids the requirement > > > of translating the number (in bytes?) given by the user to > > > "number of GIMPLE instructions" as needed by the inliner. > > > > This patch implements this, for C only so far. And the syntax is > > "asm inline", which is more in line with other syntax. > > > > How does this look? > > Looks good. A few nits - you need to document this in extend.texi, the Yup. > tree flag use needs documenting in tree-core.h, Ah yes. > and we need a testcase > (I'd suggest one that shows we inline a function with "large" asm inline > () even at -Os). I have one. Oh, and I probably should do a comment at the one line of code that isn't just bookkeeping ;-) > Oh, and I don't think we want C and C++ to diverge - so you need to > cook up C++ support as well. Right, that's why I said "C only so far". > Can kernel folks give this a second and third thought please so we > don't implement sth that in the end won't satisfy you guys? Or actually try it out and see if it has the desired effect! Nothing beats field trials. I'll do the C++ thing today hopefully, and send things to gcc-patches@. Segher