Commit Graph

14 Commits

Author SHA1 Message Date
Heejin Ahn 48b19b29ab [WebAssembly] clang-format (NFC)
Summary: This patch runs clang-format on all wasm-only files.

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341254 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-31 20:57:00 +00:00
Heejin Ahn 43e71a0b50 [WebAssembly] Revert type of wake count in atomic.wake to i32
Summary:
We decided to revert this from i64 to i32 in Nov 28 CG meeting. Fixes
PR38632.

Reviewers: dschuff

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340235 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-20 23:49:34 +00:00
Heejin Ahn 2cc8473cc7 [WebAssembly] Support for atomic.wait / atomic.wake builtins
Summary:
Add support for atomic.wait / atomic.wake builtins based on the Wasm
thread proposal.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, sunfish, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338771 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-02 21:44:40 +00:00
Dan Gohman 8c75735104 [WebAssembly] Update to the new names for the memory builtin functions.
The WebAssembly committee has decided on the names `memory.size` and
`memory.grow` for the memory intrinsics, so update the clang builtin
functions to follow those names, keeping both sets of old names in place
for compatibility.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333712 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-01 00:05:51 +00:00
Dan Gohman a11eb9ed78 [WebAssembly] Add mem.* builtin functions.
This corresponds to r323222 in LLVM. The new names are not yet
finalized, so use them at your own risk.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@323224 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-23 17:04:04 +00:00
Heejin Ahn f6dda016ee [WebAssembly] Restore __builtin_wasm_rethrow builtin
Summary:
Restore the `__builtin_wasm_rethrow` builtin deleted in D37931. On second
thought, it appears it can be used to implement `__cxa_rethrow`.

Reviewers: dschuff, sunfish

Reviewed By: dschuff

Subscribers: jfb, sbc100, jgravelle-google

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313430 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16 01:07:43 +00:00
Heejin Ahn 76889b5ed5 Remove __builtin_wasm_rethrow builtin
Summary:
Remove `__builtin_wasm_rethrow` builtin. I thought it was required to implement
`__cxa_rethrow` function in libcxxabi, but it turned out it will be using
`__builtin_wasm_throw` instead.

Reviewers: dschuff, jgravelle-google

Reviewed By: jgravelle-google

Subscribers: jfb, sbc100, jgravelle-google

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313402 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-15 22:01:22 +00:00
Heejin Ahn 115b2ce907 [WebAssembly] Add throw/rethrow builtins for exception handling
Summary:
Add new builtins for throw/rethrow instructions. This follows exception handling
handling proposal in
https://github.com/WebAssembly/exception-handling/blob/master/proposals/Exceptions.md

Reviewers: sunfish, dschuff

Reviewed By: dschuff

Subscribers: jfb, dschuff, sbc100, jgravelle-google

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306775 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-30 00:44:01 +00:00
Dan Gohman a0babd8efc [WebAssembly] Update grow_memory's return type.
The grow_memory instruction now returns the previous memory size. Add the
return type to the clang intrinsic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@292324 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 01:03:35 +00:00
Derek Schuff 4f7d65a7a2 [WebAssembly] Rename memory_size intrinsic to current_memory
This follows the recent change in the wasm spec.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268256 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 17:26:19 +00:00
Dan Gohman f8c49657e4 [WebAssembly] Update wasm builtin functions to match spec changes.
The page_size operator has been removed from the spec, and the resize_memory
operator has been changed to grow_memory.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252201 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 20:16:37 +00:00
Dan Gohman e9c854387a [WebAssembly] Add a __builtin_wasm_resize_memory() intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249179 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-02 20:20:01 +00:00
Dan Gohman c0ea625d92 [WebAssembly] Add a __builtin_wasm_memory_size() intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249176 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-02 19:38:47 +00:00
Dan Gohman ff7b957464 [WebAssembly] Initial WebAssembly support in clang
This implements basic support for compiling (though not yet assembling
or linking) for a WebAssembly target. Note that ABI details are not yet
finalized, and may change.

Differential Revision: http://reviews.llvm.org/D12002


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@246814 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-03 22:51:53 +00:00