-
Notifications
You must be signed in to change notification settings - Fork 12
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 occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| if (!n32) { | ||
| // In O32, only even registers can be used as double registers | ||
| assert(reg % 2 == 0); | ||
| } |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh, I
| if (!n32) { | ||
| // In O32, only even registers can be used as double registers | ||
| assert(reg % 2 == 0); | ||
| } |
There was a problem hiding this comment.
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
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
--n32flag (similar to--conservative) to analyze N32 code instead of O32