Skip to content

Commit

Permalink
[WebAssembly] Change type of wake count to unsigned int
Browse files Browse the repository at this point in the history
Summary:
We discussed this at the Nov 12th CG meeting, and decided to use the
unsigned semantics for the wake count.
Corresponding spec change:
WebAssembly/threads#110

Reviewers: sbc100

Subscribers: dschuff, jgravelle-google, sunfish, jfb, cfe-commits

Differential Revision: https://reviews.llvm.org/D54572

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347005 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
aheejin committed Nov 16, 2018
1 parent 5023b5e commit f2fcae2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/clang/Basic/BuiltinsWebAssembly.def
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ BUILTIN(__builtin_wasm_rethrow, "v", "r")
// Atomic wait and notify.
BUILTIN(__builtin_wasm_atomic_wait_i32, "ii*iLLi", "n")
BUILTIN(__builtin_wasm_atomic_wait_i64, "iLLi*LLiLLi", "n")
BUILTIN(__builtin_wasm_atomic_notify, "Uii*i", "n")
BUILTIN(__builtin_wasm_atomic_notify, "Uii*Ui", "n")

// Saturating fp-to-int conversions
BUILTIN(__builtin_wasm_trunc_saturate_s_i32_f32, "if", "nc")
Expand Down
2 changes: 1 addition & 1 deletion test/CodeGen/builtins-wasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ int atomic_wait_i64(long long *addr, long long expected, long long timeout) {
// WEBASSEMBLY64: call i32 @llvm.wasm.atomic.wait.i64(i64* %{{.*}}, i64 %{{.*}}, i64 %{{.*}})
}

unsigned int atomic_notify(int *addr, int count) {
unsigned int atomic_notify(int *addr, unsigned int count) {
return __builtin_wasm_atomic_notify(addr, count);
// WEBASSEMBLY32: call i32 @llvm.wasm.atomic.notify(i32* %{{.*}}, i32 %{{.*}})
// WEBASSEMBLY64: call i32 @llvm.wasm.atomic.notify(i32* %{{.*}}, i32 %{{.*}})
Expand Down

0 comments on commit f2fcae2

Please sign in to comment.