aboutsummaryrefslogtreecommitdiff
path: root/emscripten.py
diff options
context:
space:
mode:
authorDan Gohman <sunfish@google.com>2013-10-02 16:11:34 -0700
committerDan Gohman <sunfish@google.com>2013-10-02 16:11:34 -0700
commit4b8ff3fb5dcbc1ef61b17f1d7a7ca4bdb3f0b811 (patch)
tree2b4b27227fb69f4fe66ff3b198664d37a4cab12f /emscripten.py
parent4f6975f249d2f8eaabe66dd8bee5146cd9d74d28 (diff)
Optimize alignment rounding.
Replace x>>2<<2 and x>>3<<3 with x&-4 and x&-8, respectively, since an and is cheaper than two shifts.
Diffstat (limited to 'emscripten.py')
-rwxr-xr-xemscripten.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/emscripten.py b/emscripten.py
index 2b62c93a..2e90fa48 100755
--- a/emscripten.py
+++ b/emscripten.py
@@ -588,7 +588,7 @@ function stackAlloc(size) {
var ret = 0;
ret = STACKTOP;
STACKTOP = (STACKTOP + size)|0;
-''' + ('STACKTOP = ((STACKTOP + 3)>>2)<<2;' if settings['TARGET_X86'] else 'STACKTOP = ((STACKTOP + 7)>>3)<<3;') + '''
+''' + ('STACKTOP = (STACKTOP + 3)&-4;' if settings['TARGET_X86'] else 'STACKTOP = (STACKTOP + 7)&-8;') + '''
return ret|0;
}
function stackSave() {