[PATCH] D54572: [WebAssembly] Change type of wake count to unsigned int

Heejin Ahn via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 15 02:00:37 PST 2018


aheejin created this revision.
aheejin added a reviewer: dschuff.
Herald added subscribers: cfe-commits, jfb, sunfish, jgravelle-google, sbc100.

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


Repository:
  rC Clang

https://reviews.llvm.org/D54572

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


Index: test/CodeGen/builtins-wasm.c
===================================================================
--- test/CodeGen/builtins-wasm.c
+++ test/CodeGen/builtins-wasm.c
@@ -77,7 +77,7 @@
   // 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 %{{.*}})
Index: include/clang/Basic/BuiltinsWebAssembly.def
===================================================================
--- include/clang/Basic/BuiltinsWebAssembly.def
+++ include/clang/Basic/BuiltinsWebAssembly.def
@@ -37,7 +37,7 @@
 // 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")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54572.174169.patch
Type: text/x-patch
Size: 1207 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181115/27247b68/attachment.bin>


More information about the cfe-commits mailing list