Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(848)

Side by Side Diff: test/mjsunit/math-round.js

Issue 6835021: X64: Use roundsd for DoMathFloor. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed review comments Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/mjsunit/math-floor.js ('k') | test/mjsunit/mjsunit.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 14 matching lines...) Expand all
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 // Flags: --allow-natives-syntax 28 // Flags: --allow-natives-syntax
29 29
30 function testRound(expect, input) { 30 function testRound(expect, input) {
31 function doRound(input) { 31 function doRound(input) {
32 return Math.round(input); 32 return Math.round(input);
33 } 33 }
34 assertEquals(expect, doRound(input)); 34 assertEquals(expect, doRound(input));
35 assertEquals(expect, doRound(input));
36 assertEquals(expect, doRound(input));
35 %OptimizeFunctionOnNextCall(doRound); 37 %OptimizeFunctionOnNextCall(doRound);
36 assertEquals(expect, doRound(input)); 38 assertEquals(expect, doRound(input));
37 } 39 }
38 40
39 testRound(0, 0); 41 testRound(0, 0);
40 testRound(-0, -0); 42 testRound(-0, -0);
41 testRound(Infinity, Infinity); 43 testRound(Infinity, Infinity);
42 testRound(-Infinity, -Infinity); 44 testRound(-Infinity, -Infinity);
43 testRound(NaN, NaN); 45 testRound(NaN, NaN);
44 46
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 testRound(-Math.pow(2,52)+1, -max_fraction); 148 testRound(-Math.pow(2,52)+1, -max_fraction);
147 testRound(-min_nonfraction, -min_nonfraction); 149 testRound(-min_nonfraction, -min_nonfraction);
148 testRound(-max_non_infinite, -max_non_infinite); 150 testRound(-max_non_infinite, -max_non_infinite);
149 151
150 testRound(min_smi31, min_smi31 - 0.5); 152 testRound(min_smi31, min_smi31 - 0.5);
151 testRound(min_smi31 + 1, min_smi31 + 0.5); 153 testRound(min_smi31 + 1, min_smi31 + 0.5);
152 testRound(min_smi32, min_smi32 - 0.5); 154 testRound(min_smi32, min_smi32 - 0.5);
153 testRound(min_smi32 + 1, min_smi32 + 0.5); 155 testRound(min_smi32 + 1, min_smi32 + 0.5);
154 156
155 157
OLDNEW
« no previous file with comments | « test/mjsunit/math-floor.js ('k') | test/mjsunit/mjsunit.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698