From patchwork Tue Feb 19 17:40:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 221768 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C599A2C0085 for ; Wed, 20 Feb 2013 05:40:41 +1100 (EST) Received: from localhost ([::1]:49760 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7s7M-0005Su-1U for incoming@patchwork.ozlabs.org; Tue, 19 Feb 2013 13:40:40 -0500 Received: from eggs.gnu.org ([208.118.235.92]:39619) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7s7B-0005Rv-3w for qemu-devel@nongnu.org; Tue, 19 Feb 2013 13:40:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U7rCI-0008Cu-Rv for qemu-devel@nongnu.org; Tue, 19 Feb 2013 12:42:08 -0500 Received: from mail-da0-f47.google.com ([209.85.210.47]:45354) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7rCI-0008CH-L3 for qemu-devel@nongnu.org; Tue, 19 Feb 2013 12:41:42 -0500 Received: by mail-da0-f47.google.com with SMTP id s35so3073256dak.6 for ; Tue, 19 Feb 2013 09:41:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=vBJuSbaHIhq6Yo9hpZOA2UQyc//Tnvx/KnARMCqfZvQ=; b=UtSLsBeevZuuGYf55nAE2iufle4LIKQ8z/nycE1v9Sr6dAxGhCerdf2xCjo2Tdm6ZC t2pmrwMRyj9EJLwqE9sxn36YJDH0FZD5R6LBvqwDhRAvPQPOPywzw5m/5gySVrQKULrm x7CJbWtWiFzP6UFc5r5z+8uRzlSFADveVsEqwI8IOQJ9zdRKoEUvKbKdAuZuESpM71Cv X5DE4eZuDUyWrd59BF+zvuJFqgwhkLATy5oUtG47DY5KCUoWyPGw6WBiWx0/7cGIeIIw LkaGy/Zopu3Os/+vSWhVEvMQ4THD0Vyz2O0zFB2XcEGAz+PaQwAB6WyvoGZTDuQZbOtc dRpw== X-Received: by 10.68.204.164 with SMTP id kz4mr42004673pbc.158.1361295701854; Tue, 19 Feb 2013 09:41:41 -0800 (PST) Received: from anchor.twiddle.net (50-194-63-110-static.hfc.comcastbusiness.net. [50.194.63.110]) by mx.google.com with ESMTPS id 1sm18659295pbg.18.2013.02.19.09.41.39 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 19 Feb 2013 09:41:40 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 19 Feb 2013 09:40:09 -0800 Message-Id: <1361295631-21316-36-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1361295631-21316-1-git-send-email-rth@twiddle.net> References: <1361295631-21316-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.210.47 Cc: blauwirbel@gmail.com, pbonzini@redhat.com, afaerber@suse.de, aurelien@aurel32.net Subject: [Qemu-devel] [PATCH 35/57] target-i386: kill cpu_T3 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Paolo Bonzini It is almost unused, and it is simpler to pass a TCG value directly to gen_shiftd_rm_T1_T3. This value is then written to t2 without going through a temporary register. Signed-off-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target-i386/translate.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/target-i386/translate.c b/target-i386/translate.c index 9d5467d..60c1fdd 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@ -64,7 +64,7 @@ static TCGv cpu_A0, cpu_cc_src, cpu_cc_dst; static TCGv_i32 cpu_cc_op; static TCGv cpu_regs[CPU_NB_REGS]; /* local temps */ -static TCGv cpu_T[2], cpu_T3; +static TCGv cpu_T[2]; /* local register indexes (only used inside old micro ops) */ static TCGv cpu_tmp0, cpu_tmp4; static TCGv_ptr cpu_ptr0, cpu_ptr1; @@ -1858,8 +1858,8 @@ static void gen_rotc_rm_T1(DisasContext *s, int ot, int op1, } /* XXX: add faster immediate case */ -static void gen_shiftd_rm_T1_T3(DisasContext *s, int ot, int op1, - int is_right) +static void gen_shiftd_rm_T1(DisasContext *s, int ot, int op1, + int is_right, TCGv count) { int label1, label2, data_bits; target_ulong mask; @@ -1883,10 +1883,8 @@ static void gen_shiftd_rm_T1_T3(DisasContext *s, int ot, int op1, gen_op_mov_v_reg(ot, t0, op1); } - tcg_gen_andi_tl(cpu_T3, cpu_T3, mask); - + tcg_gen_andi_tl(t2, count, mask); tcg_gen_mov_tl(t1, cpu_T[1]); - tcg_gen_mov_tl(t2, cpu_T3); /* Must test zero case to avoid using undefined behaviour in TCG shifts. */ @@ -5583,12 +5581,12 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s, gen_op_mov_TN_reg(ot, 1, reg); if (shift) { - val = cpu_ldub_code(env, s->pc++); - tcg_gen_movi_tl(cpu_T3, val); + TCGv imm = tcg_const_tl(cpu_ldub_code(env, s->pc++)); + gen_shiftd_rm_T1(s, ot, opreg, op, imm); + tcg_temp_free(imm); } else { - tcg_gen_mov_tl(cpu_T3, cpu_regs[R_ECX]); + gen_shiftd_rm_T1(s, ot, opreg, op, cpu_regs[R_ECX]); } - gen_shiftd_rm_T1_T3(s, ot, opreg, op); break; /************************/ @@ -7869,7 +7867,6 @@ static inline void gen_intermediate_code_internal(CPUX86State *env, cpu_T[0] = tcg_temp_new(); cpu_T[1] = tcg_temp_new(); cpu_A0 = tcg_temp_new(); - cpu_T3 = tcg_temp_new(); cpu_tmp0 = tcg_temp_new(); cpu_tmp1_i64 = tcg_temp_new_i64();