Implement bgezal/bgezall (#23)

This commit is contained in:
Anghelo Carvajal 2024-05-12 22:07:46 -04:00 committed by GitHub
parent 3ab0edf18a
commit d7b223fde5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View File

@ -1182,6 +1182,7 @@ int main(int argc, char** argv) {
RabbitizerConfig_Cfg.pseudos.pseudoBeqz = false;
RabbitizerConfig_Cfg.pseudos.pseudoBnez = false;
RabbitizerConfig_Cfg.pseudos.pseudoNot = false;
RabbitizerConfig_Cfg.pseudos.pseudoBal = false;
std::vector<std::string> relocatable_sections_ordered{};

View File

@ -638,6 +638,15 @@ bool process_instruction(const RecompPort::Context& context, const RecompPort::C
case InstrId::cpu_break:
print_line("do_break({})", instr_vram);
break;
case InstrId::cpu_bgezall:
is_branch_likely = true;
[[fallthrough]];
case InstrId::cpu_bgezal:
print_indent();
print_branch_condition("if (SIGNED({}{}) >= 0) {{", ctx_gpr_prefix(rs), rs);
print_func_call(instr.getBranchVramGeneric());
print_line("}}");
break;
// Cop1 loads/stores
case InstrId::cpu_mtc1: