diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-12-31 11:52:54 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-12-31 11:52:54 -0800 |
commit | c3af81d6df7de206890b5f1a9f9e67bb7a02d1aa (patch) | |
tree | 869baa9b13506965371ca35c0613494f327a6773 /tools/test-js-optimizer-t2-output.js | |
parent | 0823d6c87d7dc424f680faa021caa68fec5bb120 (diff) |
simplify shift optimizer and make it safer by not optimizing out >> << combos
Diffstat (limited to 'tools/test-js-optimizer-t2-output.js')
-rw-r--r-- | tools/test-js-optimizer-t2-output.js | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/tools/test-js-optimizer-t2-output.js b/tools/test-js-optimizer-t2-output.js index 11806014..9b22905d 100644 --- a/tools/test-js-optimizer-t2-output.js +++ b/tools/test-js-optimizer-t2-output.js @@ -37,17 +37,17 @@ function shifty($id2) { pause(1); var $sn_addr = get(12), $a_addr = get(999), $a_addr$s2 = $a_addr >> 2; var $i = get(112233); - q(HEAP32[($sn_addr - 1 << 1) + $a_addr$s2 + 1]); - q(HEAP32[($i - 1 << 1) + $a_addr$s2 + 1]); - q(HEAP32[($i << 1) + $a_addr$s2]); - q(HEAP32[$a_addr$s2 + $i]); + q(HEAP32[(($sn_addr - 1 << 1) + 1 << 2 >> 2) + $a_addr$s2]); + q(HEAP32[(($i - 1 << 1) + 1 << 2 >> 2) + $a_addr$s2]); + q(HEAP32[($i << 3 >> 2) + $a_addr$s2]); + q(HEAP32[($i << 2 >> 2) + $a_addr$s2]); q($a_addr$s2, z($a_addr$s2)); pause(2); var $level = HEAP[get(322) >> 2]; var _dwt_norms_real = get("a"), _dwt_norms_real$s2 = _dwt_norms_real >> 2, $orient = get("cheez"); - q(HEAP32[($level << 1) + _dwt_norms_real$s2 + ($orient * 20 | 0)]); - q(HEAP32[($level << 1) + _dwt_norms_real$s2 + ($orient * 20 | 0) + 1]); - q(HEAP32[($level << 1) + _dwt_norms_real$s2 + ($orient * 20 | 0) + 2]); + q(HEAP32[($level << 3 >> 2) + _dwt_norms_real$s2 + ($orient * 20 | 0)]); + q(HEAP32[(($level << 3) + 4 >> 2) + _dwt_norms_real$s2 + ($orient * 20 | 0)]); + q(HEAP32[(($level << 3) + 8 >> 2) + _dwt_norms_real$s2 + ($orient * 20 | 0)]); pause(3); var $wavelet38 = get(38), $wavelet38$s2 = $wavelet38 >> 2; $k = $a_addr; @@ -56,12 +56,12 @@ function shifty($id2) { q(HEAPF32[HEAP32[$wavelet38$s2] + ($k << 4) + 400 >> 2]); pause(4); var $p = $k, $parameters_addr = get("burger"), $parameters_addr$s2 = $parameters_addr >> 2; - q(HEAP32[$parameters_addr$s2 + $p + 1406]); - q(HEAP32[$parameters_addr$s2 + $p + 1411]); - q(HEAP32[$parameters_addr$s2 + $p + 1416]); + q(HEAP32[(($p << 2) + 5624 >> 2) + $parameters_addr$s2]); + q(HEAP32[(($p << 2) + 5644 >> 2) + $parameters_addr$s2]); + q(HEAP32[(($p << 2) + 5664 >> 2) + $parameters_addr$s2]); pause(5); var $res_spec242 = get($real), $cp = get("b"), $tileno = arguments[2]; - q(HEAP32[$parameters_addr$s2 + ($res_spec242 - 1) + 1406]); + q(HEAP32[(($res_spec242 - 1 << 2) + 5624 >> 2) + $parameters_addr$s2]); q(HEAP32[(HEAP32[$cp + 108 >> 2] + 420 >> 2) + ($tileno * 1397 | 0)]); pause(6); q($idx << 3); @@ -78,9 +78,14 @@ function shifty($id2) { HEAP32[HEAP[$tp$s2]] = 5; HEAP32[HEAP[$tp$s2] >> 2] = 5; pause(7); - q(go()); + q(go() >> 1 << 1); + q(go() << 1 >> 1); + q(go() >> 2); + q(go() << 2); q(go() >> 8 << 8); + q(go() << 8 >> 8); + q(go() >> 16); + q(go() << 16); q(go() + 2 >> 2); - pause(7.5); } // EMSCRIPTEN_GENERATED_FUNCTIONS: ["shifty"] |