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/double-lo.js

Issue 974313002: [turbofan] Support for %_DoubleHi, %_DoubleLo and %_ConstructDouble. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed Svens comment. Created 5 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
OLDNEW
(Empty)
1 // Copyright 2015 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 var stdlib = this;
8 var foreign = {};
9 var heap = new ArrayBuffer(64 * 1024);
10
11
12 var m = (function(stdlib, foreign, heap) {
13 "use asm";
14 function lo1(i) {
15 i = +i;
16 return %_DoubleLo(i)|0;
17 }
18 function lo2(i, j) {
19 i = +i;
20 j = +j;
21 return %_DoubleLo(i)+%_DoubleLo(j)|0;
22 }
23 return { lo1: lo1, lo2: lo2 };
24 })(stdlib, foreign, heap);
25
26 assertEquals(0, m.lo1(0.0));
27 assertEquals(0, m.lo1(-0.0));
28 assertEquals(0, m.lo1(Infinity));
29 assertEquals(0, m.lo1(-Infinity));
30 assertEquals(0, m.lo2(0.0, 0.0));
31 assertEquals(0, m.lo2(0.0, -0.0));
32 assertEquals(0, m.lo2(-0.0, 0.0));
33 assertEquals(0, m.lo2(-0.0, -0.0));
34 for (var i = -2147483648; i < 2147483648; i += 3999773) {
35 assertEquals(%_DoubleLo(i), m.lo1(i));
36 assertEquals(i, m.lo1(%ConstructDouble(0, i)));
37 assertEquals(i, m.lo1(%ConstructDouble(i, i)));
38 assertEquals(i+i|0, m.lo2(%ConstructDouble(0, i), %ConstructDouble(0, i)));
39 assertEquals(i+i|0, m.lo2(%ConstructDouble(i, i), %ConstructDouble(i, i)));
40 }
OLDNEW
« no previous file with comments | « test/mjsunit/asm/double-hi.js ('k') | test/unittests/compiler/js-intrinsic-lowering-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698