diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-07-15 13:19:23 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-15 13:19:23 -0700 |
commit | 184cc11cee2a65d30c7696eb3284e132099e4acb (patch) | |
tree | ce8feb8cbcdc7b732aa7148bff92a5f5e77cf6c7 /test | |
parent | 8364330269151591f435ea0328aeee1c34decf79 (diff) | |
download | binaryen-184cc11cee2a65d30c7696eb3284e132099e4acb.tar.gz binaryen-184cc11cee2a65d30c7696eb3284e132099e4acb.tar.bz2 binaryen-184cc11cee2a65d30c7696eb3284e132099e4acb.zip |
eq/ne are ok to optimize even if they are nans (#640)
Diffstat (limited to 'test')
-rw-r--r-- | test/emcc_hello_world.fromasm | 30 | ||||
-rw-r--r-- | test/emcc_hello_world.fromasm.imprecise | 30 | ||||
-rw-r--r-- | test/passes/optimize-instructions.txt | 16 | ||||
-rw-r--r-- | test/passes/optimize-instructions.wast | 5 |
4 files changed, 47 insertions, 34 deletions
diff --git a/test/emcc_hello_world.fromasm b/test/emcc_hello_world.fromasm index c85852a3f..93932a33f 100644 --- a/test/emcc_hello_world.fromasm +++ b/test/emcc_hello_world.fromasm @@ -5835,21 +5835,19 @@ ) ) (if - (i32.eqz - (f64.ne - (set_local $14 - (f64.mul - (f64.sub - (get_local $14) - (f64.convert_u/i32 - (get_local $5) - ) + (f64.eq + (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 @@ -6651,14 +6649,12 @@ ) ) (if - (i32.eqz - (f64.ne - (f64.add - (get_local $14) - (get_local $29) - ) + (f64.eq + (f64.add (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 08f647aed..cdfd59b07 100644 --- a/test/emcc_hello_world.fromasm.imprecise +++ b/test/emcc_hello_world.fromasm.imprecise @@ -5829,21 +5829,19 @@ ) ) (if - (i32.eqz - (f64.ne - (set_local $14 - (f64.mul - (f64.sub - (get_local $14) - (f64.convert_u/i32 - (get_local $5) - ) + (f64.eq + (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 @@ -6645,14 +6643,12 @@ ) ) (if - (i32.eqz - (f64.ne - (f64.add - (get_local $14) - (get_local $29) - ) + (f64.eq + (f64.add (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 bad6c5f6f..fc74041a9 100644 --- a/test/passes/optimize-instructions.txt +++ b/test/passes/optimize-instructions.txt @@ -99,5 +99,21 @@ (f64.const 2) ) ) + (f32.ne + (f32.const 1) + (f32.const 2) + ) + (f32.eq + (f32.const 1) + (f32.const 2) + ) + (f64.ne + (f64.const 1) + (f64.const 2) + ) + (f64.eq + (f64.const 1) + (f64.const 2) + ) ) ) diff --git a/test/passes/optimize-instructions.wast b/test/passes/optimize-instructions.wast index 614d59b11..bea01bd1c 100644 --- a/test/passes/optimize-instructions.wast +++ b/test/passes/optimize-instructions.wast @@ -38,6 +38,11 @@ (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))) + + (i32.eqz (f32.eq (f32.const 1) (f32.const 2))) + (i32.eqz (f32.ne (f32.const 1) (f32.const 2))) + (i32.eqz (f64.eq (f64.const 1) (f64.const 2))) + (i32.eqz (f64.ne (f64.const 1) (f64.const 2))) ) ) |