aboutsummaryrefslogtreecommitdiff
path: root/src/preamble.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/preamble.js')
-rw-r--r--src/preamble.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/preamble.js b/src/preamble.js
index 05269c6e..a7731e7f 100644
--- a/src/preamble.js
+++ b/src/preamble.js
@@ -742,17 +742,19 @@ Module['writeArrayToMemory'] = writeArrayToMemory;
{{{ unSign }}}
{{{ reSign }}}
-if (!Math.imul) Math.imul = function(a, b) {
#if PRECISE_I32_MUL
+if (!Math.imul) Math.imul = function(a, b) {
var ah = a >>> 16;
var al = a & 0xffff;
var bh = b >>> 16;
var bl = b & 0xffff;
return (al*bl + ((ah*bl + al*bh) << 16))|0;
+};
#else
+Math.imul = function(a, b) {
return (a*b)|0; // fast but imprecise
-#endif
};
+#endif
// A counter of dependencies for calling run(). If we need to
// do asynchronous work before running, increment this and