diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-11-30 15:02:01 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-30 15:02:01 -0800 |
commit | 36be3e0151dd7357e47b2d8f432bdd706a30466c (patch) | |
tree | 99a40bc874dbe786ae14eaec0e78bdcfc0ea0c86 /test/memorygrowth.fromasm | |
parent | 7d2d9ec9f2f936d0a53b7dc60089456a0654d29c (diff) | |
download | binaryen-36be3e0151dd7357e47b2d8f432bdd706a30466c.tar.gz binaryen-36be3e0151dd7357e47b2d8f432bdd706a30466c.tar.bz2 binaryen-36be3e0151dd7357e47b2d8f432bdd706a30466c.zip |
Fix regression from #850 (#851)
* fix regression from #850 - it is not always safe to fold added offsets into load/store offsets, as the add wraps but offset does not
* small refactoring to simplify asm2wasm pass invocation
Diffstat (limited to 'test/memorygrowth.fromasm')
-rw-r--r-- | test/memorygrowth.fromasm | 295 |
1 files changed, 152 insertions, 143 deletions
diff --git a/test/memorygrowth.fromasm b/test/memorygrowth.fromasm index f61e92441..1422a65a9 100644 --- a/test/memorygrowth.fromasm +++ b/test/memorygrowth.fromasm @@ -723,80 +723,83 @@ (i32.and (i32.load offset=4 (tee_local $14 - (i32.load offset=1512 - (i32.shl - (i32.add - (i32.or + (i32.load + (i32.add + (i32.shl + (i32.add (i32.or (i32.or (i32.or - (tee_local $8 + (i32.or + (tee_local $8 + (i32.and + (i32.shr_u + (tee_local $4 + (i32.shr_u + (get_local $8) + (get_local $12) + ) + ) + (i32.const 5) + ) + (i32.const 8) + ) + ) + (get_local $12) + ) + (tee_local $4 (i32.and (i32.shr_u - (tee_local $4 + (tee_local $1 (i32.shr_u + (get_local $4) (get_local $8) - (get_local $12) ) ) - (i32.const 5) + (i32.const 2) ) - (i32.const 8) + (i32.const 4) ) ) - (get_local $12) ) - (tee_local $4 + (tee_local $1 (i32.and (i32.shr_u - (tee_local $1 + (tee_local $0 (i32.shr_u + (get_local $1) (get_local $4) - (get_local $8) ) ) - (i32.const 2) + (i32.const 1) ) - (i32.const 4) + (i32.const 2) ) ) ) - (tee_local $1 + (tee_local $0 (i32.and (i32.shr_u - (tee_local $0 + (tee_local $5 (i32.shr_u + (get_local $0) (get_local $1) - (get_local $4) ) ) (i32.const 1) ) - (i32.const 2) - ) - ) - ) - (tee_local $0 - (i32.and - (i32.shr_u - (tee_local $5 - (i32.shr_u - (get_local $0) - (get_local $1) - ) - ) (i32.const 1) ) - (i32.const 1) ) ) + (i32.shr_u + (get_local $5) + (get_local $0) + ) ) - (i32.shr_u - (get_local $5) - (get_local $0) - ) + (i32.const 2) ) - (i32.const 2) + (i32.const 1512) ) ) ) @@ -1463,106 +1466,109 @@ (block $label$break$a (if (tee_local $12 - (i32.load offset=1512 - (i32.shl - (tee_local $27 - (if i32 - (tee_local $7 - (i32.shr_u - (get_local $1) - (i32.const 8) - ) - ) + (i32.load + (i32.add + (i32.shl + (tee_local $27 (if i32 - (i32.gt_u - (get_local $0) - (i32.const 16777215) + (tee_local $7 + (i32.shr_u + (get_local $1) + (i32.const 8) + ) ) - (i32.const 31) - (i32.or - (i32.and - (i32.shr_u - (get_local $0) - (i32.add - (tee_local $12 - (i32.add - (i32.sub - (i32.const 14) - (i32.or + (if i32 + (i32.gt_u + (get_local $0) + (i32.const 16777215) + ) + (i32.const 31) + (i32.or + (i32.and + (i32.shr_u + (get_local $0) + (i32.add + (tee_local $12 + (i32.add + (i32.sub + (i32.const 14) (i32.or - (tee_local $7 - (i32.and - (i32.shr_u - (i32.add - (tee_local $16 - (i32.shl - (get_local $7) - (tee_local $1 - (i32.and - (i32.shr_u - (i32.add - (get_local $7) - (i32.const 1048320) + (i32.or + (tee_local $7 + (i32.and + (i32.shr_u + (i32.add + (tee_local $16 + (i32.shl + (get_local $7) + (tee_local $1 + (i32.and + (i32.shr_u + (i32.add + (get_local $7) + (i32.const 1048320) + ) + (i32.const 16) ) - (i32.const 16) + (i32.const 8) ) - (i32.const 8) ) ) ) + (i32.const 520192) ) - (i32.const 520192) + (i32.const 16) ) - (i32.const 16) + (i32.const 4) ) - (i32.const 4) ) + (get_local $1) ) - (get_local $1) - ) - (tee_local $16 - (i32.and - (i32.shr_u - (i32.add - (tee_local $14 - (i32.shl - (get_local $16) - (get_local $7) + (tee_local $16 + (i32.and + (i32.shr_u + (i32.add + (tee_local $14 + (i32.shl + (get_local $16) + (get_local $7) + ) ) + (i32.const 245760) ) - (i32.const 245760) + (i32.const 16) ) - (i32.const 16) + (i32.const 2) ) - (i32.const 2) ) ) ) - ) - (i32.shr_u - (i32.shl - (get_local $14) - (get_local $16) + (i32.shr_u + (i32.shl + (get_local $14) + (get_local $16) + ) + (i32.const 15) ) - (i32.const 15) ) ) + (i32.const 7) ) - (i32.const 7) ) + (i32.const 1) + ) + (i32.shl + (get_local $12) + (i32.const 1) ) - (i32.const 1) - ) - (i32.shl - (get_local $12) - (i32.const 1) ) ) + (i32.const 0) ) - (i32.const 0) ) + (i32.const 2) ) - (i32.const 2) + (i32.const 1512) ) ) ) @@ -1802,80 +1808,83 @@ (i32.const 16) ) ) - (i32.load offset=1512 - (i32.shl - (i32.add - (i32.or + (i32.load + (i32.add + (i32.shl + (i32.add (i32.or (i32.or (i32.or - (tee_local $12 + (i32.or + (tee_local $12 + (i32.and + (i32.shr_u + (tee_local $3 + (i32.shr_u + (get_local $12) + (get_local $4) + ) + ) + (i32.const 5) + ) + (i32.const 8) + ) + ) + (get_local $4) + ) + (tee_local $3 (i32.and (i32.shr_u - (tee_local $3 + (tee_local $5 (i32.shr_u + (get_local $3) (get_local $12) - (get_local $4) ) ) - (i32.const 5) + (i32.const 2) ) - (i32.const 8) + (i32.const 4) ) ) - (get_local $4) ) - (tee_local $3 + (tee_local $5 (i32.and (i32.shr_u - (tee_local $5 + (tee_local $8 (i32.shr_u + (get_local $5) (get_local $3) - (get_local $12) ) ) - (i32.const 2) + (i32.const 1) ) - (i32.const 4) + (i32.const 2) ) ) ) - (tee_local $5 + (tee_local $8 (i32.and (i32.shr_u - (tee_local $8 + (tee_local $1 (i32.shr_u + (get_local $8) (get_local $5) - (get_local $3) ) ) (i32.const 1) ) - (i32.const 2) - ) - ) - ) - (tee_local $8 - (i32.and - (i32.shr_u - (tee_local $1 - (i32.shr_u - (get_local $8) - (get_local $5) - ) - ) (i32.const 1) ) - (i32.const 1) ) ) + (i32.shr_u + (get_local $1) + (get_local $8) + ) ) - (i32.shr_u - (get_local $1) - (get_local $8) - ) + (i32.const 2) ) - (i32.const 2) + (i32.const 1512) ) ) ) |