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

pulley: Move fp/lr out of XReg set #9806

Merged
merged 3 commits into from
Dec 13, 2024

Conversation

alexcrichton
Copy link
Member

This commit moves the fp and lr registers out of the XReg register set and into the MachineState per-VM. These are automatically modified and read with push_frame and pop_frame. Dedicated xmov_{fp,lr} instructions were added for use in Wasmtime's trampolines which directly read these registers.

cc #9747

@alexcrichton alexcrichton requested review from a team as code owners December 12, 2024 17:58
@alexcrichton alexcrichton requested review from abrown and dicej and removed request for a team December 12, 2024 17:58
@alexcrichton
Copy link
Member Author

I'd like to get there with sp as well too but that'll require more special care since it's used in memory-related instructions as a base for stack loads/stores.

@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator isle Related to the ISLE domain-specific language pulley Issues related to the Pulley interpreter wasmtime:api Related to the API of the `wasmtime` crate itself labels Dec 12, 2024
Copy link

Subscribe to Label Action

cc @cfallin, @fitzgen

This issue or pull request has been labeled: "cranelift", "isle", "pulley", "wasmtime:api"

Thus the following users have been cc'd because of the following labels:

  • cfallin: isle
  • fitzgen: isle, pulley

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

This commit moves the `fp` and `lr` registers out of the `XReg` register
set and into the `MachineState` per-VM. These are automatically modified
and read with `push_frame` and `pop_frame`. Dedicated `xmov_{fp,lr}`
instructions were added for use in Wasmtime's trampolines which directly
read these registers.
Copy link
Member

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

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

Nice!

Comment on lines 96 to 97
x_reg(30) => spilltmp_reg, writable_spilltmp_reg;
x_reg(31) => spilltmp2_reg, writable_spilltmp2_reg;
Copy link
Member

@fitzgen fitzgen Dec 13, 2024

Choose a reason for hiding this comment

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

Do we actually use spilltmp2 in cranelift's pulley backend? AFAICT, we don't. Could free up one more GPR I think.

Also unused in CLIF
@alexcrichton alexcrichton added this pull request to the merge queue Dec 13, 2024
Merged via the queue into bytecodealliance:main with commit 5a646ad Dec 13, 2024
43 checks passed
@alexcrichton alexcrichton deleted the pulley-more-gpr branch December 13, 2024 17:27
@alexcrichton alexcrichton mentioned this pull request Dec 13, 2024
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cranelift Issues related to the Cranelift code generator isle Related to the ISLE domain-specific language pulley Issues related to the Pulley interpreter wasmtime:api Related to the API of the `wasmtime` crate itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants