Skip to content

Conversation

@cadmic
Copy link
Contributor

@cadmic cadmic commented Feb 24, 2025

For the live register tracking in pass4/pass5, the logic added an implicit edge between instructions i + 1 and i + 2 to skip a function call, but this doesn't work for bltzall/bgezall since instruction i + 1 may not be be executed. I turned this in an explicit edge instead. I diffed all the existing programs and there are no changes to the generated C code. The implementation kinda makes my head hurt though so I'd appreciate some double-checking

Copy link
Contributor

@AngheloAlf AngheloAlf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the code is okay, but I'm not completely sure either.

Since this is still generating the same code for the current programs then it should be fine, worse case scenario only ld 7.1 is broken

Comment on lines 678 to +684
if (insn.instruction.getUniqueId() == rabbitizer::InstrId::UniqueId::cpu_jal ||
insn.instruction.getUniqueId() == rabbitizer::InstrId::UniqueId::cpu_j) {
insn.instruction.getUniqueId() == rabbitizer::InstrId::UniqueId::cpu_j ||
insn.instruction.getUniqueId() == rabbitizer::InstrId::UniqueId::cpu_bal ||
insn.instruction.getUniqueId() == rabbitizer::InstrId::UniqueId::cpu_bltzal ||
insn.instruction.getUniqueId() == rabbitizer::InstrId::UniqueId::cpu_bgezal ||
insn.instruction.getUniqueId() == rabbitizer::InstrId::UniqueId::cpu_bltzall ||
insn.instruction.getUniqueId() == rabbitizer::InstrId::UniqueId::cpu_bgezall) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This starts to look like switch territory

}

void pass4(void) {
vector<uint32_t> q; // TODO: Why is this called q?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lmao, it was so obvious. Wonder what we were thinking at the time

@AngheloAlf AngheloAlf merged commit 05cd3a6 into decompals:main Feb 25, 2025
8 checks passed
@cadmic cadmic deleted the branch-and-link branch February 25, 2025 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants