gen_jump_slot(dc, dest, -1);
}
-static void gen_jumpi(DisasContext *dc, uint32_t dest, int slot)
+static int adjust_jump_slot(DisasContext *dc, uint32_t dest, int slot)
{
- TCGv_i32 tmp = tcg_const_i32(dest);
if (((dc->base.pc_first ^ dest) & TARGET_PAGE_MASK) != 0) {
- slot = -1;
+ return -1;
+ } else {
+ return slot;
}
- gen_jump_slot(dc, tmp, slot);
+}
+
+static void gen_jumpi(DisasContext *dc, uint32_t dest, int slot)
+{
+ TCGv_i32 tmp = tcg_const_i32(dest);
+ gen_jump_slot(dc, tmp, adjust_jump_slot(dc, dest, slot));
tcg_temp_free(tmp);
}
gen_jump_slot(dc, dest, slot);
}
-static void gen_callw(DisasContext *dc, int callinc, TCGv_i32 dest)
-{
- gen_callw_slot(dc, callinc, dest, -1);
-}
-
-static void gen_callwi(DisasContext *dc, int callinc, uint32_t dest, int slot)
-{
- TCGv_i32 tmp = tcg_const_i32(dest);
- if (((dc->base.pc_first ^ dest) & TARGET_PAGE_MASK) != 0) {
- slot = -1;
- }
- gen_callw_slot(dc, callinc, tmp, slot);
- tcg_temp_free(tmp);
-}
-
static bool gen_check_loop_end(DisasContext *dc, int slot)
{
if (dc->base.pc_next == dc->lend) {
static void translate_callw(DisasContext *dc, const uint32_t arg[],
const uint32_t par[])
{
- gen_callwi(dc, par[0], arg[0], 0);
+ TCGv_i32 tmp = tcg_const_i32(arg[0]);
+ gen_callw_slot(dc, par[0], tmp, adjust_jump_slot(dc, arg[0], 0));
+ tcg_temp_free(tmp);
}
static void translate_callx0(DisasContext *dc, const uint32_t arg[],
TCGv_i32 tmp = tcg_temp_new_i32();
tcg_gen_mov_i32(tmp, cpu_R[arg[0]]);
- gen_callw(dc, par[0], tmp);
+ gen_callw_slot(dc, par[0], tmp, -1);
tcg_temp_free(tmp);
}