From patchwork Tue Sep 6 10:09:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 603030 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:4388:0:0:0:0 with SMTP id w8csp4452946mae; Tue, 6 Sep 2022 04:52:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR46mBTiam5s65pmScXsAMvGhvYW05Sws+PzTEJqM95gjE0XegVNMFC1QDunnSd01fkyv+tI X-Received: by 2002:ad4:5fce:0:b0:4a4:95ad:627a with SMTP id jq14-20020ad45fce000000b004a495ad627amr8567979qvb.28.1662465148258; Tue, 06 Sep 2022 04:52:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662465148; cv=none; d=google.com; s=arc-20160816; b=eActz9wPy6K8w5Ujy0mAS5EcYm8tmQ46KuoA6tbKOuK2Bsy7PjFJLZf0RR/MFkAF2S ENnzsIEqvgN5COAmi5ACAf6SuRoX0tb3Ac4JKMQXiqztRjoEehiFkXX0lLgVuelJYArm AoqNSb6DuAd+BMk0IffkjXJTNp0KIJOOV76NdWIBduaytVtVXX/iu/M0T4LVcwgxvBn2 MZAegmaq8zPMVXiWY/YbOwrtmUGbX2lqCBWrZrhPvBXv4ycLGZAwFRTKL6trofOegtMK hd6aW3P/+fPXZn8RVLoTzf5CYaASPP0Ro1IyGlEZ6TSOSCUOZ4qlO2bPhlUPfchpY1yE 5QhQ== 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=e4npXQ7DLvxtByjVYox+uTI8xWGyZxkDNG6TBVozSlU=; b=YR2Po/4Inl53y4y1AxHo5OMvVPpuj4N2TOYcucgAnPHQhch/zSG4XwXjbM+Ce/fZj9 5a7qr6tp2wMeKd2NMgCvlRg/YDsnXB+0zoX2aKsrKErcvAfW2tFGUt1BJgx8jr6rc0MA xHB5g9+i6Arfv9quPrdlxZQvWQShd6oZ9JTXdl1Z7ZX3pLo4Lk2vHDg11dh8/ve6YwO/ F97PG5WF+leMDy3CrtS6SYp5oWrlsg9+9O7vbLOKIpiz0eZJweEjhZoWeDe3cYxPQdk1 4xUPd/kOFyT8e2xlhx9YHqM61i6hx6SgIVPW4N8Cxq0w7g3uNKlp/7VraArQ+mVLC7Fe igSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z83udYuj; 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 d14-20020ac8614e000000b0031f0cfa7680si7354391qtm.219.2022.09.06.04.52.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 06 Sep 2022 04:52:28 -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=Z83udYuj; 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]:37626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oVX7z-00087C-PU for patch@linaro.org; Tue, 06 Sep 2022 07:52:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57660) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oVVWm-0000Gs-IU for qemu-devel@nongnu.org; Tue, 06 Sep 2022 06:09:58 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:36433) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oVVWk-0003cG-Pb for qemu-devel@nongnu.org; Tue, 06 Sep 2022 06:09:56 -0400 Received: by mail-wr1-x432.google.com with SMTP id b17so1317079wrq.3 for ; Tue, 06 Sep 2022 03:09:54 -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=e4npXQ7DLvxtByjVYox+uTI8xWGyZxkDNG6TBVozSlU=; b=Z83udYujk4ZpZ+iWoJ6YIeTqUwY6+MIaEucDlXHjNa+AcYet5NaVyJtRqpspgmnZGV kkAOHg8Yq8NDyI47j9x1iiI8mv4MFd2Hq+kSctbpkLifCvq+5dJxlNV8O2wbrFqBloBc t9/QxApXtO4T/mwnXdoJFsv5KNy/wZPD7urfBtnq6Vl3ujXXhlg+tsyseycv16tKStWO 82cSAar6fiDEmn75XTjHE7gZlssfLg6WFBE8+Tlx36UQC51AttFLaRiZNKfg5DSbY5+z BsHNbbMHN8uH2oxAh49toOQ4681XdkW2NjT2C29S9a5w2uPReqOhkyZzih88quj5Cemw rGeA== 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=e4npXQ7DLvxtByjVYox+uTI8xWGyZxkDNG6TBVozSlU=; b=sAkDh/otVnb8d/QlUChdyOdOxvpYUM+A7KpAOOZ/xwdXtoTgnH07X1ufOYMfADGi/S QC0YoJeo+ZkEMfvCRcajArEIclf4j2znGIaJbsn1zbvCcB98m6zaTe5JtuwsxPQyXbDT 91E1gQQmqfNyJvy1/7R70hDjPRf1VGBiyWNqFrv2Ai8TIxvFIA02fF988EyySsawy0mU CEhEaNGCI+ode91vy822jGTeFuRfFjBtgvzcIYeoVR+cJ1nfBQ93GIxzR4thhXw3QdUy GRjv1mF84yYGbpIxCw+iJUgiBnUnNmx+9PfJhC2agVSlgrdBk6zjeiwDAIQxI/f/iv59 161w== X-Gm-Message-State: ACgBeo2BYFrywtEiyPhG07mdXcapU3JoFWb/Fo8AYGWXSkPVupwBRoHP vxJHujr6YHV2TM4QdagNwdazaVbCtLi52g4I X-Received: by 2002:a5d:6d07:0:b0:220:68a1:9ecb with SMTP id e7-20020a5d6d07000000b0022068a19ecbmr28045621wrq.116.1662458993305; Tue, 06 Sep 2022 03:09:53 -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.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 03:09:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com Subject: [PATCH v2 20/23] target/i386: Use gen_jmp_rel for gen_repz* Date: Tue, 6 Sep 2022 11:09:29 +0100 Message-Id: <20220906100932.343523-21-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::432; envelope-from=richard.henderson@linaro.org; helo=mail-wr1-x432.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" Subtract cur_insn_len to restart the current insn. Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index e27f36e4e9..7a9e533c6e 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -224,7 +224,6 @@ STUB_HELPER(wrmsr, TCGv_env env) static void gen_eob(DisasContext *s); static void gen_jr(DisasContext *s); -static void gen_jmp(DisasContext *s, target_ulong eip); static void gen_jmp_tb(DisasContext *s, target_ulong eip, int tb_num); static void gen_jmp_rel(DisasContext *s, MemOp ot, int diff, int tb_num); static void gen_op(DisasContext *s1, int op, MemOp ot, int d); @@ -1277,7 +1276,7 @@ static void gen_repz(DisasContext *s, MemOp ot, if (s->repz_opt) { gen_op_jz_ecx(s, s->aflag, l2); } - gen_jmp(s, s->base.pc_next - s->cs_base); + gen_jmp_rel(s, MO_32, -cur_insn_len(s), 0); } #define GEN_REPZ(op) \ @@ -1297,7 +1296,7 @@ static void gen_repz2(DisasContext *s, MemOp ot, int nz, if (s->repz_opt) { gen_op_jz_ecx(s, s->aflag, l2); } - gen_jmp(s, s->base.pc_next - s->cs_base); + gen_jmp_rel(s, MO_32, -cur_insn_len(s), 0); } #define GEN_REPZ2(op) \ @@ -2751,11 +2750,6 @@ static void gen_jmp_rel(DisasContext *s, MemOp ot, int diff, int tb_num) gen_jmp_tb(s, dest, tb_num); } -static void gen_jmp(DisasContext *s, target_ulong eip) -{ - gen_jmp_tb(s, eip, 0); -} - static inline void gen_ldq_env_A0(DisasContext *s, int offset) { tcg_gen_qemu_ld_i64(s->tmp1_i64, s->A0, s->mem_index, MO_LEUQ);