From patchwork Mon Aug 22 23:33:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 599227 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:4388:0:0:0:0 with SMTP id w8csp2040601mae; Mon, 22 Aug 2022 16:50:35 -0700 (PDT) X-Google-Smtp-Source: AA6agR6qqeF8TxUu6kx1vY/Knuj9UbLAwDUD/OagAjrjxw80Reu6yinsfoVqD8Rs+MZ5XDXUr8Sy X-Received: by 2002:a05:6214:2346:b0:496:ae16:f602 with SMTP id hu6-20020a056214234600b00496ae16f602mr17763259qvb.37.1661212234978; Mon, 22 Aug 2022 16:50:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661212234; cv=none; d=google.com; s=arc-20160816; b=tF2AAvyrPM6KSz973V7xsDgcrCWTWZuDyJ5G1qHFiXlCGmRlv2fJ5LBQgiNE5Hc2Yb LkCQTdRmY6Pigjaycov960R3xCEdrrq0AKF/QDXC4AQlmBs4RwypQyZP4tDFJbrDU8vn 5dnm8K1IOq+KQ+pJ2COJjBflRc9Tc5UvvePUXK6v9+0NhOUm4NcmE93igQ+D4Vk9iUx0 Lqoxy8QQfJS/C/qp3IPy8Ifs4mN7PRW+zouiQCURhAybpXZa/8CX6wrD0ma75fZGks1f NZuhgbyyVNpYmPQqK1v3k2EbpKuhio3IMptsgTrkXvpeCCpQbxi40J1xiIrh9kbPYbIG SPLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=oqjsX/TV9fFb0FKaIyHXMo7pwCHH1A0NzKkq/LQYAFc=; b=cx2cxr1Thrgy6X1Z97tP5ONm8kpYNROq77PItScTWgVT/X4UM8lJIdNm0pHQXjDeuP z4OQjEXvF0jnhkQnaF5HV1SoMCWXIVsNk6c1ferRYQ9w/MFUAkAit1HtrWr3SxNjwyN3 ZaxaZGhBbMscfXry3qaAbDgUGUGfBY1noBsQ0ldkuXJiQ0zQ5GmXkuCFTGoVzPtCaRDJ PdxSMp4CElq/Qs3Y2HymgePeG7sq5MFXVgTwfr1DmOg25IeI7hu3egzvI/nfh/gkddnn MiayvkXjaVq7H1RVlp/ia0bzXRNjuf6sTYy+qUKmmZ/FTbTzLsF38e9QDCVU7vOvZbCW p2GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="KpyMfWf/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id iw8-20020a0562140f2800b0047489bfca41si5219915qvb.8.2022.08.22.16.50.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Aug 2022 16:50:34 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="KpyMfWf/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:38230 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQHBi-0001NX-Ed for patch@linaro.org; Mon, 22 Aug 2022 19:50:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47838) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQGvF-00061f-BQ for qemu-devel@nongnu.org; Mon, 22 Aug 2022 19:33:33 -0400 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]:33412) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQGvD-0007Fs-HI for qemu-devel@nongnu.org; Mon, 22 Aug 2022 19:33:33 -0400 Received: by mail-pg1-x52f.google.com with SMTP id l64so10798134pge.0 for ; Mon, 22 Aug 2022 16:33:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=oqjsX/TV9fFb0FKaIyHXMo7pwCHH1A0NzKkq/LQYAFc=; b=KpyMfWf/ViZKTpnvq9qZACT23EiriyKD/3+cmVK0h8g+BkDpcwU3NYY6qUI8VuQpjX fEc1KhvW5bf9iqy/s3JMJ7lRZDEERBFlkpTP1AOR72hljv+Nyn+Loq9Ns22goC/B0RvS PauN+OAxpRTG9hGyQJdRFhyqLTmrN7QqU5uPmBdOVy5iygSBTV27tgTJfm92oZpIuhca fYO7ukxa0apPZjlvTrYldregKggasiZ53mjkvR03lQ5rjpcZRzlsLnHbpyfpyOgC3i+R p8yOMNJ1FGnFWm7ZCqZZDl4McTHnq2X9zK07zDqeVBxT1kGzA1V0MZI/Hq/TXpD/JH7N IO+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=oqjsX/TV9fFb0FKaIyHXMo7pwCHH1A0NzKkq/LQYAFc=; b=7YmmlOqFzwg4ql/VnY3AXoPUHN7tiX4DwX3mBY7ChM7Kl+aV7xOkgvPno3Uz1xZ26Q AnhUeKd8r1Mrukwmu8Bf3NaAdRSJLrfi3HPSad2mMxP2BgnDGv+rkFxluKT66ym0E0cY x0+Y/nQ6SB5W2tUBLhmY9fNq2J7nXGsg8+OqdrRHvMNRBohpHXWVnMrOJX3dWmbWv4yx 4BtxJRUFHooB9CCDQIN7RkvHEASjTQqwh3q5Vd5PydfUQCZ480JOK6/iR0sEK4ds0WXY diX+zDE8Aveu5f7PohItkcB0VfmiuGj0nYFUY9bV+FNxo1wSTgERhICyfKY9tziqmVJj pA7w== X-Gm-Message-State: ACgBeo2dUup9TTDewbda4T+fKDe71cAvr9Jgrc3Kvb0LhSGdwKAOqhW4 IWb01TqtZz+35pTr9z+AQ6S0HrxPntzeBQ== X-Received: by 2002:a63:f34b:0:b0:429:f039:ccfc with SMTP id t11-20020a63f34b000000b00429f039ccfcmr18915403pgj.95.1661211210239; Mon, 22 Aug 2022 16:33:30 -0700 (PDT) Received: from stoup.. ([2602:47:d49d:ec01:c3f1:b74f:5edd:63af]) by smtp.gmail.com with ESMTPSA id 82-20020a621555000000b0053655af14easm5133124pfv.45.2022.08.22.16.33.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Aug 2022 16:33:29 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 08/22] target/i386: Use DISAS_EOB_NEXT Date: Mon, 22 Aug 2022 16:33:04 -0700 Message-Id: <20220822233318.1728621-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220822233318.1728621-1-richard.henderson@linaro.org> References: <20220822233318.1728621-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52f; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Replace sequences of gen_update_cc_op, gen_update_eip_next, and gen_eob with the new is_jmp enumerator. Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 40 ++++++++++++------------------------- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 4dc8f4c1f8..73e4330fc0 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -6874,8 +6874,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) gen_pop_update(s, ot); set_cc_op(s, CC_OP_EFLAGS); /* abort translation because TF/AC flag may change */ - gen_update_eip_next(s); - gen_eob(s); + s->base.is_jmp = DISAS_EOB_NEXT; } break; case 0x9e: /* sahf */ @@ -7304,8 +7303,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) gen_helper_rdmsr(cpu_env); } else { gen_helper_wrmsr(cpu_env); - gen_update_eip_next(s); - gen_eob(s); + s->base.is_jmp = DISAS_EOB_NEXT; } } break; @@ -7504,8 +7502,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) goto illegal_op; } gen_helper_clac(cpu_env); - gen_update_eip_next(s); - gen_eob(s); + s->base.is_jmp = DISAS_EOB_NEXT; break; case 0xcb: /* stac */ @@ -7514,8 +7511,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) goto illegal_op; } gen_helper_stac(cpu_env); - gen_update_eip_next(s); - gen_eob(s); + s->base.is_jmp = DISAS_EOB_NEXT; break; CASE_MODRM_MEM_OP(1): /* sidt */ @@ -7559,8 +7555,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) tcg_gen_trunc_tl_i32(s->tmp2_i32, cpu_regs[R_ECX]); gen_helper_xsetbv(cpu_env, s->tmp2_i32, s->tmp1_i64); /* End TB because translation flags may change. */ - gen_update_eip_next(s); - gen_eob(s); + s->base.is_jmp = DISAS_EOB_NEXT; break; case 0xd8: /* VMRUN */ @@ -7621,8 +7616,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) } gen_update_cc_op(s); gen_helper_stgi(cpu_env); - gen_update_eip_next(s); - gen_eob(s); + s->base.is_jmp = DISAS_EOB_NEXT; break; case 0xdd: /* CLGI */ @@ -7660,8 +7654,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) tcg_gen_ext32u_tl(s->A0, cpu_regs[R_EAX]); } gen_helper_flush_page(cpu_env, s->A0); - gen_update_eip_next(s); - gen_eob(s); + s->base.is_jmp = DISAS_EOB_NEXT; break; CASE_MODRM_MEM_OP(2): /* lgdt */ @@ -7744,8 +7737,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) tcg_gen_andi_tl(s->T1, s->T1, ~0xe); tcg_gen_or_tl(s->T0, s->T0, s->T1); gen_helper_write_crN(cpu_env, tcg_constant_i32(0), s->T0); - gen_update_eip_next(s); - gen_eob(s); + s->base.is_jmp = DISAS_EOB_NEXT; break; CASE_MODRM_MEM_OP(7): /* invlpg */ @@ -7755,8 +7747,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) gen_svm_check_intercept(s, SVM_EXIT_INVLPG); gen_lea_modrm(env, s, modrm); gen_helper_flush_page(cpu_env, s->A0); - gen_update_eip_next(s); - gen_eob(s); + s->base.is_jmp = DISAS_EOB_NEXT; break; case 0xf8: /* swapgs */ @@ -8155,8 +8146,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) gen_svm_check_intercept(s, SVM_EXIT_WRITE_CR0 + reg); gen_op_mov_v_reg(s, ot, s->T0, rm); gen_helper_write_crN(cpu_env, tcg_constant_i32(reg), s->T0); - gen_update_eip_next(s); - gen_eob(s); + s->base.is_jmp = DISAS_EOB_NEXT; } else { gen_svm_check_intercept(s, SVM_EXIT_READ_CR0 + reg); gen_helper_read_crN(s->T0, cpu_env, tcg_constant_i32(reg)); @@ -8190,8 +8180,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) gen_op_mov_v_reg(s, ot, s->T0, rm); tcg_gen_movi_i32(s->tmp2_i32, reg); gen_helper_set_dr(cpu_env, s->tmp2_i32, s->T0); - gen_update_eip_next(s); - gen_eob(s); + s->base.is_jmp = DISAS_EOB_NEXT; } else { gen_svm_check_intercept(s, SVM_EXIT_READ_DR0 + reg); tcg_gen_movi_i32(s->tmp2_i32, reg); @@ -8205,8 +8194,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) gen_svm_check_intercept(s, SVM_EXIT_WRITE_CR0); gen_helper_clts(cpu_env); /* abort block because static cpu state changed */ - gen_update_eip_next(s); - gen_eob(s); + s->base.is_jmp = DISAS_EOB_NEXT; } break; /* MMX/3DNow!/SSE/SSE2/SSE3/SSSE3/SSE4 support */ @@ -8302,9 +8290,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) gen_helper_xrstor(cpu_env, s->A0, s->tmp1_i64); /* XRSTOR is how MPX is enabled, which changes how we translate. Thus we need to end the TB. */ - gen_update_cc_op(s); - gen_update_eip_next(s); - gen_eob(s); + s->base.is_jmp = DISAS_EOB_NEXT; break; CASE_MODRM_MEM_OP(6): /* xsaveopt / clwb */