[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 15/27] target/sh4: Replace `tb_pc()` with `tb->pc`
From: |
Anton Johansson |
Subject: |
[PATCH v3 15/27] target/sh4: Replace `tb_pc()` with `tb->pc` |
Date: |
Mon, 27 Feb 2023 14:51:50 +0100 |
Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/sh4/cpu.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c
index f0934b20fa..61769ffdfa 100644
--- a/target/sh4/cpu.c
+++ b/target/sh4/cpu.c
@@ -26,6 +26,7 @@
#include "migration/vmstate.h"
#include "exec/exec-all.h"
#include "fpu/softfloat-helpers.h"
+#include "tcg/tcg.h"
static void superh_cpu_set_pc(CPUState *cs, vaddr value)
{
@@ -46,7 +47,8 @@ static void superh_cpu_synchronize_from_tb(CPUState *cs,
{
SuperHCPU *cpu = SUPERH_CPU(cs);
- cpu->env.pc = tb_pc(tb);
+ tcg_debug_assert(!(cs->tcg_cflags & CF_PCREL));
+ cpu->env.pc = tb->pc;
cpu->env.flags = tb->flags & TB_FLAG_ENVFLAGS_MASK;
}
@@ -73,7 +75,7 @@ static bool superh_io_recompile_replay_branch(CPUState *cs,
CPUSH4State *env = &cpu->env;
if ((env->flags & (TB_FLAG_DELAY_SLOT | TB_FLAG_DELAY_SLOT_COND))
- && env->pc != tb_pc(tb)) {
+ && !(cs->tcg_cflags & CF_PCREL) && env->pc != tb->pc) {
env->pc -= 2;
env->flags &= ~(TB_FLAG_DELAY_SLOT | TB_FLAG_DELAY_SLOT_COND);
return true;
--
2.39.1
- [PATCH v3 01/27] include/exec: Introduce `CF_PCREL`, (continued)
- [PATCH v3 01/27] include/exec: Introduce `CF_PCREL`, Anton Johansson, 2023/02/27
- [PATCH v3 03/27] target/arm: set `CF_PCREL` in `arm_cpu_realizefn`, Anton Johansson, 2023/02/27
- [PATCH v3 05/27] include/exec: Replace `TARGET_TB_PCREL` with `CF_PCREL`, Anton Johansson, 2023/02/27
- [PATCH v3 08/27] include/exec: Remove `TARGET_TB_PCREL` define, Anton Johansson, 2023/02/27
- [PATCH v3 09/27] target/arm: Remove `TARGET_TB_PCREL` define, Anton Johansson, 2023/02/27
- [PATCH v3 06/27] target/arm: Replace `TARGET_TB_PCREL` with `CF_PCREL`, Anton Johansson, 2023/02/27
- [PATCH v3 07/27] target/i386: Replace `TARGET_TB_PCREL` with `CF_PCREL`, Anton Johansson, 2023/02/27
- [PATCH v3 10/27] target/i386: Remove `TARGET_TB_PCREL` define, Anton Johansson, 2023/02/27
- [PATCH v3 12/27] accel/tcg: Replace `tb_pc()` with `tb->pc`, Anton Johansson, 2023/02/27
- [PATCH v3 11/27] accel/tcg: Move jmp-cache `CF_PCREL` checks to caller, Anton Johansson, 2023/02/27
- [PATCH v3 15/27] target/sh4: Replace `tb_pc()` with `tb->pc`,
Anton Johansson <=
- [PATCH v3 23/27] target/hppa: Replace `tb_pc()` with `tb->pc`, Anton Johansson, 2023/02/27
- [PATCH v3 24/27] target/hexagon: Replace `tb_pc()` with `tb->pc`, Anton Johansson, 2023/02/27
- [PATCH v3 14/27] target/sparc: Replace `tb_pc()` with `tb->pc`, Anton Johansson, 2023/02/27
- [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