Chromium Code Reviews| Index: test/mjsunit/asm/double-lo.js |
| diff --git a/test/mjsunit/asm/double-lo.js b/test/mjsunit/asm/double-lo.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f45378ae018308775a50cb214ffc349d60e32a33 |
| --- /dev/null |
| +++ b/test/mjsunit/asm/double-lo.js |
| @@ -0,0 +1,40 @@ |
| +// Copyright 2015 the V8 project authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +// Flags: --allow-natives-syntax |
| + |
| +var stdlib = this; |
| +var foreign = {}; |
| +var heap = new ArrayBuffer(64 * 1024); |
| + |
| + |
| +var m = (function(stdlib, foreign, heap) { |
| + "use asm"; |
| + function lo1(i) { |
| + i = +i; |
| + return %_DoubleLo(i)|0; |
| + } |
| + function lo2(i, j) { |
| + i = +i; |
| + j = +j; |
| + return %_DoubleLo(i)+%_DoubleLo(j)|0; |
| + } |
| + return { lo1: lo1, lo2: lo2 }; |
| +})(stdlib, foreign, heap); |
| + |
| +assertEquals(0, m.lo1(0.0)); |
| +assertEquals(0, m.lo1(-0.0)); |
| +assertEquals(0, m.lo1(Infinity)); |
| +assertEquals(0, m.lo1(-Infinity)); |
| +assertEquals(0, m.lo2(0.0, 0.0)); |
| +assertEquals(0, m.lo2(0.0, -0.0)); |
| +assertEquals(0, m.lo2(-0.0, 0.0)); |
| +assertEquals(0, m.lo2(-0.0, -0.0)); |
| +for (var i = -2147483648; i < 2147483648; i += 3999773) { |
| + assertEquals(%_DoubleLo(i), m.lo1(i)); |
|
Yang
2015/03/05 07:36:45
same here.
Benedikt Meurer
2015/03/05 08:51:46
Done.
|
| + assertEquals(i, m.lo1(%_ConstructDouble(0, i))); |
| + assertEquals(i, m.lo1(%_ConstructDouble(i, i))); |
| + assertEquals(i+i|0, m.lo2(%_ConstructDouble(0, i), %_ConstructDouble(0, i))); |
| + assertEquals(i+i|0, m.lo2(%_ConstructDouble(i, i), %_ConstructDouble(i, i))); |
| +} |