aboutsummaryrefslogtreecommitdiff
path: root/src/parseTools.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-04-01 18:08:14 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-04-01 18:08:14 -0700
commit18a02098377c1f8a3b309f7415d10789a602eb40 (patch)
treecb3c262d5696d088be8ccc47c4d95bfd7095c2c8 /src/parseTools.js
parente9cc64df79f9de9793ed74ade92dbd02c790f678 (diff)
use bignum for unsigned i64 precise division
Diffstat (limited to 'src/parseTools.js')
-rw-r--r--src/parseTools.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index 436b496e..a37a7c54 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -1618,8 +1618,9 @@ function processMathop(item) {
return result;
}
}
- function i64PreciseOp(type) {
- return finish(['(i64Math.' + type + '(' + low1 + ',' + high1 + ',' + low2 + ',' + high2 + '),i64Math.result[0])', 'i64Math.result[1]']);
+ function i64PreciseOp(type, lastArg) {
+ return finish(['(i64Math.' + type + '(' + low1 + ',' + high1 + ',' + low2 + ',' + high2 +
+ (lastArg ? ',' + lastArg : '') + '),i64Math.result[0])', 'i64Math.result[1]']);
}
switch (op) {
// basic integer ops
@@ -1724,7 +1725,7 @@ function processMathop(item) {
}
case 'sdiv': case 'udiv': {
if (PRECISE_I64_MATH) {
- return i64PreciseOp('divide');
+ return i64PreciseOp('divide', op[0] === 'u');
} else {
warnI64_1();
return finish(splitI64(makeRounding(mergeI64(idents[0], op[0] === 'u') + '/' + mergeI64(idents[1], op[0] === 'u'), bits, op[0] === 's')));