Skip to content
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

bootstrap4's %call should use stack to stage args #8

Open
mmastrac opened this issue Jul 18, 2022 · 0 comments
Open

bootstrap4's %call should use stack to stage args #8

mmastrac opened this issue Jul 18, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@mmastrac
Copy link
Owner

mmastrac commented Jul 18, 2022

As return values and arguments share the same register (r0), attempting to make a call to another function where the return value is in another position other than the first one causes that argument to get corrupted.

For example:

%call function @foo, @ret will first clobber @ret (aka r0) with @foo, then attempt to put the clobbered value of r0 into r1.

Instead, %call should push the arguments to the stack and then pop them into registers. This is far less efficient, but we're not worried about efficiency in this stage.

This could potentially simplify some argument handling in bootstrap4/compiler0 as well.

@mmastrac mmastrac added the bug Something isn't working label Jul 18, 2022
@mmastrac mmastrac changed the title bootstrap3's %call should use stack to stage args bootstrap4's %call should use stack to stage args Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant