Added recompiler block tree to x86-64 recompiler. Fixed return value in codeblock_tree_find() that could cause GCC to generate bad code.
This commit is contained in:
parent
36bb949126
commit
14df80109b
2 changed files with 7 additions and 1 deletions
|
|
@ -65,12 +65,14 @@ static inline codeblock_t *codeblock_tree_find(uint32_t phys)
|
||||||
while (block)
|
while (block)
|
||||||
{
|
{
|
||||||
if (phys == block->phys)
|
if (phys == block->phys)
|
||||||
return block;
|
break;
|
||||||
else if (phys < block->phys)
|
else if (phys < block->phys)
|
||||||
block = block->left;
|
block = block->left;
|
||||||
else
|
else
|
||||||
block = block->right;
|
block = block->right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return block;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void codeblock_tree_add(codeblock_t *new_block)
|
static inline void codeblock_tree_add(codeblock_t *new_block)
|
||||||
|
|
|
||||||
|
|
@ -126,6 +126,8 @@ static void delete_block(codeblock_t *block)
|
||||||
fatal("Deleting deleted block\n");
|
fatal("Deleting deleted block\n");
|
||||||
block->pc = 0;
|
block->pc = 0;
|
||||||
|
|
||||||
|
codeblock_tree_delete(block);
|
||||||
|
|
||||||
if (block->prev)
|
if (block->prev)
|
||||||
{
|
{
|
||||||
block->prev->next = block->next;
|
block->prev->next = block->next;
|
||||||
|
|
@ -464,6 +466,8 @@ void codegen_block_end()
|
||||||
// pclog("End block %i\n", block_num);
|
// pclog("End block %i\n", block_num);
|
||||||
|
|
||||||
recomp_page = -1;
|
recomp_page = -1;
|
||||||
|
|
||||||
|
codeblock_tree_add(block);
|
||||||
}
|
}
|
||||||
|
|
||||||
void codegen_flush()
|
void codegen_flush()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue