diff options
author | Max Graey <maxgraey@gmail.com> | 2020-10-24 04:38:51 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-23 18:38:51 -0700 |
commit | b8b457ddad939a316cb833a8beb8987ca04fa865 (patch) | |
tree | 6ea6462578fb730ffd2545aea2086fdf2f0689b0 /test | |
parent | 2dc156d1d3af7f3eb40bdce7c20aa84c98d50c15 (diff) | |
download | binaryen-b8b457ddad939a316cb833a8beb8987ca04fa865.tar.gz binaryen-b8b457ddad939a316cb833a8beb8987ca04fa865.tar.bz2 binaryen-b8b457ddad939a316cb833a8beb8987ca04fa865.zip |
OptimizeInstructions: More 64-bit integer patterns (#3015)
Extend ZeroRemover and optimizeAddedConstants to handle 64-bit integers as well.
Use Literal.makeFromInt64 to make this easier.
Diffstat (limited to 'test')
-rw-r--r-- | test/passes/optimize-instructions_all-features.txt | 18 | ||||
-rw-r--r-- | test/passes/optimize-instructions_all-features.wast | 36 |
2 files changed, 52 insertions, 2 deletions
diff --git a/test/passes/optimize-instructions_all-features.txt b/test/passes/optimize-instructions_all-features.txt index 8a1c30e8b..b5e720353 100644 --- a/test/passes/optimize-instructions_all-features.txt +++ b/test/passes/optimize-instructions_all-features.txt @@ -1442,13 +1442,19 @@ ) ) ) - (func $add-sub-zero (param $0 i32) (param $1 i32) + (func $add-sub-zero (param $0 i32) (param $1 i64) (drop (local.get $0) ) (drop (local.get $0) ) + (drop + (local.get $1) + ) + (drop + (local.get $1) + ) ) (func $store-signext (param $0 i32) (i32.store8 @@ -2289,6 +2295,16 @@ ) ) ) + (func $zero-ops-64 (result i32) + (return + (i64.eq + (i64.load16_s align=1 + (i32.const 790656516) + ) + (i64.const -1337) + ) + ) + ) (func $sign-ext-1-and-ne (result i32) (i32.ne (i32.and diff --git a/test/passes/optimize-instructions_all-features.wast b/test/passes/optimize-instructions_all-features.wast index e989fda45..f857c1f5f 100644 --- a/test/passes/optimize-instructions_all-features.wast +++ b/test/passes/optimize-instructions_all-features.wast @@ -1654,7 +1654,7 @@ ) ) ) - (func $add-sub-zero (param $0 i32) (param $1 i32) + (func $add-sub-zero (param $0 i32) (param $1 i64) (drop (i32.add (local.get $0) @@ -1667,6 +1667,18 @@ (i32.const 0) ) ) + (drop + (i64.add + (local.get $1) + (i64.const 0) + ) + ) + (drop + (i64.sub + (local.get $1) + (i64.const 0) + ) + ) ) (func $store-signext (param $0 i32) (i32.store8 @@ -2633,6 +2645,28 @@ ) ) ) + (func $zero-ops-64 (result i32) + (return + (i64.eq + (i64.const -1337) + (i64.shr_u + (i64.add + (i64.const 0) + (i64.shr_s + (i64.shl + (i64.load16_s align=1 + (i32.const 790656516) + ) + (i64.const 0) + ) + (i64.const 0) + ) + ) + (i64.const 0) + ) + ) + ) + ) (func $sign-ext-1-and-ne (result i32) (select (i32.ne |