MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / execute_normal

Function execute_normal

src/newcpu.cpp:5712–5786  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5710}
5711
5712void execute_normal(void)
5713{
5714#ifdef JIT_DEBUG_MEM_CORRUPTION
5715 {
5716 // v34: Vec2 check at ENTRY to execute_normal.
5717 // If detected here, corruption came from compiled code chain BEFORE
5718 // the interpreter + compile_block runs. This is a key transition point.
5719 extern void jit_dbg_check_vec2_dispatch(const char* func_name);
5720 jit_dbg_check_vec2_dispatch("execute_normal_ENTRY");
5721 }
5722#endif
5723
5724 struct regstruct *r = &regs;
5725 int blocklen;
5726 cpu_history pc_hist[MAXRUN];
5727 int total_cycles;
5728
5729 if (check_for_cache_miss ())
5730 return;
5731
5732 total_cycles = 0;
5733 blocklen = 0;
5734 start_pc_p = r->pc_oldp;
5735 start_pc = r->pc;
5736 for (;;) {
5737 /* Take note: This is the do-it-normal loop */
5738 r->instruction_pc = m68k_getpc();
5739 r->opcode = get_jit_opcode();
5740
5741#if defined(JIT) && defined(CPU_x86_64)
5742 /* High x86-64 natmem uses jit_n_addr_unsafe for pointer-clean codegen
5743 * decisions. Keep pc_hist.specmem reserved for actual bank special
5744 * flags; distrust_* and jit_use_memory_helpers() handle the synthetic
5745 * comptrust defaults. */
5746 if (jit_n_addr_unsafe && !jit_n_addr_bank_unsafe) {
5747 special_mem = 0;
5748 } else
5749#endif
5750 special_mem = special_mem_default;
5751 pc_hist[blocklen].location = (uae_u16*)r->pc_p;
5752
5753 (*cpufunctbl[r->opcode])(r->opcode);
5754
5755 cpu_cycles = 4 * CYCLE_UNIT;
5756
5757// cpu_cycles = adjust_cycles(cpu_cycles);
5758 if (!currprefs.cpu_thread) {
5759 do_cycles (cpu_cycles);
5760 }
5761 total_cycles += cpu_cycles;
5762
5763 pc_hist[blocklen].specmem = special_mem;
5764 blocklen++;
5765 if (end_block (r->opcode) || blocklen >= MAXRUN || r->spcflags || uae_int_requested) {
5766#ifdef JIT_DEBUG_MEM_CORRUPTION
5767 {
5768 // v34: Vec2 check AFTER interpreter loop, BEFORE compile_block.
5769 // If detected here, corruption happened during M68k interpretation

Callers

nothing calls this directly

Calls 8

m68k_getpcFunction · 0.85
get_jit_opcodeFunction · 0.85
ppc_interruptFunction · 0.85
intlevFunction · 0.70
check_for_cache_missFunction · 0.50
end_blockFunction · 0.50
compile_blockFunction · 0.50

Tested by

no test coverage detected