aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-01-10 16:10:24 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-01-10 16:10:24 -0800
commited77c3ec7a28b8015f69340330de82b62aeac4a8 (patch)
treeb20d973a031fcdbe22717fad47b6c3d0b78ee451
parent624ef44bb35ada422bcda1a259cb8b7721f3d378 (diff)
add all math functions to asm
-rwxr-xr-xemscripten.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/emscripten.py b/emscripten.py
index 1e38319d..ccee1a85 100755
--- a/emscripten.py
+++ b/emscripten.py
@@ -305,7 +305,8 @@ def emscript(infile, settings, outfile, libraries=[]):
return 'function %s(%s) { %s abort(%d); %s };\n' % (bad, params, coercions, i, ret) + raw.replace('[0,', '[' + bad + ',').replace(',0,', ',' + bad + ',').replace(',0,', ',' + bad + ',').replace(',0]', ',' + bad + ']').replace(',0]', ',' + bad + ']')
function_tables_defs = '\n'.join([make_table(sig, raw) for sig, raw in last_forwarded_json['Functions']['tables'].iteritems()])
- maths = ['Runtime.bitshift64', 'Math.floor', 'Math.min', 'Math.abs']
+ maths = ['Runtime.bitshift64', 'Math.floor', 'Math.min', 'Math.abs', 'Math.sqrt', 'Math.pow', 'Math.cos', 'Math.sin', 'Math.tan', 'Math.acos', 'Math.asin', 'Math.atan', 'Math.atan2', 'Math.exp', 'Math.log', 'Math.ceil', 'Math.floor']
+
if settings['USE_MATH_IMUL']:
maths += ['Math.imul']
asm_setup = '\n'.join(['var %s = %s;' % (f.replace('.', '_'), f) for f in maths])