-
Notifications
You must be signed in to change notification settings - Fork 49
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
mips eabi64 support #270
mips eabi64 support #270
Conversation
Hopefully proper eabi args handling
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.
Sorry for extreme slowness in getting to this.
m2c/arch_mips.py
Outdated
"r0": Register("zero"), | ||
} | ||
|
||
o32abi_float_regs = { |
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 is not really o32 abi, is it? is there a reference for this list?
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.
you're right, it's n32, whoops. I renamed it accordingly
https://gist.github.com/EllipticEllipsis/27eef11205c7a59d8ea85632bc49224d#general-purpose-registers
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.
Is the convention that you set the assembler to assemble using n32 register names when targeting eabi? Or is this maybe not something that you specify at all, and all the register name mappings are unique and as
is able to just take the union of them? The gist seems to suggest though that $12 is $t0 rather than $t4 for n32, which doesn't quite match that.
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.
We just pass the following flags to as
for Kingdom Hearts: -no-pad-sections -EL -march=5900 -mabi=eabi
. I am not totally sure how to answer your question unfortunately..
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.
It's a vague question, I was basically just hoping to get some more information about how these aliases work. I gather from experimenting with the flags you mention that as
doesn't actually accept these register names as inputs, nor does objdump output them (-Mreg-names=eabi
is not a thing). And the same seems to be true for integer registers.
So then, I take it all the names are just made up by us? And we made a decision to stay backwards compatible with o32 names, given the choice of naming $12 $t4 instead of $t0? Are eabi projects using some common prelude.inc that define these names for use with as
, or is everyone sticking to numbered registers? Or are there projects assembling code using o32 register names? If so, should we support that, and make $t0 an alias for $a4?
Using the n32 naming of fp regs seems like a poor choice: it names $f21 $ft8 despite it being a saved register. I guess we have a few choices here:
- don't support abi names of fp regs
- use suboptimal names from o32 or n32 (but it's a bit sad to enshrine this in m2c, it makes it harder to change)
- come up with our set of names (and patching https://github.com/decompals/binutils-mips-ps2-decompals?)
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.
For now, I'm fine with option 1.. does it mean just getting rid of this dict?
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.
Yes, should be. Do you have any thoughts on the questions about integer registers?
I'll merge this and then push some follow-ups on top. |
Very much a WIP, but this PR brings us from
to the more accurate
That being said, the signature of this function is broken now, and some actual code changes will probably be needed here