From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58988) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIzNC-0005pf-Ui for qemu-devel@nongnu.org; Tue, 12 Jan 2016 08:52:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aIzN7-0006tR-Vi for qemu-devel@nongnu.org; Tue, 12 Jan 2016 08:52:34 -0500 Received: from mail-pf0-x229.google.com ([2607:f8b0:400e:c00::229]:35294) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIzN7-0006tF-Ov for qemu-devel@nongnu.org; Tue, 12 Jan 2016 08:52:29 -0500 Received: by mail-pf0-x229.google.com with SMTP id 65so63307095pff.2 for ; Tue, 12 Jan 2016 05:52:29 -0800 (PST) Date: Tue, 12 Jan 2016 14:52:24 +0100 From: "Edgar E. Iglesias" Message-ID: <20160112135224.GC29396@toto> References: <1452270356-26373-1-git-send-email-edgar.iglesias@gmail.com> <87twmj27ol.fsf@fimbulvetr.bsc.es> <87si23xahe.fsf@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87si23xahe.fsf@fimbulvetr.bsc.es> Subject: Re: [Qemu-devel] [RFC 0/2] tcg-icount: Add and use tcg_set_insn_param to update tcg insn params List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?iso-8859-1?Q?Llu=EDs?= Vilanova Cc: Peter Maydell , QEMU Developers , Richard Henderson On Tue, Jan 12, 2016 at 01:12:29PM +0100, Lluís Vilanova wrote: > Peter Maydell writes: > > > On 11 January 2016 at 20:16, Lluís Vilanova wrote: > >> Great! I implemented a similar thing long time ago. In my case the machinery is > >> completely hidden under the concept of "value promises" in TCG (i.e., the user > >> does not need to know about TCG internals like tcg_op_buf_count): > >> > >> // create promise > >> TCGv_promise_i32 imm_p; > >> TCGv_i32 imm = tcg_const_promise_i32(&imm_p); // akin to tcg_const_i32() > >> ... > >> // operate with promised immediate 'imm' > >> ... > >> // resolve promised value > >> tcg_set_promise_i32(imm_p, resolved_value); > > > I think this is definitely a nicer API if we're going to > > have more than a very few uses -- gen_icount kind of gets > > away with looking under the hood of the tcg data structures > > because it's a sort of internal thing itself, but wider > > use would definitely benefit from a more formal API. > > If this is not time-critical, I can prepare an updated patch by Friday, or let > Edgar do it. Both are fine by me. It would be awesome if you could rebase your series. Thanks Lluis Cheers, Edgar