aboutsummaryrefslogtreecommitdiff
path: root/target/sh4/cpu.c
diff options
context:
space:
mode:
authorAnton Johansson <anjo@rev.ng>2023-02-27 14:51:50 +0100
committerRichard Henderson <richard.henderson@linaro.org>2023-03-01 07:33:07 -1000
commitdd69c77cc67f879da04bddc65a07c96a9f13be63 (patch)
treec7cac2cc265c41d8569d8994d22e6da96842a705 /target/sh4/cpu.c
parentc4bf3a92264e13b4468737fce36f08f8028c74d1 (diff)
target/sh4: Replace `tb_pc()` with `tb->pc`
Signed-off-by: Anton Johansson <anjo@rev.ng> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230227135202.9710-16-anjo@rev.ng> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/sh4/cpu.c')
-rw-r--r--target/sh4/cpu.c6
1 files 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;