From: mjs@apple.com Date: Sat, 2 Jul 2011 20:45:55 +0000 (+0000) Subject: 2011-07-02 Maciej Stachowiak X-Git-Url: https://git.webkit.org/?p=WebKit-https.git;a=commitdiff_plain;h=50948762212689e15e6fdc3b34db784f7c7b2451 2011-07-02 Maciej Stachowiak Reviewed by Darin Adler. SunSpider: The main function of math-cordic is dead code https://bugs.webkit.org/show_bug.cgi?id=63863 Try to prevent math-cordic from being eliminated as dead code or compiled down to a constant. * tests/sunspider-1.0/math-cordic.js: (cordicsincos): (cordic): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@90317 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/PerformanceTests/SunSpider/ChangeLog b/PerformanceTests/SunSpider/ChangeLog index f8c0a1414cd4..07cca77937be 100644 --- a/PerformanceTests/SunSpider/ChangeLog +++ b/PerformanceTests/SunSpider/ChangeLog @@ -1,3 +1,17 @@ +2011-07-02 Maciej Stachowiak + + Reviewed by Darin Adler. + + SunSpider: The main function of math-cordic is dead code + https://bugs.webkit.org/show_bug.cgi?id=63863 + + Try to prevent math-cordic from being eliminated as dead code or + compiled down to a constant. + + * tests/sunspider-1.0/math-cordic.js: + (cordicsincos): + (cordic): + 2011-06-30 Maciej Stachowiak Reviewed by Adam Barth. diff --git a/PerformanceTests/SunSpider/tests/sunspider-1.0/math-cordic.js b/PerformanceTests/SunSpider/tests/sunspider-1.0/math-cordic.js index 4d3833b1ef5e..c708857622a1 100644 --- a/PerformanceTests/SunSpider/tests/sunspider-1.0/math-cordic.js +++ b/PerformanceTests/SunSpider/tests/sunspider-1.0/math-cordic.js @@ -49,8 +49,9 @@ var Angles = [ FIXED(0.027977) ]; +var Target = 28.027; -function cordicsincos() { +function cordicsincos(Target) { var X; var Y; var TargetAngle; @@ -60,7 +61,7 @@ function cordicsincos() { X = FIXED(AG_CONST); /* AG_CONST * cos(0) */ Y = 0; /* AG_CONST * sin(0) */ - TargetAngle = FIXED(28.027); + TargetAngle = FIXED(Target); CurrAngle = 0; for (Step = 0; Step < 12; Step++) { var NewX; @@ -76,15 +77,19 @@ function cordicsincos() { CurrAngle -= Angles[Step]; } } + + return FLOAT(X) * FLOAT(Y); } ///// End CORDIC +var total = 0; + function cordic( runs ) { var start = new Date(); for ( var i = 0 ; i < runs ; i++ ) { - cordicsincos(); + total += cordicsincos(Target); } var end = new Date();