From patchwork Tue Oct 11 10:26:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 614171 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp2538628pvb; Tue, 11 Oct 2022 03:49:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7LlJtvc86PQuQkxI1yPI9sVn81KUvNLZT4J6rgsw0QYJyDdIEt1qf3rY3xRLoiemUz3oUz X-Received: by 2002:a05:620a:28cd:b0:6cf:93b3:a78 with SMTP id l13-20020a05620a28cd00b006cf93b30a78mr15967643qkp.11.1665485372076; Tue, 11 Oct 2022 03:49:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665485372; cv=none; d=google.com; s=arc-20160816; b=LPThUPXpatfKsSz7rVCMouiypdDJ0bUDovtmT/z1lXofN+wziJBGF8Gs+Vi9QwoErq nb3/JcM9YTTh/Pm82v4R+n8tbXCB6bxg0t4uAkLR3rH/KRz0mtIH6z7tNO5b8S1vEQKy ybi5WcEz7IjDmJy+L7i3oMb/Svu6BdegESaUksc/4NKQvyFqxhqFH0o3hOab3SRu5PIF sspggUQvg9LQM7OKHPHiXf5T5DKgvxACp76u8zYqIxGOvAgLCseQyf6QDWhIVXIttrur iDgJfnKOlgVJRyOleOYtZMHf69iAbl6uZvA0IkrQSuNKG5jpqRhC93Ad1BzXV4YgG0F8 us8g== 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:cc:to :from:dkim-signature; bh=YQrgVh5+WZj8NBxv9tJEB4/Q2aTJD2W6dvNkeWRMf7E=; b=T2du+KfhNtibeN+jXd0aaX/xeS/R0lkE/zJlpZJSQkWcujUOgvvsErz/jKzWBgjmQr 5qPUqJLlPJM7HTeB9XDpmgB6UNpaVbuwEWwzLN+FWR+yxRioI56YmHL4zj9RwfaE3R1w JHPEN5KjdredmZ7mTtnkjzXAYDdlh+B7lwg36JIivyjVigm8FfRgMjnHLgVp6hI5Sh63 2KIPG0OT2+Pf7wiJPW2jdZXSMr5SdoTQvG1g0Kz9//HVFd8r5NIjCsyaea3VRdiq993H jdVBGdr9Dxi5yg3td3kATy+mOHH0P+tl2D/Ponw4yANo1REbzd7CS1FeIW54K2d4Rm31 SnwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZVVA0DjN; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s4-20020a05620a254400b006ce5a8fdeb7si7085055qko.83.2022.10.11.03.49.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Oct 2022 03:49:32 -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=@redhat.com header.s=mimecast20190719 header.b=ZVVA0DjN; 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=redhat.com Received: from localhost ([::1]:33072 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oiCpH-0000Wi-Hj for patch@linaro.org; Tue, 11 Oct 2022 06:49:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39540) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiCUI-00029W-Uu for qemu-devel@nongnu.org; Tue, 11 Oct 2022 06:27:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:20564) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiCUG-0004UY-9Y for qemu-devel@nongnu.org; Tue, 11 Oct 2022 06:27:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665484066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YQrgVh5+WZj8NBxv9tJEB4/Q2aTJD2W6dvNkeWRMf7E=; b=ZVVA0DjNs6d23dszXFtCzv9AMBwLELjXIGRpqvgCuSshFry1KfpM5pdSf/dVijW82cnPpL tyzh1T6R9fB1ou9ZMF/R9OtLtqqy9U+nPMs/+M0yPVgmI5CynMM30k7E2n1rtcTYgLuzOO Wm5PpKZpzWzk2BBGNZ766FhiyE5ZiGs= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-584-S4QAd99XP96S_4IiNUbVXA-1; Tue, 11 Oct 2022 06:27:45 -0400 X-MC-Unique: S4QAd99XP96S_4IiNUbVXA-1 Received: by mail-ed1-f70.google.com with SMTP id b19-20020a056402351300b0045c129ed62cso4014321edd.6 for ; Tue, 11 Oct 2022 03:27:45 -0700 (PDT) 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:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YQrgVh5+WZj8NBxv9tJEB4/Q2aTJD2W6dvNkeWRMf7E=; b=dT8avyp1CIJgW/tXuMYkH3IE5VRtTQ/0wElFaLtor7kshrYazWwFRTBTv6HQql64aM Q0CZJsyY5IJJSgXxgT5/3ybs9j9eCadawa/zrslzypI3K2yctXNsqfcM8zA6qnP+0i+v Qu5SApvwUa7iaEJfs3uQJ6cedj73t97b7J/WjjfQo9XUrxeXDAkKm9nqcq4PaaBtSxTk 1ki6Muh3Whsz7bTFgJuqgRONp3h/Rlh/5mJCGjYjNtR0oCF6FDlB9mX+quB1wbYpAY5+ TJc+lSfqM7Jb0WYBs5i60mguxN6krgdFTbkdWlTnW4LarG8hamX1EXVat6TBIkn2AaRV 7ETw== X-Gm-Message-State: ACrzQf2kwlMo0ONJ9WtznXjU/E4AJEiWLSFx+0UTgLVDlePERVrR/Fgq CBj01NYLLKel/b2cImylySQCUnR+m2N7nGjX3X1vM7RIQfLZ9Xs4t7qUPTEUbmiIkMJPEWPTm+I p9NBIqjT27WlKvauyMJ1KMKGaMSUGIcAPDJeP5YZ79nha8ryQMNpjGlbGtjBZ6cmamCU= X-Received: by 2002:a17:907:3d8f:b0:78d:b46e:eadd with SMTP id he15-20020a1709073d8f00b0078db46eeaddmr8615552ejc.277.1665484063659; Tue, 11 Oct 2022 03:27:43 -0700 (PDT) X-Received: by 2002:a17:907:3d8f:b0:78d:b46e:eadd with SMTP id he15-20020a1709073d8f00b0078db46eeaddmr8615529ejc.277.1665484063354; Tue, 11 Oct 2022 03:27:43 -0700 (PDT) Received: from avogadro.local ([2001:b07:6468:f312:aad8:f393:e009:e014]) by smtp.gmail.com with ESMTPSA id g3-20020a170906594300b007815c3e95f6sm6838080ejr.146.2022.10.11.03.27.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Oct 2022 03:27:42 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 14/37] target/i386: Use DISAS_EOB_NEXT Date: Tue, 11 Oct 2022 12:26:37 +0200 Message-Id: <20221011102700.319178-15-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221011102700.319178-1-pbonzini@redhat.com> References: <20221011102700.319178-1-pbonzini@redhat.com> MIME-Version: 1.0 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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 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" From: Richard Henderson Replace sequences of gen_update_cc_op, gen_update_eip_next, and gen_eob with the new is_jmp enumerator. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson Message-Id: <20221001140935.465607-10-richard.henderson@linaro.org> Signed-off-by: Paolo Bonzini --- 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 8c0ef0f212..717c978381 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -7022,8 +7022,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 */ @@ -7452,8 +7451,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; @@ -7652,8 +7650,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 */ @@ -7662,8 +7659,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 */ @@ -7707,8 +7703,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 */ @@ -7769,8 +7764,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 */ @@ -7808,8 +7802,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 */ @@ -7892,8 +7885,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 */ @@ -7903,8 +7895,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 */ @@ -8303,8 +8294,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)); @@ -8338,8 +8328,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); @@ -8353,8 +8342,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 */ @@ -8450,9 +8438,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 */