aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/parseTools.js3
-rwxr-xr-xtests/fuzz/csmith_driver.py2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index 7d1a7cd9..ae5831ae 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -1393,7 +1393,8 @@ function getFastValue(a, op, b, type) {
if (!(type in Runtime.FLOAT_TYPES)) {
// if guaranteed small enough to not overflow into a double, do a normal multiply
var bits = getBits(type) || 32; // default is 32-bit multiply for things like getelementptr indexes
- if ((isNumber(a) && Math.abs(a) < TWO_TWENTY) || (isNumber(b) && Math.abs(b) < TWO_TWENTY) || bits < 32) {
+ // Note that we can emit simple multiple in non-asm.js mode, but asm.js will not parse "16-bit" multiple, so must do imul there
+ if ((isNumber(a) && Math.abs(a) < TWO_TWENTY) || (isNumber(b) && Math.abs(b) < TWO_TWENTY) || (bits < 32 && !ASM_JS)) {
return '(((' + a + ')*(' + b + '))&' + ((Math.pow(2, bits)-1)|0) + ')'; // keep a non-eliminatable coercion directly on this
}
return 'Math.imul(' + a + ',' + b + ')';
diff --git a/tests/fuzz/csmith_driver.py b/tests/fuzz/csmith_driver.py
index 26633494..62524a93 100755
--- a/tests/fuzz/csmith_driver.py
+++ b/tests/fuzz/csmith_driver.py
@@ -30,7 +30,7 @@ while 1:
print 'Tried %d, notes: %s' % (tried, notes)
tried += 1
print '1) Generate C'
- shared.execute([CSMITH, '--no-volatiles', '--no-math64', '--max-block-depth', '2', '--max-block-size', '2', '--max-expr-complexity', '2', '--max-funcs', '2'], stdout=open(filename + '.c', 'w'))
+ shared.execute([CSMITH, '--no-volatiles', '--no-math64'], stdout=open(filename + '.c', 'w'))
print '2) Compile natively'
shared.try_delete(filename)