Skip to content

[interpreter] Add *.atomic.wait and atomic.notify - #115

Merged
binji merged 2 commits into
masterfrom
wake-notify
Jan 21, 2019
Merged

binji merged 2 commits into
masterfrom
wake-notify

Conversation

@binji

@binji binji commented Jan 16, 2019

Copy link
Copy Markdown
Member

These are not implemented for execution.

These are not implemented for execution.
@binji
binji requested a review from rossberg January 16, 2019 18:21
Comment thread interpreter/syntax/ast.ml Outdated
type atomicrmwop = rmwop * storeop
type atomicrmwcmpxchgop = storeop

type atomicmemop = storeop (* No atomic operations use Memory.extension *)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would perhaps remove all the aliases to this type (and rename this to just atomicop?); atomicrmwop could go as well -- it seems more logical to have the rmwop as a separate argument directly on the AtomicRMW constructor, since it isn't really related to the memory access per se.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done

Comment thread interpreter/text/arrange.ml Outdated

let memop name {ty; align; offset; _} =
value_type ty ^ "." ^ name ^
let memarg {ty; align; offset; _} =

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: since this one outputs a proper memop, I'd rather keep its name, and call the new one something different (memop_without_type?). Also, I think you can keep the name argument, since even the new function prepends it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done

Comment thread test/core/atomic.wast Outdated
(assert_invalid (module (memory 1 1) (func (drop (i64.atomic.rmw16_u.cmpxchg (i32.const 0) (i64.const 0) (i64.const 0))))) "atomic accesses require shared memory")
(assert_invalid (module (memory 1 1) (func (drop (i64.atomic.rmw32_u.cmpxchg (i32.const 0) (i64.const 0) (i64.const 0))))) "atomic accesses require shared memory")

;; *.atomic.wait and atomic.notify (unimplemented in exec)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Make this a TODO?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done


let memop name {ty; align; offset; _} =
value_type ty ^ "." ^ name ^
let memop_without_type name {ty; align; offset; _} =

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: can remove ty in pattern.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ty is used below when writing alignment. Maybe the name makes this unclear -- it could be memop_without_type_prefix perhaps?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah, sorry, missed that. I think it's fine as is then.

@binji
binji merged commit e7200ba into master Jan 21, 2019
@binji
binji deleted the wake-notify branch January 21, 2019 20:06
stevenfontanella pushed a commit to stevenfontanella/threads that referenced this pull request Feb 11, 2026
Implement bulk memory operations in small-step semantics, as in spec.

Minor fixes:
- In spec, memory.copy was missing use of \vconst in the backwards case
- In interpreter & test, memory.init still trapped if segment has been dropped but length parameter was 0.
stevenfontanella pushed a commit to stevenfontanella/threads that referenced this pull request Feb 11, 2026
…bAssembly#115)

This reverts commit 10d6c6c.

This reverts WebAssembly#96, which squashed all upstream commits into one, which
was not the recommended way in
https://github.com/WebAssembly/proposals/blob/master/howto.md#syncing-with-upstream-changes.

This leaves README.md untouched because WebAssembly#99 made significant changes on
top of the merged version already.
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