summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/passes/optimize-instructions_all-features.txt67
-rw-r--r--test/passes/optimize-instructions_all-features.wast73
2 files changed, 140 insertions, 0 deletions
diff --git a/test/passes/optimize-instructions_all-features.txt b/test/passes/optimize-instructions_all-features.txt
index e08702b91..b97106f2d 100644
--- a/test/passes/optimize-instructions_all-features.txt
+++ b/test/passes/optimize-instructions_all-features.txt
@@ -10,6 +10,7 @@
(type $i64_=>_i64 (func (param i64) (result i64)))
(type $i32_i64_f32_=>_none (func (param i32 i64 f32)))
(type $i32_i64_f32_f64_=>_none (func (param i32 i64 f32 f64)))
+ (type $i32_i32_i32_=>_none (func (param i32 i32 i32)))
(type $i32_i32_f64_f64_=>_none (func (param i32 i32 f64 f64)))
(type $i32_i64_f64_i32_=>_none (func (param i32 i64 f64 i32)))
(type $none_=>_f64 (func (result f64)))
@@ -3727,6 +3728,72 @@
)
)
)
+ (func $optimize-bulk-memory-copy (param $dst i32) (param $src i32) (param $sz i32)
+ (nop)
+ (block
+ (drop
+ (local.get $dst)
+ )
+ (drop
+ (local.get $src)
+ )
+ )
+ (i32.store8
+ (local.get $dst)
+ (i32.load8_u
+ (local.get $src)
+ )
+ )
+ (i32.store16 align=1
+ (local.get $dst)
+ (i32.load16_u align=1
+ (local.get $src)
+ )
+ )
+ (memory.copy
+ (local.get $dst)
+ (local.get $src)
+ (i32.const 3)
+ )
+ (i32.store align=1
+ (local.get $dst)
+ (i32.load align=1
+ (local.get $src)
+ )
+ )
+ (memory.copy
+ (local.get $dst)
+ (local.get $src)
+ (i32.const 5)
+ )
+ (memory.copy
+ (local.get $dst)
+ (local.get $src)
+ (i32.const 6)
+ )
+ (memory.copy
+ (local.get $dst)
+ (local.get $src)
+ (i32.const 7)
+ )
+ (i64.store align=1
+ (local.get $dst)
+ (i64.load align=1
+ (local.get $src)
+ )
+ )
+ (v128.store align=1
+ (local.get $dst)
+ (v128.load align=1
+ (local.get $src)
+ )
+ )
+ (memory.copy
+ (local.get $dst)
+ (local.get $src)
+ (local.get $sz)
+ )
+ )
)
(module
(type $none_=>_none (func))
diff --git a/test/passes/optimize-instructions_all-features.wast b/test/passes/optimize-instructions_all-features.wast
index 2790cc9ea..b62ecdcfd 100644
--- a/test/passes/optimize-instructions_all-features.wast
+++ b/test/passes/optimize-instructions_all-features.wast
@@ -4233,6 +4233,79 @@
)
))
)
+ (func $optimize-bulk-memory-copy (param $dst i32) (param $src i32) (param $sz i32)
+ (memory.copy ;; nop
+ (local.get $dst)
+ (local.get $dst)
+ (local.get $sz)
+ )
+
+ (memory.copy ;; nop
+ (local.get $dst)
+ (local.get $src)
+ (i32.const 0)
+ )
+
+ (memory.copy
+ (local.get $dst)
+ (local.get $src)
+ (i32.const 1)
+ )
+
+ (memory.copy
+ (local.get $dst)
+ (local.get $src)
+ (i32.const 2)
+ )
+
+ (memory.copy
+ (local.get $dst)
+ (local.get $src)
+ (i32.const 3)
+ )
+
+ (memory.copy
+ (local.get $dst)
+ (local.get $src)
+ (i32.const 4)
+ )
+
+ (memory.copy
+ (local.get $dst)
+ (local.get $src)
+ (i32.const 5)
+ )
+
+ (memory.copy
+ (local.get $dst)
+ (local.get $src)
+ (i32.const 6)
+ )
+
+ (memory.copy
+ (local.get $dst)
+ (local.get $src)
+ (i32.const 7)
+ )
+
+ (memory.copy
+ (local.get $dst)
+ (local.get $src)
+ (i32.const 8)
+ )
+
+ (memory.copy
+ (local.get $dst)
+ (local.get $src)
+ (i32.const 16)
+ )
+
+ (memory.copy ;; skip
+ (local.get $dst)
+ (local.get $src)
+ (local.get $sz)
+ )
+ )
)
(module
(import "env" "memory" (memory $0 (shared 256 256)))