summaryrefslogtreecommitdiff
path: root/test/threads.fromasm.imprecise
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2017-09-11 10:22:41 -0700
committerGitHub <noreply@github.com>2017-09-11 10:22:41 -0700
commit13bccf058972660d7d59e68c08c0278c1554a19b (patch)
tree57a5c0827243516a927ad2181bb4f361557141c7 /test/threads.fromasm.imprecise
parent9fafcef2c3dfe18b119b11fa527514835a4371ce (diff)
downloadbinaryen-13bccf058972660d7d59e68c08c0278c1554a19b.tar.gz
binaryen-13bccf058972660d7d59e68c08c0278c1554a19b.tar.bz2
binaryen-13bccf058972660d7d59e68c08c0278c1554a19b.zip
asm2wasm atomics (#1171)
* translate asm.js atomics into wasm atomics * fix wasm-builder atomic load emitting, the alignment is the loaded size, not the output size * don't require code for each node type in vaccuum, for non-mentioned nodes, assume we can't optimize them out * support atomics in hashing, comparing, and copying
Diffstat (limited to 'test/threads.fromasm.imprecise')
-rw-r--r--test/threads.fromasm.imprecise68
1 files changed, 68 insertions, 0 deletions
diff --git a/test/threads.fromasm.imprecise b/test/threads.fromasm.imprecise
new file mode 100644
index 000000000..bad9963c8
--- /dev/null
+++ b/test/threads.fromasm.imprecise
@@ -0,0 +1,68 @@
+(module
+ (import "env" "memory" (memory $0 256 256 shared))
+ (import "env" "table" (table 0 0 anyfunc))
+ (import "env" "memoryBase" (global $memoryBase i32))
+ (import "env" "tableBase" (global $tableBase i32))
+ (export "test" (func $test))
+ (func $test
+ (local $0 i32)
+ (drop
+ (i32.atomic.load
+ (i32.const 4916)
+ )
+ )
+ (drop
+ (i32.atomic.rmw.xor
+ (i32.atomic.rmw.or
+ (i32.atomic.rmw.and
+ (i32.atomic.rmw.sub
+ (i32.atomic.rmw.add
+ (i32.atomic.rmw.cmpxchg
+ (block (result i32)
+ (i32.atomic.store
+ (i32.atomic.load16_u
+ (i32.const 2458)
+ )
+ (tee_local $0
+ (i32.const 0)
+ )
+ )
+ (i32.atomic.rmw.xchg
+ (get_local $0)
+ (i32.const 1)
+ )
+ )
+ (i32.const 1)
+ (i32.const 2)
+ )
+ (i32.const 0)
+ )
+ (i32.const 0)
+ )
+ (i32.const 0)
+ )
+ (i32.const 0)
+ )
+ (i32.const 0)
+ )
+ )
+ (drop
+ (i32.atomic.rmw.xor
+ (i32.const 4096)
+ (i32.const 0)
+ )
+ )
+ (drop
+ (i32.atomic.rmw16_u.xor
+ (i32.const 2048)
+ (i32.const 0)
+ )
+ )
+ (drop
+ (i32.atomic.rmw8_u.xor
+ (i32.const 1024)
+ (i32.const 0)
+ )
+ )
+ )
+)