216 |
memop_fast_access op_handler) |
memop_fast_access op_handler) |
217 |
{ |
{ |
218 |
m_uint32_t val = sign_extend(offset,16); |
m_uint32_t val = sign_extend(offset,16); |
219 |
u_char *test1,*test2,*p_exception,*p_exit; |
u_char *test1,*test2,*p_exit; |
220 |
|
|
221 |
test2 = NULL; |
test2 = NULL; |
222 |
|
|
286 |
/* Call memory access function */ |
/* Call memory access function */ |
287 |
amd64_call_membase(b->jit_ptr,AMD64_R15,MEMOP_OFFSET(opcode)); |
amd64_call_membase(b->jit_ptr,AMD64_R15,MEMOP_OFFSET(opcode)); |
288 |
|
|
|
/* Exception ? */ |
|
|
amd64_test_reg_reg_size(b->jit_ptr,AMD64_RAX,AMD64_RAX,4); |
|
|
p_exception = b->jit_ptr; |
|
|
amd64_branch8(b->jit_ptr, X86_CC_Z, 0, 1); |
|
|
mips64_jit_tcb_push_epilog(b); |
|
|
|
|
289 |
amd64_patch(p_exit,b->jit_ptr); |
amd64_patch(p_exit,b->jit_ptr); |
|
amd64_patch(p_exception,b->jit_ptr); |
|
290 |
} |
} |
291 |
|
|
292 |
/* Fast memory operation (32-bit) */ |
/* Fast memory operation (32-bit) */ |
296 |
memop_fast_access op_handler) |
memop_fast_access op_handler) |
297 |
{ |
{ |
298 |
m_uint32_t val = sign_extend(offset,16); |
m_uint32_t val = sign_extend(offset,16); |
299 |
u_char *test1,*test2,*p_exception,*p_exit; |
u_char *test1,*test2,*p_exit; |
300 |
|
|
301 |
test2 = NULL; |
test2 = NULL; |
302 |
|
|
366 |
/* Call memory access function */ |
/* Call memory access function */ |
367 |
amd64_call_membase(b->jit_ptr,AMD64_R15,MEMOP_OFFSET(opcode)); |
amd64_call_membase(b->jit_ptr,AMD64_R15,MEMOP_OFFSET(opcode)); |
368 |
|
|
|
/* Exception ? */ |
|
|
amd64_test_reg_reg_size(b->jit_ptr,AMD64_RAX,AMD64_RAX,4); |
|
|
p_exception = b->jit_ptr; |
|
|
amd64_branch8(b->jit_ptr, X86_CC_Z, 0, 1); |
|
|
mips64_jit_tcb_push_epilog(b); |
|
|
|
|
369 |
amd64_patch(p_exit,b->jit_ptr); |
amd64_patch(p_exit,b->jit_ptr); |
|
amd64_patch(p_exception,b->jit_ptr); |
|
370 |
} |
} |
371 |
|
|
372 |
/* Fast memory operation */ |
/* Fast memory operation */ |
393 |
int target,int keep_ll_bit) |
int target,int keep_ll_bit) |
394 |
{ |
{ |
395 |
m_uint64_t val = sign_extend(offset,16); |
m_uint64_t val = sign_extend(offset,16); |
|
u_char *test1; |
|
396 |
|
|
397 |
/* Save PC for exception handling */ |
/* Save PC for exception handling */ |
398 |
mips64_set_pc(b,b->start_pc+((b->mips_trans_pos-1)<<2)); |
mips64_set_pc(b,b->start_pc+((b->mips_trans_pos-1)<<2)); |
416 |
|
|
417 |
/* Call memory access function */ |
/* Call memory access function */ |
418 |
amd64_call_membase(b->jit_ptr,AMD64_RDI,MEMOP_OFFSET(op)); |
amd64_call_membase(b->jit_ptr,AMD64_RDI,MEMOP_OFFSET(op)); |
|
|
|
|
/* Exception ? */ |
|
|
amd64_test_reg_reg_size(b->jit_ptr,AMD64_RAX,AMD64_RAX,4); |
|
|
test1 = b->jit_ptr; |
|
|
amd64_branch8(b->jit_ptr, X86_CC_Z, 0, 1); |
|
|
mips64_jit_tcb_push_epilog(b); |
|
|
amd64_patch(test1,b->jit_ptr); |
|
419 |
} |
} |
420 |
|
|
421 |
/* Coprocessor Register transfert operation */ |
/* Coprocessor Register transfert operation */ |
545 |
/* Increment the number of executed instructions (performance debugging) */ |
/* Increment the number of executed instructions (performance debugging) */ |
546 |
void mips64_inc_perf_counter(mips64_jit_tcb_t *b) |
void mips64_inc_perf_counter(mips64_jit_tcb_t *b) |
547 |
{ |
{ |
548 |
amd64_inc_membase(b->jit_ptr,AMD64_R15,OFFSET(cpu_mips_t,perf_counter)); |
amd64_inc_membase_size(b->jit_ptr, |
549 |
|
AMD64_R15,OFFSET(cpu_mips_t,perf_counter),4); |
550 |
} |
} |
551 |
|
|
552 |
/* ADD */ |
/* ADD */ |