diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-12-01 15:54:16 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-12-07 14:23:22 -0800 |
commit | c507a8cf49469b37814864ddc446feb88383dd5d (patch) | |
tree | 9891a3961c0cd11172f5557da415268a4e9709e0 /src/parseTools.js | |
parent | 74c843c55f0238bd75a919fdd5b2dc2f57f48fe2 (diff) |
64-bit dynamic shifts in asm
Diffstat (limited to 'src/parseTools.js')
-rw-r--r-- | src/parseTools.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/parseTools.js b/src/parseTools.js index 258ef40a..86c0e027 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -965,6 +965,10 @@ function asmCoercion(value, type) { } } +function makeGetTempDouble(i) { + return makeGetValue('tempDoublePtr', Runtime.getNativeTypeSize('i32')*i, 'i32'); +} + // See makeSetValue function makeGetValue(ptr, pos, type, noNeedFirst, unsigned, ignore, align, noSafe) { noticePtr(ptr); @@ -1755,7 +1759,8 @@ function processMathop(item) { case 'ashr': case 'lshr': { if (!isNumber(idents[1])) { - return 'Runtime.bitshift64(' + idents[0] + '[0], ' + idents[0] + '[1],"' + op + '",' + stripCorrections(idents[1]) + '[0]|0)'; + return '(Runtime' + (ASM_JS ? '_' : '.') + 'bitshift64(' + idents[0] + '[0], ' + idents[0] + '[1],"' + op + '",' + stripCorrections(idents[1]) + '[0]|0),' + + '[' + makeGetTempDouble(0) + ',' + makeGetTempDouble(1) + '])'; } bits = parseInt(idents[1]); var ander = Math.pow(2, bits)-1; |