Skip to content

winch: Use Masm::with_scratch in ISA-agnostic code #10998

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

Merged

Conversation

saulecabrera
Copy link
Member

@saulecabrera saulecabrera commented Jun 10, 2025

This commit is a follow-up to
#10989; it migrates all the uses of the scratch register to use Masm::with_scratch. This commit also updates the tests that can fail / are ignored, since many of the bugs were introduced by accidental clobbers to scratch registers.

Even though this change doesn't introduce any functional changes, the disassembly changes in aarch64 are due to the usage of x17 as an extra scratch registers.

Copy link
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

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

Very nice 👍

This commit is a follow-up to
bytecodealliance#10989; it migrates
all the uses of the scratch register to use `Masm::with_scratch`. This
commit also updates the tests that can fail / are ignored, since many
of the bugs were introduced by accidental clobbers to scratch
registers.

Even though this change doesn't introduce any functional changes, the
disassembly changes in aarch64 are due to the usage of x17 as an extra
scratch registers. The updates in x64 dissembly are related to offset changes.
@saulecabrera saulecabrera force-pushed the winch-use-masm-with-scratch branch from e9d0d79 to d01bcfd Compare June 10, 2025 17:11
Helper to derive the register class needed for a particular Wasm value type
@saulecabrera saulecabrera marked this pull request as ready for review June 10, 2025 17:32
@saulecabrera saulecabrera requested review from a team as code owners June 10, 2025 17:32
@saulecabrera saulecabrera requested review from cfallin and pchickey and removed request for a team June 10, 2025 17:32
@alexcrichton alexcrichton added this pull request to the merge queue Jun 10, 2025
Merged via the queue into bytecodealliance:main with commit ffef1ed Jun 10, 2025
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants