Skip to content

Add fence instruction and encoding to overview#141

Merged
binji merged 3 commits intomasterfrom
overview-fence
Jul 8, 2019
Merged

Add fence instruction and encoding to overview#141
binji merged 3 commits intomasterfrom
overview-fence

Conversation

@conrad-watt
Copy link
Collaborator

Following #140


The fence operator, `atomic.fence`, takes no operands, and returns nothing. It is intended to preserve the semantics of the [fence operators of higher-level languages](https://en.cppreference.com/w/cpp/atomic/atomic_thread_fence).

Unlike other atomic operators, `atomic.fence` does not target a particular linear memory, and it is therefore *not* a validation error for this operator to be used in a module that does not declare a shared memory.
Copy link
Member

Choose a reason for hiding this comment

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

nit: I assume it's also OK to be used in a module that declares no memory at all.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes; clarified this

@conrad-watt
Copy link
Collaborator Author

Is there anything I can do to move this forward? I've addressed previous comments.

@lars-t-hansen
Copy link

@binji, can you review too?

Copy link
Member

@binji binji left a comment

Choose a reason for hiding this comment

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

sorry, reviewed earlier but didn't approve

@binji binji merged commit 4cbecad into master Jul 8, 2019
@binji binji deleted the overview-fence branch July 8, 2019 00:09
pull bot pushed a commit to Richienb/v8 that referenced this pull request Jul 19, 2019
This adds decoding and compilation of the "atomic.fence" operator, which
is intended to preserve the synchronization guarantees of higher-level
languages.

Unlike other atomic operators, it does not target a particular linear
memory. It may occur in modules which declare no memory, or a non-shared
memory, without causing a validation error.

See proposal: WebAssembly/threads#141
See discussion: WebAssembly/threads#140

R=clemensh@chromium.org
TEST=cctest/test-run-wasm-atomics/RunWasmXXX_AtomicFence
BUG=v8:9452

Change-Id: Ibf7e46227f7edfe5c81c097cfc15924c59614067
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1701856
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62821}
pull bot pushed a commit to Richienb/v8 that referenced this pull request Jul 22, 2019
port 4ca8b4d https://crrev.com/c/1701856

Original Commit Message:
    This adds decoding and compilation of the "atomic.fence" operator, which
    is intended to preserve the synchronization guarantees of higher-level
    languages.

    Unlike other atomic operators, it does not target a particular linear
    memory. It may occur in modules which declare no memory, or a non-shared
    memory, without causing a validation error.

    See proposal: WebAssembly/threads#141
    See discussion: WebAssembly/threads#140

Change-Id: Ia60d58a6bf58e8236591d515d30184418cee47c5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1710337
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Yu Yin <xwafish@gmail.com>
Cr-Commit-Position: refs/heads/master@{#62843}
pull bot pushed a commit to Richienb/v8 that referenced this pull request Jul 22, 2019
Port 4ca8b4d

Original Commit Message:

    This adds decoding and compilation of the "atomic.fence" operator, which
    is intended to preserve the synchronization guarantees of higher-level
    languages.

    Unlike other atomic operators, it does not target a particular linear
    memory. It may occur in modules which declare no memory, or a non-shared
    memory, without causing a validation error.

    See proposal: WebAssembly/threads#141
    See discussion: WebAssembly/threads#140

R=mstarzinger@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=v8:9452
LOG=N

Change-Id: Ib8ad24e65154d7555a47e537f81110be47f4d4de
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1710620
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Reviewed-by: Junliang Yan <jyan@ca.ibm.com>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62850}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Jul 29, 2019
This commit implements the 'atomic.fence' Wasm instruction.

Issue: WebAssembly/threads#140
Overview: WebAssembly/threads#141

The instruction is encoded as, 0xFE 0x03, with a reserved byte trailing for a future
memory order immediate. The instruction is implemented by emitting a memoryBarrier
through the macro assembler.

