-
Notifications
You must be signed in to change notification settings - Fork 148
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
target-dependent function return values #17
Comments
No, you nailed it. I thought about this too because I stated several times that MIR is machine-independent languages. So I am going to implement returning any combinations of values. My plan is to pass other values through the stack. Although there will be still machine-dependence on which values are returned through regs or memory. But if only MIR is used, it should work on any target. Another thing I mentioned that MIR supports only binary compliment arithmetic. So it will not work on machines w/o it. Fortunately, there are very few such machines. And as I know coming C2x standard will require this too.
Thank you I'll investigate this on this week.
|
MIR2C was not updated when I reworked return-stmt. An early version of |
hello,
i'm reading MIR.md and found this paragraph:
this decision seems to make mir programs dependent on ARCH it runs on.
i'm wondering whether it would be preferable to modify API such that any number of args can be returned.
the target-specific codegen could then decide how these are returned (optimally the same way C does it when returning a struct).
so a scripting language can freely use MIR without being restricted in this aspect.
of course i may be missing some important aspects you already considered.
interestingly, c2mir compiles the following snippet
but using m2c[0] on mir code generated by -S causes assert failure.
[0]:
The text was updated successfully, but these errors were encountered: