Received: from eggs.gnu.org ([2001:4830:134:3::10]:55984) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aKAjL-0008QK-P5 for qemu-devel@nongnu.org; Fri, 15 Jan 2016 15:12:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aKAjI-0007xz-Hk for qemu-devel@nongnu.org; Fri, 15 Jan 2016 15:12:19 -0500 Received: from roura.ac.upc.edu ([147.83.33.10]:35009 helo=roura.ac.upc.es) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aKAjI-0007xQ-5n for qemu-devel@nongnu.org; Fri, 15 Jan 2016 15:12:16 -0500 From: =?utf-8?Q?Llu=C3=ADs_Vilanova?= References: <145287209895.25408.12995870835200275306.stgit@localhost> <145287210479.25408.17499099590726683703.stgit@localhost> <56993854.1030802@twiddle.net> Date: Fri, 15 Jan 2016 21:12:09 +0100 In-Reply-To: <56993854.1030802@twiddle.net> (Richard Henderson's message of "Fri, 15 Jan 2016 10:20:04 -0800") Message-ID: <87egdi1u1y.fsf@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v1 1/2] tcg: Add support for constant value promises List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: "Edgar E . Iglesias" , qemu-devel@nongnu.org, peter.maydell@linaro.org Richard Henderson writes: > On 01/15/2016 07:35 AM, Llu=C3=ADs Vilanova wrote: >> +TCGv_i64 tcg_promise_i64(TCGv_promise_i64 *promise) >> +{ >> + int pi =3D tcg_ctx.gen_next_parm_idx; >> + *promise =3D (TCGv_promise_i64)&tcg_ctx.gen_opparam_buf[pi]; >> + return tcg_const_i64(0xdeadcafe); >> +} > This doesn't work for a 32-bit host. The constant may be split across two > different parameter indices, and you don't know exactly where the second = will be. > Because of that, I think this is over-engineered, and really prefer the s= impler > interface that Edgar posted last week. In this case, 'tcg_set_promise_i64' sets the two arguments accordingly on 3= 2-bit targets. Both solutions depend on TCG internals (in this specific case the implementation of 'tcg_gen_movi_i64'), but now it's all implemented inside = TCG. Alternatively, promises could use the longer route of recording the opcode = index (as Edgar did AFAIR), and retrieve the argument pointer from there. Still, = for 32-bit targets we have to assume the two immediate moves are gonna generate= two consecutive opcodes. Thanks, Lluis