summaryrefslogtreecommitdiff
path: root/src/js/binaryen.js-post.js
diff options
context:
space:
mode:
authorDaniel Wirtz <dcode@dcode.io>2017-11-21 00:19:12 +0100
committerAlon Zakai <alonzakai@gmail.com>2017-11-20 15:19:12 -0800
commit07c54750eb626ea7434341e439f6cee75efbf4b5 (patch)
treeedfd9c82133ece95fdf702f222cf561afafb1f25 /src/js/binaryen.js-post.js
parenta6c4f10233c0caeb0503960d90aa36a2dd76ed64 (diff)
downloadbinaryen-07c54750eb626ea7434341e439f6cee75efbf4b5.tar.gz
binaryen-07c54750eb626ea7434341e439f6cee75efbf4b5.tar.bz2
binaryen-07c54750eb626ea7434341e439f6cee75efbf4b5.zip
Add atomic load/store to binaryen-c/.js (#1298)
Diffstat (limited to 'src/js/binaryen.js-post.js')
-rw-r--r--src/js/binaryen.js-post.js42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/js/binaryen.js-post.js b/src/js/binaryen.js-post.js
index 352da1c0a..e6d248715 100644
--- a/src/js/binaryen.js-post.js
+++ b/src/js/binaryen.js-post.js
@@ -429,6 +429,24 @@
return Module['_BinaryenBinary'](module, Module['GeUInt32'], left, right);
},
'atomic':{
+ 'load': function(offset, ptr) {
+ return Module['_BinaryenAtomicLoad'](module, 4, offset, Module['i32'], ptr);
+ },
+ 'load8_u': function(offset, ptr) {
+ return Module['_BinaryenAtomicLoad'](module, 1, offset, Module['i32'], ptr);
+ },
+ 'load16_u': function(offset, ptr) {
+ return Module['_BinaryenAtomicLoad'](module, 2, offset, Module['i32'], ptr);
+ },
+ 'store': function(offset, ptr, value) {
+ return Module['_BinaryenAtomicStore'](module, 4, offset, ptr, value, Module['i32']);
+ },
+ 'store8': function(offset, ptr, value) {
+ return Module['_BinaryenAtomicStore'](module, 1, offset, ptr, value, Module['i32']);
+ },
+ 'store16': function(offset, ptr, value) {
+ return Module['_BinaryenAtomicStore'](module, 2, offset, ptr, value, Module['i32']);
+ },
'rmw': {
'add': function(offset, ptr, value) {
return Module['_BinaryenAtomicRMW'](module, Module['AtomicRMWAdd'], 4, offset, ptr, value, Module['i32']);
@@ -655,6 +673,30 @@
return Module['_BinaryenBinary'](module, Module['GeUInt64'], left, right);
},
'atomic':{
+ 'load': function(offset, ptr) {
+ return Module['_BinaryenAtomicLoad'](module, 8, offset, Module['i64'], ptr);
+ },
+ 'load8_u': function(offset, ptr) {
+ return Module['_BinaryenAtomicLoad'](module, 1, offset, Module['i64'], ptr);
+ },
+ 'load16_u': function(offset, ptr) {
+ return Module['_BinaryenAtomicLoad'](module, 2, offset, Module['i64'], ptr);
+ },
+ 'load32_u': function(offset, ptr) {
+ return Module['_BinaryenAtomicLoad'](module, 4, offset, Module['i64'], ptr);
+ },
+ 'store': function(offset, ptr, value) {
+ return Module['_BinaryenAtomicStore'](module, 8, offset, ptr, value, Module['i64']);
+ },
+ 'store8': function(offset, ptr, value) {
+ return Module['_BinaryenAtomicStore'](module, 1, offset, ptr, value, Module['i64']);
+ },
+ 'store16': function(offset, ptr, value) {
+ return Module['_BinaryenAtomicStore'](module, 2, offset, ptr, value, Module['i64']);
+ },
+ 'store32': function(offset, ptr, value) {
+ return Module['_BinaryenAtomicStore'](module, 4, offset, ptr, value, Module['i64']);
+ },
'rmw': {
'add': function(offset, ptr, value) {
return Module['_BinaryenAtomicRMW'](module, Module['AtomicRMWAdd'], 8, offset, ptr, value, Module['i64']);