[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 19/27] target/mips: Replace `tb_pc()` with `tb->pc`
From: |
Anton Johansson |
Subject: |
[PATCH v3 19/27] target/mips: Replace `tb_pc()` with `tb->pc` |
Date: |
Mon, 27 Feb 2023 14:51:54 +0100 |
Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/mips/tcg/exception.c | 3 ++-
target/mips/tcg/sysemu/special_helper.c | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/target/mips/tcg/exception.c b/target/mips/tcg/exception.c
index 96e61170e6..da49a93912 100644
--- a/target/mips/tcg/exception.c
+++ b/target/mips/tcg/exception.c
@@ -82,7 +82,8 @@ void mips_cpu_synchronize_from_tb(CPUState *cs, const
TranslationBlock *tb)
MIPSCPU *cpu = MIPS_CPU(cs);
CPUMIPSState *env = &cpu->env;
- env->active_tc.PC = tb_pc(tb);
+ tcg_debug_assert(!(cs->tcg_cflags & CF_PCREL));
+ env->active_tc.PC = tb->pc;
env->hflags &= ~MIPS_HFLAG_BMASK;
env->hflags |= tb->flags & MIPS_HFLAG_BMASK;
}
diff --git a/target/mips/tcg/sysemu/special_helper.c
b/target/mips/tcg/sysemu/special_helper.c
index 3c5f35c759..93276f789d 100644
--- a/target/mips/tcg/sysemu/special_helper.c
+++ b/target/mips/tcg/sysemu/special_helper.c
@@ -94,7 +94,7 @@ bool mips_io_recompile_replay_branch(CPUState *cs, const
TranslationBlock *tb)
CPUMIPSState *env = &cpu->env;
if ((env->hflags & MIPS_HFLAG_BMASK) != 0
- && env->active_tc.PC != tb_pc(tb)) {
+ && !(cs->tcg_cflags & CF_PCREL) && env->active_tc.PC != tb->pc) {
env->active_tc.PC -= (env->hflags & MIPS_HFLAG_B16 ? 2 : 4);
env->hflags &= ~MIPS_HFLAG_BMASK;
return true;
--
2.39.1
- [PATCH v3 22/27] target/i386: Replace `tb_pc()` with `tb->pc`, (continued)
- [PATCH v3 22/27] target/i386: Replace `tb_pc()` with `tb->pc`, Anton Johansson, 2023/02/27
- [PATCH v3 20/27] target/microblaze: Replace `tb_pc()` with `tb->pc`, Anton Johansson, 2023/02/27
- [PATCH v3 13/27] target/tricore: Replace `tb_pc()` with `tb->pc`, Anton Johansson, 2023/02/27
- [PATCH v3 16/27] target/rx: Replace `tb_pc()` with `tb->pc`, Anton Johansson, 2023/02/27
- [PATCH v3 17/27] target/riscv: Replace `tb_pc()` with `tb->pc`, Anton Johansson, 2023/02/27
- [PATCH v3 18/27] target/openrisc: Replace `tb_pc()` with `tb->pc`, Anton Johansson, 2023/02/27
- [PATCH v3 27/27] include/exec: Remove `tb_pc()`, Anton Johansson, 2023/02/27
- [PATCH v3 21/27] target/loongarch: Replace `tb_pc()` with `tb->pc`, Anton Johansson, 2023/02/27
- [PATCH v3 25/27] target/avr: Replace `tb_pc()` with `tb->pc`, Anton Johansson, 2023/02/27
- [PATCH v3 26/27] target/arm: Replace `tb_pc()` with `tb->pc`, Anton Johansson, 2023/02/27
- [PATCH v3 19/27] target/mips: Replace `tb_pc()` with `tb->pc`,
Anton Johansson <=
- Re: [PATCH v3 00/27] Replace TARGET_TB_PCREL with CF_PCREL, Richard Henderson, 2023/02/27