MarinPostma opened PR #10092 from MarinPostma:atomic-wait
to bytecodealliance:main
:
This PR implements the following instruction in winch for the x64 backend:
atomic.fence
memory.atomic.wait32
memory.atomic.wait64
memory.atomic.notify
MarinPostma requested cfallin for a review on PR #10092.
MarinPostma requested wasmtime-compiler-reviewers for a review on PR #10092.
MarinPostma requested pchickey for a review on PR #10092.
MarinPostma requested wasmtime-core-reviewers for a review on PR #10092.
MarinPostma updated PR #10092.
MarinPostma updated PR #10092.
saulecabrera commented on PR #10092:
I can help with this one.
saulecabrera requested saulecabrera for a review on PR #10092.
MarinPostma updated PR #10092.
MarinPostma updated PR #10092.
github-actions[bot] commented on PR #10092:
Subscribe to Label Action
cc @saulecabrera
<details>
This issue or pull request has been labeled: "winch"Thus the following users have been cc'd because of the following labels:
- saulecabrera: winch
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
saulecabrera submitted PR review.
saulecabrera created PR review comment:
Given that the target memory is an immediate, and immediate values in the stack don't affect the stack ordering principle (since they are not spilled), instead of moving it to a register, it should be possible to insert the immediate directly, this would save one memory write and load at the builtin call site.
We use such pattern extensively in the table operations.
saulecabrera created PR review comment:
Similar comments here regarding the immediate and the stack and also the extend.
saulecabrera created PR review comment:
I think this extend shouldn't be emitted unconditionally: in the case of
memory64
, the address is expected to be64
bits, so there shouldn't be a need to emit this.Also, 32-bit loads are zero extend by default, so I think we can omit this extend entirely?
MarinPostma submitted PR review.
MarinPostma created PR review comment:
Let me check that again, if I recall correctly I added it because it didn't work like I expected with negative offsets
MarinPostma submitted PR review.
MarinPostma created PR review comment:
nevermind, I must have imagined that...
MarinPostma updated PR #10092.
MarinPostma commented on PR #10092:
I made the suggested changes. I think we could avoid popping the stack in the case where we don't have to compute an offset, and just insert the target memory instead, but it complicates the implementation slightly. Happy to do if you think it's better.
MarinPostma edited a comment on PR #10092:
I made the suggested changes. I think we could avoid popping the stack in the case where we don't have to compute an offset, and just insert the target memory instead, but it complicates the implementation slightly. Happy to do it if you think it's better.
saulecabrera submitted PR review:
LGTM, thanks.
saulecabrera merged PR #10092.
Last updated: Feb 28 2025 at 02:27 UTC