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

Side by Side Diff: test/mjsunit/asm/double-hi.js

Issue 2114613002: [intrinsics] Drop the now obsolete %_DoubleHi and %_DoubleLo intrinsics. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « src/runtime/runtime-maths.cc ('k') | test/mjsunit/asm/double-lo.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 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 hi1(i) {
15 i = +i;
16 return %_DoubleHi(i)|0;
17 }
18 function hi2(i, j) {
19 i = +i;
20 j = +j;
21 return %_DoubleHi(i)+%_DoubleHi(j)|0;
22 }
23 return { hi1: hi1, hi2: hi2 };
24 })(stdlib, foreign, heap);
25
26 assertEquals(0, m.hi1(0.0));
27 assertEquals(-2147483648, m.hi1(-0.0));
28 assertEquals(2146435072, m.hi1(Infinity));
29 assertEquals(-1048576, m.hi1(-Infinity));
30 assertEquals(0, m.hi2(0.0, 0.0));
31 assertEquals(-2147483648, m.hi2(0.0, -0.0));
32 assertEquals(-2147483648, m.hi2(-0.0, 0.0));
33 assertEquals(0, m.hi2(-0.0, -0.0));
34 for (var i = -2147483648; i < 2147483648; i += 3999773) {
35 assertEquals(%_DoubleHi(i), m.hi1(i));
36 assertEquals(i, m.hi1(%ConstructDouble(i, 0)));
37 assertEquals(i, m.hi1(%ConstructDouble(i, i)));
38 assertEquals(i+i|0, m.hi2(%ConstructDouble(i, 0), %ConstructDouble(i, 0)));
39 assertEquals(i+i|0, m.hi2(%ConstructDouble(i, i), %ConstructDouble(i, i)));
40 }
OLDNEW
« no previous file with comments | « src/runtime/runtime-maths.cc ('k') | test/mjsunit/asm/double-lo.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698