[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 19/22] target/i386: Use gen_jmp_rel for gen_repz*
From: |
Richard Henderson |
Subject: |
[PATCH 19/22] target/i386: Use gen_jmp_rel for gen_repz* |
Date: |
Mon, 22 Aug 2022 16:33:15 -0700 |
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 6d6c751c10..67c803263b 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 08/22] target/i386: Use DISAS_EOB_NEXT, (continued)
- [PATCH 08/22] target/i386: Use DISAS_EOB_NEXT, Richard Henderson, 2022/08/22
- [PATCH 10/22] target/i386: Create cur_insn_len, cur_insn_len_i32, Richard Henderson, 2022/08/22
- [PATCH 09/22] target/i386: USe DISAS_EOB_ONLY, Richard Henderson, 2022/08/22
- [PATCH 13/22] target/i386: Truncate values for lcall_real to i32, Richard Henderson, 2022/08/22
- [PATCH 15/22] target/i386: Use DISAS_TOO_MANY to exit after gen_io_start, Richard Henderson, 2022/08/22
- [PATCH 16/22] target/i386: Create gen_jmp_rel, Richard Henderson, 2022/08/22
- [PATCH 17/22] target/i386: Use gen_jmp_rel for loop and jecxz insns, Richard Henderson, 2022/08/22
- [PATCH 11/22] target/i386: Remove cur_eip, next_eip arguments to gen_repz*, Richard Henderson, 2022/08/22
- [PATCH 20/22] target/i386: Use gen_jmp_rel for DISAS_TOO_MANY, Richard Henderson, 2022/08/22
- [PATCH 12/22] target/i386: Introduce DISAS_JUMP, Richard Henderson, 2022/08/22
- [PATCH 19/22] target/i386: Use gen_jmp_rel for gen_repz*,
Richard Henderson <=
- [PATCH 18/22] target/i386: Use gen_jmp_rel for gen_jcc, Richard Henderson, 2022/08/22
- [PATCH 22/22] target/i386: Enable TARGET_TB_PCREL, Richard Henderson, 2022/08/22
- [PATCH 21/22] target/i386: Create gen_eip_cur, Richard Henderson, 2022/08/22
- [PATCH 14/22] target/i386: Create eip_next_*, Richard Henderson, 2022/08/22