summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/passes/optimize-instructions_all-features.txt52
-rw-r--r--test/passes/optimize-instructions_all-features.wast52
2 files changed, 104 insertions, 0 deletions
diff --git a/test/passes/optimize-instructions_all-features.txt b/test/passes/optimize-instructions_all-features.txt
index 7d223020f..2cf034c7a 100644
--- a/test/passes/optimize-instructions_all-features.txt
+++ b/test/passes/optimize-instructions_all-features.txt
@@ -4842,6 +4842,58 @@
(local.get $y)
)
)
+ (drop
+ (i32.eq
+ (local.get $x)
+ (i32.const -2147483648)
+ )
+ )
+ (drop
+ (i32.ne
+ (local.get $x)
+ (i32.const -2147483648)
+ )
+ )
+ (drop
+ (i32.lt_s
+ (i32.sub
+ (local.get $x)
+ (i32.const -2147483648)
+ )
+ (i32.const 0)
+ )
+ )
+ (drop
+ (i32.ge_s
+ (i32.sub
+ (local.get $x)
+ (i32.const -2147483648)
+ )
+ (i32.const 0)
+ )
+ )
+ (drop
+ (i32.gt_s
+ (i32.sub
+ (local.get $x)
+ (block $block (result i32)
+ (i32.const -2147483648)
+ )
+ )
+ (i32.const 0)
+ )
+ )
+ (drop
+ (i32.gt_s
+ (i32.sub
+ (local.get $x)
+ (block $block30 (result i32)
+ (i32.const -2147483648)
+ )
+ )
+ (i32.const 0)
+ )
+ )
)
(func $unsigned-context (param $x i32) (param $y i64)
(drop
diff --git a/test/passes/optimize-instructions_all-features.wast b/test/passes/optimize-instructions_all-features.wast
index 5804c1b2a..24e8a9d61 100644
--- a/test/passes/optimize-instructions_all-features.wast
+++ b/test/passes/optimize-instructions_all-features.wast
@@ -5360,6 +5360,58 @@
)
(i32.const 0)
))
+ ;; i32(x - 0x80000000) == 0 -> x == 0x80000000
+ (drop (i32.eq
+ (i32.sub
+ (local.get $x)
+ (i32.const 0x80000000)
+ )
+ (i32.const 0)
+ ))
+ ;; i32(x - 0x80000000) != 0 -> x == 0x80000000
+ (drop (i32.ne
+ (i32.sub
+ (local.get $x)
+ (i32.const 0x80000000)
+ )
+ (i32.const 0)
+ ))
+ ;; i32(x - { 0x80000000 }) < 0 -> skip
+ (drop (i32.lt_s
+ (i32.sub
+ (local.get $x)
+ (i32.const 0x80000000)
+ )
+ (i32.const 0)
+ ))
+ ;; i32(x - { 0x80000000 }) >= 0 -> skip
+ (drop (i32.ge_s
+ (i32.sub
+ (local.get $x)
+ (i32.const 0x80000000)
+ )
+ (i32.const 0)
+ ))
+ ;; i32(x - { 0x80000000 }) > 0 -> skip
+ (drop (i32.gt_s
+ (i32.sub
+ (local.get $x)
+ (block (result i32)
+ (i32.const 0x80000000)
+ )
+ )
+ (i32.const 0)
+ ))
+ ;; i32(x - { 0x80000000 }) <= 0 -> skip
+ (drop (i32.gt_s
+ (i32.sub
+ (local.get $x)
+ (block (result i32)
+ (i32.const 0x80000000)
+ )
+ )
+ (i32.const 0)
+ ))
)
(func $unsigned-context (param $x i32) (param $y i64)
(drop (i32.div_s