From nobody Wed Nov 27 00:29:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1703269216; cv=none; d=zohomail.com; s=zohoarc; b=YBeErVKxLHgh92pnZdRF8YopHWQKt26h9tDgTiOBxSxDQNzg3HLjR7TjXNIzrIorn3KIN+bcrDR7OBP2KxJ9hgb+WPp8Ht3CyLk8S8EsLM07VTYCfUUSU7YQeEfmLl8WcZ2H1vDVdwXPxDCzmEAUcAtj92PHR2nxNC9RcS2UzuI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1703269216; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=hMgCYkMSChTxWgsOsJ7pbZi3k2H6rsfqHMxXx+MaqbY=; b=QZtmmmnAeOjOrsxudlnglNyouC05Rt1ZoSIPXh3l0dyD+/netaBzN2IrzH5frUiaxRqbCLO3gGAarD6VIUL6wNQm4HGYZbKHM/QVtaHTaKT804wpsI+Skr7z/Avf/bBlzQ2kFbXTb0zuo+Mq5PbjOAMOGHc6VVRPTzD3NaZQyPY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1703269216754424.66851223306116; Fri, 22 Dec 2023 10:20:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rGk4n-00014H-10; Fri, 22 Dec 2023 13:16:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rGk4N-0000y2-7K for qemu-devel@nongnu.org; Fri, 22 Dec 2023 13:16:26 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rGk4I-0006Ae-Kx for qemu-devel@nongnu.org; Fri, 22 Dec 2023 13:16:19 -0500 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-384-Sv_ZktSUMViCLF6-iFhZCQ-1; Fri, 22 Dec 2023 13:16:15 -0500 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-3369382a524so665009f8f.1 for ; Fri, 22 Dec 2023 10:16:15 -0800 (PST) Received: from [192.168.10.118] ([2001:b07:6468:f312:9af8:e5f5:7516:fa89]) by smtp.gmail.com with ESMTPSA id w11-20020adfcd0b000000b003367e35abd4sm4879394wrm.71.2023.12.22.10.16.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 10:16:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1703268977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hMgCYkMSChTxWgsOsJ7pbZi3k2H6rsfqHMxXx+MaqbY=; b=E8d/1BaygetFib4+z0kvu/DeyMXEnPruP5BQ9F2QOoqIow4pM9p+M24vOjPfvVIGmoAr1j KPsBODyKZ9Gf19CUOMPI6DR2222pwEernGQittUIAdjdlQhwGXtOB0yJFi+VvovTnH0wzM 77HrEaKNIFkUY+7wzGfAeYpCh8vuYOo= X-MC-Unique: Sv_ZktSUMViCLF6-iFhZCQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703268974; x=1703873774; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hMgCYkMSChTxWgsOsJ7pbZi3k2H6rsfqHMxXx+MaqbY=; b=RS7nn2nqZmtjE5peUcKLhLyp8j1ZrUXQHMz2RwhK/rVxoKkmyzHaIH6PP/kBW1kuVS TbIhdCQXXO/5ORZv3bEyiuTjD3WcM/9yl+ZHTF0VYlJrt0oNxCPYHWTT304KW+WRt5Gq IaEBK9Su4IZjXrI2nnvdMOPfpLUsHr9xnQ+w0Y+quKSntOpwoP1lbW8UphYdGUSg/L7T S4f9PWCv1Z6Sotd8OJYMOuIjkf+hRmdnVooiNVTaCUzjMPdO5qiByrEV58qxMq8YbENy +WzKKalCRN0cCq3eZesDjTtSX466HvX7Njkvk+PqkLz47Doa6rXkuNujLH9Y7KBRY65A KKPg== X-Gm-Message-State: AOJu0YyV/SlnSz6THL4yakNCq1K3ynO6J+SkS/WBqiqcUHRKT6yzrQ17 MfoCk2hf/V95zH4JEBC5YSFQrgF4xbeY7YSqsT3hSZ6YzsB//M1UbhCYB7cgt72F24fltysynU7 pibSo7EdWIb8qu4ltLgHm+zXSlVSdrA5mW81Ma0cm9qPqDZhB0wjokGM7krBOcCHREbdZqTbGZQ RmfZrGqsk= X-Received: by 2002:adf:eac3:0:b0:333:5247:be11 with SMTP id o3-20020adfeac3000000b003335247be11mr1173086wrn.119.1703268974353; Fri, 22 Dec 2023 10:16:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IGrDnhQaw1nbqCpu26T4b42rz69tH5mOtU1y3bruWyL6eEaKNC+G19Eq7FiJiIDBuP6dNVrIA== X-Received: by 2002:adf:eac3:0:b0:333:5247:be11 with SMTP id o3-20020adfeac3000000b003335247be11mr1173078wrn.119.1703268974038; Fri, 22 Dec 2023 10:16:14 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 04/22] target/i386: remove unnecessary truncations Date: Fri, 22 Dec 2023 19:15:45 +0100 Message-ID: <20231222181603.174137-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231222181603.174137-1-pbonzini@redhat.com> References: <20231222181603.174137-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1703269217141100005 Content-Type: text/plain; charset="utf-8" gen_lea_v_seg (called by gen_add_A0_ds_seg) already zeroes any bits of s->A0 beyond s->aflag. It does so before summing the segment base and, if not in 64-bit mode, also after summing it. Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- target/i386/tcg/emit.c.inc | 4 +--- target/i386/tcg/translate.c | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/target/i386/tcg/emit.c.inc b/target/i386/tcg/emit.c.inc index 82da5488d47..d444d83e534 100644 --- a/target/i386/tcg/emit.c.inc +++ b/target/i386/tcg/emit.c.inc @@ -1242,9 +1242,7 @@ static void gen_LDMXCSR(DisasContext *s, CPUX86State = *env, X86DecodedInsn *decod =20 static void gen_MASKMOV(DisasContext *s, CPUX86State *env, X86DecodedInsn = *decode) { - tcg_gen_mov_tl(s->A0, cpu_regs[R_EDI]); - gen_extu(s->aflag, s->A0); - gen_add_A0_ds_seg(s); + gen_lea_v_seg(s, s->aflag, cpu_regs[R_EDI], R_DS, s->override); =20 if (s->prefix & PREFIX_DATA) { gen_helper_maskmov_xmm(tcg_env, OP_PTR1, OP_PTR2, s->A0); diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index a16eb8d4008..73b83e07e23 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -4183,7 +4183,6 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) tcg_gen_mov_tl(s->A0, cpu_regs[R_EBX]); tcg_gen_ext8u_tl(s->T0, cpu_regs[R_EAX]); tcg_gen_add_tl(s->A0, s->A0, s->T0); - gen_extu(s->aflag, s->A0); gen_add_A0_ds_seg(s); gen_op_ld_v(s, MO_8, s->T0, s->A0); gen_op_mov_reg_v(s, MO_8, R_EAX, s->T0); @@ -5835,7 +5834,6 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) gen_update_cc_op(s); gen_update_eip_cur(s); tcg_gen_mov_tl(s->A0, cpu_regs[R_EAX]); - gen_extu(s->aflag, s->A0); gen_add_A0_ds_seg(s); gen_helper_monitor(tcg_env, s->A0); break; --=20 2.43.0