Add JR test.

This commit is contained in:
Hans-Kristian Arntzen 2020-01-31 20:59:04 +01:00
parent e9e55d7742
commit 9349cd300d
3 changed files with 25 additions and 2 deletions

View File

@ -140,4 +140,5 @@ if (PARALLEL_RSP_TESTS)
rsp_add_test(bgtz)
rsp_add_test(j)
rsp_add_test(jal)
rsp_add_test(jr)
endif()

22
debug-toolchain/jr.s Normal file
View File

@ -0,0 +1,22 @@
.text
.set noreorder
.global main
main:
la $t5, notdie
la $ra, indelay
jr $ra
nop
j die # Test to make sure this becomes a conditional branch.
indelay:
jr $t5
li $t0, 1
die:
li $t0, 0x10000
notdie:
li $t1, 2
break

View File

@ -1346,12 +1346,12 @@ Func CPU::jit_region(uint64_t hash, unsigned pc_word, unsigned instruction_count
jit_prolog();
jit_tramp(JIT_FRAME_SIZE);
jit_node_t *branch_targets[CODE_BLOCK_WORDS];
jit_node_t *branch_targets[CODE_BLOCK_WORDS * 2];
jit_node_t *latent_delay_slot = nullptr;
local_branches.clear();
// Mark which instructions can be branched to via local goto.
bool block_entry[CODE_BLOCK_WORDS];
bool block_entry[CODE_BLOCK_WORDS * 2];
memset(block_entry, 0, instruction_count * sizeof(bool));
jit_mark_block_entries(pc_word, pc_word + instruction_count, block_entry);