]> granicus.if.org Git - clang/commitdiff
[WebAssembly] Change type of wake count to unsigned int
authorHeejin Ahn <aheejin@gmail.com>
Fri, 16 Nov 2018 00:48:58 +0000 (00:48 +0000)
committerHeejin Ahn <aheejin@gmail.com>
Fri, 16 Nov 2018 00:48:58 +0000 (00:48 +0000)
Summary:
We discussed this at the Nov 12th CG meeting, and decided to use the
unsigned semantics for the wake count.
Corresponding spec change:
https://github.com/WebAssembly/threads/pull/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

include/clang/Basic/BuiltinsWebAssembly.def
test/CodeGen/builtins-wasm.c

index 92f14d92e9bfbd9af6518c794f4a3b5c27282654..e1e97fe26ada628ffb3dd693da2898ea076cc6a1 100644 (file)
@@ -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")
index dc1923e5d4eae526d902d11ea3a6184b7cd6c54c..dce721ef5a5e5a43386ffddc3463b4c770694d90 100644 (file)
@@ -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 %{{.*}})