aboutsummaryrefslogtreecommitdiff
path: root/tools/test-js-optimizer-t2.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-12-29 18:55:41 -0800
committerAlon Zakai <alonzakai@gmail.com>2011-12-29 18:55:41 -0800
commit3d9832b7518bfd7b0585269fcb0ec605fff5f8e3 (patch)
treedfcf93ddbd92f83575141009fc810cc2cb35196e /tools/test-js-optimizer-t2.js
parente53ee130a3fd19746f312ee30bd26a549ca09223 (diff)
make shift optimizer output more similar to normal output
Diffstat (limited to 'tools/test-js-optimizer-t2.js')
-rw-r--r--tools/test-js-optimizer-t2.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/test-js-optimizer-t2.js b/tools/test-js-optimizer-t2.js
index f7bda9ea..167c1f47 100644
--- a/tools/test-js-optimizer-t2.js
+++ b/tools/test-js-optimizer-t2.js
@@ -82,5 +82,13 @@ function shifty($id) {
q(go() >> 1 << 1);
q(go() >> 8 << 8);
q((go() + 2) >> 2); // the 2 >> 2 can't be simplified
+ pause(7.5);
+ // We prefer to do additions then shifts, so the shift happens last, because the shift output is known to be 32-bit. So these should not change
+ q($13 + 8 >> 2);
+ q(28 + $13 >> 2);
+ q(48 + $13 + 12 >> 2);
+ q($13 + $15 + 12 >> 2);
+ q(HEAPF32[$output + ($j37 << 4) + 4 >> 2]);
+ q(5 + $13 + 8 << 2);
}
// EMSCRIPTEN_GENERATED_FUNCTIONS: ["shifty"]