From patchwork Tue Sep 6 10:09:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 603011 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:4388:0:0:0:0 with SMTP id w8csp4427160mae; Tue, 6 Sep 2022 04:13:16 -0700 (PDT) X-Google-Smtp-Source: AA6agR6si/LUV+0eWQH6m08nRYKfMNAEHyJA3h5WII1WpzEwHplvH1UDDbYv95jGOYMSYcnPhhI5 X-Received: by 2002:a05:622a:44f:b0:343:499:e77c with SMTP id o15-20020a05622a044f00b003430499e77cmr41865626qtx.129.1662462796377; Tue, 06 Sep 2022 04:13:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662462796; cv=none; d=google.com; s=arc-20160816; b=AzjBOkBc4J988kF1AAFXSVhXpeG1ZFAyJdHc1LKED6UCXZvcrCIcaAZnZqUtSbyhG/ 3TeOn4DZQb4rFS67dbAOWM98RkUOFnm74ttgZo4W0isFHfD3oY7RIFIMsfbpYKm2e1Uk 4edCOP1mDNQ6eJnlseLTbtgBd3vyaMQwljcFYsfwd+F8byZYU+MpG9nopvlEg4XmosWk Kqn3HR6YaTzAXJY0pTslBE3GabTyPoriLb59AGM2j/9oMErKy0JnhG35y1BRaDKu+pim Xn+Dx7Z4TEG1VbRsanECpT3ZwB2C+EcSwPNUiuZ+AerbX+xiPNInqmIc8RFjLrO3FC5d xKJw== 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=nVh1xXH3Saj+Yr5nLG8CgQIGecm00fAvyeGV47OTtj0=; b=L8h6YMtPY5v1khRjoLdMBzva/0sZWw7d6cR/Kt8k1q6u/5NqJBYSfQ5EHquESD1ngc uDuQ94Ae6uZk/WFwE/ugTELDd+sLO0d8jN0sA86oyUO1El0YV7U3Raw8AkFwCmf4Rfps Ys6WA7FJy/D4TZF2ABdLDLZ7u0zTPAXXdhbZexFoDy9Ru2I97U5BL7uEfN2jyajGwwkf vJO8TlM4IhM6CQHcGEfHQizdHXltaEyGIeTvruxzee3hAFLrETmbV7kEuyv2UWmmGTKT htvLsAI20q3mCYg6ncYr8hy1EnIIZdNXoYKrmv1Ec/NuMRMuWCHNjMOej7esGh+eAHZ+ RtYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XApaAhxu; 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 cm20-20020a05622a251400b0031ed9558bb5si7476585qtb.522.2022.09.06.04.13.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 06 Sep 2022 04:13:16 -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=XApaAhxu; 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]:60116 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oVWW3-0000fH-U4 for patch@linaro.org; Tue, 06 Sep 2022 07:13:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57666) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oVVWo-0000Ha-53 for qemu-devel@nongnu.org; Tue, 06 Sep 2022 06:09:58 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:34790) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oVVWm-0003cm-MD for qemu-devel@nongnu.org; Tue, 06 Sep 2022 06:09:57 -0400 Received: by mail-wr1-x42e.google.com with SMTP id e13so14677300wrm.1 for ; Tue, 06 Sep 2022 03:09:56 -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:cc:to:from:from:to:cc:subject:date; bh=nVh1xXH3Saj+Yr5nLG8CgQIGecm00fAvyeGV47OTtj0=; b=XApaAhxuqVjsnpCPMH+8emtRkj2tbJ0e0g6cYkA/g0gdVs8zgJwJ7NoUDMv+HAg32G Yap7geWSr4OEBPcdloIIcembAY8qRS3e4lyXnThzQF5iF54cjDjR6DwWaQ7vwW09F9jl qFbDQx1mDKa4wjzTVtyo0haRqMp9a3QJ0jBG+ZAQ2xfBKtmuaWomDylvftTtoBu4GiwQ GS8cWAIMyT4vFmaQInZW3v8WEQUDwFGvl0yywHTQo22nonIZgNQ6VLnCZupvV3mRr4F8 2ULApcAiaqDw10g69U6L8RgSTE8jBtU+P1DfkfAtmvi0nKbAs83AkSpx9qd1PU9IfL+M WikA== 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; bh=nVh1xXH3Saj+Yr5nLG8CgQIGecm00fAvyeGV47OTtj0=; b=VwSKFVEro2eAjrFCjA8HS8rG/vee2h+pz51drQCSeg3Zmdw2skkUhD0YQ4UDqeS132 7t1W9qhAkKTJdEijoNHyMa7uDkVjXcFagn0j3rzyThE3/qU4e1TvxZGjkwAPYXZrQNBU +2uBY6JDx1bAbPMBZvasTAqpLW4NNDq15cFEPsaxKSX94JuKw3b6rkVjx00Vh6e7fee1 BWMIDXnjdGC4JFbv1nU9INd9KZxwgJ0QZITAnwZmMKGeu5WHZGCgvl+N5Ibt+ekwVfS4 t+ylcp6DCah/mZec1uKQO03gS4CG63YMS3XlhERHXU9jS8T6hC8cGQEigGX5yRuEdfbp NXsQ== X-Gm-Message-State: ACgBeo1d2jazeQ2MXnSwBFtk1U4Typ6UUKzhnQbkuD46vl3miUWQuci2 qs7UjRAq+iSKQn+k2draTEhxESbPC6Canh+f X-Received: by 2002:adf:db85:0:b0:225:2d24:9455 with SMTP id u5-20020adfdb85000000b002252d249455mr27850689wri.711.1662458995164; Tue, 06 Sep 2022 03:09:55 -0700 (PDT) Received: from localhost.localdomain ([2a02:8084:a5c0:5a80:ba98:3a71:8524:e0b1]) by smtp.gmail.com with ESMTPSA id f25-20020a1c6a19000000b003a840690609sm23125014wmc.36.2022.09.06.03.09.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 03:09:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com Subject: [PATCH v2 22/23] target/i386: Create gen_eip_cur Date: Tue, 6 Sep 2022 11:09:31 +0100 Message-Id: <20220906100932.343523-23-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220906100932.343523-1-richard.henderson@linaro.org> References: <20220906100932.343523-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=richard.henderson@linaro.org; helo=mail-wr1-x42e.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" Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/i386/tcg/translate.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 97a5f7e432..39bcb7263b 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -516,6 +516,11 @@ static inline void gen_op_st_rm_T0_A0(DisasContext *s, int idx, int d) } } +static TCGv gen_eip_cur(DisasContext *s) +{ + return tcg_constant_tl(s->base.pc_next - s->cs_base); +} + static void gen_jmp_im(DisasContext *s, target_ulong pc) { gen_op_jmp_v(tcg_constant_tl(pc)); @@ -6574,7 +6579,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) offsetof(CPUX86State, segs[R_CS].selector)); tcg_gen_st16_i32(s->tmp2_i32, cpu_env, offsetof(CPUX86State, fpcs)); - tcg_gen_st_tl(tcg_constant_tl(s->base.pc_next - s->cs_base), + tcg_gen_st_tl(gen_eip_cur(s), cpu_env, offsetof(CPUX86State, fpip)); } }