aboutsummaryrefslogtreecommitdiff
path: root/src/jsifier.js
diff options
context:
space:
mode:
authorAlon Zakai <azakai@mozilla.com>2011-01-02 21:26:22 -0800
committerAlon Zakai <azakai@mozilla.com>2011-01-02 21:26:22 -0800
commit044ce8ea7c61616d1836633a40db06e128c051b9 (patch)
tree8f2003c9a98d93a09f403e029ea3098de844649a /src/jsifier.js
parent78aa032b233add4d31f323c650b78d21bc9482a4 (diff)
optimize mod operator, and primes benchmark
Diffstat (limited to 'src/jsifier.js')
-rw-r--r--src/jsifier.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index a753fd05..0738363e 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -758,7 +758,7 @@ function JSify(data, functionsOnly, givenTypes, givenFunctions, givenGlobalVaria
case 'sub': return handleOverflow(ident1 + ' - ' + ident2);
case 'sdiv': case 'udiv': return 'Math.floor(' + ident1 + ' / ' + ident2 + ')';
case 'mul': return handleOverflow(ident1 + ' * ' + ident2);
- case 'urem': case 'srem': return 'Math.floor(' + ident1 + ' % ' + ident2 + ')';
+ case 'urem': case 'srem': return ident1 + ' % ' + ident2;
case 'or': return ident1 + ' | ' + ident2; // TODO this forces into a 32-bit int - add overflow-style checks? also other bitops below us
case 'and': return ident1 + ' & ' + ident2;
case 'xor': return ident1 + ' ^ ' + ident2;