diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-01-22 15:59:59 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-01-22 15:59:59 -0800 |
commit | d43e4bf77f2a5083f384c33fbc94cfc8995114e3 (patch) | |
tree | 6187a127d03b0a3bb2a4de7e00236112242b477e | |
parent | 455e5225b99dc68350213487b3960293c980eae3 (diff) |
asm coercions in i64 to double
-rw-r--r-- | src/runtime.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/runtime.js b/src/runtime.js index b6754249..43bd7de1 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -79,8 +79,8 @@ var RuntimeGenerator = { // Rounding is inevitable if the number is large. This is a particular problem for small negative numbers // (-1 will be rounded!), so handle negatives separately and carefully makeBigInt: function(low, high, unsigned) { - var unsignedRet = '(' + makeSignOp(low, 'i32', 'un', 1, 1) + '+(' + makeSignOp(high, 'i32', 'un', 1, 1) + '*4294967296))'; - var signedRet = '(' + makeSignOp(low, 'i32', 'un', 1, 1) + '+(' + makeSignOp(high, 'i32', 're', 1, 1) + '*4294967296))'; + var unsignedRet = '(' + asmCoercion(makeSignOp(low, 'i32', 'un', 1, 1), 'float') + '+(' + asmCoercion(makeSignOp(high, 'i32', 'un', 1, 1), 'float') + '*' + asmEnsureFloat(4294967296, 'float') + '))'; + var signedRet = '(' + asmCoercion(makeSignOp(low, 'i32', 'un', 1, 1), 'float') + '+(' + asmCoercion(makeSignOp(high, 'i32', 're', 1, 1), 'float') + '*' + asmEnsureFloat(4294967296, 'float') + '))'; if (typeof unsigned === 'string') return '(' + unsigned + ' ? ' + unsignedRet + ' : ' + signedRet + ')'; return unsigned ? unsignedRet : signedRet; } |