Differential Revision: https://phabricator.services.mozilla.com/D39264

--HG--
extra : moz-landing-system : lando
xeonchen pushed a commit to xeonchen/gecko that referenced this pull request Jul 30, 2019
This commit implements the 'atomic.fence' Wasm instruction.

Issue: WebAssembly/threads#140
Overview: WebAssembly/threads#141

The instruction is encoded as, 0xFE 0x03, with a reserved byte trailing for a future
memory order immediate. The instruction is implemented by emitting a memoryBarrier
through the macro assembler.

Differential Revision: https://phabricator.services.mozilla.com/D39264
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 4, 2019
This commit implements the 'atomic.fence' Wasm instruction.

Issue: WebAssembly/threads#140
Overview: WebAssembly/threads#141

The instruction is encoded as, 0xFE 0x03, with a reserved byte trailing for a future
memory order immediate. The instruction is implemented by emitting a memoryBarrier
through the macro assembler.

Differential Revision: https://phabricator.services.mozilla.com/D39264

UltraBlame original commit: d32c27f13f21b0927cbfb7ce6f8509c0dea6bf09
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 4, 2019
This commit implements the 'atomic.fence' Wasm instruction.

Issue: WebAssembly/threads#140
Overview: WebAssembly/threads#141

The instruction is encoded as, 0xFE 0x03, with a reserved byte trailing for a future
memory order immediate. The instruction is implemented by emitting a memoryBarrier
through the macro assembler.

Differential Revision: https://phabricator.services.mozilla.com/D39264

UltraBlame original commit: d32c27f13f21b0927cbfb7ce6f8509c0dea6bf09
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 4, 2019
This commit implements the 'atomic.fence' Wasm instruction.

Issue: WebAssembly/threads#140
Overview: WebAssembly/threads#141

The instruction is encoded as, 0xFE 0x03, with a reserved byte trailing for a future
memory order immediate. The instruction is implemented by emitting a memoryBarrier
through the macro assembler.

Differential Revision: https://phabricator.services.mozilla.com/D39264

UltraBlame original commit: d32c27f13f21b0927cbfb7ce6f8509c0dea6bf09
wingo added a commit to wingo/wabt that referenced this pull request Nov 18, 2019
See WebAssembly/threads#141 for the binary
encoding.  This patch does add a field to AtomicFenceExpr for the
consistency model, though without a type for the time being.
wingo added a commit to wingo/wabt that referenced this pull request Apr 20, 2020
See WebAssembly/threads#141 for the binary
encoding.  This patch does add a field to AtomicFenceExpr for the
consistency model, though without a type for the time being.
binji pushed a commit to WebAssembly/wabt that referenced this pull request Apr 20, 2020
See WebAssembly/threads#141 for the binary
encoding.  This patch does add a field to AtomicFenceExpr for the
consistency model, though without a type for the time being.
ngzhian added a commit to ngzhian/wasmparser that referenced this pull request Aug 18, 2020
atomic.fence was added to the threads proposal in
WebAssembly/threads#141, and supported in wabt
in
WebAssembly/wabt@d041025#diff-25d902c24283ab8cfbac54dfa101ad31.
bmeurer pushed a commit to wasdk/wasmparser that referenced this pull request Aug 19, 2020
atomic.fence was added to the threads proposal in
WebAssembly/threads#141, and supported in wabt
in
WebAssembly/wabt@d041025#diff-25d902c24283ab8cfbac54dfa101ad31.
bhearsum pushed a commit to mozilla-releng/staging-firefox that referenced this pull request May 1, 2025
This commit implements the 'atomic.fence' Wasm instruction.

Issue: WebAssembly/threads#140
Overview: WebAssembly/threads#141

The instruction is encoded as, 0xFE 0x03, with a reserved byte trailing for a future
memory order immediate. The instruction is implemented by emitting a memoryBarrier
through the macro assembler.

Differential Revision: https://phabricator.services.mozilla.com/D39264
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.

3 participants