summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/passes/optimize-instructions_all-features.txt20
-rw-r--r--test/passes/optimize-instructions_all-features.wast18
2 files changed, 38 insertions, 0 deletions
diff --git a/test/passes/optimize-instructions_all-features.txt b/test/passes/optimize-instructions_all-features.txt
index a5cc470fb..88b053835 100644
--- a/test/passes/optimize-instructions_all-features.txt
+++ b/test/passes/optimize-instructions_all-features.txt
@@ -4005,6 +4005,26 @@
(i32.const 0)
)
)
+ (drop
+ (if (result i32)
+ (i32.and
+ (local.get $x)
+ (i32.const 3)
+ )
+ (i32.const 1)
+ (i32.const 0)
+ )
+ )
+ (drop
+ (if (result i32)
+ (i32.and
+ (local.get $x)
+ (i32.const 2147483647)
+ )
+ (i32.const 1)
+ (i32.const 0)
+ )
+ )
)
(func $optimize-bitwise-oprations (param $x i32) (param $y i32) (param $z i64) (param $w i64)
(drop
diff --git a/test/passes/optimize-instructions_all-features.wast b/test/passes/optimize-instructions_all-features.wast
index b28536519..5804c1b2a 100644
--- a/test/passes/optimize-instructions_all-features.wast
+++ b/test/passes/optimize-instructions_all-features.wast
@@ -4517,6 +4517,24 @@
)
(i32.const 0)
))
+ ;; (signed)x % 4 ? 1 : 0
+ (drop (if (result i32)
+ (i32.rem_s
+ (local.get $x)
+ (i32.const 4)
+ )
+ (i32.const 1)
+ (i32.const 0)
+ ))
+ ;; (signed)x % min_s ? 1 : 0
+ (drop (if (result i32)
+ (i32.rem_s
+ (local.get $x)
+ (i32.const 0x80000000)
+ )
+ (i32.const 1)
+ (i32.const 0)
+ ))
)
(func $optimize-bitwise-oprations (param $x i32) (param $y i32) (param $z i64) (param $w i64)
;; ~(1 << x) -> rotl(-2, x)