diff options
author | Alon Zakai <alonzakai@gmail.com> | 2017-07-28 14:10:25 -0700 |
---|---|---|
committer | Alon Zakai (kripken) <alonzakai@gmail.com> | 2017-07-29 19:18:53 -0700 |
commit | 1de12041904d5571ead6e64b5e51a3e26c8cfce1 (patch) | |
tree | 5deb95d9fbea4c01091a81b87100be72e274c2a1 /test/passes/optimize-instructions.wast | |
parent | 1d67ab02aeb71b1a250a44161c8fdb3e97b04210 (diff) | |
download | binaryen-1de12041904d5571ead6e64b5e51a3e26c8cfce1.tar.gz binaryen-1de12041904d5571ead6e64b5e51a3e26c8cfce1.tar.bz2 binaryen-1de12041904d5571ead6e64b5e51a3e26c8cfce1.zip |
fix shift computation in getMaxBits - in wasm only the lower 5 bits matter for a 32-bit shift
Diffstat (limited to 'test/passes/optimize-instructions.wast')
-rw-r--r-- | test/passes/optimize-instructions.wast | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/passes/optimize-instructions.wast b/test/passes/optimize-instructions.wast index cf8275412..5300b8da8 100644 --- a/test/passes/optimize-instructions.wast +++ b/test/passes/optimize-instructions.wast @@ -842,7 +842,7 @@ (i32.const -1) (i32.const 2147483647) ) - (i32.const 32) + (i32.const 31) ;; adjusted after we fixed shift computation to just look at lower 5 bits ) (i32.const 24) ) @@ -2433,4 +2433,13 @@ (i32.const 1) ) ) + (func $neg-shifts-and-255 (result i32) + (i32.and + (i32.shr_u + (i32.const -99) + (i32.const -32) ;; this shift does nothing + ) + (i32.const 255) + ) + ) ) |