Received: from eggs.gnu.org ([2001:4830:134:3::10]:54377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIxoS-0000Yq-I6 for qemu-devel@nongnu.org; Tue, 12 Jan 2016 07:12:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aIxoO-0003qR-FS for qemu-devel@nongnu.org; Tue, 12 Jan 2016 07:12:36 -0500 Received: from roura.ac.upc.es ([147.83.33.10]:35289) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIxoO-0003q3-3Z for qemu-devel@nongnu.org; Tue, 12 Jan 2016 07:12:32 -0500 From: =?utf-8?Q?Llu=C3=ADs_Vilanova?= References: <1452270356-26373-1-git-send-email-edgar.iglesias@gmail.com> <87twmj27ol.fsf@fimbulvetr.bsc.es> Date: Tue, 12 Jan 2016 13:12:29 +0100 In-Reply-To: (Peter Maydell's message of "Mon, 11 Jan 2016 22:29:42 +0000") Message-ID: <87si23xahe.fsf@fimbulvetr.bsc.es> MIME-Version: 1.0 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: Peter Maydell Cc: "Edgar E. Iglesias" , QEMU Developers , Richard Henderson Peter Maydell writes: > On 11 January 2016 at 20:16, Llu=C3=ADs Vilanova wr= ote: >> Great! I implemented a similar thing long time ago. In my case the machi= nery is >> completely hidden under the concept of "value promises" in TCG (i.e., th= e user >> does not need to know about TCG internals like tcg_op_buf_count): >>=20 >> // create promise >> TCGv_promise_i32 imm_p; >> TCGv_i32 imm =3D 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. Cheers, Lluis