[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 24/26] target/i386: Add cpu_eip
From: |
Richard Henderson |
Subject: |
[PATCH v3 24/26] target/i386: Add cpu_eip |
Date: |
Sat, 1 Oct 2022 07:09:33 -0700 |
Create a tcg global temp for this, and use it instead of explicit stores.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/i386/tcg/translate.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
index 5b0dab8633..f08fa060c4 100644
--- a/target/i386/tcg/translate.c
+++ b/target/i386/tcg/translate.c
@@ -64,6 +64,7 @@
/* global register indexes */
static TCGv cpu_cc_dst, cpu_cc_src, cpu_cc_src2;
+static TCGv cpu_eip;
static TCGv_i32 cpu_cc_op;
static TCGv cpu_regs[CPU_NB_REGS];
static TCGv cpu_seg_base[6];
@@ -481,7 +482,7 @@ static void gen_add_A0_im(DisasContext *s, int val)
static inline void gen_op_jmp_v(TCGv dest)
{
- tcg_gen_st_tl(dest, cpu_env, offsetof(CPUX86State, eip));
+ tcg_gen_mov_tl(cpu_eip, dest);
}
static inline
@@ -518,7 +519,7 @@ static inline void gen_op_st_rm_T0_A0(DisasContext *s, int
idx, int d)
static void gen_jmp_im(DisasContext *s, target_ulong pc)
{
- gen_op_jmp_v(tcg_constant_tl(pc));
+ tcg_gen_movi_tl(cpu_eip, pc);
}
static void gen_update_eip_cur(DisasContext *s)
@@ -8614,6 +8615,13 @@ void tcg_x86_init(void)
[R_EDI] = "edi",
[R_EBP] = "ebp",
[R_ESP] = "esp",
+#endif
+ };
+ static const char eip_name[] = {
+#ifdef TARGET_X86_64
+ "rip"
+#else
+ "eip"
#endif
};
static const char seg_base_names[6][8] = {
@@ -8640,6 +8648,7 @@ void tcg_x86_init(void)
"cc_src");
cpu_cc_src2 = tcg_global_mem_new(cpu_env, offsetof(CPUX86State, cc_src2),
"cc_src2");
+ cpu_eip = tcg_global_mem_new(cpu_env, offsetof(CPUX86State, eip),
eip_name);
for (i = 0; i < CPU_NB_REGS; ++i) {
cpu_regs[i] = tcg_global_mem_new(cpu_env,
--
2.34.1
- [PATCH v3 14/26] target/i386: Truncate values for lcall_real to i32, (continued)
- [PATCH v3 14/26] target/i386: Truncate values for lcall_real to i32, Richard Henderson, 2022/10/01
- [PATCH v3 15/26] target/i386: Create eip_next_*, Richard Henderson, 2022/10/01
- [PATCH v3 16/26] target/i386: Use DISAS_TOO_MANY to exit after gen_io_start, Richard Henderson, 2022/10/01
- [PATCH v3 20/26] target/i386: Use gen_jmp_rel for DISAS_TOO_MANY, Richard Henderson, 2022/10/01
- [PATCH v3 17/26] target/i386: Create gen_jmp_rel, Richard Henderson, 2022/10/01
- [PATCH v3 21/26] target/i386: Remove MemOp argument to gen_op_j*_ecx, Richard Henderson, 2022/10/01
- [PATCH v3 19/26] target/i386: Use gen_jmp_rel for gen_jcc, Richard Henderson, 2022/10/01
- [PATCH v3 18/26] target/i386: Use gen_jmp_rel for loop, repz, jecxz insns, Richard Henderson, 2022/10/01
- [PATCH v3 22/26] target/i386: Merge gen_jmp_tb and gen_goto_tb into gen_jmp_rel, Richard Henderson, 2022/10/01
- [PATCH v3 23/26] target/i386: Create eip_cur_tl, Richard Henderson, 2022/10/01
- [PATCH v3 24/26] target/i386: Add cpu_eip,
Richard Henderson <=
- [PATCH v3 25/26] target/i386: Inline gen_jmp_im, Richard Henderson, 2022/10/01
- [PATCH v3 26/26] target/i386: Enable TARGET_TB_PCREL, Richard Henderson, 2022/10/01
- Re: [PATCH v3 00/26] target/i386: pc-relative translation blocks, Paolo Bonzini, 2022/10/01