aboutsummaryrefslogtreecommitdiff
path: root/tools/test-js-optimizer-asm-pre-output-f32.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-05-03 12:09:37 -0700
committerAlon Zakai <alonzakai@gmail.com>2014-05-03 12:29:23 -0700
commit77aa2a72f38d73e71eef48cacfe72cce33fc7201 (patch)
tree6dd3e801732e0aa3307e2af370eabd1c8570e207 /tools/test-js-optimizer-asm-pre-output-f32.js
parent2308587a85de571844e71e574fcc63c7955d6012 (diff)
emit a global const for Math_fround(0) to avoid function call overheads in the fround polyfill
Diffstat (limited to 'tools/test-js-optimizer-asm-pre-output-f32.js')
-rw-r--r--tools/test-js-optimizer-asm-pre-output-f32.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/test-js-optimizer-asm-pre-output-f32.js b/tools/test-js-optimizer-asm-pre-output-f32.js
index 19059619..f0f2d0da 100644
--- a/tools/test-js-optimizer-asm-pre-output-f32.js
+++ b/tools/test-js-optimizer-asm-pre-output-f32.js
@@ -4,7 +4,7 @@ function badf() {
HEAP32[$gep23_asptr >> 2] = $9;
}
function badf2() {
- var $9 = Math_fround(0);
+ var $9 = f0;
$9 = Math_fround($8);
HEAPF32[$gep23_asptr >> 2] = $9;
}
@@ -14,4 +14,10 @@ function dupe() {
x = Math_fround(x);
x = Math_fround(x);
}
+function zeros(x) {
+ x = Math_fround(x);
+ var y = f0;
+ print(Math_fround(y) + f0);
+ return Math_fround(0);
+}