From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KzE4a-00077z-6T for qemu-devel@nongnu.org; Sun, 09 Nov 2008 12:27:40 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KzE4Z-00077N-Dd for qemu-devel@nongnu.org; Sun, 09 Nov 2008 12:27:39 -0500 Received: from [199.232.76.173] (port=47934 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KzE4Z-00077D-8Q for qemu-devel@nongnu.org; Sun, 09 Nov 2008 12:27:39 -0500 Received: from savannah.gnu.org ([199.232.41.3]:42882 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KzE4Y-0008Nx-OO for qemu-devel@nongnu.org; Sun, 09 Nov 2008 12:27:38 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KzE4X-0001ey-Cy for qemu-devel@nongnu.org; Sun, 09 Nov 2008 17:27:37 +0000 Received: from aurel32 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KzE4X-0001eu-4b for qemu-devel@nongnu.org; Sun, 09 Nov 2008 17:27:37 +0000 MIME-Version: 1.0 Errors-To: aurel32 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Aurelien Jarno Message-Id: Date: Sun, 09 Nov 2008 17:27:37 +0000 Subject: [Qemu-devel] [5660] target-ppc: Remove a few TCG temp variable leaks 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 Revision: 5660 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5660 Author: aurel32 Date: 2008-11-09 17:27:36 +0000 (Sun, 09 Nov 2008) Log Message: ----------- target-ppc: Remove a few TCG temp variable leaks Signed-off-by: Aurelien Jarno Modified Paths: -------------- trunk/target-ppc/translate.c Modified: trunk/target-ppc/translate.c =================================================================== --- trunk/target-ppc/translate.c 2008-11-09 17:27:27 UTC (rev 5659) +++ trunk/target-ppc/translate.c 2008-11-09 17:27:36 UTC (rev 5660) @@ -858,6 +858,7 @@ gen_set_label(l1); tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_gpr[rB(ctx->opcode)]); gen_set_label(l2); + tcg_temp_free(t0); } /*** Integer arithmetic ***/ @@ -911,15 +912,21 @@ } else { tcg_gen_brcond_tl(TCG_COND_GEU, t0, t1, l1); } + tcg_gen_ori_tl(cpu_xer, cpu_xer, 1 << XER_CA); + gen_set_label(l1); + tcg_temp_free(t0); + tcg_temp_free(t1); } else #endif - if (sub) { - tcg_gen_brcond_tl(TCG_COND_GTU, arg1, arg2, l1); - } else { - tcg_gen_brcond_tl(TCG_COND_GEU, arg1, arg2, l1); + { + if (sub) { + tcg_gen_brcond_tl(TCG_COND_GTU, arg1, arg2, l1); + } else { + tcg_gen_brcond_tl(TCG_COND_GEU, arg1, arg2, l1); + } + tcg_gen_ori_tl(cpu_xer, cpu_xer, 1 << XER_CA); + gen_set_label(l1); } - tcg_gen_ori_tl(cpu_xer, cpu_xer, 1 << XER_CA); - gen_set_label(l1); } /* Common add function */ @@ -1230,8 +1237,8 @@ int l1; TCGv t0, t1; - t0 = tcg_temp_local_new(TCG_TYPE_I64); - t1 = tcg_temp_local_new(TCG_TYPE_I64); + t0 = tcg_temp_new(TCG_TYPE_I64); + t1 = tcg_temp_new(TCG_TYPE_I64); l1 = gen_new_label(); /* Start with XER OV disabled, the most likely case */ tcg_gen_andi_tl(cpu_xer, cpu_xer, ~(1 << XER_OV)); @@ -1253,6 +1260,8 @@ #endif tcg_gen_ori_tl(cpu_xer, cpu_xer, (1 << XER_OV) | (1 << XER_SO)); gen_set_label(l1); + tcg_temp_free(t0); + tcg_temp_free(t1); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx, cpu_gpr[rD(ctx->opcode)]); } @@ -2034,8 +2043,8 @@ TCGv t0; l1 = gen_new_label(); l2 = gen_new_label(); + t0 = tcg_temp_local_new(TCG_TYPE_TL); tcg_gen_brcondi_tl(TCG_COND_GE, cpu_gpr[rS(ctx->opcode)], 0, l1); - t0 = tcg_temp_new(TCG_TYPE_TL); tcg_gen_andi_tl(t0, cpu_gpr[rS(ctx->opcode)], (1ULL << sh) - 1); tcg_gen_brcondi_tl(TCG_COND_EQ, t0, 0, l1); tcg_gen_ori_tl(cpu_xer, cpu_xer, 1 << XER_CA); @@ -2043,6 +2052,7 @@ gen_set_label(l1); tcg_gen_andi_tl(cpu_xer, cpu_xer, ~(1 << XER_CA)); gen_set_label(l2); + tcg_temp_free(t0); tcg_gen_sari_tl(cpu_gpr[rA(ctx->opcode)], cpu_gpr[rS(ctx->opcode)], sh); } else { tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_gpr[rS(ctx->opcode)]);