From nobody Sun Apr 6 04:17:35 2025 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=1737712218; cv=none; d=zohomail.com; s=zohoarc; b=Murdi6Jwkkh3coblvN+OXlkeS8einF04V+TulfBk3KI6YlQeihZFhpTllVHXILy5LquDyFfK37elB/g3lIkL9L5x8NiTTwi9CS3Ixp4mD6mX3T11JPJZYZ3awYilTtkW0H0QCssbs5wNBHczFEad9XRprRDM5ncnjkT0YDi7gIk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1737712218; h=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=JBevoGoFcg9Wd4iiTpRW0rHaDELMzFnRDJIXacwfsdU=; b=jE5pER4BIrozfeHvAp47n1zcncWK9t6ckRaiMim7h5J7b/mfbOYlyJWAr9QOP+M8xJCAJG8Gy3WGA4Ut4/EJubXSAm3Zr6s4vLVB6WL1lLfuEcVELtvvsZWlN5Hpb3xxjeG7ENaSDgbUPfNF7Pl3VWwxP1coQs+8ENH5AASc0Y8= 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 1737712218005355.85800568504885; Fri, 24 Jan 2025 01:50:18 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbGFQ-0006Wi-Vf; Fri, 24 Jan 2025 04:45:09 -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 1tbGFP-0006W2-7B for qemu-devel@nongnu.org; Fri, 24 Jan 2025 04:45:07 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbGFN-0003qe-A3 for qemu-devel@nongnu.org; Fri, 24 Jan 2025 04:45:06 -0500 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-575-cGnTO2R-MlyG0IEuuftqmg-1; Fri, 24 Jan 2025 04:45:01 -0500 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-38c24ac3415so1500725f8f.2 for ; Fri, 24 Jan 2025 01:45:01 -0800 (PST) Received: from [192.168.10.48] ([151.95.59.125]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a1761f4sm2171855f8f.20.2025.01.24.01.44.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 01:44:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1737711904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JBevoGoFcg9Wd4iiTpRW0rHaDELMzFnRDJIXacwfsdU=; b=VJePcRwPgzwsmbBL//v/KrqodU55wgM1HgE0+ahWQPXJcIogXMe3zfQvvg9VYjbNuYu8FM FtTFHaf+RrCygBQ3l5xFw4fJCympq6BxP4FytPxrpITLM3qFPNbjlg1NppGCGIbNF69l81 2ARURjDOfOgvspn5uLCQJ4ALVLi3fZg= X-MC-Unique: cGnTO2R-MlyG0IEuuftqmg-1 X-Mimecast-MFC-AGG-ID: cGnTO2R-MlyG0IEuuftqmg X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737711900; x=1738316700; 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=JBevoGoFcg9Wd4iiTpRW0rHaDELMzFnRDJIXacwfsdU=; b=kj2DSyQQyaPQuW58LrY/UQwLPQ7kWumRdizBlfrvjq6154C0C1VyQI9gA+malwQ1+h XniMqxo8trBHxQRK/5rDQJUn7MGL4iCBaKsNIQXRNtUVJBtVb2BDKdh4Om8gbUDUJiLB RM9DGRiCHR+FHuyBls3KsSxVVIoyEm0/YnA4yt/MwUL8Pd2HEVzSHUt1p6M1uxQT+sL3 n+Qeji8fTAyiPl5DcMp8r+xj3xdseeNLz9cUH76fJXd149FWFvx/m8qPfmbbr2eBpWC6 dE4qQp2YcA8DuZ5BlpBsyPwDEeOW0dzwMZSXLGFkneg5UlsUW0/PrjCAt3my8S3jDEXm MQBg== X-Gm-Message-State: AOJu0YxHlvwcVOjb6gzTk7oF51LV3qHCY1ikpO1Nv53HmFOQZCJQMqrs sUYyjeVhMvsGfjlUUjZfO5djLruKYnnq7feKPzSCKMbSii0R8ppLkues53azgMk6dV9L9+JX421 VXC9R4+R4wzat3LF22f0N0gRL7VzLNnPvh9O2AfTk7RPj7KluGKPYSKm0YA+UW76G3ZOBhzUaZm nX1tE5yrABAvDFSnLzxtzBYgipWA8CCLRF/7MdS/Q= X-Gm-Gg: ASbGnctPzaj7szY4Qx06Jn19PrO/SSAbpyqiS/io5Q1x8/a6/c/1zVZHnT46kRk9Lhc 8VBbv2yvT1Q91DwWtRh55NMEIN7vlYAPy/vBMfosy4XCBorbjDFb4FHnUn1tqeQIxxCCoUD7dAt 404gJPJmdeeZowGGZ5Pzzt48naIm+0v4u8ej1hiZJUxMXkgWLS0RFaMo5Lp3we6NjxX3xV9pEC0 i/zwGQixX0dI1HLfuVjwomZRP+2yfKmOLBrbUDwSfTr/M4OT4xkDImuRQvHroIvICtrJUETXQ== X-Received: by 2002:a5d:59ab:0:b0:386:605:77e with SMTP id ffacd0b85a97d-38bf57beaebmr30842937f8f.49.1737711899645; Fri, 24 Jan 2025 01:44:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IGupPXe6hHHo51ER4hJGbbh5egb8AnEQVVr6m9rE9XQTJUnUwc1W1oJgvSQM1+C7VmOYvL7Iw== X-Received: by 2002:a5d:59ab:0:b0:386:605:77e with SMTP id ffacd0b85a97d-38bf57beaebmr30842818f8f.49.1737711897663; Fri, 24 Jan 2025 01:44:57 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 07/48] target/i386: tcg: move gen_set/reset_* earlier in the file Date: Fri, 24 Jan 2025 10:44:01 +0100 Message-ID: <20250124094442.13207-8-pbonzini@redhat.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250124094442.13207-1-pbonzini@redhat.com> References: <20250124094442.13207-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.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -50 X-Spam_score: -5.1 X-Spam_bar: ----- X-Spam_report: (-5.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.996, 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: 1737712220118019100 Content-Type: text/plain; charset="utf-8" Allow using them in the code that translates REP/REPZ, without forward declarations. Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson Link: https://lore.kernel.org/r/20241215090613.89588-7-pbonzini@redhat.com Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 80 ++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index ee536234398..6347de446a4 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -725,6 +725,46 @@ static inline void gen_op_jnz_ecx(DisasContext *s, TCG= Label *label1) gen_op_j_ecx(s, TCG_COND_NE, label1); } =20 +static void gen_set_hflag(DisasContext *s, uint32_t mask) +{ + if ((s->flags & mask) =3D=3D 0) { + TCGv_i32 t =3D tcg_temp_new_i32(); + tcg_gen_ld_i32(t, tcg_env, offsetof(CPUX86State, hflags)); + tcg_gen_ori_i32(t, t, mask); + tcg_gen_st_i32(t, tcg_env, offsetof(CPUX86State, hflags)); + s->flags |=3D mask; + } +} + +static void gen_reset_hflag(DisasContext *s, uint32_t mask) +{ + if (s->flags & mask) { + TCGv_i32 t =3D tcg_temp_new_i32(); + tcg_gen_ld_i32(t, tcg_env, offsetof(CPUX86State, hflags)); + tcg_gen_andi_i32(t, t, ~mask); + tcg_gen_st_i32(t, tcg_env, offsetof(CPUX86State, hflags)); + s->flags &=3D ~mask; + } +} + +static void gen_set_eflags(DisasContext *s, target_ulong mask) +{ + TCGv t =3D tcg_temp_new(); + + tcg_gen_ld_tl(t, tcg_env, offsetof(CPUX86State, eflags)); + tcg_gen_ori_tl(t, t, mask); + tcg_gen_st_tl(t, tcg_env, offsetof(CPUX86State, eflags)); +} + +static void gen_reset_eflags(DisasContext *s, target_ulong mask) +{ + TCGv t =3D tcg_temp_new(); + + tcg_gen_ld_tl(t, tcg_env, offsetof(CPUX86State, eflags)); + tcg_gen_andi_tl(t, t, ~mask); + tcg_gen_st_tl(t, tcg_env, offsetof(CPUX86State, eflags)); +} + static void gen_helper_in_func(MemOp ot, TCGv v, TCGv_i32 n) { switch (ot) { @@ -2084,46 +2124,6 @@ static void gen_interrupt(DisasContext *s, uint8_t i= ntno) s->base.is_jmp =3D DISAS_NORETURN; } =20 -static void gen_set_hflag(DisasContext *s, uint32_t mask) -{ - if ((s->flags & mask) =3D=3D 0) { - TCGv_i32 t =3D tcg_temp_new_i32(); - tcg_gen_ld_i32(t, tcg_env, offsetof(CPUX86State, hflags)); - tcg_gen_ori_i32(t, t, mask); - tcg_gen_st_i32(t, tcg_env, offsetof(CPUX86State, hflags)); - s->flags |=3D mask; - } -} - -static void gen_reset_hflag(DisasContext *s, uint32_t mask) -{ - if (s->flags & mask) { - TCGv_i32 t =3D tcg_temp_new_i32(); - tcg_gen_ld_i32(t, tcg_env, offsetof(CPUX86State, hflags)); - tcg_gen_andi_i32(t, t, ~mask); - tcg_gen_st_i32(t, tcg_env, offsetof(CPUX86State, hflags)); - s->flags &=3D ~mask; - } -} - -static void gen_set_eflags(DisasContext *s, target_ulong mask) -{ - TCGv t =3D tcg_temp_new(); - - tcg_gen_ld_tl(t, tcg_env, offsetof(CPUX86State, eflags)); - tcg_gen_ori_tl(t, t, mask); - tcg_gen_st_tl(t, tcg_env, offsetof(CPUX86State, eflags)); -} - -static void gen_reset_eflags(DisasContext *s, target_ulong mask) -{ - TCGv t =3D tcg_temp_new(); - - tcg_gen_ld_tl(t, tcg_env, offsetof(CPUX86State, eflags)); - tcg_gen_andi_tl(t, t, ~mask); - tcg_gen_st_tl(t, tcg_env, offsetof(CPUX86State, eflags)); -} - /* Clear BND registers during legacy branches. */ static void gen_bnd_jmp(DisasContext *s) { --=20 2.48.1