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

Side by Side Diff: test/mjsunit/asm/math-ceil.js

Issue 677433002: Add floor, ceil, round (truncate) instructions for ia32, x64 (if SSE4.1) and (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address changes and fix compilation on mac. Created 6 years, 1 month 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/cctest/compiler/test-run-machops.cc ('k') | test/mjsunit/asm/math-floor.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 function Module(stdlib) {
6 "use asm";
7
8 var ceil = stdlib.Math.ceil;
9
10 // f: double -> float
11 function f(a) {
12 a = +a;
13 return ceil(a);
14 }
15
16 return { f: f };
17 }
18
19 var f = Module({ Math: Math }).f;
20
21 assertTrue(isNaN(f(NaN)));
22 assertTrue(isNaN(f(undefined)));
23 assertTrue(isNaN(f(function() {})));
24
25 assertEquals(0, f(0));
26 assertEquals(+0, f(+0));
27 assertEquals(-0, f(-0));
28 assertEquals(1, f(0.49999));
29 assertEquals(1, f(0.6));
30 assertEquals(1, f(0.5));
31 assertEquals(-0, f(-0.1));
32 assertEquals(-0, f(-0.5));
33 assertEquals(-0, f(-0.6));
34 assertEquals(-1, f(-1.6));
35 assertEquals(-0, f(-0.50001));
36
37 assertEquals("Infinity", String(f(Infinity)));
38 assertEquals("-Infinity", String(f(-Infinity)));
OLDNEW
« no previous file with comments | « test/cctest/compiler/test-run-machops.cc ('k') | test/mjsunit/asm/math-floor.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698