From patchwork Mon Feb 8 17:03:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 8252561 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6EB61BEEE5 for ; Mon, 8 Feb 2016 17:09:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C289D203C3 for ; Mon, 8 Feb 2016 17:09:51 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1DAD8203B7 for ; Mon, 8 Feb 2016 17:09:51 +0000 (UTC) Received: from localhost ([::1]:46896 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSpJu-0005gQ-DO for patchwork-qemu-devel@patchwork.kernel.org; Mon, 08 Feb 2016 12:09:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43670) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSpEB-0003nO-2f for qemu-devel@nongnu.org; Mon, 08 Feb 2016 12:03:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aSpE9-0006sv-1i for qemu-devel@nongnu.org; Mon, 08 Feb 2016 12:03:55 -0500 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]:33530) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSpE8-0006sl-Rs for qemu-devel@nongnu.org; Mon, 08 Feb 2016 12:03:52 -0500 Received: by mail-wm0-x233.google.com with SMTP id g62so141574434wme.0 for ; Mon, 08 Feb 2016 09:03:52 -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=qa51eoB/E+ZRS5gnpWsRQdlDG+lwpJ9f2wagudapHYQ=; b=PI/OhqB0C0scr51rEM591hFcKkznDQry4AMEcZUMc6vRjeGm/9KNKMag6yhI7BnZQQ raTh4i8ogl0jqv/EctmJxGEiuioCOgNA4Y2U3PdUmajy3gLeb7lBtdJMQaG04V9jJi/s O1f3NhuDueKI+U4P44Vxpv8VlTOLn5ZGX+Wlh1ZCnHQqZmv9cqpUqlG4mRIHBVOSf4QU 0hTsOBn4Erw6OsPH9A5phKndI3UsuPYkGfhVZI4pyFVilGB6sVJLGTWlnLLggWJ+zLcu jqIcEwPrCdiQW5s+oI0XQ/Jhg5XoVlj+6swl1OlK+gP0VGniBBTwcj2wbEd2RpGUiqCi k28w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=qa51eoB/E+ZRS5gnpWsRQdlDG+lwpJ9f2wagudapHYQ=; b=lmsN/vegN5Cl/eEU/4PVaJPEnVwl41LyehMmx2DPP4h9aOtlSux0mSWgsIY9Cp8utD JsFMq4kaP3i+iFTIh3euqx/dJywHd9iOGcpkNEuaroIPvI0dNGygh2bavmLCQhnddqHA QLlh0qsX2W/za6n/wO5W3GnOipsxcQ8FkXOPKMqH4GJ8fM411v7p5fB2fcELvhy8ib/3 qwmkrmx1YjmJBOjyF2b1wmSbfZkKvVDB/kLkWTwNHwcZiy8sSmui3XFp0q08FGN8wBdv dVW8D/uVW5kiMmyVafes/1NYYEeuI6+qF4aQm7bAemBG+gUmDfVcBzwz9JjniIMZQQyB ht9g== X-Gm-Message-State: AG10YOTcDUPmQ9f9RFdlfWrn4csf3+kjCO5S8eYIZWjhc7TPfeD/CVVfqve1O1O2qoUHXQ== X-Received: by 10.28.65.5 with SMTP id o5mr32198696wma.75.1454951032218; Mon, 08 Feb 2016 09:03:52 -0800 (PST) Received: from 640k.lan (94-39-141-130.adsl-ull.clienti.tiscali.it. [94.39.141.130]) by smtp.gmail.com with ESMTPSA id b1sm30651442wjy.0.2016.02.08.09.03.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Feb 2016 09:03:51 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 8 Feb 2016 18:03:15 +0100 Message-Id: <1454950999-64128-25-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1454950999-64128-1-git-send-email-pbonzini@redhat.com> References: <1454950999-64128-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::233 Cc: Richard Henderson Subject: [Qemu-devel] [PULL 24/28] 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Richard Henderson 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 Message-Id: <1450379966-28198-10-git-send-email-rth@twiddle.net> Signed-off-by: Paolo Bonzini --- 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 6b901b1..e9d61df 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@ -373,29 +373,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) @@ -6229,7 +6212,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 */