Stream: git-wasmtime

Topic: wasmtime / PR #4243 x64 backend: fix cmpxchg (don't retur...


view this post on Zulip Wasmtime GitHub notifications bot (Jun 08 2022 at 06:50):

cfallin opened PR #4243 from fix-atomic-cas to main:

The current lowering helper for cmpxchg returns the literal RealReg
rax as its result. However, this breaks a number of invariants, and
eventually causes a regalloc panic if used as a blockparam arg (pinned
vregs cannot be used in this way).

In general we have to return regular vregs, not a RealReg, as results of
instructions during lowering. However #4223 added a helper for
x64_cmpxchg that returns a literal rax.

Fortunately we can do the right thing here by just giving a fresh vreg
to the instruction; the regalloc constraints mean that this vreg is
constrained to rax at the instruction (at its def/late point), so the
generator of the instruction need not worry about rax here.

Fixes second issue reported by @bjorn3 in #4234.

cc/fyi @abrown, but I missed this in review (sorry!).

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Jun 08 2022 at 06:50):

cfallin requested abrown for a review on PR #4243.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 08 2022 at 06:50):

cfallin requested fitzgen for a review on PR #4243.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 08 2022 at 13:13):

abrown submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 08 2022 at 13:13):

abrown merged PR #4243.


Last updated: Nov 22 2024 at 17:03 UTC