diff options
author | Max Graey <maxgraey@gmail.com> | 2020-10-02 03:12:44 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-01 17:12:44 -0700 |
commit | 2959218552a202b2b1d983ffcff68b015b9a94bd (patch) | |
tree | 3b8a56ca2f0cfc197e90fc26643d99c87d9bf617 /test/passes/optimize-instructions_all-features.wast | |
parent | f703a3a3c9021e1ae2cb009a37786210d3fcf870 (diff) | |
download | binaryen-2959218552a202b2b1d983ffcff68b015b9a94bd.tar.gz binaryen-2959218552a202b2b1d983ffcff68b015b9a94bd.tar.bz2 binaryen-2959218552a202b2b1d983ffcff68b015b9a94bd.zip |
Optimize "clear bit mask" combination to cyclic rotation over preinverted mask (#3184)
Diffstat (limited to 'test/passes/optimize-instructions_all-features.wast')
-rw-r--r-- | test/passes/optimize-instructions_all-features.wast | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/passes/optimize-instructions_all-features.wast b/test/passes/optimize-instructions_all-features.wast index 246fd41a2..c8a48391c 100644 --- a/test/passes/optimize-instructions_all-features.wast +++ b/test/passes/optimize-instructions_all-features.wast @@ -4163,6 +4163,23 @@ (i64.const 1) )) ) + (func $optimize-bitwise-oprations (param $x i32) (param $y i32) (param $z i64) (param $w i64) + ;; ~(1 << x) -> rotl(-2, x) + (drop (i32.xor + (i32.shl + (i32.const 1) + (local.get $x) + ) + (i32.const -1) + )) + (drop (i64.xor + (i64.shl + (i64.const 1) + (local.get $z) + ) + (i64.const -1) + )) + ) (func $getFallthrough ;; unit tests for Properties::getFallthrough (local $x0 i32) (local $x1 i32) |