From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dibyendu Majumdar Subject: Re: [RFC v0 0/4] Give a type to constants too Date: Fri, 11 Aug 2017 13:20:38 +0100 Message-ID: References: <20170811114937.fqzgxdqcq64jlpgn@ltop.local> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from mail-vk0-f42.google.com ([209.85.213.42]:33307 "EHLO mail-vk0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752902AbdHKMUj (ORCPT ); Fri, 11 Aug 2017 08:20:39 -0400 Received: by mail-vk0-f42.google.com with SMTP id j189so12652861vka.0 for ; Fri, 11 Aug 2017 05:20:39 -0700 (PDT) In-Reply-To: <20170811114937.fqzgxdqcq64jlpgn@ltop.local> Sender: linux-sparse-owner@vger.kernel.org List-Id: linux-sparse@vger.kernel.org To: Luc Van Oostenryck Cc: Christopher Li , Linus Torvalds , Sparse Mailing-list , Jeff Garzik , Pekka Enberg Hi Luc, On 11 August 2017 at 12:49, Luc Van Oostenryck wrote: > On Fri, Aug 11, 2017 at 11:28:23AM +0100, Dibyendu Majumdar wrote: >> On 10 August 2017 at 23:34, Luc Van Oostenryck >> wrote: >> > * the OP_PUSH instructions do a perfect job of giving a type to functions >> > arguments >> > * the OP_PUSH instructions also nicely abstract away the *operation* of >> > argument passing that all architectures have. It's a good thing. >> > >> >> It is true that OP_PUSH instructions resolved the issue I was having. >> However there is something odd about them as they are not really >> instructions in the instruction stream, are they? They get added as >> arguments to the OP_CALL instruction. The solution works great though. > > Yes, they are somehow odd. I'm not totally sure by what you exactly > mean by "in the instruction stream", though. > > Let's use an example: > fun(1, a) > > Currently it's linearized as: > call fun, 1, a > > The first version of the patch gave: > arg %r1, $1 > arg %r2, a > call fun, %r1, %r2 > > The current version gives: > push $1 > push a > call fun > which is very much like a lot of functions really work. I was mistaken - I think they do appear in the instruction stream. I thought they didn't because we kind of ignore them - and only look at them as part of the OP_CALL arguments. Regards Dibyendu