From patchwork Thu Dec 17 19:19:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 558592 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 1960C1402CD for ; Fri, 18 Dec 2015 06:37:39 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=nSnIi6Sf; dkim-atps=neutral Received: from localhost ([::1]:56635 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9eMr-0007dG-1u for incoming@patchwork.ozlabs.org; Thu, 17 Dec 2015 14:37:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9e60-0004S0-45 for qemu-devel@nongnu.org; Thu, 17 Dec 2015 14:20:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9e5x-0006dy-Bj for qemu-devel@nongnu.org; Thu, 17 Dec 2015 14:20:12 -0500 Received: from mail-qk0-x232.google.com ([2607:f8b0:400d:c09::232]:34106) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9e5x-0006du-6v for qemu-devel@nongnu.org; Thu, 17 Dec 2015 14:20:09 -0500 Received: by mail-qk0-x232.google.com with SMTP id p187so102545445qkd.1 for ; Thu, 17 Dec 2015 11:20:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Qiqp1A2hnCsMr96yaI3Z5PzBMybgHgsJrI2VsLl/zNo=; b=nSnIi6SffzkuJPKlbY4FztHV679TvN0CHXOnpyjA4qJzJ1eyVUTHOsgnkNyzOr1HAu yctOCmBs5MCLXuUAhyxgXi0Agfh6CB9bAj5cQomKhPYaEsjJpbGQHQuPF08u6mMcwqcO lAAxN0EnpyJeL71Yq0D+tgDRk0ZqYWdjgcw+OGlrV71bVhiCGmU6FMEpDdGbxV7k+qgG axRl75CfjAAvMNkNYp9SWr6l0PLEJaewiGRZU366YMi+pG5dBvpi+b9OAzxTHbfLdh9F oJC3d4ggeQfA163MlULbq4Bhrr/SxTcpqSAVWyk7nf7v2JKA6Yy+vOFGLhwOmvxJ/H3u Gneg== X-Received: by 10.55.72.205 with SMTP id v196mr46176907qka.52.1450380008803; Thu, 17 Dec 2015 11:20:08 -0800 (PST) Received: from bigtime.com (200-56-192-86-cable.cybercable.net.mx. [200.56.192.86]) by smtp.gmail.com with ESMTPSA id v129sm5253942qhb.0.2015.12.17.11.20.07 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 17 Dec 2015 11:20:08 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 17 Dec 2015 11:19:25 -0800 Message-Id: <1450379966-28198-10-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1450379966-28198-1-git-send-email-rth@twiddle.net> References: <1450379966-28198-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c09::232 Cc: pbonzini@redhat.com, aurelien@aurel32.net, peter.maydell@linaro.org Subject: [Qemu-devel] [PATCH v2 09/10] target-i386: Tidy gen_add_A0_im 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 Merge gen_op_addl_A0_im and gen_op_addq_A0_im into gen_add_A0_im and clean up the ifdef. Replace the one remaining user of gen_op_addl_A0_im with gen_add_A0_im. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target-i386/translate.c | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/target-i386/translate.c b/target-i386/translate.c index 2be4ba8..8059bbc 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@ -376,29 +376,12 @@ static inline void gen_op_mov_v_reg(TCGMemOp ot, TCGv t0, int reg) } } -static inline void gen_op_addl_A0_im(int32_t val) -{ - tcg_gen_addi_tl(cpu_A0, cpu_A0, val); -#ifdef TARGET_X86_64 - tcg_gen_andi_tl(cpu_A0, cpu_A0, 0xffffffff); -#endif -} - -#ifdef TARGET_X86_64 -static inline void gen_op_addq_A0_im(int64_t val) -{ - tcg_gen_addi_tl(cpu_A0, cpu_A0, val); -} -#endif - static void gen_add_A0_im(DisasContext *s, int val) { -#ifdef TARGET_X86_64 - if (CODE64(s)) - gen_op_addq_A0_im(val); - else -#endif - gen_op_addl_A0_im(val); + tcg_gen_addi_tl(cpu_A0, cpu_A0, val); + if (!CODE64(s)) { + tcg_gen_ext32u_tl(cpu_A0, cpu_A0); + } } static inline void gen_op_jmp_v(TCGv dest) @@ -6232,7 +6215,7 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s, exception */ gen_op_jmp_v(cpu_T[0]); /* pop selector */ - gen_op_addl_A0_im(1 << dflag); + gen_add_A0_im(s, 1 << dflag); gen_op_ld_v(s, dflag, cpu_T[0], cpu_A0); gen_op_movl_seg_T0_vm(R_CS); /* add stack offset */