From nobody Thu Nov 6 01:09:04 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 153829707906557.78801501160456; Sun, 30 Sep 2018 01:44:39 -0700 (PDT) Received: from localhost ([::1]:54377 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6XL6-0006fi-FG for importer@patchew.org; Sun, 30 Sep 2018 04:44:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41361) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6WrJ-0002Ir-9f for qemu-devel@nongnu.org; Sun, 30 Sep 2018 04:13:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g6WrH-0000Pf-Ur for qemu-devel@nongnu.org; Sun, 30 Sep 2018 04:13:45 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:40050) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g6WrH-0000OH-Na for qemu-devel@nongnu.org; Sun, 30 Sep 2018 04:13:43 -0400 Received: by mail-wm1-x32b.google.com with SMTP id o2-v6so5729717wmh.5 for ; Sun, 30 Sep 2018 01:13:43 -0700 (PDT) Received: from 640k.lan (94-36-187-248.adsl-ull.clienti.tiscali.it. [94.36.187.248]) by smtp.gmail.com with ESMTPSA id u76-v6sm11369194wmd.10.2018.09.30.01.13.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Sep 2018 01:13:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=f92WyQpRyX1XCYfJINuff1xPlXbK450u4bhtosxib2U=; b=jgYixHu/lJTRVqc7fp1W4lOJHEtrTC6NeAafacC0vmRAo07bag9jM/BsDuBHbDyucS eyJRXnoDqc7L/eAB2whZYx3Kaz9WpKRg9v2wLMmpKUyUiSKdFuUKDFLt3wPZOFMp1Oxy 1eGbL9s74NfeGYta1wz4wJCKXUmGYONdRDFNlTVs5WU1bVoPoO96P1qfrtwjWkKE3AYD PTGL2Ss7QvmlSv1H19s0b72l4eFhAS7jc73no9igfMmYEnjXiB4v7izHKkgbJF25ZH+L GiSxxI8vS+GTdE9G0Zn6wq5DPBPGMPAwUj9FlgtsNkcsKbtjvS6OwYQNkUay+IA4+JlI Opyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=f92WyQpRyX1XCYfJINuff1xPlXbK450u4bhtosxib2U=; b=TNJrfQvAPIMFmG9lrqchHeWwGrxHF+lhqnRDMr8vIfATcfuDRiUhM7UQGjmK7aBR0Z /wcJRdXYbOavb1Qx2GOG4bO25R9UugyVTRkaVZflTdwh4+//7If0NBJfMAAPZp5kH9Gy NAoOBgZHCJWHPS6DQYQ7eq29zAGhBdk7DkT5y9XexXYd6oRUy6623RXt+yVc0uizEChe oWNoUdU/YPjW3ueHan0w9R9nO5xWI2Ivl1jKN116asLH5BzEnC3IXmJlADJV7F/QGD9+ unu5j4MEWUIKwXNuW540nCVSCq8nR5dGUwcQNSCnB/tw2lV1/ppzFENEt7hVk9nKhqg5 Hf6A== X-Gm-Message-State: ABuFfojM2mSWIlkSleur+lo9TXmqEU2Q2ss8mpDfetTrUqeORwaVBOsx eohjKxKFRTvt99R/n454UWBN/4H1 X-Google-Smtp-Source: ACcGV602xB+gKzRl372UoYjCOuPC0wwhUDLNlc1d4PN6y00kDJ1Xd6ELnNyBVrAdrU2uro31sjGY/A== X-Received: by 2002:a7b:c0d3:: with SMTP id s19-v6mr5970591wmh.119.1538295222359; Sun, 30 Sep 2018 01:13:42 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sun, 30 Sep 2018 10:12:23 +0200 Message-Id: <1538295197-23704-26-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1538295197-23704-1-git-send-email-pbonzini@redhat.com> References: <1538295197-23704-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32b Subject: [Qemu-devel] [PULL 25/79] target/i386: move cpu_cc_srcT to DisasContext X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Emilio G. Cota" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/translate.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/target/i386/translate.c b/target/i386/translate.c index 1f9d1d9..e9f5124 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -73,7 +73,7 @@ =20 /* global register indexes */ static TCGv cpu_A0; -static TCGv cpu_cc_dst, cpu_cc_src, cpu_cc_src2, cpu_cc_srcT; +static TCGv cpu_cc_dst, cpu_cc_src, cpu_cc_src2; static TCGv_i32 cpu_cc_op; static TCGv cpu_regs[CPU_NB_REGS]; static TCGv cpu_seg_base[6]; @@ -135,6 +135,10 @@ typedef struct DisasContext { int cpuid_ext3_features; int cpuid_7_0_ebx_features; int cpuid_xsave_features; + + /* TCG local temps */ + TCGv cc_srcT; + sigjmp_buf jmpbuf; } DisasContext; =20 @@ -244,7 +248,7 @@ static void set_cc_op(DisasContext *s, CCOp op) tcg_gen_discard_tl(cpu_cc_src2); } if (dead & USES_CC_SRCT) { - tcg_gen_discard_tl(cpu_cc_srcT); + tcg_gen_discard_tl(s->cc_srcT); } =20 if (op =3D=3D CC_OP_DYNAMIC) { @@ -667,11 +671,11 @@ static inline void gen_op_testl_T0_T1_cc(void) tcg_gen_and_tl(cpu_cc_dst, cpu_T0, cpu_T1); } =20 -static void gen_op_update_neg_cc(void) +static void gen_op_update_neg_cc(DisasContext *s) { tcg_gen_mov_tl(cpu_cc_dst, cpu_T0); tcg_gen_neg_tl(cpu_cc_src, cpu_T0); - tcg_gen_movi_tl(cpu_cc_srcT, 0); + tcg_gen_movi_tl(s->cc_srcT, 0); } =20 /* compute all eflags to cc_src */ @@ -742,7 +746,7 @@ static CCPrepare gen_prepare_eflags_c(DisasContext *s, = TCGv reg) t1 =3D gen_ext_tl(cpu_tmp0, cpu_cc_src, size, false); /* If no temporary was used, be careful not to alias t1 and t0. */ t0 =3D t1 =3D=3D cpu_cc_src ? cpu_tmp0 : reg; - tcg_gen_mov_tl(t0, cpu_cc_srcT); + tcg_gen_mov_tl(t0, s->cc_srcT); gen_extu(size, t0); goto add_sub; =20 @@ -899,7 +903,7 @@ static CCPrepare gen_prepare_cc(DisasContext *s, int b,= TCGv reg) size =3D s->cc_op - CC_OP_SUBB; switch (jcc_op) { case JCC_BE: - tcg_gen_mov_tl(cpu_tmp4, cpu_cc_srcT); + tcg_gen_mov_tl(cpu_tmp4, s->cc_srcT); gen_extu(size, cpu_tmp4); t0 =3D gen_ext_tl(cpu_tmp0, cpu_cc_src, size, false); cc =3D (CCPrepare) { .cond =3D TCG_COND_LEU, .reg =3D cpu_tmp4, @@ -912,7 +916,7 @@ static CCPrepare gen_prepare_cc(DisasContext *s, int b,= TCGv reg) case JCC_LE: cond =3D TCG_COND_LE; fast_jcc_l: - tcg_gen_mov_tl(cpu_tmp4, cpu_cc_srcT); + tcg_gen_mov_tl(cpu_tmp4, s->cc_srcT); gen_exts(size, cpu_tmp4); t0 =3D gen_ext_tl(cpu_tmp0, cpu_cc_src, size, true); cc =3D (CCPrepare) { .cond =3D cond, .reg =3D cpu_tmp4, @@ -1309,11 +1313,11 @@ static void gen_op(DisasContext *s1, int op, TCGMem= Op ot, int d) case OP_SUBL: if (s1->prefix & PREFIX_LOCK) { tcg_gen_neg_tl(cpu_T0, cpu_T1); - tcg_gen_atomic_fetch_add_tl(cpu_cc_srcT, cpu_A0, cpu_T0, + tcg_gen_atomic_fetch_add_tl(s1->cc_srcT, cpu_A0, cpu_T0, s1->mem_index, ot | MO_LE); - tcg_gen_sub_tl(cpu_T0, cpu_cc_srcT, cpu_T1); + tcg_gen_sub_tl(cpu_T0, s1->cc_srcT, cpu_T1); } else { - tcg_gen_mov_tl(cpu_cc_srcT, cpu_T0); + tcg_gen_mov_tl(s1->cc_srcT, cpu_T0); tcg_gen_sub_tl(cpu_T0, cpu_T0, cpu_T1); gen_op_st_rm_T0_A0(s1, ot, d); } @@ -1356,7 +1360,7 @@ static void gen_op(DisasContext *s1, int op, TCGMemOp= ot, int d) break; case OP_CMPL: tcg_gen_mov_tl(cpu_cc_src, cpu_T1); - tcg_gen_mov_tl(cpu_cc_srcT, cpu_T0); + tcg_gen_mov_tl(s1->cc_srcT, cpu_T0); tcg_gen_sub_tl(cpu_cc_dst, cpu_T0, cpu_T1); set_cc_op(s1, CC_OP_SUBB + ot); break; @@ -4823,7 +4827,7 @@ static target_ulong disas_insn(DisasContext *s, CPUSt= ate *cpu) gen_op_mov_reg_v(ot, rm, cpu_T0); } } - gen_op_update_neg_cc(); + gen_op_update_neg_cc(s); set_cc_op(s, CC_OP_SUBB + ot); break; case 4: /* mul */ @@ -5283,7 +5287,7 @@ static target_ulong disas_insn(DisasContext *s, CPUSt= ate *cpu) } } tcg_gen_mov_tl(cpu_cc_src, oldv); - tcg_gen_mov_tl(cpu_cc_srcT, cmpv); + tcg_gen_mov_tl(s->cc_srcT, cmpv); tcg_gen_sub_tl(cpu_cc_dst, cmpv, oldv); set_cc_op(s, CC_OP_SUBB + ot); tcg_temp_free(oldv); @@ -8463,7 +8467,7 @@ static void i386_tr_init_disas_context(DisasContextBa= se *dcbase, CPUState *cpu) cpu_tmp4 =3D tcg_temp_new(); cpu_ptr0 =3D tcg_temp_new_ptr(); cpu_ptr1 =3D tcg_temp_new_ptr(); - cpu_cc_srcT =3D tcg_temp_local_new(); + dc->cc_srcT =3D tcg_temp_local_new(); } =20 static void i386_tr_tb_start(DisasContextBase *db, CPUState *cpu) --=20 1.8.3.1