notaz.gp2x.de
/
pcsx_rearmed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cdrom: add a timing hack
[pcsx_rearmed.git]
/
deps
/
lightrec
/
emitter.c
diff --git
a/deps/lightrec/emitter.c
b/deps/lightrec/emitter.c
index
270fd48
..
3f7da58
100644
(file)
--- a/
deps/lightrec/emitter.c
+++ b/
deps/lightrec/emitter.c
@@
-87,21
+87,16
@@
static void lightrec_emit_end_of_block(struct lightrec_cstate *state,
lightrec_jump_to_eob(state, _jit);
}
lightrec_jump_to_eob(state, _jit);
}
-void lightrec_emit_eob(struct lightrec_cstate *state,
const struct block *block,
-
u16 offset, bool after_op
)
+void lightrec_emit_eob(struct lightrec_cstate *state,
+
const struct block *block, u16 offset
)
{
struct regcache *reg_cache = state->reg_cache;
jit_state_t *_jit = block->_jit;
{
struct regcache *reg_cache = state->reg_cache;
jit_state_t *_jit = block->_jit;
- union code c = block->opcode_list[offset].c;
- u32 cycles = state->cycles;
-
- if (after_op)
- cycles += lightrec_cycles_of_opcode(c);
lightrec_clean_regs(reg_cache, _jit);
jit_movi(JIT_V0, block->pc + (offset << 2));
lightrec_clean_regs(reg_cache, _jit);
jit_movi(JIT_V0, block->pc + (offset << 2));
- jit_subi(LIGHTREC_REG_CYCLE, LIGHTREC_REG_CYCLE, cycles);
+ jit_subi(LIGHTREC_REG_CYCLE, LIGHTREC_REG_CYCLE,
state->
cycles);
lightrec_jump_to_eob(state, _jit);
}
lightrec_jump_to_eob(state, _jit);
}
@@
-250,7
+245,7
@@
static void rec_b(struct lightrec_cstate *state, const struct block *block, u16
if (op_flag_local_branch(op->flags)) {
/* Recompile the delay slot */
if (op_flag_local_branch(op->flags)) {
/* Recompile the delay slot */
- if (
next && next->opcode && !op_flag_no_ds(op->flags)
)
+ if (
!op_flag_no_ds(op->flags) && next->opcode
)
lightrec_rec_opcode(state, block, offset + 1);
if (link) {
lightrec_rec_opcode(state, block, offset + 1);
if (link) {
@@
-1127,6
+1122,13
@@
static u32 rec_ram_mask(struct lightrec_state *state)
return (RAM_SIZE << (state->mirrors_mapped * 2)) - 1;
}
return (RAM_SIZE << (state->mirrors_mapped * 2)) - 1;
}
+static u32 rec_io_mask(const struct lightrec_state *state)
+{
+ u32 length = state->maps[PSX_MAP_HW_REGISTERS].length;
+
+ return GENMASK(31 - clz32(length - 1), 0);
+}
+
static void rec_store_memory(struct lightrec_cstate *cstate,
const struct block *block,
u16 offset, jit_code_t code,
static void rec_store_memory(struct lightrec_cstate *cstate,
const struct block *block,
u16 offset, jit_code_t code,
@@
-1258,7
+1260,7
@@
static void rec_store_io(struct lightrec_cstate *cstate,
return rec_store_memory(cstate, block, offset, code, swap_code,
cstate->state->offset_io,
return rec_store_memory(cstate, block, offset, code, swap_code,
cstate->state->offset_io,
-
0x1fffffff
, false);
+
rec_io_mask(cstate->state)
, false);
}
static void rec_store_direct_no_invalidate(struct lightrec_cstate *cstate,
}
static void rec_store_direct_no_invalidate(struct lightrec_cstate *cstate,
@@
-1582,7
+1584,7
@@
static void rec_load_io(struct lightrec_cstate *cstate,
_jit_note(block->_jit, __FILE__, __LINE__);
rec_load_memory(cstate, block, offset, code, swap_code, is_unsigned,
_jit_note(block->_jit, __FILE__, __LINE__);
rec_load_memory(cstate, block, offset, code, swap_code, is_unsigned,
- cstate->state->offset_io,
0x1fffffff
);
+ cstate->state->offset_io,
rec_io_mask(cstate->state)
);
}
static void rec_load_direct(struct lightrec_cstate *cstate,
}
static void rec_load_direct(struct lightrec_cstate *cstate,
@@
-1966,8
+1968,10
@@
rec_mtc0(struct lightrec_cstate *state, const struct block *block, u16 offset)
lightrec_free_reg(reg_cache, rt);
if (!op_flag_no_ds(block->opcode_list[offset].flags) &&
lightrec_free_reg(reg_cache, rt);
if (!op_flag_no_ds(block->opcode_list[offset].flags) &&
- (c.r.rd == 12 || c.r.rd == 13))
- lightrec_emit_eob(state, block, offset + 1, true);
+ (c.r.rd == 12 || c.r.rd == 13)) {
+ state->cycles += lightrec_cycles_of_opcode(c);
+ lightrec_emit_eob(state, block, offset + 1);
+ }
}
static void rec_cp0_MFC0(struct lightrec_cstate *state,
}
static void rec_cp0_MFC0(struct lightrec_cstate *state,