From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIkyS-0001w9-4M for qemu-devel@nongnu.org; Mon, 11 Jan 2016 17:30:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aIkyR-0003tS-1z for qemu-devel@nongnu.org; Mon, 11 Jan 2016 17:30:04 -0500 Received: from mail-vk0-x22c.google.com ([2607:f8b0:400c:c05::22c]:33470) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIkyQ-0003sR-Tm for qemu-devel@nongnu.org; Mon, 11 Jan 2016 17:30:03 -0500 Received: by mail-vk0-x22c.google.com with SMTP id i129so94580594vkb.0 for ; Mon, 11 Jan 2016 14:30:02 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <87twmj27ol.fsf@fimbulvetr.bsc.es> References: <1452270356-26373-1-git-send-email-edgar.iglesias@gmail.com> <87twmj27ol.fsf@fimbulvetr.bsc.es> From: Peter Maydell Date: Mon, 11 Jan 2016 22:29:42 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: =?UTF-8?Q?Llu=C3=ADs_Vilanova?= Cc: "Edgar E. Iglesias" , QEMU Developers , Richard Henderson On 11 January 2016 at 20:16, Llu=C3=ADs Vilanova wrot= e: > Great! I implemented a similar thing long time ago. In my case the machin= ery 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 =3D tcg_const_promise_i32(&imm_p); // akin to tcg_const_i= 32() > ... > // 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. thanks -- PMM