aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/jsifier.js4
-rw-r--r--src/parseTools.js4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 86931f3e..82b78d0a 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -1479,8 +1479,8 @@ function JSify(data, functionsOnly, givenFunctions) {
return inline.apply(null, args); // Warning: inlining does not prevent recalculation of the arguments. They should be simple identifiers
}
- if (ASM_JS) {
- // remove unneeded arguments, which the asm sig can show us. this lets us alias memset with llvm.memset, we just
+ if (ASM_JS && ident.indexOf('llvm_') >= 0) {
+ // remove unneeded arguments in llvm intrinsic functions, which the asm sig can show us. this lets us alias memset with llvm.memset, we just
// drop the final 2 args so things validate properly in asm
var libsig = LibraryManager.library[simpleIdent + '__sig'];
if (libsig) {
diff --git a/src/parseTools.js b/src/parseTools.js
index dfd4b7ed..eb200c65 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -2222,9 +2222,9 @@ function processMathop(item) {
// basic integer ops
case 'add': return handleOverflow(getFastValue(idents[0], '+', idents[1], item.type), bits);
case 'sub': return handleOverflow(getFastValue(idents[0], '-', idents[1], item.type), bits);
- case 'sdiv': case 'udiv': return makeRounding(getFastValue(idents[0], '/', idents[1], item.type), bits, op[0] === 's');
+ case 'sdiv': case 'udiv': return makeRounding(getFastValue(idents[0], '/', idents[1], item.type), bits, true);
case 'mul': return getFastValue(idents[0], '*', idents[1], item.type); // overflow handling is already done in getFastValue for '*'
- case 'urem': case 'srem': return makeRounding(getFastValue(idents[0], '%', idents[1], item.type), bits, op[0] === 's');
+ case 'urem': case 'srem': return makeRounding(getFastValue(idents[0], '%', idents[1], item.type), bits, true);
case 'or': {
if (bits > 32) {
assert(bits === 64, 'Too many bits for or: ' + bits);