aboutsummaryrefslogtreecommitdiff
path: root/src/analyzer.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-03-14 12:52:50 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-03-14 12:52:50 -0700
commit83db455d3c69971e1d109fdb8f92e91b7ee667d8 (patch)
tree8f255689c0429984a70f8ae06f1564ec110b887b /src/analyzer.js
parente28105b8e3767ac6691bd6410a484d0fb0a6437e (diff)
move dynamic 64-bit shifts into asm library calls
Diffstat (limited to 'src/analyzer.js')
-rw-r--r--src/analyzer.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/analyzer.js b/src/analyzer.js
index b73cc943..92b7d8cf 100644
--- a/src/analyzer.js
+++ b/src/analyzer.js
@@ -653,13 +653,14 @@ function analyzer(data, sidePass) {
if (!isNumber(shifts)) {
// We can't statically legalize this, do the operation at runtime TODO: optimize
assert(sourceBits == 64, 'TODO: handle nonconstant shifts on != 64 bits');
+ assert(PRECISE_I64_MATH, 'Must have precise i64 math for non-constant 64-bit shifts');
+ Types.preciseI64MathUsed = 1;
value.intertype = 'value';
- value.ident = 'Runtime' + (ASM_JS ? '_' : '.') + 'bitshift64(' +
+ value.ident = 'var ' + value.assignTo + '$0 = _bitshift64' + value.op[0].toUpperCase() + value.op.substr(1) + '(' +
asmCoercion(sourceElements[0].ident, 'i32') + ',' +
asmCoercion(sourceElements[1].ident, 'i32') + ',' +
- Runtime['BITSHIFT64_' + value.op.toUpperCase()] + ',' +
asmCoercion(value.params[1].ident + '$0', 'i32') + ');' +
- 'var ' + value.assignTo + '$0 = ' + makeGetTempDouble(0, 'i32') + ', ' + value.assignTo + '$1 = ' + makeGetTempDouble(1, 'i32') + ';';
+ 'var ' + value.assignTo + '$1 = tempRet0;';
value.assignTo = null;
i++;
continue;