8000 Implement N32 floating-point regs by cadmic · Pull Request #78 · decompals/ido-static-recomp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Implement N32 floating-point regs #78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occ 8000 asionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 26, 2025
Merged

Conversation

cadmic
Copy link
Contributor
@cadmic cadmic commented Feb 25, 2025

N32 has a full set of 32 FPRs ("FR=1") instead of having odd regs be aliases for the upper halves of even ones. I checked that this PR generates the same code for O32, but the N32 bits are not well-tested because compilers don't do a lot of FP math

And recomp.cpp now has a --n32 flag (similar to --conservative) to analyze N32 code instead of O32

Comment on lines +2052 to +2055
if (!n32) {
// In O32, only even registers can be used as double registers
assert(reg % 2 == 0);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't true, you can use odd registers on o32. That's how doubles are implemented on mips1

Example code from Rocket robot on wheels:

    /* B18C 8000A58C 3C018000 */  lui        $at, %hi(D_80000630)
    /* B190 8000A590 C4210630 */  lwc1       $f1, %lo(D_80000630)($at)
    /* B194 8000A594 C4200634 */  lwc1       $f0, %lo(D_80000630 + 0x4)($at)
    /* B198 8000A598 4620A083 */  div.d      $f2, $f20, $f0

Copy link
Contributor Author
@cadmic cadmic Feb 25, 2025

Choose a reason for hiding this comment

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

that code uses $f2, $f20 and $f0 as double registers which are all even. The lwc1 would be handled by wr() above

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, I missed that part. Nice catch

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.

Ohh, I

Comment on lines +2052 to +2055
if (!n32) {
// In O32, only even registers can be used as double registers
assert(reg % 2 == 0);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, I missed that part. Nice catch

@AngheloAlf AngheloAlf merged commit acd7e82 into decompals:main Feb 26, 2025
8 checks passed
@cadmic cadmic deleted the n32-fp branch February 26, 2025 18:31
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
0