From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NJ13T-0003rN-QO for qemu-devel@nongnu.org; Fri, 11 Dec 2009 03:40:51 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NJ13O-0003of-HU for qemu-devel@nongnu.org; Fri, 11 Dec 2009 03:40:50 -0500 Received: from [199.232.76.173] (port=53208 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NJ13O-0003oc-DU for qemu-devel@nongnu.org; Fri, 11 Dec 2009 03:40:46 -0500 Received: from mail-pw0-f43.google.com ([209.85.160.43]:59481) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NJ13O-0006Fc-8Z for qemu-devel@nongnu.org; Fri, 11 Dec 2009 03:40:46 -0500 Received: by pwj11 with SMTP id 11so42893pwj.2 for ; Fri, 11 Dec 2009 00:40:45 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <761ea48b0912102336r7fba6f75q56d153a57241ed05@mail.gmail.com> References: <4CC2A3A0-B3BC-48C2-850B-3EC92BAC4ED8@web.de> <761ea48b0912102336r7fba6f75q56d153a57241ed05@mail.gmail.com> From: Jun Koi Date: Fri, 11 Dec 2009 17:40:23 +0900 Message-ID: Subject: Re: [Qemu-devel] TCG is hard to understand! 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: Laurent Desnogues Cc: Alexander Graf , qemu-devel@nongnu.org On Fri, Dec 11, 2009 at 4:36 PM, Laurent Desnogues wrote: > 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 > Now I see how TCG manipulates the stack memory there. Thanks, J