From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EEB46-000142-Rw for qemu-devel@nongnu.org; Sat, 10 Sep 2005 15:31:07 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EEB41-00011S-Pa for qemu-devel@nongnu.org; Sat, 10 Sep 2005 15:31:03 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EEB40-0000iK-P0 for qemu-devel@nongnu.org; Sat, 10 Sep 2005 15:31:00 -0400 Received: from [62.241.162.31] (helo=galaxy.systems.pipex.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EEAnn-0002wF-DP for qemu-devel@nongnu.org; Sat, 10 Sep 2005 15:14:15 -0400 Received: from nowt.org (81-178-249-194.dsl.pipex.com [81.178.249.194]) by galaxy.systems.pipex.net (Postfix) with ESMTP id 7184BE0000EC for ; Sat, 10 Sep 2005 20:13:58 +0100 (BST) Received: from wren.home (wren.home [192.168.1.7]) by nowt.org (Postfix) with ESMTP id 176856FF94 for ; Sat, 10 Sep 2005 20:13:57 +0100 (BST) From: Paul Brook Date: Sat, 10 Sep 2005 20:13:53 +0100 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_yBzID+bN71MG2M6" Message-Id: <200509102013.54644.paul@nowt.org> Subject: [Qemu-devel] [patch] Move Arm to GOTO_TB Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --Boundary-00=_yBzID+bN71MG2M6 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline The attached patch migrates the Arm target from JUMP_TB to GOTO_TB. The comment in exec-all.h indicates this is a Good Thing(tm), and it's a prerequisite for my hand coded generator. Paul --Boundary-00=_yBzID+bN71MG2M6 Content-Type: text/x-diff; charset="us-ascii"; name="p" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="p" Index: target-arm/op.c =================================================================== RCS file: /cvsroot/qemu/qemu/target-arm/op.c,v retrieving revision 1.14 diff -u -p -r1.14 op.c --- target-arm/op.c 13 May 2005 22:45:23 -0000 1.14 +++ target-arm/op.c 10 Sep 2005 19:09:08 -0000 @@ -346,14 +346,14 @@ void OPPROTO op_test_le(void) FORCE_RET(); } -void OPPROTO op_jmp0(void) +void OPPROTO op_goto_tb0(void) { - JUMP_TB(op_jmp0, PARAM1, 0, PARAM2); + GOTO_TB(op_goto_tb0, PARAM1, 0); } -void OPPROTO op_jmp1(void) +void OPPROTO op_goto_tb1(void) { - JUMP_TB(op_jmp1, PARAM1, 1, PARAM2); + GOTO_TB(op_goto_tb1, PARAM1, 1); } void OPPROTO op_exit_tb(void) Index: target-arm/translate.c =================================================================== RCS file: /cvsroot/qemu/qemu/target-arm/translate.c,v retrieving revision 1.27 diff -u -p -r1.27 translate.c --- target-arm/translate.c 21 Aug 2005 10:14:28 -0000 1.27 +++ target-arm/translate.c 10 Sep 2005 19:09:08 -0000 @@ -43,6 +43,12 @@ typedef struct DisasContext { #define DISAS_JUMP_NEXT 4 +#ifdef USE_DIRECT_JUMP +#define TBPARAM(x) +#else +#define TBPARAM(x) (long)(x) +#endif + /* XXX: move that elsewhere */ static uint16_t *gen_opc_ptr; static uint32_t *gen_opparam_ptr; @@ -897,6 +903,18 @@ static int disas_vfp_insn(CPUState * env return 0; } +static inline gen_jmp_tb(long tb, int n, uint32_t dest) +{ + if (n == 0) + gen_op_goto_tb0(TBPARAM(tb)); + else + gen_op_goto_tb1(TBPARAM(tb)); + gen_op_movl_T0_im(dest); + gen_op_movl_r15_T0(); + gen_op_movl_T0_im(tb + n); + gen_op_exit_tb(); +} + static inline void gen_jmp (DisasContext *s, uint32_t dest) { if (__builtin_expect(s->singlestep_enabled, 0)) { @@ -906,7 +924,8 @@ static inline void gen_jmp (DisasContext gen_op_movl_T0_im(dest); gen_bx(s); } else { - gen_op_jmp0((long)s->tb, dest); + long tb = (long)s->tb; + gen_jmp_tb(tb, 0, dest); s->is_jmp = DISAS_TB_JUMP; } } @@ -2118,7 +2137,7 @@ static inline int gen_intermediate_code_ } else { switch(dc->is_jmp) { case DISAS_NEXT: - gen_op_jmp1((long)dc->tb, (long)dc->pc); + gen_jmp_tb((long)dc->tb, 1, dc->pc); break; default: case DISAS_JUMP: @@ -2133,7 +2152,7 @@ static inline int gen_intermediate_code_ } if (dc->condjmp) { gen_set_label(dc->condlabel); - gen_op_jmp1((long)dc->tb, (long)dc->pc); + gen_jmp_tb((long)dc->tb, 1, dc->pc); dc->condjmp = 0; } } --Boundary-00=_yBzID+bN71MG2M6--