From 13bccf058972660d7d59e68c08c0278c1554a19b Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 11 Sep 2017 10:22:41 -0700 Subject: 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 --- test/threads.fromasm.imprecise | 68 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 test/threads.fromasm.imprecise (limited to 'test/threads.fromasm.imprecise') 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) + ) + ) + ) +) -- cgit v1.2.3