summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/emcc_hello_world.fromasm30
-rw-r--r--test/emcc_hello_world.fromasm.imprecise30
-rw-r--r--test/passes/optimize-instructions.txt48
-rw-r--r--test/passes/optimize-instructions.wast9
4 files changed, 91 insertions, 26 deletions
diff --git a/test/emcc_hello_world.fromasm b/test/emcc_hello_world.fromasm
index 93932a33f..c85852a3f 100644
--- a/test/emcc_hello_world.fromasm
+++ b/test/emcc_hello_world.fromasm
@@ -5835,19 +5835,21 @@
)
)
(if
- (f64.eq
- (set_local $14
- (f64.mul
- (f64.sub
- (get_local $14)
- (f64.convert_u/i32
- (get_local $5)
+ (i32.eqz
+ (f64.ne
+ (set_local $14
+ (f64.mul
+ (f64.sub
+ (get_local $14)
+ (f64.convert_u/i32
+ (get_local $5)
+ )
)
+ (f64.const 1e9)
)
- (f64.const 1e9)
)
+ (f64.const 0)
)
- (f64.const 0)
)
(block
(set_local $7
@@ -6649,12 +6651,14 @@
)
)
(if
- (f64.eq
- (f64.add
+ (i32.eqz
+ (f64.ne
+ (f64.add
+ (get_local $14)
+ (get_local $29)
+ )
(get_local $14)
- (get_local $29)
)
- (get_local $14)
)
(block
(set_local $5
diff --git a/test/emcc_hello_world.fromasm.imprecise b/test/emcc_hello_world.fromasm.imprecise
index cdfd59b07..08f647aed 100644
--- a/test/emcc_hello_world.fromasm.imprecise
+++ b/test/emcc_hello_world.fromasm.imprecise
@@ -5829,19 +5829,21 @@
)
)
(if
- (f64.eq
- (set_local $14
- (f64.mul
- (f64.sub
- (get_local $14)
- (f64.convert_u/i32
- (get_local $5)
+ (i32.eqz
+ (f64.ne
+ (set_local $14
+ (f64.mul
+ (f64.sub
+ (get_local $14)
+ (f64.convert_u/i32
+ (get_local $5)
+ )
)
+ (f64.const 1e9)
)
- (f64.const 1e9)
)
+ (f64.const 0)
)
- (f64.const 0)
)
(block
(set_local $7
@@ -6643,12 +6645,14 @@
)
)
(if
- (f64.eq
- (f64.add
+ (i32.eqz
+ (f64.ne
+ (f64.add
+ (get_local $14)
+ (get_local $29)
+ )
(get_local $14)
- (get_local $29)
)
- (get_local $14)
)
(block
(set_local $5
diff --git a/test/passes/optimize-instructions.txt b/test/passes/optimize-instructions.txt
index c64115f49..bad6c5f6f 100644
--- a/test/passes/optimize-instructions.txt
+++ b/test/passes/optimize-instructions.txt
@@ -51,5 +51,53 @@
(i32.const 1)
(i32.const 2)
)
+ (i32.eqz
+ (f32.gt
+ (f32.const 1)
+ (f32.const 2)
+ )
+ )
+ (i32.eqz
+ (f32.ge
+ (f32.const 1)
+ (f32.const 2)
+ )
+ )
+ (i32.eqz
+ (f32.lt
+ (f32.const 1)
+ (f32.const 2)
+ )
+ )
+ (i32.eqz
+ (f32.le
+ (f32.const 1)
+ (f32.const 2)
+ )
+ )
+ (i32.eqz
+ (f64.gt
+ (f64.const 1)
+ (f64.const 2)
+ )
+ )
+ (i32.eqz
+ (f64.ge
+ (f64.const 1)
+ (f64.const 2)
+ )
+ )
+ (i32.eqz
+ (f64.lt
+ (f64.const 1)
+ (f64.const 2)
+ )
+ )
+ (i32.eqz
+ (f64.le
+ (f64.const 1)
+ (f64.const 2)
+ )
+ )
)
)
diff --git a/test/passes/optimize-instructions.wast b/test/passes/optimize-instructions.wast
index b579a2054..614d59b11 100644
--- a/test/passes/optimize-instructions.wast
+++ b/test/passes/optimize-instructions.wast
@@ -29,6 +29,15 @@
(i32.eqz (i32.ge_u (i32.const 1) (i32.const 2)))
(i32.eqz (i32.lt_u (i32.const 1) (i32.const 2)))
(i32.eqz (i32.le_u (i32.const 1) (i32.const 2)))
+
+ (i32.eqz (f32.gt (f32.const 1) (f32.const 2)))
+ (i32.eqz (f32.ge (f32.const 1) (f32.const 2)))
+ (i32.eqz (f32.lt (f32.const 1) (f32.const 2)))
+ (i32.eqz (f32.le (f32.const 1) (f32.const 2)))
+ (i32.eqz (f64.gt (f64.const 1) (f64.const 2)))
+ (i32.eqz (f64.ge (f64.const 1) (f64.const 2)))
+ (i32.eqz (f64.lt (f64.const 1) (f64.const 2)))
+ (i32.eqz (f64.le (f64.const 1) (f64.const 2)))
)
)