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

Side by Side Diff: test/mjsunit/double-intrinsics.js

Issue 178583006: Introduce intrinsics for double values in Javascript. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: platform ports Created 6 years, 9 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 | « src/x64/lithium-x64.cc ('k') | no next file » | 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 // Flags: --allow-natives-syntax
6
7 function assertDoubleBits(hi, lo, x) {
8 hi = hi | 0;
9 lo = lo | 0;
10 assertEquals(x, %_ConstructDouble(hi, lo));
11 assertEquals(hi, %_DoubleHi(x));
12 assertEquals(lo, %_DoubleLo(x));
13 assertEquals(x, %_ConstructDouble(%_DoubleHi(x), %_DoubleLo(x)));
14 }
15
16 function test() {
17 assertDoubleBits(0x7ff80000, 0x00000000, NaN);
18 assertDoubleBits(0x7ff00000, 0x00000000, Infinity);
19 assertDoubleBits(0xfff00000, 0x00000000, -Infinity);
20 assertDoubleBits(0x80000000, 0x00000000, -0);
21 assertDoubleBits(0x400921fb, 0x54442d18, Math.PI);
22 assertDoubleBits(0xc00921fb, 0x54442d18, -Math.PI);
23 assertDoubleBits(0x4005bf0a, 0x8b145769, Math.E);
24 assertDoubleBits(0xc005bf0a, 0x8b145769, -Math.E);
25 assertDoubleBits(0xbfe80000, 0x00000000, -0.75);
26 }
27
28 test();
29 test();
30 %OptimizeFunctionOnNextCall(test);
Sven Panne 2014/03/05 08:00:52 Hmmm, this relies on inlining heuristics, otherwis
31 test();
32 assertOptimized(test);
OLDNEW
« no previous file with comments | « src/x64/lithium-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698