Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NJ03S-0000vu-Is for qemu-devel@nongnu.org; Fri, 11 Dec 2009 02:36:46 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NJ03N-0000v8-66 for qemu-devel@nongnu.org; Fri, 11 Dec 2009 02:36:45 -0500 Received: from [199.232.76.173] (port=59107 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NJ03N-0000v5-2V for qemu-devel@nongnu.org; Fri, 11 Dec 2009 02:36:41 -0500 Received: from mail-pw0-f43.google.com ([209.85.160.43]:38166) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NJ03M-00014B-Kv for qemu-devel@nongnu.org; Fri, 11 Dec 2009 02:36:40 -0500 Received: by pwj11 with SMTP id 11so16701pwj.2 for ; Thu, 10 Dec 2009 23:36:39 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <4CC2A3A0-B3BC-48C2-850B-3EC92BAC4ED8@web.de> Date: Fri, 11 Dec 2009 08:36:38 +0100 Message-ID: <761ea48b0912102336r7fba6f75q56d153a57241ed05@mail.gmail.com> Subject: Re: [Qemu-devel] TCG is hard to understand! From: Laurent Desnogues Content-Type: text/plain; charset=ISO-8859-1 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jun Koi Cc: Alexander Graf , qemu-devel@nongnu.org On Fri, Dec 11, 2009 at 4:18 AM, Jun Koi wrote: > > Another question: I look at tcg_gen_callN() to see how the helper is > executed. We put the helper opcode into the TCG code buffer, and put > helper's params into gen_opparam_buf. > > However, then when TCG generates code to actually call the helper, we > just put the opcode of the host insn into the output buffer, which is > target code at this step, then run it. > > Now when the helper is executed, it must get its param from the stack, > which is really the host stack. But as said above, its params are in > gen_opparam_buf, but not in stack? > I searched around, and dont see anywhere we link gen_opparam_buf with > the host stack. So how the helper can get its param?? > > Surely I missed something, or misunderstand the whole picture. Any hint? Take a look at tcg.c:tcg_reg_alloc_call Laurent