[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 20/23] target/i386: Use gen_jmp_rel for gen_repz*
From: |
Richard Henderson |
Subject: |
[PATCH v2 20/23] target/i386: Use gen_jmp_rel for gen_repz* |
Date: |
Tue, 6 Sep 2022 11:09:29 +0100 |
Subtract cur_insn_len to restart the current insn.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
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);
--
2.34.1
- [PATCH v2 08/23] target/i386: Use DISAS_EOB* in gen_movl_seg_T0, (continued)
- [PATCH v2 08/23] target/i386: Use DISAS_EOB* in gen_movl_seg_T0, Richard Henderson, 2022/09/06
- [PATCH v2 09/23] target/i386: Use DISAS_EOB_NEXT, Richard Henderson, 2022/09/06
- [PATCH v2 11/23] target/i386: Create cur_insn_len, cur_insn_len_i32, Richard Henderson, 2022/09/06
- [PATCH v2 13/23] target/i386: Introduce DISAS_JUMP, Richard Henderson, 2022/09/06
- [PATCH v2 20/23] target/i386: Use gen_jmp_rel for gen_repz*,
Richard Henderson <=
- [PATCH v2 16/23] target/i386: Use DISAS_TOO_MANY to exit after gen_io_start, Richard Henderson, 2022/09/06
- [PATCH v2 21/23] target/i386: Use gen_jmp_rel for DISAS_TOO_MANY, Richard Henderson, 2022/09/06
- Re: [PATCH v2 00/23] target/i386: pc-relative translation blocks, Paolo Bonzini, 2022/09/21