From fbf5965db460674be2fabbe0421d0c8adb3faaec Mon Sep 17 00:00:00 2001 From: "jkummerow@chromium.org" Date: Mon, 24 Sep 2012 10:04:58 +0000 Subject: [PATCH] Split test/mjsunit/mul-exhaustive into smaller chunks Review URL: https://codereview.chromium.org/10958064 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12590 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- test/mjsunit/mul-exhaustive-part1.js | 491 ++++ test/mjsunit/mul-exhaustive-part10.js | 470 ++++ test/mjsunit/mul-exhaustive-part2.js | 525 ++++ test/mjsunit/mul-exhaustive-part3.js | 532 ++++ test/mjsunit/mul-exhaustive-part4.js | 509 ++++ test/mjsunit/mul-exhaustive-part5.js | 505 ++++ test/mjsunit/mul-exhaustive-part6.js | 554 ++++ test/mjsunit/mul-exhaustive-part7.js | 497 ++++ test/mjsunit/mul-exhaustive-part8.js | 526 ++++ test/mjsunit/mul-exhaustive-part9.js | 533 ++++ test/mjsunit/mul-exhaustive.js | 4629 --------------------------------- 11 files changed, 5142 insertions(+), 4629 deletions(-) create mode 100644 test/mjsunit/mul-exhaustive-part1.js create mode 100644 test/mjsunit/mul-exhaustive-part10.js create mode 100644 test/mjsunit/mul-exhaustive-part2.js create mode 100644 test/mjsunit/mul-exhaustive-part3.js create mode 100644 test/mjsunit/mul-exhaustive-part4.js create mode 100644 test/mjsunit/mul-exhaustive-part5.js create mode 100644 test/mjsunit/mul-exhaustive-part6.js create mode 100644 test/mjsunit/mul-exhaustive-part7.js create mode 100644 test/mjsunit/mul-exhaustive-part8.js create mode 100644 test/mjsunit/mul-exhaustive-part9.js delete mode 100644 test/mjsunit/mul-exhaustive.js diff --git a/test/mjsunit/mul-exhaustive-part1.js b/test/mjsunit/mul-exhaustive-part1.js new file mode 100644 index 0000000..7902cc2 --- /dev/null +++ b/test/mjsunit/mul-exhaustive-part1.js @@ -0,0 +1,491 @@ +// Copyright 2008 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +var x; + +// Converts a number to string respecting -0. +function stringify(n) { + if ((1 / n) === -Infinity) return "-0"; + return String(n); +} + +function f(expected, y) { + function testEval(string, x, y) { + var mulFunction = Function("x, y", "return " + string); + return mulFunction(x, y); + } + function mulTest(expected, x, y) { + assertEquals(expected, x * y); + assertEquals(expected, testEval(stringify(x) + " * y", x, y)); + assertEquals(expected, testEval("x * " + stringify(y), x, y)); + assertEquals(expected, testEval(stringify(x) + " * " + stringify(y), x, y)); + } + mulTest(expected, x, y); + mulTest(-expected, -x, y); + mulTest(-expected, x, -y); + mulTest(expected, -x, -y); + if (x === y) return; // Symmetric cases not necessary. + mulTest(expected, y, x); + mulTest(-expected, -y, x); + mulTest(-expected, y, -x); + mulTest(expected, -y, -x); +} + +x = 0; +f(0, 0); +x = 1; +f(0, 0); +f(1, 1); +x = 2; +f(0, 0); +f(2, 1); +f(4, 2); +x = 3; +f(0, 0); +f(3, 1); +f(6, 2); +f(9, 3); +x = 4; +f(0, 0); +f(4, 1); +f(8, 2); +f(12, 3); +f(16, 4); +x = 5; +f(0, 0); +f(5, 1); +f(10, 2); +f(15, 3); +f(20, 4); +f(25, 5); +x = 7; +f(0, 0); +f(7, 1); +f(14, 2); +f(21, 3); +f(28, 4); +f(35, 5); +f(49, 7); +x = 8; +f(0, 0); +f(8, 1); +f(16, 2); +f(24, 3); +f(32, 4); +f(40, 5); +f(56, 7); +f(64, 8); +x = 9; +f(0, 0); +f(9, 1); +f(18, 2); +f(27, 3); +f(36, 4); +f(45, 5); +f(63, 7); +f(72, 8); +f(81, 9); +x = 15; +f(0, 0); +f(15, 1); +f(30, 2); +f(45, 3); +f(60, 4); +f(75, 5); +f(105, 7); +f(120, 8); +f(135, 9); +f(225, 15); +x = 16; +f(0, 0); +f(16, 1); +f(32, 2); +f(48, 3); +f(64, 4); +f(80, 5); +f(112, 7); +f(128, 8); +f(144, 9); +f(240, 15); +f(256, 16); +x = 17; +f(0, 0); +f(17, 1); +f(34, 2); +f(51, 3); +f(68, 4); +f(85, 5); +f(119, 7); +f(136, 8); +f(153, 9); +f(255, 15); +f(272, 16); +f(289, 17); +x = 31; +f(0, 0); +f(31, 1); +f(62, 2); +f(93, 3); +f(124, 4); +f(155, 5); +f(217, 7); +f(248, 8); +f(279, 9); +f(465, 15); +f(496, 16); +f(527, 17); +f(961, 31); +x = 32; +f(0, 0); +f(32, 1); +f(64, 2); +f(96, 3); +f(128, 4); +f(160, 5); +f(224, 7); +f(256, 8); +f(288, 9); +f(480, 15); +f(512, 16); +f(544, 17); +f(992, 31); +f(1024, 32); +x = 33; +f(0, 0); +f(33, 1); +f(66, 2); +f(99, 3); +f(132, 4); +f(165, 5); +f(231, 7); +f(264, 8); +f(297, 9); +f(495, 15); +f(528, 16); +f(561, 17); +f(1023, 31); +f(1056, 32); +f(1089, 33); +x = 63; +f(0, 0); +f(63, 1); +f(126, 2); +f(189, 3); +f(252, 4); +f(315, 5); +f(441, 7); +f(504, 8); +f(567, 9); +f(945, 15); +f(1008, 16); +f(1071, 17); +f(1953, 31); +f(2016, 32); +f(2079, 33); +f(3969, 63); +x = 64; +f(0, 0); +f(64, 1); +f(128, 2); +f(192, 3); +f(256, 4); +f(320, 5); +f(448, 7); +f(512, 8); +f(576, 9); +f(960, 15); +f(1024, 16); +f(1088, 17); +f(1984, 31); +f(2048, 32); +f(2112, 33); +f(4032, 63); +f(4096, 64); +x = 65; +f(0, 0); +f(65, 1); +f(130, 2); +f(195, 3); +f(260, 4); +f(325, 5); +f(455, 7); +f(520, 8); +f(585, 9); +f(975, 15); +f(1040, 16); +f(1105, 17); +f(2015, 31); +f(2080, 32); +f(2145, 33); +f(4095, 63); +f(4160, 64); +f(4225, 65); +x = 127; +f(0, 0); +f(127, 1); +f(254, 2); +f(381, 3); +f(508, 4); +f(635, 5); +f(889, 7); +f(1016, 8); +f(1143, 9); +f(1905, 15); +f(2032, 16); +f(2159, 17); +f(3937, 31); +f(4064, 32); +f(4191, 33); +f(8001, 63); +f(8128, 64); +f(8255, 65); +f(16129, 127); +x = 128; +f(0, 0); +f(128, 1); +f(256, 2); +f(384, 3); +f(512, 4); +f(640, 5); +f(896, 7); +f(1024, 8); +f(1152, 9); +f(1920, 15); +f(2048, 16); +f(2176, 17); +f(3968, 31); +f(4096, 32); +f(4224, 33); +f(8064, 63); +f(8192, 64); +f(8320, 65); +f(16256, 127); +f(16384, 128); +x = 129; +f(0, 0); +f(129, 1); +f(258, 2); +f(387, 3); +f(516, 4); +f(645, 5); +f(903, 7); +f(1032, 8); +f(1161, 9); +f(1935, 15); +f(2064, 16); +f(2193, 17); +f(3999, 31); +f(4128, 32); +f(4257, 33); +f(8127, 63); +f(8256, 64); +f(8385, 65); +f(16383, 127); +f(16512, 128); +f(16641, 129); +x = 255; +f(0, 0); +f(255, 1); +f(510, 2); +f(765, 3); +f(1020, 4); +f(1275, 5); +f(1785, 7); +f(2040, 8); +f(2295, 9); +f(3825, 15); +f(4080, 16); +f(4335, 17); +f(7905, 31); +f(8160, 32); +f(8415, 33); +f(16065, 63); +f(16320, 64); +f(16575, 65); +f(32385, 127); +f(32640, 128); +f(32895, 129); +f(65025, 255); +x = 256; +f(0, 0); +f(256, 1); +f(512, 2); +f(768, 3); +f(1024, 4); +f(1280, 5); +f(1792, 7); +f(2048, 8); +f(2304, 9); +f(3840, 15); +f(4096, 16); +f(4352, 17); +f(7936, 31); +f(8192, 32); +f(8448, 33); +f(16128, 63); +f(16384, 64); +f(16640, 65); +f(32512, 127); +f(32768, 128); +f(33024, 129); +f(65280, 255); +f(65536, 256); +x = 257; +f(0, 0); +f(257, 1); +f(514, 2); +f(771, 3); +f(1028, 4); +f(1285, 5); +f(1799, 7); +f(2056, 8); +f(2313, 9); +f(3855, 15); +f(4112, 16); +f(4369, 17); +f(7967, 31); +f(8224, 32); +f(8481, 33); +f(16191, 63); +f(16448, 64); +f(16705, 65); +f(32639, 127); +f(32896, 128); +f(33153, 129); +f(65535, 255); +f(65792, 256); +f(66049, 257); +x = 511; +f(0, 0); +f(511, 1); +f(1022, 2); +f(1533, 3); +f(2044, 4); +f(2555, 5); +f(3577, 7); +f(4088, 8); +f(4599, 9); +f(7665, 15); +f(8176, 16); +f(8687, 17); +f(15841, 31); +f(16352, 32); +f(16863, 33); +f(32193, 63); +f(32704, 64); +f(33215, 65); +f(64897, 127); +f(65408, 128); +f(65919, 129); +f(130305, 255); +f(130816, 256); +f(131327, 257); +f(261121, 511); +x = 512; +f(0, 0); +f(512, 1); +f(1024, 2); +f(1536, 3); +f(2048, 4); +f(2560, 5); +f(3584, 7); +f(4096, 8); +f(4608, 9); +f(7680, 15); +f(8192, 16); +f(8704, 17); +f(15872, 31); +f(16384, 32); +f(16896, 33); +f(32256, 63); +f(32768, 64); +f(33280, 65); +f(65024, 127); +f(65536, 128); +f(66048, 129); +f(130560, 255); +f(131072, 256); +f(131584, 257); +f(261632, 511); +f(262144, 512); +x = 513; +f(0, 0); +f(513, 1); +f(1026, 2); +f(1539, 3); +f(2052, 4); +f(2565, 5); +f(3591, 7); +f(4104, 8); +f(4617, 9); +f(7695, 15); +f(8208, 16); +f(8721, 17); +f(15903, 31); +f(16416, 32); +f(16929, 33); +f(32319, 63); +f(32832, 64); +f(33345, 65); +f(65151, 127); +f(65664, 128); +f(66177, 129); +f(130815, 255); +f(131328, 256); +f(131841, 257); +f(262143, 511); +f(262656, 512); +f(263169, 513); +x = 1023; +f(0, 0); +f(1023, 1); +f(2046, 2); +f(3069, 3); +f(4092, 4); +f(5115, 5); +f(7161, 7); +f(8184, 8); +f(9207, 9); +f(15345, 15); +f(16368, 16); +f(17391, 17); +f(31713, 31); +f(32736, 32); +f(33759, 33); +f(64449, 63); +f(65472, 64); +f(66495, 65); +f(129921, 127); +f(130944, 128); +f(131967, 129); +f(260865, 255); +f(261888, 256); +f(262911, 257); +f(522753, 511); +f(523776, 512); +f(524799, 513); +f(1046529, 1023); diff --git a/test/mjsunit/mul-exhaustive-part10.js b/test/mjsunit/mul-exhaustive-part10.js new file mode 100644 index 0000000..166ec52 --- /dev/null +++ b/test/mjsunit/mul-exhaustive-part10.js @@ -0,0 +1,470 @@ +// Copyright 2008 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +var x; + +// Converts a number to string respecting -0. +function stringify(n) { + if ((1 / n) === -Infinity) return "-0"; + return String(n); +} + +function f(expected, y) { + function testEval(string, x, y) { + var mulFunction = Function("x, y", "return " + string); + return mulFunction(x, y); + } + function mulTest(expected, x, y) { + assertEquals(expected, x * y); + assertEquals(expected, testEval(stringify(x) + " * y", x, y)); + assertEquals(expected, testEval("x * " + stringify(y), x, y)); + assertEquals(expected, testEval(stringify(x) + " * " + stringify(y), x, y)); + } + mulTest(expected, x, y); + mulTest(-expected, -x, y); + mulTest(-expected, x, -y); + mulTest(expected, -x, -y); + if (x === y) return; // Symmetric cases not necessary. + mulTest(expected, y, x); + mulTest(-expected, -y, x); + mulTest(-expected, y, -x); + mulTest(expected, -y, -x); +} + +x = 4294967296; +f(0, 0); +f(4294967296, 1); +f(8589934592, 2); +f(12884901888, 3); +f(17179869184, 4); +f(21474836480, 5); +f(30064771072, 7); +f(34359738368, 8); +f(38654705664, 9); +f(64424509440, 15); +f(68719476736, 16); +f(73014444032, 17); +f(133143986176, 31); +f(137438953472, 32); +f(141733920768, 33); +f(270582939648, 63); +f(274877906944, 64); +f(279172874240, 65); +f(545460846592, 127); +f(549755813888, 128); +f(554050781184, 129); +f(1095216660480, 255); +f(1099511627776, 256); +f(1103806595072, 257); +f(2194728288256, 511); +f(2199023255552, 512); +f(2203318222848, 513); +f(4393751543808, 1023); +f(4398046511104, 1024); +f(4402341478400, 1025); +f(8791798054912, 2047); +f(8796093022208, 2048); +f(8800387989504, 2049); +f(17587891077120, 4095); +f(17592186044416, 4096); +f(17596481011712, 4097); +f(35180077121536, 8191); +f(35184372088832, 8192); +f(35188667056128, 8193); +f(70364449210368, 16383); +f(70368744177664, 16384); +f(70373039144960, 16385); +f(140733193388032, 32767); +f(140737488355328, 32768); +f(140741783322624, 32769); +f(281470681743360, 65535); +f(281474976710656, 65536); +f(281479271677952, 65537); +f(562945658454016, 131071); +f(562949953421312, 131072); +f(562954248388608, 131073); +f(1125895611875328, 262143); +f(1125899906842624, 262144); +f(1125904201809920, 262145); +x = 4294967297; +f(0, 0); +f(4294967297, 1); +f(8589934594, 2); +f(12884901891, 3); +f(17179869188, 4); +f(21474836485, 5); +f(30064771079, 7); +f(34359738376, 8); +f(38654705673, 9); +f(64424509455, 15); +f(68719476752, 16); +f(73014444049, 17); +f(133143986207, 31); +f(137438953504, 32); +f(141733920801, 33); +f(270582939711, 63); +f(274877907008, 64); +f(279172874305, 65); +f(545460846719, 127); +f(549755814016, 128); +f(554050781313, 129); +f(1095216660735, 255); +f(1099511628032, 256); +f(1103806595329, 257); +f(2194728288767, 511); +f(2199023256064, 512); +f(2203318223361, 513); +f(4393751544831, 1023); +f(4398046512128, 1024); +f(4402341479425, 1025); +f(8791798056959, 2047); +f(8796093024256, 2048); +f(8800387991553, 2049); +f(17587891081215, 4095); +f(17592186048512, 4096); +f(17596481015809, 4097); +f(35180077129727, 8191); +f(35184372097024, 8192); +f(35188667064321, 8193); +f(70364449226751, 16383); +f(70368744194048, 16384); +f(70373039161345, 16385); +f(140733193420799, 32767); +f(140737488388096, 32768); +f(140741783355393, 32769); +f(281470681808895, 65535); +f(281474976776192, 65536); +f(281479271743489, 65537); +f(562945658585087, 131071); +f(562949953552384, 131072); +f(562954248519681, 131073); +f(1125895612137471, 262143); +f(1125899907104768, 262144); +f(1125904202072065, 262145); +x = 8589934591; +f(0, 0); +f(8589934591, 1); +f(17179869182, 2); +f(25769803773, 3); +f(34359738364, 4); +f(42949672955, 5); +f(60129542137, 7); +f(68719476728, 8); +f(77309411319, 9); +f(128849018865, 15); +f(137438953456, 16); +f(146028888047, 17); +f(266287972321, 31); +f(274877906912, 32); +f(283467841503, 33); +f(541165879233, 63); +f(549755813824, 64); +f(558345748415, 65); +f(1090921693057, 127); +f(1099511627648, 128); +f(1108101562239, 129); +f(2190433320705, 255); +f(2199023255296, 256); +f(2207613189887, 257); +f(4389456576001, 511); +f(4398046510592, 512); +f(4406636445183, 513); +f(8787503086593, 1023); +f(8796093021184, 1024); +f(8804682955775, 1025); +f(17583596107777, 2047); +f(17592186042368, 2048); +f(17600775976959, 2049); +f(35175782150145, 4095); +f(35184372084736, 4096); +f(35192962019327, 4097); +f(70360154234881, 8191); +f(70368744169472, 8192); +f(70377334104063, 8193); +f(140728898404353, 16383); +f(140737488338944, 16384); +f(140746078273535, 16385); +f(281466386743297, 32767); +f(281474976677888, 32768); +f(281483566612479, 32769); +f(562941363421185, 65535); +f(562949953355776, 65536); +f(562958543290367, 65537); +f(1125891316776961, 131071); +f(1125899906711552, 131072); +f(1125908496646143, 131073); +x = 8589934592; +f(0, 0); +f(8589934592, 1); +f(17179869184, 2); +f(25769803776, 3); +f(34359738368, 4); +f(42949672960, 5); +f(60129542144, 7); +f(68719476736, 8); +f(77309411328, 9); +f(128849018880, 15); +f(137438953472, 16); +f(146028888064, 17); +f(266287972352, 31); +f(274877906944, 32); +f(283467841536, 33); +f(541165879296, 63); +f(549755813888, 64); +f(558345748480, 65); +f(1090921693184, 127); +f(1099511627776, 128); +f(1108101562368, 129); +f(2190433320960, 255); +f(2199023255552, 256); +f(2207613190144, 257); +f(4389456576512, 511); +f(4398046511104, 512); +f(4406636445696, 513); +f(8787503087616, 1023); +f(8796093022208, 1024); +f(8804682956800, 1025); +f(17583596109824, 2047); +f(17592186044416, 2048); +f(17600775979008, 2049); +f(35175782154240, 4095); +f(35184372088832, 4096); +f(35192962023424, 4097); +f(70360154243072, 8191); +f(70368744177664, 8192); +f(70377334112256, 8193); +f(140728898420736, 16383); +f(140737488355328, 16384); +f(140746078289920, 16385); +f(281466386776064, 32767); +f(281474976710656, 32768); +f(281483566645248, 32769); +f(562941363486720, 65535); +f(562949953421312, 65536); +f(562958543355904, 65537); +f(1125891316908032, 131071); +f(1125899906842624, 131072); +f(1125908496777216, 131073); +x = 8589934593; +f(0, 0); +f(8589934593, 1); +f(17179869186, 2); +f(25769803779, 3); +f(34359738372, 4); +f(42949672965, 5); +f(60129542151, 7); +f(68719476744, 8); +f(77309411337, 9); +f(128849018895, 15); +f(137438953488, 16); +f(146028888081, 17); +f(266287972383, 31); +f(274877906976, 32); +f(283467841569, 33); +f(541165879359, 63); +f(549755813952, 64); +f(558345748545, 65); +f(1090921693311, 127); +f(1099511627904, 128); +f(1108101562497, 129); +f(2190433321215, 255); +f(2199023255808, 256); +f(2207613190401, 257); +f(4389456577023, 511); +f(4398046511616, 512); +f(4406636446209, 513); +f(8787503088639, 1023); +f(8796093023232, 1024); +f(8804682957825, 1025); +f(17583596111871, 2047); +f(17592186046464, 2048); +f(17600775981057, 2049); +f(35175782158335, 4095); +f(35184372092928, 4096); +f(35192962027521, 4097); +f(70360154251263, 8191); +f(70368744185856, 8192); +f(70377334120449, 8193); +f(140728898437119, 16383); +f(140737488371712, 16384); +f(140746078306305, 16385); +f(281466386808831, 32767); +f(281474976743424, 32768); +f(281483566678017, 32769); +f(562941363552255, 65535); +f(562949953486848, 65536); +f(562958543421441, 65537); +f(1125891317039103, 131071); +f(1125899906973696, 131072); +f(1125908496908289, 131073); +x = 17179869183; +f(0, 0); +f(17179869183, 1); +f(34359738366, 2); +f(51539607549, 3); +f(68719476732, 4); +f(85899345915, 5); +f(120259084281, 7); +f(137438953464, 8); +f(154618822647, 9); +f(257698037745, 15); +f(274877906928, 16); +f(292057776111, 17); +f(532575944673, 31); +f(549755813856, 32); +f(566935683039, 33); +f(1082331758529, 63); +f(1099511627712, 64); +f(1116691496895, 65); +f(2181843386241, 127); +f(2199023255424, 128); +f(2216203124607, 129); +f(4380866641665, 255); +f(4398046510848, 256); +f(4415226380031, 257); +f(8778913152513, 511); +f(8796093021696, 512); +f(8813272890879, 513); +f(17575006174209, 1023); +f(17592186043392, 1024); +f(17609365912575, 1025); +f(35167192217601, 2047); +f(35184372086784, 2048); +f(35201551955967, 2049); +f(70351564304385, 4095); +f(70368744173568, 4096); +f(70385924042751, 4097); +f(140720308477953, 8191); +f(140737488347136, 8192); +f(140754668216319, 8193); +f(281457796825089, 16383); +f(281474976694272, 16384); +f(281492156563455, 16385); +f(562932773519361, 32767); +f(562949953388544, 32768); +f(562967133257727, 32769); +f(1125882726907905, 65535); +f(1125899906777088, 65536); +f(1125917086646271, 65537); +x = 17179869184; +f(0, 0); +f(17179869184, 1); +f(34359738368, 2); +f(51539607552, 3); +f(68719476736, 4); +f(85899345920, 5); +f(120259084288, 7); +f(137438953472, 8); +f(154618822656, 9); +f(257698037760, 15); +f(274877906944, 16); +f(292057776128, 17); +f(532575944704, 31); +f(549755813888, 32); +f(566935683072, 33); +f(1082331758592, 63); +f(1099511627776, 64); +f(1116691496960, 65); +f(2181843386368, 127); +f(2199023255552, 128); +f(2216203124736, 129); +f(4380866641920, 255); +f(4398046511104, 256); +f(4415226380288, 257); +f(8778913153024, 511); +f(8796093022208, 512); +f(8813272891392, 513); +f(17575006175232, 1023); +f(17592186044416, 1024); +f(17609365913600, 1025); +f(35167192219648, 2047); +f(35184372088832, 2048); +f(35201551958016, 2049); +f(70351564308480, 4095); +f(70368744177664, 4096); +f(70385924046848, 4097); +f(140720308486144, 8191); +f(140737488355328, 8192); +f(140754668224512, 8193); +f(281457796841472, 16383); +f(281474976710656, 16384); +f(281492156579840, 16385); +f(562932773552128, 32767); +f(562949953421312, 32768); +f(562967133290496, 32769); +f(1125882726973440, 65535); +f(1125899906842624, 65536); +f(1125917086711808, 65537); +x = 17179869185; +f(0, 0); +f(17179869185, 1); +f(34359738370, 2); +f(51539607555, 3); +f(68719476740, 4); +f(85899345925, 5); +f(120259084295, 7); +f(137438953480, 8); +f(154618822665, 9); +f(257698037775, 15); +f(274877906960, 16); +f(292057776145, 17); +f(532575944735, 31); +f(549755813920, 32); +f(566935683105, 33); +f(1082331758655, 63); +f(1099511627840, 64); +f(1116691497025, 65); +f(2181843386495, 127); +f(2199023255680, 128); +f(2216203124865, 129); +f(4380866642175, 255); +f(4398046511360, 256); +f(4415226380545, 257); +f(8778913153535, 511); +f(8796093022720, 512); +f(8813272891905, 513); +f(17575006176255, 1023); +f(17592186045440, 1024); +f(17609365914625, 1025); +f(35167192221695, 2047); +f(35184372090880, 2048); +f(35201551960065, 2049); +f(70351564312575, 4095); +f(70368744181760, 4096); +f(70385924050945, 4097); +f(140720308494335, 8191); +f(140737488363520, 8192); +f(140754668232705, 8193); +f(281457796857855, 16383); +f(281474976727040, 16384); +f(281492156596225, 16385); +f(562932773584895, 32767); +f(562949953454080, 32768); +f(562967133323265, 32769); +f(1125882727038975, 65535); +f(1125899906908160, 65536); +f(1125917086777345, 65537); diff --git a/test/mjsunit/mul-exhaustive-part2.js b/test/mjsunit/mul-exhaustive-part2.js new file mode 100644 index 0000000..4c4a123 --- /dev/null +++ b/test/mjsunit/mul-exhaustive-part2.js @@ -0,0 +1,525 @@ +// Copyright 2008 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +var x; + +// Converts a number to string respecting -0. +function stringify(n) { + if ((1 / n) === -Infinity) return "-0"; + return String(n); +} + +function f(expected, y) { + function testEval(string, x, y) { + var mulFunction = Function("x, y", "return " + string); + return mulFunction(x, y); + } + function mulTest(expected, x, y) { + assertEquals(expected, x * y); + assertEquals(expected, testEval(stringify(x) + " * y", x, y)); + assertEquals(expected, testEval("x * " + stringify(y), x, y)); + assertEquals(expected, testEval(stringify(x) + " * " + stringify(y), x, y)); + } + mulTest(expected, x, y); + mulTest(-expected, -x, y); + mulTest(-expected, x, -y); + mulTest(expected, -x, -y); + if (x === y) return; // Symmetric cases not necessary. + mulTest(expected, y, x); + mulTest(-expected, -y, x); + mulTest(-expected, y, -x); + mulTest(expected, -y, -x); +} + +x = 1024; +f(0, 0); +f(1024, 1); +f(2048, 2); +f(3072, 3); +f(4096, 4); +f(5120, 5); +f(7168, 7); +f(8192, 8); +f(9216, 9); +f(15360, 15); +f(16384, 16); +f(17408, 17); +f(31744, 31); +f(32768, 32); +f(33792, 33); +f(64512, 63); +f(65536, 64); +f(66560, 65); +f(130048, 127); +f(131072, 128); +f(132096, 129); +f(261120, 255); +f(262144, 256); +f(263168, 257); +f(523264, 511); +f(524288, 512); +f(525312, 513); +f(1047552, 1023); +f(1048576, 1024); +x = 1025; +f(0, 0); +f(1025, 1); +f(2050, 2); +f(3075, 3); +f(4100, 4); +f(5125, 5); +f(7175, 7); +f(8200, 8); +f(9225, 9); +f(15375, 15); +f(16400, 16); +f(17425, 17); +f(31775, 31); +f(32800, 32); +f(33825, 33); +f(64575, 63); +f(65600, 64); +f(66625, 65); +f(130175, 127); +f(131200, 128); +f(132225, 129); +f(261375, 255); +f(262400, 256); +f(263425, 257); +f(523775, 511); +f(524800, 512); +f(525825, 513); +f(1048575, 1023); +f(1049600, 1024); +f(1050625, 1025); +x = 2047; +f(0, 0); +f(2047, 1); +f(4094, 2); +f(6141, 3); +f(8188, 4); +f(10235, 5); +f(14329, 7); +f(16376, 8); +f(18423, 9); +f(30705, 15); +f(32752, 16); +f(34799, 17); +f(63457, 31); +f(65504, 32); +f(67551, 33); +f(128961, 63); +f(131008, 64); +f(133055, 65); +f(259969, 127); +f(262016, 128); +f(264063, 129); +f(521985, 255); +f(524032, 256); +f(526079, 257); +f(1046017, 511); +f(1048064, 512); +f(1050111, 513); +f(2094081, 1023); +f(2096128, 1024); +f(2098175, 1025); +f(4190209, 2047); +x = 2048; +f(0, 0); +f(2048, 1); +f(4096, 2); +f(6144, 3); +f(8192, 4); +f(10240, 5); +f(14336, 7); +f(16384, 8); +f(18432, 9); +f(30720, 15); +f(32768, 16); +f(34816, 17); +f(63488, 31); +f(65536, 32); +f(67584, 33); +f(129024, 63); +f(131072, 64); +f(133120, 65); +f(260096, 127); +f(262144, 128); +f(264192, 129); +f(522240, 255); +f(524288, 256); +f(526336, 257); +f(1046528, 511); +f(1048576, 512); +f(1050624, 513); +f(2095104, 1023); +f(2097152, 1024); +f(2099200, 1025); +f(4192256, 2047); +f(4194304, 2048); +x = 2049; +f(0, 0); +f(2049, 1); +f(4098, 2); +f(6147, 3); +f(8196, 4); +f(10245, 5); +f(14343, 7); +f(16392, 8); +f(18441, 9); +f(30735, 15); +f(32784, 16); +f(34833, 17); +f(63519, 31); +f(65568, 32); +f(67617, 33); +f(129087, 63); +f(131136, 64); +f(133185, 65); +f(260223, 127); +f(262272, 128); +f(264321, 129); +f(522495, 255); +f(524544, 256); +f(526593, 257); +f(1047039, 511); +f(1049088, 512); +f(1051137, 513); +f(2096127, 1023); +f(2098176, 1024); +f(2100225, 1025); +f(4194303, 2047); +f(4196352, 2048); +f(4198401, 2049); +x = 4095; +f(0, 0); +f(4095, 1); +f(8190, 2); +f(12285, 3); +f(16380, 4); +f(20475, 5); +f(28665, 7); +f(32760, 8); +f(36855, 9); +f(61425, 15); +f(65520, 16); +f(69615, 17); +f(126945, 31); +f(131040, 32); +f(135135, 33); +f(257985, 63); +f(262080, 64); +f(266175, 65); +f(520065, 127); +f(524160, 128); +f(528255, 129); +f(1044225, 255); +f(1048320, 256); +f(1052415, 257); +f(2092545, 511); +f(2096640, 512); +f(2100735, 513); +f(4189185, 1023); +f(4193280, 1024); +f(4197375, 1025); +f(8382465, 2047); +f(8386560, 2048); +f(8390655, 2049); +f(16769025, 4095); +x = 4096; +f(0, 0); +f(4096, 1); +f(8192, 2); +f(12288, 3); +f(16384, 4); +f(20480, 5); +f(28672, 7); +f(32768, 8); +f(36864, 9); +f(61440, 15); +f(65536, 16); +f(69632, 17); +f(126976, 31); +f(131072, 32); +f(135168, 33); +f(258048, 63); +f(262144, 64); +f(266240, 65); +f(520192, 127); +f(524288, 128); +f(528384, 129); +f(1044480, 255); +f(1048576, 256); +f(1052672, 257); +f(2093056, 511); +f(2097152, 512); +f(2101248, 513); +f(4190208, 1023); +f(4194304, 1024); +f(4198400, 1025); +f(8384512, 2047); +f(8388608, 2048); +f(8392704, 2049); +f(16773120, 4095); +f(16777216, 4096); +x = 4097; +f(0, 0); +f(4097, 1); +f(8194, 2); +f(12291, 3); +f(16388, 4); +f(20485, 5); +f(28679, 7); +f(32776, 8); +f(36873, 9); +f(61455, 15); +f(65552, 16); +f(69649, 17); +f(127007, 31); +f(131104, 32); +f(135201, 33); +f(258111, 63); +f(262208, 64); +f(266305, 65); +f(520319, 127); +f(524416, 128); +f(528513, 129); +f(1044735, 255); +f(1048832, 256); +f(1052929, 257); +f(2093567, 511); +f(2097664, 512); +f(2101761, 513); +f(4191231, 1023); +f(4195328, 1024); +f(4199425, 1025); +f(8386559, 2047); +f(8390656, 2048); +f(8394753, 2049); +f(16777215, 4095); +f(16781312, 4096); +f(16785409, 4097); +x = 8191; +f(0, 0); +f(8191, 1); +f(16382, 2); +f(24573, 3); +f(32764, 4); +f(40955, 5); +f(57337, 7); +f(65528, 8); +f(73719, 9); +f(122865, 15); +f(131056, 16); +f(139247, 17); +f(253921, 31); +f(262112, 32); +f(270303, 33); +f(516033, 63); +f(524224, 64); +f(532415, 65); +f(1040257, 127); +f(1048448, 128); +f(1056639, 129); +f(2088705, 255); +f(2096896, 256); +f(2105087, 257); +f(4185601, 511); +f(4193792, 512); +f(4201983, 513); +f(8379393, 1023); +f(8387584, 1024); +f(8395775, 1025); +f(16766977, 2047); +f(16775168, 2048); +f(16783359, 2049); +f(33542145, 4095); +f(33550336, 4096); +f(33558527, 4097); +f(67092481, 8191); +x = 8192; +f(0, 0); +f(8192, 1); +f(16384, 2); +f(24576, 3); +f(32768, 4); +f(40960, 5); +f(57344, 7); +f(65536, 8); +f(73728, 9); +f(122880, 15); +f(131072, 16); +f(139264, 17); +f(253952, 31); +f(262144, 32); +f(270336, 33); +f(516096, 63); +f(524288, 64); +f(532480, 65); +f(1040384, 127); +f(1048576, 128); +f(1056768, 129); +f(2088960, 255); +f(2097152, 256); +f(2105344, 257); +f(4186112, 511); +f(4194304, 512); +f(4202496, 513); +f(8380416, 1023); +f(8388608, 1024); +f(8396800, 1025); +f(16769024, 2047); +f(16777216, 2048); +f(16785408, 2049); +f(33546240, 4095); +f(33554432, 4096); +f(33562624, 4097); +f(67100672, 8191); +f(67108864, 8192); +x = 8193; +f(0, 0); +f(8193, 1); +f(16386, 2); +f(24579, 3); +f(32772, 4); +f(40965, 5); +f(57351, 7); +f(65544, 8); +f(73737, 9); +f(122895, 15); +f(131088, 16); +f(139281, 17); +f(253983, 31); +f(262176, 32); +f(270369, 33); +f(516159, 63); +f(524352, 64); +f(532545, 65); +f(1040511, 127); +f(1048704, 128); +f(1056897, 129); +f(2089215, 255); +f(2097408, 256); +f(2105601, 257); +f(4186623, 511); +f(4194816, 512); +f(4203009, 513); +f(8381439, 1023); +f(8389632, 1024); +f(8397825, 1025); +f(16771071, 2047); +f(16779264, 2048); +f(16787457, 2049); +f(33550335, 4095); +f(33558528, 4096); +f(33566721, 4097); +f(67108863, 8191); +f(67117056, 8192); +f(67125249, 8193); +x = 16383; +f(0, 0); +f(16383, 1); +f(32766, 2); +f(49149, 3); +f(65532, 4); +f(81915, 5); +f(114681, 7); +f(131064, 8); +f(147447, 9); +f(245745, 15); +f(262128, 16); +f(278511, 17); +f(507873, 31); +f(524256, 32); +f(540639, 33); +f(1032129, 63); +f(1048512, 64); +f(1064895, 65); +f(2080641, 127); +f(2097024, 128); +f(2113407, 129); +f(4177665, 255); +f(4194048, 256); +f(4210431, 257); +f(8371713, 511); +f(8388096, 512); +f(8404479, 513); +f(16759809, 1023); +f(16776192, 1024); +f(16792575, 1025); +f(33536001, 2047); +f(33552384, 2048); +f(33568767, 2049); +f(67088385, 4095); +f(67104768, 4096); +f(67121151, 4097); +f(134193153, 8191); +f(134209536, 8192); +f(134225919, 8193); +f(268402689, 16383); +x = 16384; +f(0, 0); +f(16384, 1); +f(32768, 2); +f(49152, 3); +f(65536, 4); +f(81920, 5); +f(114688, 7); +f(131072, 8); +f(147456, 9); +f(245760, 15); +f(262144, 16); +f(278528, 17); +f(507904, 31); +f(524288, 32); +f(540672, 33); +f(1032192, 63); +f(1048576, 64); +f(1064960, 65); +f(2080768, 127); +f(2097152, 128); +f(2113536, 129); +f(4177920, 255); +f(4194304, 256); +f(4210688, 257); +f(8372224, 511); +f(8388608, 512); +f(8404992, 513); +f(16760832, 1023); +f(16777216, 1024); +f(16793600, 1025); +f(33538048, 2047); +f(33554432, 2048); +f(33570816, 2049); +f(67092480, 4095); +f(67108864, 4096); +f(67125248, 4097); +f(134201344, 8191); +f(134217728, 8192); +f(134234112, 8193); +f(268419072, 16383); +f(268435456, 16384); diff --git a/test/mjsunit/mul-exhaustive-part3.js b/test/mjsunit/mul-exhaustive-part3.js new file mode 100644 index 0000000..06e41a1 --- /dev/null +++ b/test/mjsunit/mul-exhaustive-part3.js @@ -0,0 +1,532 @@ +// Copyright 2008 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +var x; + +// Converts a number to string respecting -0. +function stringify(n) { + if ((1 / n) === -Infinity) return "-0"; + return String(n); +} + +function f(expected, y) { + function testEval(string, x, y) { + var mulFunction = Function("x, y", "return " + string); + return mulFunction(x, y); + } + function mulTest(expected, x, y) { + assertEquals(expected, x * y); + assertEquals(expected, testEval(stringify(x) + " * y", x, y)); + assertEquals(expected, testEval("x * " + stringify(y), x, y)); + assertEquals(expected, testEval(stringify(x) + " * " + stringify(y), x, y)); + } + mulTest(expected, x, y); + mulTest(-expected, -x, y); + mulTest(-expected, x, -y); + mulTest(expected, -x, -y); + if (x === y) return; // Symmetric cases not necessary. + mulTest(expected, y, x); + mulTest(-expected, -y, x); + mulTest(-expected, y, -x); + mulTest(expected, -y, -x); +} + +x = 16385; +f(0, 0); +f(16385, 1); +f(32770, 2); +f(49155, 3); +f(65540, 4); +f(81925, 5); +f(114695, 7); +f(131080, 8); +f(147465, 9); +f(245775, 15); +f(262160, 16); +f(278545, 17); +f(507935, 31); +f(524320, 32); +f(540705, 33); +f(1032255, 63); +f(1048640, 64); +f(1065025, 65); +f(2080895, 127); +f(2097280, 128); +f(2113665, 129); +f(4178175, 255); +f(4194560, 256); +f(4210945, 257); +f(8372735, 511); +f(8389120, 512); +f(8405505, 513); +f(16761855, 1023); +f(16778240, 1024); +f(16794625, 1025); +f(33540095, 2047); +f(33556480, 2048); +f(33572865, 2049); +f(67096575, 4095); +f(67112960, 4096); +f(67129345, 4097); +f(134209535, 8191); +f(134225920, 8192); +f(134242305, 8193); +f(268435455, 16383); +f(268451840, 16384); +f(268468225, 16385); +x = 32767; +f(0, 0); +f(32767, 1); +f(65534, 2); +f(98301, 3); +f(131068, 4); +f(163835, 5); +f(229369, 7); +f(262136, 8); +f(294903, 9); +f(491505, 15); +f(524272, 16); +f(557039, 17); +f(1015777, 31); +f(1048544, 32); +f(1081311, 33); +f(2064321, 63); +f(2097088, 64); +f(2129855, 65); +f(4161409, 127); +f(4194176, 128); +f(4226943, 129); +f(8355585, 255); +f(8388352, 256); +f(8421119, 257); +f(16743937, 511); +f(16776704, 512); +f(16809471, 513); +f(33520641, 1023); +f(33553408, 1024); +f(33586175, 1025); +f(67074049, 2047); +f(67106816, 2048); +f(67139583, 2049); +f(134180865, 4095); +f(134213632, 4096); +f(134246399, 4097); +f(268394497, 8191); +f(268427264, 8192); +f(268460031, 8193); +f(536821761, 16383); +f(536854528, 16384); +f(536887295, 16385); +f(1073676289, 32767); +x = 32768; +f(0, 0); +f(32768, 1); +f(65536, 2); +f(98304, 3); +f(131072, 4); +f(163840, 5); +f(229376, 7); +f(262144, 8); +f(294912, 9); +f(491520, 15); +f(524288, 16); +f(557056, 17); +f(1015808, 31); +f(1048576, 32); +f(1081344, 33); +f(2064384, 63); +f(2097152, 64); +f(2129920, 65); +f(4161536, 127); +f(4194304, 128); +f(4227072, 129); +f(8355840, 255); +f(8388608, 256); +f(8421376, 257); +f(16744448, 511); +f(16777216, 512); +f(16809984, 513); +f(33521664, 1023); +f(33554432, 1024); +f(33587200, 1025); +f(67076096, 2047); +f(67108864, 2048); +f(67141632, 2049); +f(134184960, 4095); +f(134217728, 4096); +f(134250496, 4097); +f(268402688, 8191); +f(268435456, 8192); +f(268468224, 8193); +f(536838144, 16383); +f(536870912, 16384); +f(536903680, 16385); +f(1073709056, 32767); +f(1073741824, 32768); +x = 32769; +f(0, 0); +f(32769, 1); +f(65538, 2); +f(98307, 3); +f(131076, 4); +f(163845, 5); +f(229383, 7); +f(262152, 8); +f(294921, 9); +f(491535, 15); +f(524304, 16); +f(557073, 17); +f(1015839, 31); +f(1048608, 32); +f(1081377, 33); +f(2064447, 63); +f(2097216, 64); +f(2129985, 65); +f(4161663, 127); +f(4194432, 128); +f(4227201, 129); +f(8356095, 255); +f(8388864, 256); +f(8421633, 257); +f(16744959, 511); +f(16777728, 512); +f(16810497, 513); +f(33522687, 1023); +f(33555456, 1024); +f(33588225, 1025); +f(67078143, 2047); +f(67110912, 2048); +f(67143681, 2049); +f(134189055, 4095); +f(134221824, 4096); +f(134254593, 4097); +f(268410879, 8191); +f(268443648, 8192); +f(268476417, 8193); +f(536854527, 16383); +f(536887296, 16384); +f(536920065, 16385); +f(1073741823, 32767); +f(1073774592, 32768); +f(1073807361, 32769); +x = 65535; +f(0, 0); +f(65535, 1); +f(131070, 2); +f(196605, 3); +f(262140, 4); +f(327675, 5); +f(458745, 7); +f(524280, 8); +f(589815, 9); +f(983025, 15); +f(1048560, 16); +f(1114095, 17); +f(2031585, 31); +f(2097120, 32); +f(2162655, 33); +f(4128705, 63); +f(4194240, 64); +f(4259775, 65); +f(8322945, 127); +f(8388480, 128); +f(8454015, 129); +f(16711425, 255); +f(16776960, 256); +f(16842495, 257); +f(33488385, 511); +f(33553920, 512); +f(33619455, 513); +f(67042305, 1023); +f(67107840, 1024); +f(67173375, 1025); +f(134150145, 2047); +f(134215680, 2048); +f(134281215, 2049); +f(268365825, 4095); +f(268431360, 4096); +f(268496895, 4097); +f(536797185, 8191); +f(536862720, 8192); +f(536928255, 8193); +f(1073659905, 16383); +f(1073725440, 16384); +f(1073790975, 16385); +f(2147385345, 32767); +f(2147450880, 32768); +f(2147516415, 32769); +f(4294836225, 65535); +x = 65536; +f(0, 0); +f(65536, 1); +f(131072, 2); +f(196608, 3); +f(262144, 4); +f(327680, 5); +f(458752, 7); +f(524288, 8); +f(589824, 9); +f(983040, 15); +f(1048576, 16); +f(1114112, 17); +f(2031616, 31); +f(2097152, 32); +f(2162688, 33); +f(4128768, 63); +f(4194304, 64); +f(4259840, 65); +f(8323072, 127); +f(8388608, 128); +f(8454144, 129); +f(16711680, 255); +f(16777216, 256); +f(16842752, 257); +f(33488896, 511); +f(33554432, 512); +f(33619968, 513); +f(67043328, 1023); +f(67108864, 1024); +f(67174400, 1025); +f(134152192, 2047); +f(134217728, 2048); +f(134283264, 2049); +f(268369920, 4095); +f(268435456, 4096); +f(268500992, 4097); +f(536805376, 8191); +f(536870912, 8192); +f(536936448, 8193); +f(1073676288, 16383); +f(1073741824, 16384); +f(1073807360, 16385); +f(2147418112, 32767); +f(2147483648, 32768); +f(2147549184, 32769); +f(4294901760, 65535); +f(4294967296, 65536); +x = 65537; +f(0, 0); +f(65537, 1); +f(131074, 2); +f(196611, 3); +f(262148, 4); +f(327685, 5); +f(458759, 7); +f(524296, 8); +f(589833, 9); +f(983055, 15); +f(1048592, 16); +f(1114129, 17); +f(2031647, 31); +f(2097184, 32); +f(2162721, 33); +f(4128831, 63); +f(4194368, 64); +f(4259905, 65); +f(8323199, 127); +f(8388736, 128); +f(8454273, 129); +f(16711935, 255); +f(16777472, 256); +f(16843009, 257); +f(33489407, 511); +f(33554944, 512); +f(33620481, 513); +f(67044351, 1023); +f(67109888, 1024); +f(67175425, 1025); +f(134154239, 2047); +f(134219776, 2048); +f(134285313, 2049); +f(268374015, 4095); +f(268439552, 4096); +f(268505089, 4097); +f(536813567, 8191); +f(536879104, 8192); +f(536944641, 8193); +f(1073692671, 16383); +f(1073758208, 16384); +f(1073823745, 16385); +f(2147450879, 32767); +f(2147516416, 32768); +f(2147581953, 32769); +f(4294967295, 65535); +f(4295032832, 65536); +f(4295098369, 65537); +x = 131071; +f(0, 0); +f(131071, 1); +f(262142, 2); +f(393213, 3); +f(524284, 4); +f(655355, 5); +f(917497, 7); +f(1048568, 8); +f(1179639, 9); +f(1966065, 15); +f(2097136, 16); +f(2228207, 17); +f(4063201, 31); +f(4194272, 32); +f(4325343, 33); +f(8257473, 63); +f(8388544, 64); +f(8519615, 65); +f(16646017, 127); +f(16777088, 128); +f(16908159, 129); +f(33423105, 255); +f(33554176, 256); +f(33685247, 257); +f(66977281, 511); +f(67108352, 512); +f(67239423, 513); +f(134085633, 1023); +f(134216704, 1024); +f(134347775, 1025); +f(268302337, 2047); +f(268433408, 2048); +f(268564479, 2049); +f(536735745, 4095); +f(536866816, 4096); +f(536997887, 4097); +f(1073602561, 8191); +f(1073733632, 8192); +f(1073864703, 8193); +f(2147336193, 16383); +f(2147467264, 16384); +f(2147598335, 16385); +f(4294803457, 32767); +f(4294934528, 32768); +f(4295065599, 32769); +f(8589737985, 65535); +f(8589869056, 65536); +f(8590000127, 65537); +f(17179607041, 131071); +x = 131072; +f(0, 0); +f(131072, 1); +f(262144, 2); +f(393216, 3); +f(524288, 4); +f(655360, 5); +f(917504, 7); +f(1048576, 8); +f(1179648, 9); +f(1966080, 15); +f(2097152, 16); +f(2228224, 17); +f(4063232, 31); +f(4194304, 32); +f(4325376, 33); +f(8257536, 63); +f(8388608, 64); +f(8519680, 65); +f(16646144, 127); +f(16777216, 128); +f(16908288, 129); +f(33423360, 255); +f(33554432, 256); +f(33685504, 257); +f(66977792, 511); +f(67108864, 512); +f(67239936, 513); +f(134086656, 1023); +f(134217728, 1024); +f(134348800, 1025); +f(268304384, 2047); +f(268435456, 2048); +f(268566528, 2049); +f(536739840, 4095); +f(536870912, 4096); +f(537001984, 4097); +f(1073610752, 8191); +f(1073741824, 8192); +f(1073872896, 8193); +f(2147352576, 16383); +f(2147483648, 16384); +f(2147614720, 16385); +f(4294836224, 32767); +f(4294967296, 32768); +f(4295098368, 32769); +f(8589803520, 65535); +f(8589934592, 65536); +f(8590065664, 65537); +f(17179738112, 131071); +f(17179869184, 131072); +x = 131073; +f(0, 0); +f(131073, 1); +f(262146, 2); +f(393219, 3); +f(524292, 4); +f(655365, 5); +f(917511, 7); +f(1048584, 8); +f(1179657, 9); +f(1966095, 15); +f(2097168, 16); +f(2228241, 17); +f(4063263, 31); +f(4194336, 32); +f(4325409, 33); +f(8257599, 63); +f(8388672, 64); +f(8519745, 65); +f(16646271, 127); +f(16777344, 128); +f(16908417, 129); +f(33423615, 255); +f(33554688, 256); +f(33685761, 257); +f(66978303, 511); +f(67109376, 512); +f(67240449, 513); +f(134087679, 1023); +f(134218752, 1024); +f(134349825, 1025); +f(268306431, 2047); +f(268437504, 2048); +f(268568577, 2049); +f(536743935, 4095); +f(536875008, 4096); +f(537006081, 4097); +f(1073618943, 8191); +f(1073750016, 8192); +f(1073881089, 8193); +f(2147368959, 16383); +f(2147500032, 16384); +f(2147631105, 16385); +f(4294868991, 32767); +f(4295000064, 32768); +f(4295131137, 32769); +f(8589869055, 65535); +f(8590000128, 65536); +f(8590131201, 65537); +f(17179869183, 131071); +f(17180000256, 131072); +f(17180131329, 131073); diff --git a/test/mjsunit/mul-exhaustive-part4.js b/test/mjsunit/mul-exhaustive-part4.js new file mode 100644 index 0000000..de9f983 --- /dev/null +++ b/test/mjsunit/mul-exhaustive-part4.js @@ -0,0 +1,509 @@ +// Copyright 2008 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +var x; + +// Converts a number to string respecting -0. +function stringify(n) { + if ((1 / n) === -Infinity) return "-0"; + return String(n); +} + +function f(expected, y) { + function testEval(string, x, y) { + var mulFunction = Function("x, y", "return " + string); + return mulFunction(x, y); + } + function mulTest(expected, x, y) { + assertEquals(expected, x * y); + assertEquals(expected, testEval(stringify(x) + " * y", x, y)); + assertEquals(expected, testEval("x * " + stringify(y), x, y)); + assertEquals(expected, testEval(stringify(x) + " * " + stringify(y), x, y)); + } + mulTest(expected, x, y); + mulTest(-expected, -x, y); + mulTest(-expected, x, -y); + mulTest(expected, -x, -y); + if (x === y) return; // Symmetric cases not necessary. + mulTest(expected, y, x); + mulTest(-expected, -y, x); + mulTest(-expected, y, -x); + mulTest(expected, -y, -x); +} + +x = 262143; +f(0, 0); +f(262143, 1); +f(524286, 2); +f(786429, 3); +f(1048572, 4); +f(1310715, 5); +f(1835001, 7); +f(2097144, 8); +f(2359287, 9); +f(3932145, 15); +f(4194288, 16); +f(4456431, 17); +f(8126433, 31); +f(8388576, 32); +f(8650719, 33); +f(16515009, 63); +f(16777152, 64); +f(17039295, 65); +f(33292161, 127); +f(33554304, 128); +f(33816447, 129); +f(66846465, 255); +f(67108608, 256); +f(67370751, 257); +f(133955073, 511); +f(134217216, 512); +f(134479359, 513); +f(268172289, 1023); +f(268434432, 1024); +f(268696575, 1025); +f(536606721, 2047); +f(536868864, 2048); +f(537131007, 2049); +f(1073475585, 4095); +f(1073737728, 4096); +f(1073999871, 4097); +f(2147213313, 8191); +f(2147475456, 8192); +f(2147737599, 8193); +f(4294688769, 16383); +f(4294950912, 16384); +f(4295213055, 16385); +f(8589639681, 32767); +f(8589901824, 32768); +f(8590163967, 32769); +f(17179541505, 65535); +f(17179803648, 65536); +f(17180065791, 65537); +f(34359345153, 131071); +f(34359607296, 131072); +f(34359869439, 131073); +f(68718952449, 262143); +x = 262144; +f(0, 0); +f(262144, 1); +f(524288, 2); +f(786432, 3); +f(1048576, 4); +f(1310720, 5); +f(1835008, 7); +f(2097152, 8); +f(2359296, 9); +f(3932160, 15); +f(4194304, 16); +f(4456448, 17); +f(8126464, 31); +f(8388608, 32); +f(8650752, 33); +f(16515072, 63); +f(16777216, 64); +f(17039360, 65); +f(33292288, 127); +f(33554432, 128); +f(33816576, 129); +f(66846720, 255); +f(67108864, 256); +f(67371008, 257); +f(133955584, 511); +f(134217728, 512); +f(134479872, 513); +f(268173312, 1023); +f(268435456, 1024); +f(268697600, 1025); +f(536608768, 2047); +f(536870912, 2048); +f(537133056, 2049); +f(1073479680, 4095); +f(1073741824, 4096); +f(1074003968, 4097); +f(2147221504, 8191); +f(2147483648, 8192); +f(2147745792, 8193); +f(4294705152, 16383); +f(4294967296, 16384); +f(4295229440, 16385); +f(8589672448, 32767); +f(8589934592, 32768); +f(8590196736, 32769); +f(17179607040, 65535); +f(17179869184, 65536); +f(17180131328, 65537); +f(34359476224, 131071); +f(34359738368, 131072); +f(34360000512, 131073); +f(68719214592, 262143); +f(68719476736, 262144); +x = 262145; +f(0, 0); +f(262145, 1); +f(524290, 2); +f(786435, 3); +f(1048580, 4); +f(1310725, 5); +f(1835015, 7); +f(2097160, 8); +f(2359305, 9); +f(3932175, 15); +f(4194320, 16); +f(4456465, 17); +f(8126495, 31); +f(8388640, 32); +f(8650785, 33); +f(16515135, 63); +f(16777280, 64); +f(17039425, 65); +f(33292415, 127); +f(33554560, 128); +f(33816705, 129); +f(66846975, 255); +f(67109120, 256); +f(67371265, 257); +f(133956095, 511); +f(134218240, 512); +f(134480385, 513); +f(268174335, 1023); +f(268436480, 1024); +f(268698625, 1025); +f(536610815, 2047); +f(536872960, 2048); +f(537135105, 2049); +f(1073483775, 4095); +f(1073745920, 4096); +f(1074008065, 4097); +f(2147229695, 8191); +f(2147491840, 8192); +f(2147753985, 8193); +f(4294721535, 16383); +f(4294983680, 16384); +f(4295245825, 16385); +f(8589705215, 32767); +f(8589967360, 32768); +f(8590229505, 32769); +f(17179672575, 65535); +f(17179934720, 65536); +f(17180196865, 65537); +f(34359607295, 131071); +f(34359869440, 131072); +f(34360131585, 131073); +f(68719476735, 262143); +f(68719738880, 262144); +f(68720001025, 262145); +x = 524287; +f(0, 0); +f(524287, 1); +f(1048574, 2); +f(1572861, 3); +f(2097148, 4); +f(2621435, 5); +f(3670009, 7); +f(4194296, 8); +f(4718583, 9); +f(7864305, 15); +f(8388592, 16); +f(8912879, 17); +f(16252897, 31); +f(16777184, 32); +f(17301471, 33); +f(33030081, 63); +f(33554368, 64); +f(34078655, 65); +f(66584449, 127); +f(67108736, 128); +f(67633023, 129); +f(133693185, 255); +f(134217472, 256); +f(134741759, 257); +f(267910657, 511); +f(268434944, 512); +f(268959231, 513); +f(536345601, 1023); +f(536869888, 1024); +f(537394175, 1025); +f(1073215489, 2047); +f(1073739776, 2048); +f(1074264063, 2049); +f(2146955265, 4095); +f(2147479552, 4096); +f(2148003839, 4097); +f(4294434817, 8191); +f(4294959104, 8192); +f(4295483391, 8193); +f(8589393921, 16383); +f(8589918208, 16384); +f(8590442495, 16385); +f(17179312129, 32767); +f(17179836416, 32768); +f(17180360703, 32769); +f(34359148545, 65535); +f(34359672832, 65536); +f(34360197119, 65537); +f(68718821377, 131071); +f(68719345664, 131072); +f(68719869951, 131073); +f(137438167041, 262143); +f(137438691328, 262144); +f(137439215615, 262145); +f(274876858369, 524287); +x = 524288; +f(0, 0); +f(524288, 1); +f(1048576, 2); +f(1572864, 3); +f(2097152, 4); +f(2621440, 5); +f(3670016, 7); +f(4194304, 8); +f(4718592, 9); +f(7864320, 15); +f(8388608, 16); +f(8912896, 17); +f(16252928, 31); +f(16777216, 32); +f(17301504, 33); +f(33030144, 63); +f(33554432, 64); +f(34078720, 65); +f(66584576, 127); +f(67108864, 128); +f(67633152, 129); +f(133693440, 255); +f(134217728, 256); +f(134742016, 257); +f(267911168, 511); +f(268435456, 512); +f(268959744, 513); +f(536346624, 1023); +f(536870912, 1024); +f(537395200, 1025); +f(1073217536, 2047); +f(1073741824, 2048); +f(1074266112, 2049); +f(2146959360, 4095); +f(2147483648, 4096); +f(2148007936, 4097); +f(4294443008, 8191); +f(4294967296, 8192); +f(4295491584, 8193); +f(8589410304, 16383); +f(8589934592, 16384); +f(8590458880, 16385); +f(17179344896, 32767); +f(17179869184, 32768); +f(17180393472, 32769); +f(34359214080, 65535); +f(34359738368, 65536); +f(34360262656, 65537); +f(68718952448, 131071); +f(68719476736, 131072); +f(68720001024, 131073); +f(137438429184, 262143); +f(137438953472, 262144); +f(137439477760, 262145); +f(274877382656, 524287); +f(274877906944, 524288); +x = 524289; +f(0, 0); +f(524289, 1); +f(1048578, 2); +f(1572867, 3); +f(2097156, 4); +f(2621445, 5); +f(3670023, 7); +f(4194312, 8); +f(4718601, 9); +f(7864335, 15); +f(8388624, 16); +f(8912913, 17); +f(16252959, 31); +f(16777248, 32); +f(17301537, 33); +f(33030207, 63); +f(33554496, 64); +f(34078785, 65); +f(66584703, 127); +f(67108992, 128); +f(67633281, 129); +f(133693695, 255); +f(134217984, 256); +f(134742273, 257); +f(267911679, 511); +f(268435968, 512); +f(268960257, 513); +f(536347647, 1023); +f(536871936, 1024); +f(537396225, 1025); +f(1073219583, 2047); +f(1073743872, 2048); +f(1074268161, 2049); +f(2146963455, 4095); +f(2147487744, 4096); +f(2148012033, 4097); +f(4294451199, 8191); +f(4294975488, 8192); +f(4295499777, 8193); +f(8589426687, 16383); +f(8589950976, 16384); +f(8590475265, 16385); +f(17179377663, 32767); +f(17179901952, 32768); +f(17180426241, 32769); +f(34359279615, 65535); +f(34359803904, 65536); +f(34360328193, 65537); +f(68719083519, 131071); +f(68719607808, 131072); +f(68720132097, 131073); +f(137438691327, 262143); +f(137439215616, 262144); +f(137439739905, 262145); +f(274877906943, 524287); +f(274878431232, 524288); +f(274878955521, 524289); +x = 1048575; +f(0, 0); +f(1048575, 1); +f(2097150, 2); +f(3145725, 3); +f(4194300, 4); +f(5242875, 5); +f(7340025, 7); +f(8388600, 8); +f(9437175, 9); +f(15728625, 15); +f(16777200, 16); +f(17825775, 17); +f(32505825, 31); +f(33554400, 32); +f(34602975, 33); +f(66060225, 63); +f(67108800, 64); +f(68157375, 65); +f(133169025, 127); +f(134217600, 128); +f(135266175, 129); +f(267386625, 255); +f(268435200, 256); +f(269483775, 257); +f(535821825, 511); +f(536870400, 512); +f(537918975, 513); +f(1072692225, 1023); +f(1073740800, 1024); +f(1074789375, 1025); +f(2146433025, 2047); +f(2147481600, 2048); +f(2148530175, 2049); +f(4293914625, 4095); +f(4294963200, 4096); +f(4296011775, 4097); +f(8588877825, 8191); +f(8589926400, 8192); +f(8590974975, 8193); +f(17178804225, 16383); +f(17179852800, 16384); +f(17180901375, 16385); +f(34358657025, 32767); +f(34359705600, 32768); +f(34360754175, 32769); +f(68718362625, 65535); +f(68719411200, 65536); +f(68720459775, 65537); +f(137437773825, 131071); +f(137438822400, 131072); +f(137439870975, 131073); +f(274876596225, 262143); +f(274877644800, 262144); +f(274878693375, 262145); +f(549754241025, 524287); +f(549755289600, 524288); +f(549756338175, 524289); +f(1099509530625, 1048575); +x = 1048576; +f(0, 0); +f(1048576, 1); +f(2097152, 2); +f(3145728, 3); +f(4194304, 4); +f(5242880, 5); +f(7340032, 7); +f(8388608, 8); +f(9437184, 9); +f(15728640, 15); +f(16777216, 16); +f(17825792, 17); +f(32505856, 31); +f(33554432, 32); +f(34603008, 33); +f(66060288, 63); +f(67108864, 64); +f(68157440, 65); +f(133169152, 127); +f(134217728, 128); +f(135266304, 129); +f(267386880, 255); +f(268435456, 256); +f(269484032, 257); +f(535822336, 511); +f(536870912, 512); +f(537919488, 513); +f(1072693248, 1023); +f(1073741824, 1024); +f(1074790400, 1025); +f(2146435072, 2047); +f(2147483648, 2048); +f(2148532224, 2049); +f(4293918720, 4095); +f(4294967296, 4096); +f(4296015872, 4097); +f(8588886016, 8191); +f(8589934592, 8192); +f(8590983168, 8193); +f(17178820608, 16383); +f(17179869184, 16384); +f(17180917760, 16385); +f(34358689792, 32767); +f(34359738368, 32768); +f(34360786944, 32769); +f(68718428160, 65535); +f(68719476736, 65536); +f(68720525312, 65537); +f(137437904896, 131071); +f(137438953472, 131072); +f(137440002048, 131073); +f(274876858368, 262143); +f(274877906944, 262144); +f(274878955520, 262145); +f(549754765312, 524287); +f(549755813888, 524288); +f(549756862464, 524289); +f(1099510579200, 1048575); +f(1099511627776, 1048576); diff --git a/test/mjsunit/mul-exhaustive-part5.js b/test/mjsunit/mul-exhaustive-part5.js new file mode 100644 index 0000000..e929985 --- /dev/null +++ b/test/mjsunit/mul-exhaustive-part5.js @@ -0,0 +1,505 @@ +// Copyright 2008 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +var x; + +// Converts a number to string respecting -0. +function stringify(n) { + if ((1 / n) === -Infinity) return "-0"; + return String(n); +} + +function f(expected, y) { + function testEval(string, x, y) { + var mulFunction = Function("x, y", "return " + string); + return mulFunction(x, y); + } + function mulTest(expected, x, y) { + assertEquals(expected, x * y); + assertEquals(expected, testEval(stringify(x) + " * y", x, y)); + assertEquals(expected, testEval("x * " + stringify(y), x, y)); + assertEquals(expected, testEval(stringify(x) + " * " + stringify(y), x, y)); + } + mulTest(expected, x, y); + mulTest(-expected, -x, y); + mulTest(-expected, x, -y); + mulTest(expected, -x, -y); + if (x === y) return; // Symmetric cases not necessary. + mulTest(expected, y, x); + mulTest(-expected, -y, x); + mulTest(-expected, y, -x); + mulTest(expected, -y, -x); +} + +x = 1048577; +f(0, 0); +f(1048577, 1); +f(2097154, 2); +f(3145731, 3); +f(4194308, 4); +f(5242885, 5); +f(7340039, 7); +f(8388616, 8); +f(9437193, 9); +f(15728655, 15); +f(16777232, 16); +f(17825809, 17); +f(32505887, 31); +f(33554464, 32); +f(34603041, 33); +f(66060351, 63); +f(67108928, 64); +f(68157505, 65); +f(133169279, 127); +f(134217856, 128); +f(135266433, 129); +f(267387135, 255); +f(268435712, 256); +f(269484289, 257); +f(535822847, 511); +f(536871424, 512); +f(537920001, 513); +f(1072694271, 1023); +f(1073742848, 1024); +f(1074791425, 1025); +f(2146437119, 2047); +f(2147485696, 2048); +f(2148534273, 2049); +f(4293922815, 4095); +f(4294971392, 4096); +f(4296019969, 4097); +f(8588894207, 8191); +f(8589942784, 8192); +f(8590991361, 8193); +f(17178836991, 16383); +f(17179885568, 16384); +f(17180934145, 16385); +f(34358722559, 32767); +f(34359771136, 32768); +f(34360819713, 32769); +f(68718493695, 65535); +f(68719542272, 65536); +f(68720590849, 65537); +f(137438035967, 131071); +f(137439084544, 131072); +f(137440133121, 131073); +f(274877120511, 262143); +f(274878169088, 262144); +f(274879217665, 262145); +f(549755289599, 524287); +f(549756338176, 524288); +f(549757386753, 524289); +f(1099511627775, 1048575); +f(1099512676352, 1048576); +f(1099513724929, 1048577); +x = 2097151; +f(0, 0); +f(2097151, 1); +f(4194302, 2); +f(6291453, 3); +f(8388604, 4); +f(10485755, 5); +f(14680057, 7); +f(16777208, 8); +f(18874359, 9); +f(31457265, 15); +f(33554416, 16); +f(35651567, 17); +f(65011681, 31); +f(67108832, 32); +f(69205983, 33); +f(132120513, 63); +f(134217664, 64); +f(136314815, 65); +f(266338177, 127); +f(268435328, 128); +f(270532479, 129); +f(534773505, 255); +f(536870656, 256); +f(538967807, 257); +f(1071644161, 511); +f(1073741312, 512); +f(1075838463, 513); +f(2145385473, 1023); +f(2147482624, 1024); +f(2149579775, 1025); +f(4292868097, 2047); +f(4294965248, 2048); +f(4297062399, 2049); +f(8587833345, 4095); +f(8589930496, 4096); +f(8592027647, 4097); +f(17177763841, 8191); +f(17179860992, 8192); +f(17181958143, 8193); +f(34357624833, 16383); +f(34359721984, 16384); +f(34361819135, 16385); +f(68717346817, 32767); +f(68719443968, 32768); +f(68721541119, 32769); +f(137436790785, 65535); +f(137438887936, 65536); +f(137440985087, 65537); +f(274875678721, 131071); +f(274877775872, 131072); +f(274879873023, 131073); +f(549753454593, 262143); +f(549755551744, 262144); +f(549757648895, 262145); +f(1099509006337, 524287); +f(1099511103488, 524288); +f(1099513200639, 524289); +f(2199020109825, 1048575); +f(2199022206976, 1048576); +f(2199024304127, 1048577); +f(4398042316801, 2097151); +x = 2097152; +f(0, 0); +f(2097152, 1); +f(4194304, 2); +f(6291456, 3); +f(8388608, 4); +f(10485760, 5); +f(14680064, 7); +f(16777216, 8); +f(18874368, 9); +f(31457280, 15); +f(33554432, 16); +f(35651584, 17); +f(65011712, 31); +f(67108864, 32); +f(69206016, 33); +f(132120576, 63); +f(134217728, 64); +f(136314880, 65); +f(266338304, 127); +f(268435456, 128); +f(270532608, 129); +f(534773760, 255); +f(536870912, 256); +f(538968064, 257); +f(1071644672, 511); +f(1073741824, 512); +f(1075838976, 513); +f(2145386496, 1023); +f(2147483648, 1024); +f(2149580800, 1025); +f(4292870144, 2047); +f(4294967296, 2048); +f(4297064448, 2049); +f(8587837440, 4095); +f(8589934592, 4096); +f(8592031744, 4097); +f(17177772032, 8191); +f(17179869184, 8192); +f(17181966336, 8193); +f(34357641216, 16383); +f(34359738368, 16384); +f(34361835520, 16385); +f(68717379584, 32767); +f(68719476736, 32768); +f(68721573888, 32769); +f(137436856320, 65535); +f(137438953472, 65536); +f(137441050624, 65537); +f(274875809792, 131071); +f(274877906944, 131072); +f(274880004096, 131073); +f(549753716736, 262143); +f(549755813888, 262144); +f(549757911040, 262145); +f(1099509530624, 524287); +f(1099511627776, 524288); +f(1099513724928, 524289); +f(2199021158400, 1048575); +f(2199023255552, 1048576); +f(2199025352704, 1048577); +f(4398044413952, 2097151); +f(4398046511104, 2097152); +x = 2097153; +f(0, 0); +f(2097153, 1); +f(4194306, 2); +f(6291459, 3); +f(8388612, 4); +f(10485765, 5); +f(14680071, 7); +f(16777224, 8); +f(18874377, 9); +f(31457295, 15); +f(33554448, 16); +f(35651601, 17); +f(65011743, 31); +f(67108896, 32); +f(69206049, 33); +f(132120639, 63); +f(134217792, 64); +f(136314945, 65); +f(266338431, 127); +f(268435584, 128); +f(270532737, 129); +f(534774015, 255); +f(536871168, 256); +f(538968321, 257); +f(1071645183, 511); +f(1073742336, 512); +f(1075839489, 513); +f(2145387519, 1023); +f(2147484672, 1024); +f(2149581825, 1025); +f(4292872191, 2047); +f(4294969344, 2048); +f(4297066497, 2049); +f(8587841535, 4095); +f(8589938688, 4096); +f(8592035841, 4097); +f(17177780223, 8191); +f(17179877376, 8192); +f(17181974529, 8193); +f(34357657599, 16383); +f(34359754752, 16384); +f(34361851905, 16385); +f(68717412351, 32767); +f(68719509504, 32768); +f(68721606657, 32769); +f(137436921855, 65535); +f(137439019008, 65536); +f(137441116161, 65537); +f(274875940863, 131071); +f(274878038016, 131072); +f(274880135169, 131073); +f(549753978879, 262143); +f(549756076032, 262144); +f(549758173185, 262145); +f(1099510054911, 524287); +f(1099512152064, 524288); +f(1099514249217, 524289); +f(2199022206975, 1048575); +f(2199024304128, 1048576); +f(2199026401281, 1048577); +f(4398046511103, 2097151); +f(4398048608256, 2097152); +f(4398050705409, 2097153); +x = 4194303; +f(0, 0); +f(4194303, 1); +f(8388606, 2); +f(12582909, 3); +f(16777212, 4); +f(20971515, 5); +f(29360121, 7); +f(33554424, 8); +f(37748727, 9); +f(62914545, 15); +f(67108848, 16); +f(71303151, 17); +f(130023393, 31); +f(134217696, 32); +f(138411999, 33); +f(264241089, 63); +f(268435392, 64); +f(272629695, 65); +f(532676481, 127); +f(536870784, 128); +f(541065087, 129); +f(1069547265, 255); +f(1073741568, 256); +f(1077935871, 257); +f(2143288833, 511); +f(2147483136, 512); +f(2151677439, 513); +f(4290771969, 1023); +f(4294966272, 1024); +f(4299160575, 1025); +f(8585738241, 2047); +f(8589932544, 2048); +f(8594126847, 2049); +f(17175670785, 4095); +f(17179865088, 4096); +f(17184059391, 4097); +f(34355535873, 8191); +f(34359730176, 8192); +f(34363924479, 8193); +f(68715266049, 16383); +f(68719460352, 16384); +f(68723654655, 16385); +f(137434726401, 32767); +f(137438920704, 32768); +f(137443115007, 32769); +f(274873647105, 65535); +f(274877841408, 65536); +f(274882035711, 65537); +f(549751488513, 131071); +f(549755682816, 131072); +f(549759877119, 131073); +f(1099507171329, 262143); +f(1099511365632, 262144); +f(1099515559935, 262145); +f(2199018536961, 524287); +f(2199022731264, 524288); +f(2199026925567, 524289); +f(4398041268225, 1048575); +f(4398045462528, 1048576); +f(4398049656831, 1048577); +f(8796086730753, 2097151); +f(8796090925056, 2097152); +f(8796095119359, 2097153); +f(17592177655809, 4194303); +x = 4194304; +f(0, 0); +f(4194304, 1); +f(8388608, 2); +f(12582912, 3); +f(16777216, 4); +f(20971520, 5); +f(29360128, 7); +f(33554432, 8); +f(37748736, 9); +f(62914560, 15); +f(67108864, 16); +f(71303168, 17); +f(130023424, 31); +f(134217728, 32); +f(138412032, 33); +f(264241152, 63); +f(268435456, 64); +f(272629760, 65); +f(532676608, 127); +f(536870912, 128); +f(541065216, 129); +f(1069547520, 255); +f(1073741824, 256); +f(1077936128, 257); +f(2143289344, 511); +f(2147483648, 512); +f(2151677952, 513); +f(4290772992, 1023); +f(4294967296, 1024); +f(4299161600, 1025); +f(8585740288, 2047); +f(8589934592, 2048); +f(8594128896, 2049); +f(17175674880, 4095); +f(17179869184, 4096); +f(17184063488, 4097); +f(34355544064, 8191); +f(34359738368, 8192); +f(34363932672, 8193); +f(68715282432, 16383); +f(68719476736, 16384); +f(68723671040, 16385); +f(137434759168, 32767); +f(137438953472, 32768); +f(137443147776, 32769); +f(274873712640, 65535); +f(274877906944, 65536); +f(274882101248, 65537); +f(549751619584, 131071); +f(549755813888, 131072); +f(549760008192, 131073); +f(1099507433472, 262143); +f(1099511627776, 262144); +f(1099515822080, 262145); +f(2199019061248, 524287); +f(2199023255552, 524288); +f(2199027449856, 524289); +f(4398042316800, 1048575); +f(4398046511104, 1048576); +f(4398050705408, 1048577); +f(8796088827904, 2097151); +f(8796093022208, 2097152); +f(8796097216512, 2097153); +f(17592181850112, 4194303); +f(17592186044416, 4194304); +x = 4194305; +f(0, 0); +f(4194305, 1); +f(8388610, 2); +f(12582915, 3); +f(16777220, 4); +f(20971525, 5); +f(29360135, 7); +f(33554440, 8); +f(37748745, 9); +f(62914575, 15); +f(67108880, 16); +f(71303185, 17); +f(130023455, 31); +f(134217760, 32); +f(138412065, 33); +f(264241215, 63); +f(268435520, 64); +f(272629825, 65); +f(532676735, 127); +f(536871040, 128); +f(541065345, 129); +f(1069547775, 255); +f(1073742080, 256); +f(1077936385, 257); +f(2143289855, 511); +f(2147484160, 512); +f(2151678465, 513); +f(4290774015, 1023); +f(4294968320, 1024); +f(4299162625, 1025); +f(8585742335, 2047); +f(8589936640, 2048); +f(8594130945, 2049); +f(17175678975, 4095); +f(17179873280, 4096); +f(17184067585, 4097); +f(34355552255, 8191); +f(34359746560, 8192); +f(34363940865, 8193); +f(68715298815, 16383); +f(68719493120, 16384); +f(68723687425, 16385); +f(137434791935, 32767); +f(137438986240, 32768); +f(137443180545, 32769); +f(274873778175, 65535); +f(274877972480, 65536); +f(274882166785, 65537); +f(549751750655, 131071); +f(549755944960, 131072); +f(549760139265, 131073); +f(1099507695615, 262143); +f(1099511889920, 262144); +f(1099516084225, 262145); +f(2199019585535, 524287); +f(2199023779840, 524288); +f(2199027974145, 524289); +f(4398043365375, 1048575); +f(4398047559680, 1048576); +f(4398051753985, 1048577); +f(8796090925055, 2097151); +f(8796095119360, 2097152); +f(8796099313665, 2097153); +f(17592186044415, 4194303); +f(17592190238720, 4194304); +f(17592194433025, 4194305); diff --git a/test/mjsunit/mul-exhaustive-part6.js b/test/mjsunit/mul-exhaustive-part6.js new file mode 100644 index 0000000..91cb798 --- /dev/null +++ b/test/mjsunit/mul-exhaustive-part6.js @@ -0,0 +1,554 @@ +// Copyright 2008 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +var x; + +// Converts a number to string respecting -0. +function stringify(n) { + if ((1 / n) === -Infinity) return "-0"; + return String(n); +} + +function f(expected, y) { + function testEval(string, x, y) { + var mulFunction = Function("x, y", "return " + string); + return mulFunction(x, y); + } + function mulTest(expected, x, y) { + assertEquals(expected, x * y); + assertEquals(expected, testEval(stringify(x) + " * y", x, y)); + assertEquals(expected, testEval("x * " + stringify(y), x, y)); + assertEquals(expected, testEval(stringify(x) + " * " + stringify(y), x, y)); + } + mulTest(expected, x, y); + mulTest(-expected, -x, y); + mulTest(-expected, x, -y); + mulTest(expected, -x, -y); + if (x === y) return; // Symmetric cases not necessary. + mulTest(expected, y, x); + mulTest(-expected, -y, x); + mulTest(-expected, y, -x); + mulTest(expected, -y, -x); +} + +x = 8388607; +f(0, 0); +f(8388607, 1); +f(16777214, 2); +f(25165821, 3); +f(33554428, 4); +f(41943035, 5); +f(58720249, 7); +f(67108856, 8); +f(75497463, 9); +f(125829105, 15); +f(134217712, 16); +f(142606319, 17); +f(260046817, 31); +f(268435424, 32); +f(276824031, 33); +f(528482241, 63); +f(536870848, 64); +f(545259455, 65); +f(1065353089, 127); +f(1073741696, 128); +f(1082130303, 129); +f(2139094785, 255); +f(2147483392, 256); +f(2155871999, 257); +f(4286578177, 511); +f(4294966784, 512); +f(4303355391, 513); +f(8581544961, 1023); +f(8589933568, 1024); +f(8598322175, 1025); +f(17171478529, 2047); +f(17179867136, 2048); +f(17188255743, 2049); +f(34351345665, 4095); +f(34359734272, 4096); +f(34368122879, 4097); +f(68711079937, 8191); +f(68719468544, 8192); +f(68727857151, 8193); +f(137430548481, 16383); +f(137438937088, 16384); +f(137447325695, 16385); +f(274869485569, 32767); +f(274877874176, 32768); +f(274886262783, 32769); +f(549747359745, 65535); +f(549755748352, 65536); +f(549764136959, 65537); +f(1099503108097, 131071); +f(1099511496704, 131072); +f(1099519885311, 131073); +f(2199014604801, 262143); +f(2199022993408, 262144); +f(2199031382015, 262145); +f(4398037598209, 524287); +f(4398045986816, 524288); +f(4398054375423, 524289); +f(8796083585025, 1048575); +f(8796091973632, 1048576); +f(8796100362239, 1048577); +f(17592175558657, 2097151); +f(17592183947264, 2097152); +f(17592192335871, 2097153); +f(35184359505921, 4194303); +f(35184367894528, 4194304); +f(35184376283135, 4194305); +f(70368727400449, 8388607); +x = 8388608; +f(0, 0); +f(8388608, 1); +f(16777216, 2); +f(25165824, 3); +f(33554432, 4); +f(41943040, 5); +f(58720256, 7); +f(67108864, 8); +f(75497472, 9); +f(125829120, 15); +f(134217728, 16); +f(142606336, 17); +f(260046848, 31); +f(268435456, 32); +f(276824064, 33); +f(528482304, 63); +f(536870912, 64); +f(545259520, 65); +f(1065353216, 127); +f(1073741824, 128); +f(1082130432, 129); +f(2139095040, 255); +f(2147483648, 256); +f(2155872256, 257); +f(4286578688, 511); +f(4294967296, 512); +f(4303355904, 513); +f(8581545984, 1023); +f(8589934592, 1024); +f(8598323200, 1025); +f(17171480576, 2047); +f(17179869184, 2048); +f(17188257792, 2049); +f(34351349760, 4095); +f(34359738368, 4096); +f(34368126976, 4097); +f(68711088128, 8191); +f(68719476736, 8192); +f(68727865344, 8193); +f(137430564864, 16383); +f(137438953472, 16384); +f(137447342080, 16385); +f(274869518336, 32767); +f(274877906944, 32768); +f(274886295552, 32769); +f(549747425280, 65535); +f(549755813888, 65536); +f(549764202496, 65537); +f(1099503239168, 131071); +f(1099511627776, 131072); +f(1099520016384, 131073); +f(2199014866944, 262143); +f(2199023255552, 262144); +f(2199031644160, 262145); +f(4398038122496, 524287); +f(4398046511104, 524288); +f(4398054899712, 524289); +f(8796084633600, 1048575); +f(8796093022208, 1048576); +f(8796101410816, 1048577); +f(17592177655808, 2097151); +f(17592186044416, 2097152); +f(17592194433024, 2097153); +f(35184363700224, 4194303); +f(35184372088832, 4194304); +f(35184380477440, 4194305); +f(70368735789056, 8388607); +f(70368744177664, 8388608); +x = 8388609; +f(0, 0); +f(8388609, 1); +f(16777218, 2); +f(25165827, 3); +f(33554436, 4); +f(41943045, 5); +f(58720263, 7); +f(67108872, 8); +f(75497481, 9); +f(125829135, 15); +f(134217744, 16); +f(142606353, 17); +f(260046879, 31); +f(268435488, 32); +f(276824097, 33); +f(528482367, 63); +f(536870976, 64); +f(545259585, 65); +f(1065353343, 127); +f(1073741952, 128); +f(1082130561, 129); +f(2139095295, 255); +f(2147483904, 256); +f(2155872513, 257); +f(4286579199, 511); +f(4294967808, 512); +f(4303356417, 513); +f(8581547007, 1023); +f(8589935616, 1024); +f(8598324225, 1025); +f(17171482623, 2047); +f(17179871232, 2048); +f(17188259841, 2049); +f(34351353855, 4095); +f(34359742464, 4096); +f(34368131073, 4097); +f(68711096319, 8191); +f(68719484928, 8192); +f(68727873537, 8193); +f(137430581247, 16383); +f(137438969856, 16384); +f(137447358465, 16385); +f(274869551103, 32767); +f(274877939712, 32768); +f(274886328321, 32769); +f(549747490815, 65535); +f(549755879424, 65536); +f(549764268033, 65537); +f(1099503370239, 131071); +f(1099511758848, 131072); +f(1099520147457, 131073); +f(2199015129087, 262143); +f(2199023517696, 262144); +f(2199031906305, 262145); +f(4398038646783, 524287); +f(4398047035392, 524288); +f(4398055424001, 524289); +f(8796085682175, 1048575); +f(8796094070784, 1048576); +f(8796102459393, 1048577); +f(17592179752959, 2097151); +f(17592188141568, 2097152); +f(17592196530177, 2097153); +f(35184367894527, 4194303); +f(35184376283136, 4194304); +f(35184384671745, 4194305); +f(70368744177663, 8388607); +f(70368752566272, 8388608); +f(70368760954881, 8388609); +x = 16777215; +f(0, 0); +f(16777215, 1); +f(33554430, 2); +f(50331645, 3); +f(67108860, 4); +f(83886075, 5); +f(117440505, 7); +f(134217720, 8); +f(150994935, 9); +f(251658225, 15); +f(268435440, 16); +f(285212655, 17); +f(520093665, 31); +f(536870880, 32); +f(553648095, 33); +f(1056964545, 63); +f(1073741760, 64); +f(1090518975, 65); +f(2130706305, 127); +f(2147483520, 128); +f(2164260735, 129); +f(4278189825, 255); +f(4294967040, 256); +f(4311744255, 257); +f(8573156865, 511); +f(8589934080, 512); +f(8606711295, 513); +f(17163090945, 1023); +f(17179868160, 1024); +f(17196645375, 1025); +f(34342959105, 2047); +f(34359736320, 2048); +f(34376513535, 2049); +f(68702695425, 4095); +f(68719472640, 4096); +f(68736249855, 4097); +f(137422168065, 8191); +f(137438945280, 8192); +f(137455722495, 8193); +f(274861113345, 16383); +f(274877890560, 16384); +f(274894667775, 16385); +f(549739003905, 32767); +f(549755781120, 32768); +f(549772558335, 32769); +f(1099494785025, 65535); +f(1099511562240, 65536); +f(1099528339455, 65537); +f(2199006347265, 131071); +f(2199023124480, 131072); +f(2199039901695, 131073); +f(4398029471745, 262143); +f(4398046248960, 262144); +f(4398063026175, 262145); +f(8796075720705, 524287); +f(8796092497920, 524288); +f(8796109275135, 524289); +f(17592168218625, 1048575); +f(17592184995840, 1048576); +f(17592201773055, 1048577); +f(35184353214465, 2097151); +f(35184369991680, 2097152); +f(35184386768895, 2097153); +f(70368723206145, 4194303); +f(70368739983360, 4194304); +f(70368756760575, 4194305); +f(140737463189505, 8388607); +f(140737479966720, 8388608); +f(140737496743935, 8388609); +f(281474943156225, 16777215); +x = 16777216; +f(0, 0); +f(16777216, 1); +f(33554432, 2); +f(50331648, 3); +f(67108864, 4); +f(83886080, 5); +f(117440512, 7); +f(134217728, 8); +f(150994944, 9); +f(251658240, 15); +f(268435456, 16); +f(285212672, 17); +f(520093696, 31); +f(536870912, 32); +f(553648128, 33); +f(1056964608, 63); +f(1073741824, 64); +f(1090519040, 65); +f(2130706432, 127); +f(2147483648, 128); +f(2164260864, 129); +f(4278190080, 255); +f(4294967296, 256); +f(4311744512, 257); +f(8573157376, 511); +f(8589934592, 512); +f(8606711808, 513); +f(17163091968, 1023); +f(17179869184, 1024); +f(17196646400, 1025); +f(34342961152, 2047); +f(34359738368, 2048); +f(34376515584, 2049); +f(68702699520, 4095); +f(68719476736, 4096); +f(68736253952, 4097); +f(137422176256, 8191); +f(137438953472, 8192); +f(137455730688, 8193); +f(274861129728, 16383); +f(274877906944, 16384); +f(274894684160, 16385); +f(549739036672, 32767); +f(549755813888, 32768); +f(549772591104, 32769); +f(1099494850560, 65535); +f(1099511627776, 65536); +f(1099528404992, 65537); +f(2199006478336, 131071); +f(2199023255552, 131072); +f(2199040032768, 131073); +f(4398029733888, 262143); +f(4398046511104, 262144); +f(4398063288320, 262145); +f(8796076244992, 524287); +f(8796093022208, 524288); +f(8796109799424, 524289); +f(17592169267200, 1048575); +f(17592186044416, 1048576); +f(17592202821632, 1048577); +f(35184355311616, 2097151); +f(35184372088832, 2097152); +f(35184388866048, 2097153); +f(70368727400448, 4194303); +f(70368744177664, 4194304); +f(70368760954880, 4194305); +f(140737471578112, 8388607); +f(140737488355328, 8388608); +f(140737505132544, 8388609); +f(281474959933440, 16777215); +f(281474976710656, 16777216); +x = 16777217; +f(0, 0); +f(16777217, 1); +f(33554434, 2); +f(50331651, 3); +f(67108868, 4); +f(83886085, 5); +f(117440519, 7); +f(134217736, 8); +f(150994953, 9); +f(251658255, 15); +f(268435472, 16); +f(285212689, 17); +f(520093727, 31); +f(536870944, 32); +f(553648161, 33); +f(1056964671, 63); +f(1073741888, 64); +f(1090519105, 65); +f(2130706559, 127); +f(2147483776, 128); +f(2164260993, 129); +f(4278190335, 255); +f(4294967552, 256); +f(4311744769, 257); +f(8573157887, 511); +f(8589935104, 512); +f(8606712321, 513); +f(17163092991, 1023); +f(17179870208, 1024); +f(17196647425, 1025); +f(34342963199, 2047); +f(34359740416, 2048); +f(34376517633, 2049); +f(68702703615, 4095); +f(68719480832, 4096); +f(68736258049, 4097); +f(137422184447, 8191); +f(137438961664, 8192); +f(137455738881, 8193); +f(274861146111, 16383); +f(274877923328, 16384); +f(274894700545, 16385); +f(549739069439, 32767); +f(549755846656, 32768); +f(549772623873, 32769); +f(1099494916095, 65535); +f(1099511693312, 65536); +f(1099528470529, 65537); +f(2199006609407, 131071); +f(2199023386624, 131072); +f(2199040163841, 131073); +f(4398029996031, 262143); +f(4398046773248, 262144); +f(4398063550465, 262145); +f(8796076769279, 524287); +f(8796093546496, 524288); +f(8796110323713, 524289); +f(17592170315775, 1048575); +f(17592187092992, 1048576); +f(17592203870209, 1048577); +f(35184357408767, 2097151); +f(35184374185984, 2097152); +f(35184390963201, 2097153); +f(70368731594751, 4194303); +f(70368748371968, 4194304); +f(70368765149185, 4194305); +f(140737479966719, 8388607); +f(140737496743936, 8388608); +f(140737513521153, 8388609); +f(281474976710655, 16777215); +f(281474993487872, 16777216); +f(281475010265089, 16777217); +x = 33554431; +f(0, 0); +f(33554431, 1); +f(67108862, 2); +f(100663293, 3); +f(134217724, 4); +f(167772155, 5); +f(234881017, 7); +f(268435448, 8); +f(301989879, 9); +f(503316465, 15); +f(536870896, 16); +f(570425327, 17); +f(1040187361, 31); +f(1073741792, 32); +f(1107296223, 33); +f(2113929153, 63); +f(2147483584, 64); +f(2181038015, 65); +f(4261412737, 127); +f(4294967168, 128); +f(4328521599, 129); +f(8556379905, 255); +f(8589934336, 256); +f(8623488767, 257); +f(17146314241, 511); +f(17179868672, 512); +f(17213423103, 513); +f(34326182913, 1023); +f(34359737344, 1024); +f(34393291775, 1025); +f(68685920257, 2047); +f(68719474688, 2048); +f(68753029119, 2049); +f(137405394945, 4095); +f(137438949376, 4096); +f(137472503807, 4097); +f(274844344321, 8191); +f(274877898752, 8192); +f(274911453183, 8193); +f(549722243073, 16383); +f(549755797504, 16384); +f(549789351935, 16385); +f(1099478040577, 32767); +f(1099511595008, 32768); +f(1099545149439, 32769); +f(2198989635585, 65535); +f(2199023190016, 65536); +f(2199056744447, 65537); +f(4398012825601, 131071); +f(4398046380032, 131072); +f(4398079934463, 131073); +f(8796059205633, 262143); +f(8796092760064, 262144); +f(8796126314495, 262145); +f(17592151965697, 524287); +f(17592185520128, 524288); +f(17592219074559, 524289); +f(35184337485825, 1048575); +f(35184371040256, 1048576); +f(35184404594687, 1048577); +f(70368708526081, 2097151); +f(70368742080512, 2097152); +f(70368775634943, 2097153); +f(140737450606593, 4194303); +f(140737484161024, 4194304); +f(140737517715455, 4194305); +f(281474934767617, 8388607); +f(281474968322048, 8388608); +f(281475001876479, 8388609); +f(562949903089665, 16777215); +f(562949936644096, 16777216); +f(562949970198527, 16777217); +f(1125899839733761, 33554431); \ No newline at end of file diff --git a/test/mjsunit/mul-exhaustive-part7.js b/test/mjsunit/mul-exhaustive-part7.js new file mode 100644 index 0000000..d517225 --- /dev/null +++ b/test/mjsunit/mul-exhaustive-part7.js @@ -0,0 +1,497 @@ +// Copyright 2008 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +var x; + +// Converts a number to string respecting -0. +function stringify(n) { + if ((1 / n) === -Infinity) return "-0"; + return String(n); +} + +function f(expected, y) { + function testEval(string, x, y) { + var mulFunction = Function("x, y", "return " + string); + return mulFunction(x, y); + } + function mulTest(expected, x, y) { + assertEquals(expected, x * y); + assertEquals(expected, testEval(stringify(x) + " * y", x, y)); + assertEquals(expected, testEval("x * " + stringify(y), x, y)); + assertEquals(expected, testEval(stringify(x) + " * " + stringify(y), x, y)); + } + mulTest(expected, x, y); + mulTest(-expected, -x, y); + mulTest(-expected, x, -y); + mulTest(expected, -x, -y); + if (x === y) return; // Symmetric cases not necessary. + mulTest(expected, y, x); + mulTest(-expected, -y, x); + mulTest(-expected, y, -x); + mulTest(expected, -y, -x); +} + +x = 33554432; +f(0, 0); +f(33554432, 1); +f(67108864, 2); +f(100663296, 3); +f(134217728, 4); +f(167772160, 5); +f(234881024, 7); +f(268435456, 8); +f(301989888, 9); +f(503316480, 15); +f(536870912, 16); +f(570425344, 17); +f(1040187392, 31); +f(1073741824, 32); +f(1107296256, 33); +f(2113929216, 63); +f(2147483648, 64); +f(2181038080, 65); +f(4261412864, 127); +f(4294967296, 128); +f(4328521728, 129); +f(8556380160, 255); +f(8589934592, 256); +f(8623489024, 257); +f(17146314752, 511); +f(17179869184, 512); +f(17213423616, 513); +f(34326183936, 1023); +f(34359738368, 1024); +f(34393292800, 1025); +f(68685922304, 2047); +f(68719476736, 2048); +f(68753031168, 2049); +f(137405399040, 4095); +f(137438953472, 4096); +f(137472507904, 4097); +f(274844352512, 8191); +f(274877906944, 8192); +f(274911461376, 8193); +f(549722259456, 16383); +f(549755813888, 16384); +f(549789368320, 16385); +f(1099478073344, 32767); +f(1099511627776, 32768); +f(1099545182208, 32769); +f(2198989701120, 65535); +f(2199023255552, 65536); +f(2199056809984, 65537); +f(4398012956672, 131071); +f(4398046511104, 131072); +f(4398080065536, 131073); +f(8796059467776, 262143); +f(8796093022208, 262144); +f(8796126576640, 262145); +f(17592152489984, 524287); +f(17592186044416, 524288); +f(17592219598848, 524289); +f(35184338534400, 1048575); +f(35184372088832, 1048576); +f(35184405643264, 1048577); +f(70368710623232, 2097151); +f(70368744177664, 2097152); +f(70368777732096, 2097153); +f(140737454800896, 4194303); +f(140737488355328, 4194304); +f(140737521909760, 4194305); +f(281474943156224, 8388607); +f(281474976710656, 8388608); +f(281475010265088, 8388609); +f(562949919866880, 16777215); +f(562949953421312, 16777216); +f(562949986975744, 16777217); +f(1125899873288192, 33554431); +f(1125899906842624, 33554432); +x = 33554433; +f(0, 0); +f(33554433, 1); +f(67108866, 2); +f(100663299, 3); +f(134217732, 4); +f(167772165, 5); +f(234881031, 7); +f(268435464, 8); +f(301989897, 9); +f(503316495, 15); +f(536870928, 16); +f(570425361, 17); +f(1040187423, 31); +f(1073741856, 32); +f(1107296289, 33); +f(2113929279, 63); +f(2147483712, 64); +f(2181038145, 65); +f(4261412991, 127); +f(4294967424, 128); +f(4328521857, 129); +f(8556380415, 255); +f(8589934848, 256); +f(8623489281, 257); +f(17146315263, 511); +f(17179869696, 512); +f(17213424129, 513); +f(34326184959, 1023); +f(34359739392, 1024); +f(34393293825, 1025); +f(68685924351, 2047); +f(68719478784, 2048); +f(68753033217, 2049); +f(137405403135, 4095); +f(137438957568, 4096); +f(137472512001, 4097); +f(274844360703, 8191); +f(274877915136, 8192); +f(274911469569, 8193); +f(549722275839, 16383); +f(549755830272, 16384); +f(549789384705, 16385); +f(1099478106111, 32767); +f(1099511660544, 32768); +f(1099545214977, 32769); +f(2198989766655, 65535); +f(2199023321088, 65536); +f(2199056875521, 65537); +f(4398013087743, 131071); +f(4398046642176, 131072); +f(4398080196609, 131073); +f(8796059729919, 262143); +f(8796093284352, 262144); +f(8796126838785, 262145); +f(17592153014271, 524287); +f(17592186568704, 524288); +f(17592220123137, 524289); +f(35184339582975, 1048575); +f(35184373137408, 1048576); +f(35184406691841, 1048577); +f(70368712720383, 2097151); +f(70368746274816, 2097152); +f(70368779829249, 2097153); +f(140737458995199, 4194303); +f(140737492549632, 4194304); +f(140737526104065, 4194305); +f(281474951544831, 8388607); +f(281474985099264, 8388608); +f(281475018653697, 8388609); +f(562949936644095, 16777215); +f(562949970198528, 16777216); +f(562950003752961, 16777217); +f(1125899906842623, 33554431); +f(1125899940397056, 33554432); +f(1125899973951489, 33554433); +x = 67108863; +f(0, 0); +f(67108863, 1); +f(134217726, 2); +f(201326589, 3); +f(268435452, 4); +f(335544315, 5); +f(469762041, 7); +f(536870904, 8); +f(603979767, 9); +f(1006632945, 15); +f(1073741808, 16); +f(1140850671, 17); +f(2080374753, 31); +f(2147483616, 32); +f(2214592479, 33); +f(4227858369, 63); +f(4294967232, 64); +f(4362076095, 65); +f(8522825601, 127); +f(8589934464, 128); +f(8657043327, 129); +f(17112760065, 255); +f(17179868928, 256); +f(17246977791, 257); +f(34292628993, 511); +f(34359737856, 512); +f(34426846719, 513); +f(68652366849, 1023); +f(68719475712, 1024); +f(68786584575, 1025); +f(137371842561, 2047); +f(137438951424, 2048); +f(137506060287, 2049); +f(274810793985, 4095); +f(274877902848, 4096); +f(274945011711, 4097); +f(549688696833, 8191); +f(549755805696, 8192); +f(549822914559, 8193); +f(1099444502529, 16383); +f(1099511611392, 16384); +f(1099578720255, 16385); +f(2198956113921, 32767); +f(2199023222784, 32768); +f(2199090331647, 32769); +f(4397979336705, 65535); +f(4398046445568, 65536); +f(4398113554431, 65537); +f(8796025782273, 131071); +f(8796092891136, 131072); +f(8796159999999, 131073); +f(17592118673409, 262143); +f(17592185782272, 262144); +f(17592252891135, 262145); +f(35184304455681, 524287); +f(35184371564544, 524288); +f(35184438673407, 524289); +f(70368676020225, 1048575); +f(70368743129088, 1048576); +f(70368810237951, 1048577); +f(140737419149313, 2097151); +f(140737486258176, 2097152); +f(140737553367039, 2097153); +f(281474905407489, 4194303); +f(281474972516352, 4194304); +f(281475039625215, 4194305); +f(562949877923841, 8388607); +f(562949945032704, 8388608); +f(562950012141567, 8388609); +f(1125899822956545, 16777215); +f(1125899890065408, 16777216); +f(1125899957174271, 16777217); +x = 67108864; +f(0, 0); +f(67108864, 1); +f(134217728, 2); +f(201326592, 3); +f(268435456, 4); +f(335544320, 5); +f(469762048, 7); +f(536870912, 8); +f(603979776, 9); +f(1006632960, 15); +f(1073741824, 16); +f(1140850688, 17); +f(2080374784, 31); +f(2147483648, 32); +f(2214592512, 33); +f(4227858432, 63); +f(4294967296, 64); +f(4362076160, 65); +f(8522825728, 127); +f(8589934592, 128); +f(8657043456, 129); +f(17112760320, 255); +f(17179869184, 256); +f(17246978048, 257); +f(34292629504, 511); +f(34359738368, 512); +f(34426847232, 513); +f(68652367872, 1023); +f(68719476736, 1024); +f(68786585600, 1025); +f(137371844608, 2047); +f(137438953472, 2048); +f(137506062336, 2049); +f(274810798080, 4095); +f(274877906944, 4096); +f(274945015808, 4097); +f(549688705024, 8191); +f(549755813888, 8192); +f(549822922752, 8193); +f(1099444518912, 16383); +f(1099511627776, 16384); +f(1099578736640, 16385); +f(2198956146688, 32767); +f(2199023255552, 32768); +f(2199090364416, 32769); +f(4397979402240, 65535); +f(4398046511104, 65536); +f(4398113619968, 65537); +f(8796025913344, 131071); +f(8796093022208, 131072); +f(8796160131072, 131073); +f(17592118935552, 262143); +f(17592186044416, 262144); +f(17592253153280, 262145); +f(35184304979968, 524287); +f(35184372088832, 524288); +f(35184439197696, 524289); +f(70368677068800, 1048575); +f(70368744177664, 1048576); +f(70368811286528, 1048577); +f(140737421246464, 2097151); +f(140737488355328, 2097152); +f(140737555464192, 2097153); +f(281474909601792, 4194303); +f(281474976710656, 4194304); +f(281475043819520, 4194305); +f(562949886312448, 8388607); +f(562949953421312, 8388608); +f(562950020530176, 8388609); +f(1125899839733760, 16777215); +f(1125899906842624, 16777216); +f(1125899973951488, 16777217); +x = 67108865; +f(0, 0); +f(67108865, 1); +f(134217730, 2); +f(201326595, 3); +f(268435460, 4); +f(335544325, 5); +f(469762055, 7); +f(536870920, 8); +f(603979785, 9); +f(1006632975, 15); +f(1073741840, 16); +f(1140850705, 17); +f(2080374815, 31); +f(2147483680, 32); +f(2214592545, 33); +f(4227858495, 63); +f(4294967360, 64); +f(4362076225, 65); +f(8522825855, 127); +f(8589934720, 128); +f(8657043585, 129); +f(17112760575, 255); +f(17179869440, 256); +f(17246978305, 257); +f(34292630015, 511); +f(34359738880, 512); +f(34426847745, 513); +f(68652368895, 1023); +f(68719477760, 1024); +f(68786586625, 1025); +f(137371846655, 2047); +f(137438955520, 2048); +f(137506064385, 2049); +f(274810802175, 4095); +f(274877911040, 4096); +f(274945019905, 4097); +f(549688713215, 8191); +f(549755822080, 8192); +f(549822930945, 8193); +f(1099444535295, 16383); +f(1099511644160, 16384); +f(1099578753025, 16385); +f(2198956179455, 32767); +f(2199023288320, 32768); +f(2199090397185, 32769); +f(4397979467775, 65535); +f(4398046576640, 65536); +f(4398113685505, 65537); +f(8796026044415, 131071); +f(8796093153280, 131072); +f(8796160262145, 131073); +f(17592119197695, 262143); +f(17592186306560, 262144); +f(17592253415425, 262145); +f(35184305504255, 524287); +f(35184372613120, 524288); +f(35184439721985, 524289); +f(70368678117375, 1048575); +f(70368745226240, 1048576); +f(70368812335105, 1048577); +f(140737423343615, 2097151); +f(140737490452480, 2097152); +f(140737557561345, 2097153); +f(281474913796095, 4194303); +f(281474980904960, 4194304); +f(281475048013825, 4194305); +f(562949894701055, 8388607); +f(562949961809920, 8388608); +f(562950028918785, 8388609); +f(1125899856510975, 16777215); +f(1125899923619840, 16777216); +f(1125899990728705, 16777217); +x = 134217727; +f(0, 0); +f(134217727, 1); +f(268435454, 2); +f(402653181, 3); +f(536870908, 4); +f(671088635, 5); +f(939524089, 7); +f(1073741816, 8); +f(1207959543, 9); +f(2013265905, 15); +f(2147483632, 16); +f(2281701359, 17); +f(4160749537, 31); +f(4294967264, 32); +f(4429184991, 33); +f(8455716801, 63); +f(8589934528, 64); +f(8724152255, 65); +f(17045651329, 127); +f(17179869056, 128); +f(17314086783, 129); +f(34225520385, 255); +f(34359738112, 256); +f(34493955839, 257); +f(68585258497, 511); +f(68719476224, 512); +f(68853693951, 513); +f(137304734721, 1023); +f(137438952448, 1024); +f(137573170175, 1025); +f(274743687169, 2047); +f(274877904896, 2048); +f(275012122623, 2049); +f(549621592065, 4095); +f(549755809792, 4096); +f(549890027519, 4097); +f(1099377401857, 8191); +f(1099511619584, 8192); +f(1099645837311, 8193); +f(2198889021441, 16383); +f(2199023239168, 16384); +f(2199157456895, 16385); +f(4397912260609, 32767); +f(4398046478336, 32768); +f(4398180696063, 32769); +f(8795958738945, 65535); +f(8796092956672, 65536); +f(8796227174399, 65537); +f(17592051695617, 131071); +f(17592185913344, 131072); +f(17592320131071, 131073); +f(35184237608961, 262143); +f(35184371826688, 262144); +f(35184506044415, 262145); +f(70368609435649, 524287); +f(70368743653376, 524288); +f(70368877871103, 524289); +f(140737353089025, 1048575); +f(140737487306752, 1048576); +f(140737621524479, 1048577); +f(281474840395777, 2097151); +f(281474974613504, 2097152); +f(281475108831231, 2097153); +f(562949815009281, 4194303); +f(562949949227008, 4194304); +f(562950083444735, 4194305); +f(1125899764236289, 8388607); +f(1125899898454016, 8388608); +f(1125900032671743, 8388609); diff --git a/test/mjsunit/mul-exhaustive-part8.js b/test/mjsunit/mul-exhaustive-part8.js new file mode 100644 index 0000000..7e5f285 --- /dev/null +++ b/test/mjsunit/mul-exhaustive-part8.js @@ -0,0 +1,526 @@ +// Copyright 2008 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +var x; + +// Converts a number to string respecting -0. +function stringify(n) { + if ((1 / n) === -Infinity) return "-0"; + return String(n); +} + +function f(expected, y) { + function testEval(string, x, y) { + var mulFunction = Function("x, y", "return " + string); + return mulFunction(x, y); + } + function mulTest(expected, x, y) { + assertEquals(expected, x * y); + assertEquals(expected, testEval(stringify(x) + " * y", x, y)); + assertEquals(expected, testEval("x * " + stringify(y), x, y)); + assertEquals(expected, testEval(stringify(x) + " * " + stringify(y), x, y)); + } + mulTest(expected, x, y); + mulTest(-expected, -x, y); + mulTest(-expected, x, -y); + mulTest(expected, -x, -y); + if (x === y) return; // Symmetric cases not necessary. + mulTest(expected, y, x); + mulTest(-expected, -y, x); + mulTest(-expected, y, -x); + mulTest(expected, -y, -x); +} + +x = 134217728; +f(0, 0); +f(134217728, 1); +f(268435456, 2); +f(402653184, 3); +f(536870912, 4); +f(671088640, 5); +f(939524096, 7); +f(1073741824, 8); +f(1207959552, 9); +f(2013265920, 15); +f(2147483648, 16); +f(2281701376, 17); +f(4160749568, 31); +f(4294967296, 32); +f(4429185024, 33); +f(8455716864, 63); +f(8589934592, 64); +f(8724152320, 65); +f(17045651456, 127); +f(17179869184, 128); +f(17314086912, 129); +f(34225520640, 255); +f(34359738368, 256); +f(34493956096, 257); +f(68585259008, 511); +f(68719476736, 512); +f(68853694464, 513); +f(137304735744, 1023); +f(137438953472, 1024); +f(137573171200, 1025); +f(274743689216, 2047); +f(274877906944, 2048); +f(275012124672, 2049); +f(549621596160, 4095); +f(549755813888, 4096); +f(549890031616, 4097); +f(1099377410048, 8191); +f(1099511627776, 8192); +f(1099645845504, 8193); +f(2198889037824, 16383); +f(2199023255552, 16384); +f(2199157473280, 16385); +f(4397912293376, 32767); +f(4398046511104, 32768); +f(4398180728832, 32769); +f(8795958804480, 65535); +f(8796093022208, 65536); +f(8796227239936, 65537); +f(17592051826688, 131071); +f(17592186044416, 131072); +f(17592320262144, 131073); +f(35184237871104, 262143); +f(35184372088832, 262144); +f(35184506306560, 262145); +f(70368609959936, 524287); +f(70368744177664, 524288); +f(70368878395392, 524289); +f(140737354137600, 1048575); +f(140737488355328, 1048576); +f(140737622573056, 1048577); +f(281474842492928, 2097151); +f(281474976710656, 2097152); +f(281475110928384, 2097153); +f(562949819203584, 4194303); +f(562949953421312, 4194304); +f(562950087639040, 4194305); +f(1125899772624896, 8388607); +f(1125899906842624, 8388608); +f(1125900041060352, 8388609); +x = 134217729; +f(0, 0); +f(134217729, 1); +f(268435458, 2); +f(402653187, 3); +f(536870916, 4); +f(671088645, 5); +f(939524103, 7); +f(1073741832, 8); +f(1207959561, 9); +f(2013265935, 15); +f(2147483664, 16); +f(2281701393, 17); +f(4160749599, 31); +f(4294967328, 32); +f(4429185057, 33); +f(8455716927, 63); +f(8589934656, 64); +f(8724152385, 65); +f(17045651583, 127); +f(17179869312, 128); +f(17314087041, 129); +f(34225520895, 255); +f(34359738624, 256); +f(34493956353, 257); +f(68585259519, 511); +f(68719477248, 512); +f(68853694977, 513); +f(137304736767, 1023); +f(137438954496, 1024); +f(137573172225, 1025); +f(274743691263, 2047); +f(274877908992, 2048); +f(275012126721, 2049); +f(549621600255, 4095); +f(549755817984, 4096); +f(549890035713, 4097); +f(1099377418239, 8191); +f(1099511635968, 8192); +f(1099645853697, 8193); +f(2198889054207, 16383); +f(2199023271936, 16384); +f(2199157489665, 16385); +f(4397912326143, 32767); +f(4398046543872, 32768); +f(4398180761601, 32769); +f(8795958870015, 65535); +f(8796093087744, 65536); +f(8796227305473, 65537); +f(17592051957759, 131071); +f(17592186175488, 131072); +f(17592320393217, 131073); +f(35184238133247, 262143); +f(35184372350976, 262144); +f(35184506568705, 262145); +f(70368610484223, 524287); +f(70368744701952, 524288); +f(70368878919681, 524289); +f(140737355186175, 1048575); +f(140737489403904, 1048576); +f(140737623621633, 1048577); +f(281474844590079, 2097151); +f(281474978807808, 2097152); +f(281475113025537, 2097153); +f(562949823397887, 4194303); +f(562949957615616, 4194304); +f(562950091833345, 4194305); +f(1125899781013503, 8388607); +f(1125899915231232, 8388608); +f(1125900049448961, 8388609); +x = 268435455; +f(0, 0); +f(268435455, 1); +f(536870910, 2); +f(805306365, 3); +f(1073741820, 4); +f(1342177275, 5); +f(1879048185, 7); +f(2147483640, 8); +f(2415919095, 9); +f(4026531825, 15); +f(4294967280, 16); +f(4563402735, 17); +f(8321499105, 31); +f(8589934560, 32); +f(8858370015, 33); +f(16911433665, 63); +f(17179869120, 64); +f(17448304575, 65); +f(34091302785, 127); +f(34359738240, 128); +f(34628173695, 129); +f(68451041025, 255); +f(68719476480, 256); +f(68987911935, 257); +f(137170517505, 511); +f(137438952960, 512); +f(137707388415, 513); +f(274609470465, 1023); +f(274877905920, 1024); +f(275146341375, 1025); +f(549487376385, 2047); +f(549755811840, 2048); +f(550024247295, 2049); +f(1099243188225, 4095); +f(1099511623680, 4096); +f(1099780059135, 4097); +f(2198754811905, 8191); +f(2199023247360, 8192); +f(2199291682815, 8193); +f(4397778059265, 16383); +f(4398046494720, 16384); +f(4398314930175, 16385); +f(8795824553985, 32767); +f(8796092989440, 32768); +f(8796361424895, 32769); +f(17591917543425, 65535); +f(17592185978880, 65536); +f(17592454414335, 65537); +f(35184103522305, 131071); +f(35184371957760, 131072); +f(35184640393215, 131073); +f(70368475480065, 262143); +f(70368743915520, 262144); +f(70369012350975, 262145); +f(140737219395585, 524287); +f(140737487831040, 524288); +f(140737756266495, 524289); +f(281474707226625, 1048575); +f(281474975662080, 1048576); +f(281475244097535, 1048577); +f(562949682888705, 2097151); +f(562949951324160, 2097152); +f(562950219759615, 2097153); +f(1125899634212865, 4194303); +f(1125899902648320, 4194304); +f(1125900171083775, 4194305); +x = 268435456; +f(0, 0); +f(268435456, 1); +f(536870912, 2); +f(805306368, 3); +f(1073741824, 4); +f(1342177280, 5); +f(1879048192, 7); +f(2147483648, 8); +f(2415919104, 9); +f(4026531840, 15); +f(4294967296, 16); +f(4563402752, 17); +f(8321499136, 31); +f(8589934592, 32); +f(8858370048, 33); +f(16911433728, 63); +f(17179869184, 64); +f(17448304640, 65); +f(34091302912, 127); +f(34359738368, 128); +f(34628173824, 129); +f(68451041280, 255); +f(68719476736, 256); +f(68987912192, 257); +f(137170518016, 511); +f(137438953472, 512); +f(137707388928, 513); +f(274609471488, 1023); +f(274877906944, 1024); +f(275146342400, 1025); +f(549487378432, 2047); +f(549755813888, 2048); +f(550024249344, 2049); +f(1099243192320, 4095); +f(1099511627776, 4096); +f(1099780063232, 4097); +f(2198754820096, 8191); +f(2199023255552, 8192); +f(2199291691008, 8193); +f(4397778075648, 16383); +f(4398046511104, 16384); +f(4398314946560, 16385); +f(8795824586752, 32767); +f(8796093022208, 32768); +f(8796361457664, 32769); +f(17591917608960, 65535); +f(17592186044416, 65536); +f(17592454479872, 65537); +f(35184103653376, 131071); +f(35184372088832, 131072); +f(35184640524288, 131073); +f(70368475742208, 262143); +f(70368744177664, 262144); +f(70369012613120, 262145); +f(140737219919872, 524287); +f(140737488355328, 524288); +f(140737756790784, 524289); +f(281474708275200, 1048575); +f(281474976710656, 1048576); +f(281475245146112, 1048577); +f(562949684985856, 2097151); +f(562949953421312, 2097152); +f(562950221856768, 2097153); +f(1125899638407168, 4194303); +f(1125899906842624, 4194304); +f(1125900175278080, 4194305); +x = 268435457; +f(0, 0); +f(268435457, 1); +f(536870914, 2); +f(805306371, 3); +f(1073741828, 4); +f(1342177285, 5); +f(1879048199, 7); +f(2147483656, 8); +f(2415919113, 9); +f(4026531855, 15); +f(4294967312, 16); +f(4563402769, 17); +f(8321499167, 31); +f(8589934624, 32); +f(8858370081, 33); +f(16911433791, 63); +f(17179869248, 64); +f(17448304705, 65); +f(34091303039, 127); +f(34359738496, 128); +f(34628173953, 129); +f(68451041535, 255); +f(68719476992, 256); +f(68987912449, 257); +f(137170518527, 511); +f(137438953984, 512); +f(137707389441, 513); +f(274609472511, 1023); +f(274877907968, 1024); +f(275146343425, 1025); +f(549487380479, 2047); +f(549755815936, 2048); +f(550024251393, 2049); +f(1099243196415, 4095); +f(1099511631872, 4096); +f(1099780067329, 4097); +f(2198754828287, 8191); +f(2199023263744, 8192); +f(2199291699201, 8193); +f(4397778092031, 16383); +f(4398046527488, 16384); +f(4398314962945, 16385); +f(8795824619519, 32767); +f(8796093054976, 32768); +f(8796361490433, 32769); +f(17591917674495, 65535); +f(17592186109952, 65536); +f(17592454545409, 65537); +f(35184103784447, 131071); +f(35184372219904, 131072); +f(35184640655361, 131073); +f(70368476004351, 262143); +f(70368744439808, 262144); +f(70369012875265, 262145); +f(140737220444159, 524287); +f(140737488879616, 524288); +f(140737757315073, 524289); +f(281474709323775, 1048575); +f(281474977759232, 1048576); +f(281475246194689, 1048577); +f(562949687083007, 2097151); +f(562949955518464, 2097152); +f(562950223953921, 2097153); +f(1125899642601471, 4194303); +f(1125899911036928, 4194304); +f(1125900179472385, 4194305); +x = 536870911; +f(0, 0); +f(536870911, 1); +f(1073741822, 2); +f(1610612733, 3); +f(2147483644, 4); +f(2684354555, 5); +f(3758096377, 7); +f(4294967288, 8); +f(4831838199, 9); +f(8053063665, 15); +f(8589934576, 16); +f(9126805487, 17); +f(16642998241, 31); +f(17179869152, 32); +f(17716740063, 33); +f(33822867393, 63); +f(34359738304, 64); +f(34896609215, 65); +f(68182605697, 127); +f(68719476608, 128); +f(69256347519, 129); +f(136902082305, 255); +f(137438953216, 256); +f(137975824127, 257); +f(274341035521, 511); +f(274877906432, 512); +f(275414777343, 513); +f(549218941953, 1023); +f(549755812864, 1024); +f(550292683775, 1025); +f(1098974754817, 2047); +f(1099511625728, 2048); +f(1100048496639, 2049); +f(2198486380545, 4095); +f(2199023251456, 4096); +f(2199560122367, 4097); +f(4397509632001, 8191); +f(4398046502912, 8192); +f(4398583373823, 8193); +f(8795556134913, 16383); +f(8796093005824, 16384); +f(8796629876735, 16385); +f(17591649140737, 32767); +f(17592186011648, 32768); +f(17592722882559, 32769); +f(35183835152385, 65535); +f(35184372023296, 65536); +f(35184908894207, 65537); +f(70368207175681, 131071); +f(70368744046592, 131072); +f(70369280917503, 131073); +f(140736951222273, 262143); +f(140737488093184, 262144); +f(140738024964095, 262145); +f(281474439315457, 524287); +f(281474976186368, 524288); +f(281475513057279, 524289); +f(562949415501825, 1048575); +f(562949952372736, 1048576); +f(562950489243647, 1048577); +f(1125899367874561, 2097151); +f(1125899904745472, 2097152); +f(1125900441616383, 2097153); +x = 536870912; +f(0, 0); +f(536870912, 1); +f(1073741824, 2); +f(1610612736, 3); +f(2147483648, 4); +f(2684354560, 5); +f(3758096384, 7); +f(4294967296, 8); +f(4831838208, 9); +f(8053063680, 15); +f(8589934592, 16); +f(9126805504, 17); +f(16642998272, 31); +f(17179869184, 32); +f(17716740096, 33); +f(33822867456, 63); +f(34359738368, 64); +f(34896609280, 65); +f(68182605824, 127); +f(68719476736, 128); +f(69256347648, 129); +f(136902082560, 255); +f(137438953472, 256); +f(137975824384, 257); +f(274341036032, 511); +f(274877906944, 512); +f(275414777856, 513); +f(549218942976, 1023); +f(549755813888, 1024); +f(550292684800, 1025); +f(1098974756864, 2047); +f(1099511627776, 2048); +f(1100048498688, 2049); +f(2198486384640, 4095); +f(2199023255552, 4096); +f(2199560126464, 4097); +f(4397509640192, 8191); +f(4398046511104, 8192); +f(4398583382016, 8193); +f(8795556151296, 16383); +f(8796093022208, 16384); +f(8796629893120, 16385); +f(17591649173504, 32767); +f(17592186044416, 32768); +f(17592722915328, 32769); +f(35183835217920, 65535); +f(35184372088832, 65536); +f(35184908959744, 65537); +f(70368207306752, 131071); +f(70368744177664, 131072); +f(70369281048576, 131073); +f(140736951484416, 262143); +f(140737488355328, 262144); +f(140738025226240, 262145); +f(281474439839744, 524287); +f(281474976710656, 524288); +f(281475513581568, 524289); +f(562949416550400, 1048575); +f(562949953421312, 1048576); +f(562950490292224, 1048577); +f(1125899369971712, 2097151); +f(1125899906842624, 2097152); +f(1125900443713536, 2097153); diff --git a/test/mjsunit/mul-exhaustive-part9.js b/test/mjsunit/mul-exhaustive-part9.js new file mode 100644 index 0000000..f329a5a --- /dev/null +++ b/test/mjsunit/mul-exhaustive-part9.js @@ -0,0 +1,533 @@ +// Copyright 2008 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +var x; + +// Converts a number to string respecting -0. +function stringify(n) { + if ((1 / n) === -Infinity) return "-0"; + return String(n); +} + +function f(expected, y) { + function testEval(string, x, y) { + var mulFunction = Function("x, y", "return " + string); + return mulFunction(x, y); + } + function mulTest(expected, x, y) { + assertEquals(expected, x * y); + assertEquals(expected, testEval(stringify(x) + " * y", x, y)); + assertEquals(expected, testEval("x * " + stringify(y), x, y)); + assertEquals(expected, testEval(stringify(x) + " * " + stringify(y), x, y)); + } + mulTest(expected, x, y); + mulTest(-expected, -x, y); + mulTest(-expected, x, -y); + mulTest(expected, -x, -y); + if (x === y) return; // Symmetric cases not necessary. + mulTest(expected, y, x); + mulTest(-expected, -y, x); + mulTest(-expected, y, -x); + mulTest(expected, -y, -x); +} + +x = 536870913; +f(0, 0); +f(536870913, 1); +f(1073741826, 2); +f(1610612739, 3); +f(2147483652, 4); +f(2684354565, 5); +f(3758096391, 7); +f(4294967304, 8); +f(4831838217, 9); +f(8053063695, 15); +f(8589934608, 16); +f(9126805521, 17); +f(16642998303, 31); +f(17179869216, 32); +f(17716740129, 33); +f(33822867519, 63); +f(34359738432, 64); +f(34896609345, 65); +f(68182605951, 127); +f(68719476864, 128); +f(69256347777, 129); +f(136902082815, 255); +f(137438953728, 256); +f(137975824641, 257); +f(274341036543, 511); +f(274877907456, 512); +f(275414778369, 513); +f(549218943999, 1023); +f(549755814912, 1024); +f(550292685825, 1025); +f(1098974758911, 2047); +f(1099511629824, 2048); +f(1100048500737, 2049); +f(2198486388735, 4095); +f(2199023259648, 4096); +f(2199560130561, 4097); +f(4397509648383, 8191); +f(4398046519296, 8192); +f(4398583390209, 8193); +f(8795556167679, 16383); +f(8796093038592, 16384); +f(8796629909505, 16385); +f(17591649206271, 32767); +f(17592186077184, 32768); +f(17592722948097, 32769); +f(35183835283455, 65535); +f(35184372154368, 65536); +f(35184909025281, 65537); +f(70368207437823, 131071); +f(70368744308736, 131072); +f(70369281179649, 131073); +f(140736951746559, 262143); +f(140737488617472, 262144); +f(140738025488385, 262145); +f(281474440364031, 524287); +f(281474977234944, 524288); +f(281475514105857, 524289); +f(562949417598975, 1048575); +f(562949954469888, 1048576); +f(562950491340801, 1048577); +f(1125899372068863, 2097151); +f(1125899908939776, 2097152); +f(1125900445810689, 2097153); +x = 1073741823; +f(0, 0); +f(1073741823, 1); +f(2147483646, 2); +f(3221225469, 3); +f(4294967292, 4); +f(5368709115, 5); +f(7516192761, 7); +f(8589934584, 8); +f(9663676407, 9); +f(16106127345, 15); +f(17179869168, 16); +f(18253610991, 17); +f(33285996513, 31); +f(34359738336, 32); +f(35433480159, 33); +f(67645734849, 63); +f(68719476672, 64); +f(69793218495, 65); +f(136365211521, 127); +f(137438953344, 128); +f(138512695167, 129); +f(273804164865, 255); +f(274877906688, 256); +f(275951648511, 257); +f(548682071553, 511); +f(549755813376, 512); +f(550829555199, 513); +f(1098437884929, 1023); +f(1099511626752, 1024); +f(1100585368575, 1025); +f(2197949511681, 2047); +f(2199023253504, 2048); +f(2200096995327, 2049); +f(4396972765185, 4095); +f(4398046507008, 4096); +f(4399120248831, 4097); +f(8795019272193, 8191); +f(8796093014016, 8192); +f(8797166755839, 8193); +f(17591112286209, 16383); +f(17592186028032, 16384); +f(17593259769855, 16385); +f(35183298314241, 32767); +f(35184372056064, 32768); +f(35185445797887, 32769); +f(70367670370305, 65535); +f(70368744112128, 65536); +f(70369817853951, 65537); +f(140736414482433, 131071); +f(140737488224256, 131072); +f(140738561966079, 131073); +f(281473902706689, 262143); +f(281474976448512, 262144); +f(281476050190335, 262145); +f(562948879155201, 524287); +f(562949952897024, 524288); +f(562951026638847, 524289); +f(1125898832052225, 1048575); +f(1125899905794048, 1048576); +f(1125900979535871, 1048577); +x = 1073741824; +f(0, 0); +f(1073741824, 1); +f(2147483648, 2); +f(3221225472, 3); +f(4294967296, 4); +f(5368709120, 5); +f(7516192768, 7); +f(8589934592, 8); +f(9663676416, 9); +f(16106127360, 15); +f(17179869184, 16); +f(18253611008, 17); +f(33285996544, 31); +f(34359738368, 32); +f(35433480192, 33); +f(67645734912, 63); +f(68719476736, 64); +f(69793218560, 65); +f(136365211648, 127); +f(137438953472, 128); +f(138512695296, 129); +f(273804165120, 255); +f(274877906944, 256); +f(275951648768, 257); +f(548682072064, 511); +f(549755813888, 512); +f(550829555712, 513); +f(1098437885952, 1023); +f(1099511627776, 1024); +f(1100585369600, 1025); +f(2197949513728, 2047); +f(2199023255552, 2048); +f(2200096997376, 2049); +f(4396972769280, 4095); +f(4398046511104, 4096); +f(4399120252928, 4097); +f(8795019280384, 8191); +f(8796093022208, 8192); +f(8797166764032, 8193); +f(17591112302592, 16383); +f(17592186044416, 16384); +f(17593259786240, 16385); +f(35183298347008, 32767); +f(35184372088832, 32768); +f(35185445830656, 32769); +f(70367670435840, 65535); +f(70368744177664, 65536); +f(70369817919488, 65537); +f(140736414613504, 131071); +f(140737488355328, 131072); +f(140738562097152, 131073); +f(281473902968832, 262143); +f(281474976710656, 262144); +f(281476050452480, 262145); +f(562948879679488, 524287); +f(562949953421312, 524288); +f(562951027163136, 524289); +f(1125898833100800, 1048575); +f(1125899906842624, 1048576); +f(1125900980584448, 1048577); +x = 1073741825; +f(0, 0); +f(1073741825, 1); +f(2147483650, 2); +f(3221225475, 3); +f(4294967300, 4); +f(5368709125, 5); +f(7516192775, 7); +f(8589934600, 8); +f(9663676425, 9); +f(16106127375, 15); +f(17179869200, 16); +f(18253611025, 17); +f(33285996575, 31); +f(34359738400, 32); +f(35433480225, 33); +f(67645734975, 63); +f(68719476800, 64); +f(69793218625, 65); +f(136365211775, 127); +f(137438953600, 128); +f(138512695425, 129); +f(273804165375, 255); +f(274877907200, 256); +f(275951649025, 257); +f(548682072575, 511); +f(549755814400, 512); +f(550829556225, 513); +f(1098437886975, 1023); +f(1099511628800, 1024); +f(1100585370625, 1025); +f(2197949515775, 2047); +f(2199023257600, 2048); +f(2200096999425, 2049); +f(4396972773375, 4095); +f(4398046515200, 4096); +f(4399120257025, 4097); +f(8795019288575, 8191); +f(8796093030400, 8192); +f(8797166772225, 8193); +f(17591112318975, 16383); +f(17592186060800, 16384); +f(17593259802625, 16385); +f(35183298379775, 32767); +f(35184372121600, 32768); +f(35185445863425, 32769); +f(70367670501375, 65535); +f(70368744243200, 65536); +f(70369817985025, 65537); +f(140736414744575, 131071); +f(140737488486400, 131072); +f(140738562228225, 131073); +f(281473903230975, 262143); +f(281474976972800, 262144); +f(281476050714625, 262145); +f(562948880203775, 524287); +f(562949953945600, 524288); +f(562951027687425, 524289); +f(1125898834149375, 1048575); +f(1125899907891200, 1048576); +f(1125900981633025, 1048577); +x = 2147483647; +f(0, 0); +f(2147483647, 1); +f(4294967294, 2); +f(6442450941, 3); +f(8589934588, 4); +f(10737418235, 5); +f(15032385529, 7); +f(17179869176, 8); +f(19327352823, 9); +f(32212254705, 15); +f(34359738352, 16); +f(36507221999, 17); +f(66571993057, 31); +f(68719476704, 32); +f(70866960351, 33); +f(135291469761, 63); +f(137438953408, 64); +f(139586437055, 65); +f(272730423169, 127); +f(274877906816, 128); +f(277025390463, 129); +f(547608329985, 255); +f(549755813632, 256); +f(551903297279, 257); +f(1097364143617, 511); +f(1099511627264, 512); +f(1101659110911, 513); +f(2196875770881, 1023); +f(2199023254528, 1024); +f(2201170738175, 1025); +f(4395899025409, 2047); +f(4398046509056, 2048); +f(4400193992703, 2049); +f(8793945534465, 4095); +f(8796093018112, 4096); +f(8798240501759, 4097); +f(17590038552577, 8191); +f(17592186036224, 8192); +f(17594333519871, 8193); +f(35182224588801, 16383); +f(35184372072448, 16384); +f(35186519556095, 16385); +f(70366596661249, 32767); +f(70368744144896, 32768); +f(70370891628543, 32769); +f(140735340806145, 65535); +f(140737488289792, 65536); +f(140739635773439, 65537); +f(281472829095937, 131071); +f(281474976579584, 131072); +f(281477124063231, 131073); +f(562947805675521, 262143); +f(562949953159168, 262144); +f(562952100642815, 262145); +f(1125897758834689, 524287); +f(1125899906318336, 524288); +f(1125902053801983, 524289); +x = 2147483648; +f(0, 0); +f(2147483648, 1); +f(4294967296, 2); +f(6442450944, 3); +f(8589934592, 4); +f(10737418240, 5); +f(15032385536, 7); +f(17179869184, 8); +f(19327352832, 9); +f(32212254720, 15); +f(34359738368, 16); +f(36507222016, 17); +f(66571993088, 31); +f(68719476736, 32); +f(70866960384, 33); +f(135291469824, 63); +f(137438953472, 64); +f(139586437120, 65); +f(272730423296, 127); +f(274877906944, 128); +f(277025390592, 129); +f(547608330240, 255); +f(549755813888, 256); +f(551903297536, 257); +f(1097364144128, 511); +f(1099511627776, 512); +f(1101659111424, 513); +f(2196875771904, 1023); +f(2199023255552, 1024); +f(2201170739200, 1025); +f(4395899027456, 2047); +f(4398046511104, 2048); +f(4400193994752, 2049); +f(8793945538560, 4095); +f(8796093022208, 4096); +f(8798240505856, 4097); +f(17590038560768, 8191); +f(17592186044416, 8192); +f(17594333528064, 8193); +f(35182224605184, 16383); +f(35184372088832, 16384); +f(35186519572480, 16385); +f(70366596694016, 32767); +f(70368744177664, 32768); +f(70370891661312, 32769); +f(140735340871680, 65535); +f(140737488355328, 65536); +f(140739635838976, 65537); +f(281472829227008, 131071); +f(281474976710656, 131072); +f(281477124194304, 131073); +f(562947805937664, 262143); +f(562949953421312, 262144); +f(562952100904960, 262145); +f(1125897759358976, 524287); +f(1125899906842624, 524288); +f(1125902054326272, 524289); +x = 2147483649; +f(0, 0); +f(2147483649, 1); +f(4294967298, 2); +f(6442450947, 3); +f(8589934596, 4); +f(10737418245, 5); +f(15032385543, 7); +f(17179869192, 8); +f(19327352841, 9); +f(32212254735, 15); +f(34359738384, 16); +f(36507222033, 17); +f(66571993119, 31); +f(68719476768, 32); +f(70866960417, 33); +f(135291469887, 63); +f(137438953536, 64); +f(139586437185, 65); +f(272730423423, 127); +f(274877907072, 128); +f(277025390721, 129); +f(547608330495, 255); +f(549755814144, 256); +f(551903297793, 257); +f(1097364144639, 511); +f(1099511628288, 512); +f(1101659111937, 513); +f(2196875772927, 1023); +f(2199023256576, 1024); +f(2201170740225, 1025); +f(4395899029503, 2047); +f(4398046513152, 2048); +f(4400193996801, 2049); +f(8793945542655, 4095); +f(8796093026304, 4096); +f(8798240509953, 4097); +f(17590038568959, 8191); +f(17592186052608, 8192); +f(17594333536257, 8193); +f(35182224621567, 16383); +f(35184372105216, 16384); +f(35186519588865, 16385); +f(70366596726783, 32767); +f(70368744210432, 32768); +f(70370891694081, 32769); +f(140735340937215, 65535); +f(140737488420864, 65536); +f(140739635904513, 65537); +f(281472829358079, 131071); +f(281474976841728, 131072); +f(281477124325377, 131073); +f(562947806199807, 262143); +f(562949953683456, 262144); +f(562952101167105, 262145); +f(1125897759883263, 524287); +f(1125899907366912, 524288); +f(1125902054850561, 524289); +x = 4294967295; +f(0, 0); +f(4294967295, 1); +f(8589934590, 2); +f(12884901885, 3); +f(17179869180, 4); +f(21474836475, 5); +f(30064771065, 7); +f(34359738360, 8); +f(38654705655, 9); +f(64424509425, 15); +f(68719476720, 16); +f(73014444015, 17); +f(133143986145, 31); +f(137438953440, 32); +f(141733920735, 33); +f(270582939585, 63); +f(274877906880, 64); +f(279172874175, 65); +f(545460846465, 127); +f(549755813760, 128); +f(554050781055, 129); +f(1095216660225, 255); +f(1099511627520, 256); +f(1103806594815, 257); +f(2194728287745, 511); +f(2199023255040, 512); +f(2203318222335, 513); +f(4393751542785, 1023); +f(4398046510080, 1024); +f(4402341477375, 1025); +f(8791798052865, 2047); +f(8796093020160, 2048); +f(8800387987455, 2049); +f(17587891073025, 4095); +f(17592186040320, 4096); +f(17596481007615, 4097); +f(35180077113345, 8191); +f(35184372080640, 8192); +f(35188667047935, 8193); +f(70364449193985, 16383); +f(70368744161280, 16384); +f(70373039128575, 16385); +f(140733193355265, 32767); +f(140737488322560, 32768); +f(140741783289855, 32769); +f(281470681677825, 65535); +f(281474976645120, 65536); +f(281479271612415, 65537); +f(562945658322945, 131071); +f(562949953290240, 131072); +f(562954248257535, 131073); +f(1125895611613185, 262143); +f(1125899906580480, 262144); +f(1125904201547775, 262145); diff --git a/test/mjsunit/mul-exhaustive.js b/test/mjsunit/mul-exhaustive.js deleted file mode 100644 index 12689db..0000000 --- a/test/mjsunit/mul-exhaustive.js +++ /dev/null @@ -1,4629 +0,0 @@ -// Copyright 2008 the V8 project authors. All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -var x; - -// Converts a number to string respecting -0. -function stringify(n) { - if ((1 / n) === -Infinity) return "-0"; - return String(n); -} - -function f(expected, y) { - function testEval(string, x, y) { - var mulFunction = Function("x, y", "return " + string); - return mulFunction(x, y); - } - function mulTest(expected, x, y) { - assertEquals(expected, x * y); - assertEquals(expected, testEval(stringify(x) + " * y", x, y)); - assertEquals(expected, testEval("x * " + stringify(y), x, y)); - assertEquals(expected, testEval(stringify(x) + " * " + stringify(y), x, y)); - } - mulTest(expected, x, y); - mulTest(-expected, -x, y); - mulTest(-expected, x, -y); - mulTest(expected, -x, -y); - if (x === y) return; // Symmetric cases not necessary. - mulTest(expected, y, x); - mulTest(-expected, -y, x); - mulTest(-expected, y, -x); - mulTest(expected, -y, -x); -} - -x = 0; -f(0, 0); -x = 1; -f(0, 0); -f(1, 1); -x = 2; -f(0, 0); -f(2, 1); -f(4, 2); -x = 3; -f(0, 0); -f(3, 1); -f(6, 2); -f(9, 3); -x = 4; -f(0, 0); -f(4, 1); -f(8, 2); -f(12, 3); -f(16, 4); -x = 5; -f(0, 0); -f(5, 1); -f(10, 2); -f(15, 3); -f(20, 4); -f(25, 5); -x = 7; -f(0, 0); -f(7, 1); -f(14, 2); -f(21, 3); -f(28, 4); -f(35, 5); -f(49, 7); -x = 8; -f(0, 0); -f(8, 1); -f(16, 2); -f(24, 3); -f(32, 4); -f(40, 5); -f(56, 7); -f(64, 8); -x = 9; -f(0, 0); -f(9, 1); -f(18, 2); -f(27, 3); -f(36, 4); -f(45, 5); -f(63, 7); -f(72, 8); -f(81, 9); -x = 15; -f(0, 0); -f(15, 1); -f(30, 2); -f(45, 3); -f(60, 4); -f(75, 5); -f(105, 7); -f(120, 8); -f(135, 9); -f(225, 15); -x = 16; -f(0, 0); -f(16, 1); -f(32, 2); -f(48, 3); -f(64, 4); -f(80, 5); -f(112, 7); -f(128, 8); -f(144, 9); -f(240, 15); -f(256, 16); -x = 17; -f(0, 0); -f(17, 1); -f(34, 2); -f(51, 3); -f(68, 4); -f(85, 5); -f(119, 7); -f(136, 8); -f(153, 9); -f(255, 15); -f(272, 16); -f(289, 17); -x = 31; -f(0, 0); -f(31, 1); -f(62, 2); -f(93, 3); -f(124, 4); -f(155, 5); -f(217, 7); -f(248, 8); -f(279, 9); -f(465, 15); -f(496, 16); -f(527, 17); -f(961, 31); -x = 32; -f(0, 0); -f(32, 1); -f(64, 2); -f(96, 3); -f(128, 4); -f(160, 5); -f(224, 7); -f(256, 8); -f(288, 9); -f(480, 15); -f(512, 16); -f(544, 17); -f(992, 31); -f(1024, 32); -x = 33; -f(0, 0); -f(33, 1); -f(66, 2); -f(99, 3); -f(132, 4); -f(165, 5); -f(231, 7); -f(264, 8); -f(297, 9); -f(495, 15); -f(528, 16); -f(561, 17); -f(1023, 31); -f(1056, 32); -f(1089, 33); -x = 63; -f(0, 0); -f(63, 1); -f(126, 2); -f(189, 3); -f(252, 4); -f(315, 5); -f(441, 7); -f(504, 8); -f(567, 9); -f(945, 15); -f(1008, 16); -f(1071, 17); -f(1953, 31); -f(2016, 32); -f(2079, 33); -f(3969, 63); -x = 64; -f(0, 0); -f(64, 1); -f(128, 2); -f(192, 3); -f(256, 4); -f(320, 5); -f(448, 7); -f(512, 8); -f(576, 9); -f(960, 15); -f(1024, 16); -f(1088, 17); -f(1984, 31); -f(2048, 32); -f(2112, 33); -f(4032, 63); -f(4096, 64); -x = 65; -f(0, 0); -f(65, 1); -f(130, 2); -f(195, 3); -f(260, 4); -f(325, 5); -f(455, 7); -f(520, 8); -f(585, 9); -f(975, 15); -f(1040, 16); -f(1105, 17); -f(2015, 31); -f(2080, 32); -f(2145, 33); -f(4095, 63); -f(4160, 64); -f(4225, 65); -x = 127; -f(0, 0); -f(127, 1); -f(254, 2); -f(381, 3); -f(508, 4); -f(635, 5); -f(889, 7); -f(1016, 8); -f(1143, 9); -f(1905, 15); -f(2032, 16); -f(2159, 17); -f(3937, 31); -f(4064, 32); -f(4191, 33); -f(8001, 63); -f(8128, 64); -f(8255, 65); -f(16129, 127); -x = 128; -f(0, 0); -f(128, 1); -f(256, 2); -f(384, 3); -f(512, 4); -f(640, 5); -f(896, 7); -f(1024, 8); -f(1152, 9); -f(1920, 15); -f(2048, 16); -f(2176, 17); -f(3968, 31); -f(4096, 32); -f(4224, 33); -f(8064, 63); -f(8192, 64); -f(8320, 65); -f(16256, 127); -f(16384, 128); -x = 129; -f(0, 0); -f(129, 1); -f(258, 2); -f(387, 3); -f(516, 4); -f(645, 5); -f(903, 7); -f(1032, 8); -f(1161, 9); -f(1935, 15); -f(2064, 16); -f(2193, 17); -f(3999, 31); -f(4128, 32); -f(4257, 33); -f(8127, 63); -f(8256, 64); -f(8385, 65); -f(16383, 127); -f(16512, 128); -f(16641, 129); -x = 255; -f(0, 0); -f(255, 1); -f(510, 2); -f(765, 3); -f(1020, 4); -f(1275, 5); -f(1785, 7); -f(2040, 8); -f(2295, 9); -f(3825, 15); -f(4080, 16); -f(4335, 17); -f(7905, 31); -f(8160, 32); -f(8415, 33); -f(16065, 63); -f(16320, 64); -f(16575, 65); -f(32385, 127); -f(32640, 128); -f(32895, 129); -f(65025, 255); -x = 256; -f(0, 0); -f(256, 1); -f(512, 2); -f(768, 3); -f(1024, 4); -f(1280, 5); -f(1792, 7); -f(2048, 8); -f(2304, 9); -f(3840, 15); -f(4096, 16); -f(4352, 17); -f(7936, 31); -f(8192, 32); -f(8448, 33); -f(16128, 63); -f(16384, 64); -f(16640, 65); -f(32512, 127); -f(32768, 128); -f(33024, 129); -f(65280, 255); -f(65536, 256); -x = 257; -f(0, 0); -f(257, 1); -f(514, 2); -f(771, 3); -f(1028, 4); -f(1285, 5); -f(1799, 7); -f(2056, 8); -f(2313, 9); -f(3855, 15); -f(4112, 16); -f(4369, 17); -f(7967, 31); -f(8224, 32); -f(8481, 33); -f(16191, 63); -f(16448, 64); -f(16705, 65); -f(32639, 127); -f(32896, 128); -f(33153, 129); -f(65535, 255); -f(65792, 256); -f(66049, 257); -x = 511; -f(0, 0); -f(511, 1); -f(1022, 2); -f(1533, 3); -f(2044, 4); -f(2555, 5); -f(3577, 7); -f(4088, 8); -f(4599, 9); -f(7665, 15); -f(8176, 16); -f(8687, 17); -f(15841, 31); -f(16352, 32); -f(16863, 33); -f(32193, 63); -f(32704, 64); -f(33215, 65); -f(64897, 127); -f(65408, 128); -f(65919, 129); -f(130305, 255); -f(130816, 256); -f(131327, 257); -f(261121, 511); -x = 512; -f(0, 0); -f(512, 1); -f(1024, 2); -f(1536, 3); -f(2048, 4); -f(2560, 5); -f(3584, 7); -f(4096, 8); -f(4608, 9); -f(7680, 15); -f(8192, 16); -f(8704, 17); -f(15872, 31); -f(16384, 32); -f(16896, 33); -f(32256, 63); -f(32768, 64); -f(33280, 65); -f(65024, 127); -f(65536, 128); -f(66048, 129); -f(130560, 255); -f(131072, 256); -f(131584, 257); -f(261632, 511); -f(262144, 512); -x = 513; -f(0, 0); -f(513, 1); -f(1026, 2); -f(1539, 3); -f(2052, 4); -f(2565, 5); -f(3591, 7); -f(4104, 8); -f(4617, 9); -f(7695, 15); -f(8208, 16); -f(8721, 17); -f(15903, 31); -f(16416, 32); -f(16929, 33); -f(32319, 63); -f(32832, 64); -f(33345, 65); -f(65151, 127); -f(65664, 128); -f(66177, 129); -f(130815, 255); -f(131328, 256); -f(131841, 257); -f(262143, 511); -f(262656, 512); -f(263169, 513); -x = 1023; -f(0, 0); -f(1023, 1); -f(2046, 2); -f(3069, 3); -f(4092, 4); -f(5115, 5); -f(7161, 7); -f(8184, 8); -f(9207, 9); -f(15345, 15); -f(16368, 16); -f(17391, 17); -f(31713, 31); -f(32736, 32); -f(33759, 33); -f(64449, 63); -f(65472, 64); -f(66495, 65); -f(129921, 127); -f(130944, 128); -f(131967, 129); -f(260865, 255); -f(261888, 256); -f(262911, 257); -f(522753, 511); -f(523776, 512); -f(524799, 513); -f(1046529, 1023); -x = 1024; -f(0, 0); -f(1024, 1); -f(2048, 2); -f(3072, 3); -f(4096, 4); -f(5120, 5); -f(7168, 7); -f(8192, 8); -f(9216, 9); -f(15360, 15); -f(16384, 16); -f(17408, 17); -f(31744, 31); -f(32768, 32); -f(33792, 33); -f(64512, 63); -f(65536, 64); -f(66560, 65); -f(130048, 127); -f(131072, 128); -f(132096, 129); -f(261120, 255); -f(262144, 256); -f(263168, 257); -f(523264, 511); -f(524288, 512); -f(525312, 513); -f(1047552, 1023); -f(1048576, 1024); -x = 1025; -f(0, 0); -f(1025, 1); -f(2050, 2); -f(3075, 3); -f(4100, 4); -f(5125, 5); -f(7175, 7); -f(8200, 8); -f(9225, 9); -f(15375, 15); -f(16400, 16); -f(17425, 17); -f(31775, 31); -f(32800, 32); -f(33825, 33); -f(64575, 63); -f(65600, 64); -f(66625, 65); -f(130175, 127); -f(131200, 128); -f(132225, 129); -f(261375, 255); -f(262400, 256); -f(263425, 257); -f(523775, 511); -f(524800, 512); -f(525825, 513); -f(1048575, 1023); -f(1049600, 1024); -f(1050625, 1025); -x = 2047; -f(0, 0); -f(2047, 1); -f(4094, 2); -f(6141, 3); -f(8188, 4); -f(10235, 5); -f(14329, 7); -f(16376, 8); -f(18423, 9); -f(30705, 15); -f(32752, 16); -f(34799, 17); -f(63457, 31); -f(65504, 32); -f(67551, 33); -f(128961, 63); -f(131008, 64); -f(133055, 65); -f(259969, 127); -f(262016, 128); -f(264063, 129); -f(521985, 255); -f(524032, 256); -f(526079, 257); -f(1046017, 511); -f(1048064, 512); -f(1050111, 513); -f(2094081, 1023); -f(2096128, 1024); -f(2098175, 1025); -f(4190209, 2047); -x = 2048; -f(0, 0); -f(2048, 1); -f(4096, 2); -f(6144, 3); -f(8192, 4); -f(10240, 5); -f(14336, 7); -f(16384, 8); -f(18432, 9); -f(30720, 15); -f(32768, 16); -f(34816, 17); -f(63488, 31); -f(65536, 32); -f(67584, 33); -f(129024, 63); -f(131072, 64); -f(133120, 65); -f(260096, 127); -f(262144, 128); -f(264192, 129); -f(522240, 255); -f(524288, 256); -f(526336, 257); -f(1046528, 511); -f(1048576, 512); -f(1050624, 513); -f(2095104, 1023); -f(2097152, 1024); -f(2099200, 1025); -f(4192256, 2047); -f(4194304, 2048); -x = 2049; -f(0, 0); -f(2049, 1); -f(4098, 2); -f(6147, 3); -f(8196, 4); -f(10245, 5); -f(14343, 7); -f(16392, 8); -f(18441, 9); -f(30735, 15); -f(32784, 16); -f(34833, 17); -f(63519, 31); -f(65568, 32); -f(67617, 33); -f(129087, 63); -f(131136, 64); -f(133185, 65); -f(260223, 127); -f(262272, 128); -f(264321, 129); -f(522495, 255); -f(524544, 256); -f(526593, 257); -f(1047039, 511); -f(1049088, 512); -f(1051137, 513); -f(2096127, 1023); -f(2098176, 1024); -f(2100225, 1025); -f(4194303, 2047); -f(4196352, 2048); -f(4198401, 2049); -x = 4095; -f(0, 0); -f(4095, 1); -f(8190, 2); -f(12285, 3); -f(16380, 4); -f(20475, 5); -f(28665, 7); -f(32760, 8); -f(36855, 9); -f(61425, 15); -f(65520, 16); -f(69615, 17); -f(126945, 31); -f(131040, 32); -f(135135, 33); -f(257985, 63); -f(262080, 64); -f(266175, 65); -f(520065, 127); -f(524160, 128); -f(528255, 129); -f(1044225, 255); -f(1048320, 256); -f(1052415, 257); -f(2092545, 511); -f(2096640, 512); -f(2100735, 513); -f(4189185, 1023); -f(4193280, 1024); -f(4197375, 1025); -f(8382465, 2047); -f(8386560, 2048); -f(8390655, 2049); -f(16769025, 4095); -x = 4096; -f(0, 0); -f(4096, 1); -f(8192, 2); -f(12288, 3); -f(16384, 4); -f(20480, 5); -f(28672, 7); -f(32768, 8); -f(36864, 9); -f(61440, 15); -f(65536, 16); -f(69632, 17); -f(126976, 31); -f(131072, 32); -f(135168, 33); -f(258048, 63); -f(262144, 64); -f(266240, 65); -f(520192, 127); -f(524288, 128); -f(528384, 129); -f(1044480, 255); -f(1048576, 256); -f(1052672, 257); -f(2093056, 511); -f(2097152, 512); -f(2101248, 513); -f(4190208, 1023); -f(4194304, 1024); -f(4198400, 1025); -f(8384512, 2047); -f(8388608, 2048); -f(8392704, 2049); -f(16773120, 4095); -f(16777216, 4096); -x = 4097; -f(0, 0); -f(4097, 1); -f(8194, 2); -f(12291, 3); -f(16388, 4); -f(20485, 5); -f(28679, 7); -f(32776, 8); -f(36873, 9); -f(61455, 15); -f(65552, 16); -f(69649, 17); -f(127007, 31); -f(131104, 32); -f(135201, 33); -f(258111, 63); -f(262208, 64); -f(266305, 65); -f(520319, 127); -f(524416, 128); -f(528513, 129); -f(1044735, 255); -f(1048832, 256); -f(1052929, 257); -f(2093567, 511); -f(2097664, 512); -f(2101761, 513); -f(4191231, 1023); -f(4195328, 1024); -f(4199425, 1025); -f(8386559, 2047); -f(8390656, 2048); -f(8394753, 2049); -f(16777215, 4095); -f(16781312, 4096); -f(16785409, 4097); -x = 8191; -f(0, 0); -f(8191, 1); -f(16382, 2); -f(24573, 3); -f(32764, 4); -f(40955, 5); -f(57337, 7); -f(65528, 8); -f(73719, 9); -f(122865, 15); -f(131056, 16); -f(139247, 17); -f(253921, 31); -f(262112, 32); -f(270303, 33); -f(516033, 63); -f(524224, 64); -f(532415, 65); -f(1040257, 127); -f(1048448, 128); -f(1056639, 129); -f(2088705, 255); -f(2096896, 256); -f(2105087, 257); -f(4185601, 511); -f(4193792, 512); -f(4201983, 513); -f(8379393, 1023); -f(8387584, 1024); -f(8395775, 1025); -f(16766977, 2047); -f(16775168, 2048); -f(16783359, 2049); -f(33542145, 4095); -f(33550336, 4096); -f(33558527, 4097); -f(67092481, 8191); -x = 8192; -f(0, 0); -f(8192, 1); -f(16384, 2); -f(24576, 3); -f(32768, 4); -f(40960, 5); -f(57344, 7); -f(65536, 8); -f(73728, 9); -f(122880, 15); -f(131072, 16); -f(139264, 17); -f(253952, 31); -f(262144, 32); -f(270336, 33); -f(516096, 63); -f(524288, 64); -f(532480, 65); -f(1040384, 127); -f(1048576, 128); -f(1056768, 129); -f(2088960, 255); -f(2097152, 256); -f(2105344, 257); -f(4186112, 511); -f(4194304, 512); -f(4202496, 513); -f(8380416, 1023); -f(8388608, 1024); -f(8396800, 1025); -f(16769024, 2047); -f(16777216, 2048); -f(16785408, 2049); -f(33546240, 4095); -f(33554432, 4096); -f(33562624, 4097); -f(67100672, 8191); -f(67108864, 8192); -x = 8193; -f(0, 0); -f(8193, 1); -f(16386, 2); -f(24579, 3); -f(32772, 4); -f(40965, 5); -f(57351, 7); -f(65544, 8); -f(73737, 9); -f(122895, 15); -f(131088, 16); -f(139281, 17); -f(253983, 31); -f(262176, 32); -f(270369, 33); -f(516159, 63); -f(524352, 64); -f(532545, 65); -f(1040511, 127); -f(1048704, 128); -f(1056897, 129); -f(2089215, 255); -f(2097408, 256); -f(2105601, 257); -f(4186623, 511); -f(4194816, 512); -f(4203009, 513); -f(8381439, 1023); -f(8389632, 1024); -f(8397825, 1025); -f(16771071, 2047); -f(16779264, 2048); -f(16787457, 2049); -f(33550335, 4095); -f(33558528, 4096); -f(33566721, 4097); -f(67108863, 8191); -f(67117056, 8192); -f(67125249, 8193); -x = 16383; -f(0, 0); -f(16383, 1); -f(32766, 2); -f(49149, 3); -f(65532, 4); -f(81915, 5); -f(114681, 7); -f(131064, 8); -f(147447, 9); -f(245745, 15); -f(262128, 16); -f(278511, 17); -f(507873, 31); -f(524256, 32); -f(540639, 33); -f(1032129, 63); -f(1048512, 64); -f(1064895, 65); -f(2080641, 127); -f(2097024, 128); -f(2113407, 129); -f(4177665, 255); -f(4194048, 256); -f(4210431, 257); -f(8371713, 511); -f(8388096, 512); -f(8404479, 513); -f(16759809, 1023); -f(16776192, 1024); -f(16792575, 1025); -f(33536001, 2047); -f(33552384, 2048); -f(33568767, 2049); -f(67088385, 4095); -f(67104768, 4096); -f(67121151, 4097); -f(134193153, 8191); -f(134209536, 8192); -f(134225919, 8193); -f(268402689, 16383); -x = 16384; -f(0, 0); -f(16384, 1); -f(32768, 2); -f(49152, 3); -f(65536, 4); -f(81920, 5); -f(114688, 7); -f(131072, 8); -f(147456, 9); -f(245760, 15); -f(262144, 16); -f(278528, 17); -f(507904, 31); -f(524288, 32); -f(540672, 33); -f(1032192, 63); -f(1048576, 64); -f(1064960, 65); -f(2080768, 127); -f(2097152, 128); -f(2113536, 129); -f(4177920, 255); -f(4194304, 256); -f(4210688, 257); -f(8372224, 511); -f(8388608, 512); -f(8404992, 513); -f(16760832, 1023); -f(16777216, 1024); -f(16793600, 1025); -f(33538048, 2047); -f(33554432, 2048); -f(33570816, 2049); -f(67092480, 4095); -f(67108864, 4096); -f(67125248, 4097); -f(134201344, 8191); -f(134217728, 8192); -f(134234112, 8193); -f(268419072, 16383); -f(268435456, 16384); -x = 16385; -f(0, 0); -f(16385, 1); -f(32770, 2); -f(49155, 3); -f(65540, 4); -f(81925, 5); -f(114695, 7); -f(131080, 8); -f(147465, 9); -f(245775, 15); -f(262160, 16); -f(278545, 17); -f(507935, 31); -f(524320, 32); -f(540705, 33); -f(1032255, 63); -f(1048640, 64); -f(1065025, 65); -f(2080895, 127); -f(2097280, 128); -f(2113665, 129); -f(4178175, 255); -f(4194560, 256); -f(4210945, 257); -f(8372735, 511); -f(8389120, 512); -f(8405505, 513); -f(16761855, 1023); -f(16778240, 1024); -f(16794625, 1025); -f(33540095, 2047); -f(33556480, 2048); -f(33572865, 2049); -f(67096575, 4095); -f(67112960, 4096); -f(67129345, 4097); -f(134209535, 8191); -f(134225920, 8192); -f(134242305, 8193); -f(268435455, 16383); -f(268451840, 16384); -f(268468225, 16385); -x = 32767; -f(0, 0); -f(32767, 1); -f(65534, 2); -f(98301, 3); -f(131068, 4); -f(163835, 5); -f(229369, 7); -f(262136, 8); -f(294903, 9); -f(491505, 15); -f(524272, 16); -f(557039, 17); -f(1015777, 31); -f(1048544, 32); -f(1081311, 33); -f(2064321, 63); -f(2097088, 64); -f(2129855, 65); -f(4161409, 127); -f(4194176, 128); -f(4226943, 129); -f(8355585, 255); -f(8388352, 256); -f(8421119, 257); -f(16743937, 511); -f(16776704, 512); -f(16809471, 513); -f(33520641, 1023); -f(33553408, 1024); -f(33586175, 1025); -f(67074049, 2047); -f(67106816, 2048); -f(67139583, 2049); -f(134180865, 4095); -f(134213632, 4096); -f(134246399, 4097); -f(268394497, 8191); -f(268427264, 8192); -f(268460031, 8193); -f(536821761, 16383); -f(536854528, 16384); -f(536887295, 16385); -f(1073676289, 32767); -x = 32768; -f(0, 0); -f(32768, 1); -f(65536, 2); -f(98304, 3); -f(131072, 4); -f(163840, 5); -f(229376, 7); -f(262144, 8); -f(294912, 9); -f(491520, 15); -f(524288, 16); -f(557056, 17); -f(1015808, 31); -f(1048576, 32); -f(1081344, 33); -f(2064384, 63); -f(2097152, 64); -f(2129920, 65); -f(4161536, 127); -f(4194304, 128); -f(4227072, 129); -f(8355840, 255); -f(8388608, 256); -f(8421376, 257); -f(16744448, 511); -f(16777216, 512); -f(16809984, 513); -f(33521664, 1023); -f(33554432, 1024); -f(33587200, 1025); -f(67076096, 2047); -f(67108864, 2048); -f(67141632, 2049); -f(134184960, 4095); -f(134217728, 4096); -f(134250496, 4097); -f(268402688, 8191); -f(268435456, 8192); -f(268468224, 8193); -f(536838144, 16383); -f(536870912, 16384); -f(536903680, 16385); -f(1073709056, 32767); -f(1073741824, 32768); -x = 32769; -f(0, 0); -f(32769, 1); -f(65538, 2); -f(98307, 3); -f(131076, 4); -f(163845, 5); -f(229383, 7); -f(262152, 8); -f(294921, 9); -f(491535, 15); -f(524304, 16); -f(557073, 17); -f(1015839, 31); -f(1048608, 32); -f(1081377, 33); -f(2064447, 63); -f(2097216, 64); -f(2129985, 65); -f(4161663, 127); -f(4194432, 128); -f(4227201, 129); -f(8356095, 255); -f(8388864, 256); -f(8421633, 257); -f(16744959, 511); -f(16777728, 512); -f(16810497, 513); -f(33522687, 1023); -f(33555456, 1024); -f(33588225, 1025); -f(67078143, 2047); -f(67110912, 2048); -f(67143681, 2049); -f(134189055, 4095); -f(134221824, 4096); -f(134254593, 4097); -f(268410879, 8191); -f(268443648, 8192); -f(268476417, 8193); -f(536854527, 16383); -f(536887296, 16384); -f(536920065, 16385); -f(1073741823, 32767); -f(1073774592, 32768); -f(1073807361, 32769); -x = 65535; -f(0, 0); -f(65535, 1); -f(131070, 2); -f(196605, 3); -f(262140, 4); -f(327675, 5); -f(458745, 7); -f(524280, 8); -f(589815, 9); -f(983025, 15); -f(1048560, 16); -f(1114095, 17); -f(2031585, 31); -f(2097120, 32); -f(2162655, 33); -f(4128705, 63); -f(4194240, 64); -f(4259775, 65); -f(8322945, 127); -f(8388480, 128); -f(8454015, 129); -f(16711425, 255); -f(16776960, 256); -f(16842495, 257); -f(33488385, 511); -f(33553920, 512); -f(33619455, 513); -f(67042305, 1023); -f(67107840, 1024); -f(67173375, 1025); -f(134150145, 2047); -f(134215680, 2048); -f(134281215, 2049); -f(268365825, 4095); -f(268431360, 4096); -f(268496895, 4097); -f(536797185, 8191); -f(536862720, 8192); -f(536928255, 8193); -f(1073659905, 16383); -f(1073725440, 16384); -f(1073790975, 16385); -f(2147385345, 32767); -f(2147450880, 32768); -f(2147516415, 32769); -f(4294836225, 65535); -x = 65536; -f(0, 0); -f(65536, 1); -f(131072, 2); -f(196608, 3); -f(262144, 4); -f(327680, 5); -f(458752, 7); -f(524288, 8); -f(589824, 9); -f(983040, 15); -f(1048576, 16); -f(1114112, 17); -f(2031616, 31); -f(2097152, 32); -f(2162688, 33); -f(4128768, 63); -f(4194304, 64); -f(4259840, 65); -f(8323072, 127); -f(8388608, 128); -f(8454144, 129); -f(16711680, 255); -f(16777216, 256); -f(16842752, 257); -f(33488896, 511); -f(33554432, 512); -f(33619968, 513); -f(67043328, 1023); -f(67108864, 1024); -f(67174400, 1025); -f(134152192, 2047); -f(134217728, 2048); -f(134283264, 2049); -f(268369920, 4095); -f(268435456, 4096); -f(268500992, 4097); -f(536805376, 8191); -f(536870912, 8192); -f(536936448, 8193); -f(1073676288, 16383); -f(1073741824, 16384); -f(1073807360, 16385); -f(2147418112, 32767); -f(2147483648, 32768); -f(2147549184, 32769); -f(4294901760, 65535); -f(4294967296, 65536); -x = 65537; -f(0, 0); -f(65537, 1); -f(131074, 2); -f(196611, 3); -f(262148, 4); -f(327685, 5); -f(458759, 7); -f(524296, 8); -f(589833, 9); -f(983055, 15); -f(1048592, 16); -f(1114129, 17); -f(2031647, 31); -f(2097184, 32); -f(2162721, 33); -f(4128831, 63); -f(4194368, 64); -f(4259905, 65); -f(8323199, 127); -f(8388736, 128); -f(8454273, 129); -f(16711935, 255); -f(16777472, 256); -f(16843009, 257); -f(33489407, 511); -f(33554944, 512); -f(33620481, 513); -f(67044351, 1023); -f(67109888, 1024); -f(67175425, 1025); -f(134154239, 2047); -f(134219776, 2048); -f(134285313, 2049); -f(268374015, 4095); -f(268439552, 4096); -f(268505089, 4097); -f(536813567, 8191); -f(536879104, 8192); -f(536944641, 8193); -f(1073692671, 16383); -f(1073758208, 16384); -f(1073823745, 16385); -f(2147450879, 32767); -f(2147516416, 32768); -f(2147581953, 32769); -f(4294967295, 65535); -f(4295032832, 65536); -f(4295098369, 65537); -x = 131071; -f(0, 0); -f(131071, 1); -f(262142, 2); -f(393213, 3); -f(524284, 4); -f(655355, 5); -f(917497, 7); -f(1048568, 8); -f(1179639, 9); -f(1966065, 15); -f(2097136, 16); -f(2228207, 17); -f(4063201, 31); -f(4194272, 32); -f(4325343, 33); -f(8257473, 63); -f(8388544, 64); -f(8519615, 65); -f(16646017, 127); -f(16777088, 128); -f(16908159, 129); -f(33423105, 255); -f(33554176, 256); -f(33685247, 257); -f(66977281, 511); -f(67108352, 512); -f(67239423, 513); -f(134085633, 1023); -f(134216704, 1024); -f(134347775, 1025); -f(268302337, 2047); -f(268433408, 2048); -f(268564479, 2049); -f(536735745, 4095); -f(536866816, 4096); -f(536997887, 4097); -f(1073602561, 8191); -f(1073733632, 8192); -f(1073864703, 8193); -f(2147336193, 16383); -f(2147467264, 16384); -f(2147598335, 16385); -f(4294803457, 32767); -f(4294934528, 32768); -f(4295065599, 32769); -f(8589737985, 65535); -f(8589869056, 65536); -f(8590000127, 65537); -f(17179607041, 131071); -x = 131072; -f(0, 0); -f(131072, 1); -f(262144, 2); -f(393216, 3); -f(524288, 4); -f(655360, 5); -f(917504, 7); -f(1048576, 8); -f(1179648, 9); -f(1966080, 15); -f(2097152, 16); -f(2228224, 17); -f(4063232, 31); -f(4194304, 32); -f(4325376, 33); -f(8257536, 63); -f(8388608, 64); -f(8519680, 65); -f(16646144, 127); -f(16777216, 128); -f(16908288, 129); -f(33423360, 255); -f(33554432, 256); -f(33685504, 257); -f(66977792, 511); -f(67108864, 512); -f(67239936, 513); -f(134086656, 1023); -f(134217728, 1024); -f(134348800, 1025); -f(268304384, 2047); -f(268435456, 2048); -f(268566528, 2049); -f(536739840, 4095); -f(536870912, 4096); -f(537001984, 4097); -f(1073610752, 8191); -f(1073741824, 8192); -f(1073872896, 8193); -f(2147352576, 16383); -f(2147483648, 16384); -f(2147614720, 16385); -f(4294836224, 32767); -f(4294967296, 32768); -f(4295098368, 32769); -f(8589803520, 65535); -f(8589934592, 65536); -f(8590065664, 65537); -f(17179738112, 131071); -f(17179869184, 131072); -x = 131073; -f(0, 0); -f(131073, 1); -f(262146, 2); -f(393219, 3); -f(524292, 4); -f(655365, 5); -f(917511, 7); -f(1048584, 8); -f(1179657, 9); -f(1966095, 15); -f(2097168, 16); -f(2228241, 17); -f(4063263, 31); -f(4194336, 32); -f(4325409, 33); -f(8257599, 63); -f(8388672, 64); -f(8519745, 65); -f(16646271, 127); -f(16777344, 128); -f(16908417, 129); -f(33423615, 255); -f(33554688, 256); -f(33685761, 257); -f(66978303, 511); -f(67109376, 512); -f(67240449, 513); -f(134087679, 1023); -f(134218752, 1024); -f(134349825, 1025); -f(268306431, 2047); -f(268437504, 2048); -f(268568577, 2049); -f(536743935, 4095); -f(536875008, 4096); -f(537006081, 4097); -f(1073618943, 8191); -f(1073750016, 8192); -f(1073881089, 8193); -f(2147368959, 16383); -f(2147500032, 16384); -f(2147631105, 16385); -f(4294868991, 32767); -f(4295000064, 32768); -f(4295131137, 32769); -f(8589869055, 65535); -f(8590000128, 65536); -f(8590131201, 65537); -f(17179869183, 131071); -f(17180000256, 131072); -f(17180131329, 131073); -x = 262143; -f(0, 0); -f(262143, 1); -f(524286, 2); -f(786429, 3); -f(1048572, 4); -f(1310715, 5); -f(1835001, 7); -f(2097144, 8); -f(2359287, 9); -f(3932145, 15); -f(4194288, 16); -f(4456431, 17); -f(8126433, 31); -f(8388576, 32); -f(8650719, 33); -f(16515009, 63); -f(16777152, 64); -f(17039295, 65); -f(33292161, 127); -f(33554304, 128); -f(33816447, 129); -f(66846465, 255); -f(67108608, 256); -f(67370751, 257); -f(133955073, 511); -f(134217216, 512); -f(134479359, 513); -f(268172289, 1023); -f(268434432, 1024); -f(268696575, 1025); -f(536606721, 2047); -f(536868864, 2048); -f(537131007, 2049); -f(1073475585, 4095); -f(1073737728, 4096); -f(1073999871, 4097); -f(2147213313, 8191); -f(2147475456, 8192); -f(2147737599, 8193); -f(4294688769, 16383); -f(4294950912, 16384); -f(4295213055, 16385); -f(8589639681, 32767); -f(8589901824, 32768); -f(8590163967, 32769); -f(17179541505, 65535); -f(17179803648, 65536); -f(17180065791, 65537); -f(34359345153, 131071); -f(34359607296, 131072); -f(34359869439, 131073); -f(68718952449, 262143); -x = 262144; -f(0, 0); -f(262144, 1); -f(524288, 2); -f(786432, 3); -f(1048576, 4); -f(1310720, 5); -f(1835008, 7); -f(2097152, 8); -f(2359296, 9); -f(3932160, 15); -f(4194304, 16); -f(4456448, 17); -f(8126464, 31); -f(8388608, 32); -f(8650752, 33); -f(16515072, 63); -f(16777216, 64); -f(17039360, 65); -f(33292288, 127); -f(33554432, 128); -f(33816576, 129); -f(66846720, 255); -f(67108864, 256); -f(67371008, 257); -f(133955584, 511); -f(134217728, 512); -f(134479872, 513); -f(268173312, 1023); -f(268435456, 1024); -f(268697600, 1025); -f(536608768, 2047); -f(536870912, 2048); -f(537133056, 2049); -f(1073479680, 4095); -f(1073741824, 4096); -f(1074003968, 4097); -f(2147221504, 8191); -f(2147483648, 8192); -f(2147745792, 8193); -f(4294705152, 16383); -f(4294967296, 16384); -f(4295229440, 16385); -f(8589672448, 32767); -f(8589934592, 32768); -f(8590196736, 32769); -f(17179607040, 65535); -f(17179869184, 65536); -f(17180131328, 65537); -f(34359476224, 131071); -f(34359738368, 131072); -f(34360000512, 131073); -f(68719214592, 262143); -f(68719476736, 262144); -x = 262145; -f(0, 0); -f(262145, 1); -f(524290, 2); -f(786435, 3); -f(1048580, 4); -f(1310725, 5); -f(1835015, 7); -f(2097160, 8); -f(2359305, 9); -f(3932175, 15); -f(4194320, 16); -f(4456465, 17); -f(8126495, 31); -f(8388640, 32); -f(8650785, 33); -f(16515135, 63); -f(16777280, 64); -f(17039425, 65); -f(33292415, 127); -f(33554560, 128); -f(33816705, 129); -f(66846975, 255); -f(67109120, 256); -f(67371265, 257); -f(133956095, 511); -f(134218240, 512); -f(134480385, 513); -f(268174335, 1023); -f(268436480, 1024); -f(268698625, 1025); -f(536610815, 2047); -f(536872960, 2048); -f(537135105, 2049); -f(1073483775, 4095); -f(1073745920, 4096); -f(1074008065, 4097); -f(2147229695, 8191); -f(2147491840, 8192); -f(2147753985, 8193); -f(4294721535, 16383); -f(4294983680, 16384); -f(4295245825, 16385); -f(8589705215, 32767); -f(8589967360, 32768); -f(8590229505, 32769); -f(17179672575, 65535); -f(17179934720, 65536); -f(17180196865, 65537); -f(34359607295, 131071); -f(34359869440, 131072); -f(34360131585, 131073); -f(68719476735, 262143); -f(68719738880, 262144); -f(68720001025, 262145); -x = 524287; -f(0, 0); -f(524287, 1); -f(1048574, 2); -f(1572861, 3); -f(2097148, 4); -f(2621435, 5); -f(3670009, 7); -f(4194296, 8); -f(4718583, 9); -f(7864305, 15); -f(8388592, 16); -f(8912879, 17); -f(16252897, 31); -f(16777184, 32); -f(17301471, 33); -f(33030081, 63); -f(33554368, 64); -f(34078655, 65); -f(66584449, 127); -f(67108736, 128); -f(67633023, 129); -f(133693185, 255); -f(134217472, 256); -f(134741759, 257); -f(267910657, 511); -f(268434944, 512); -f(268959231, 513); -f(536345601, 1023); -f(536869888, 1024); -f(537394175, 1025); -f(1073215489, 2047); -f(1073739776, 2048); -f(1074264063, 2049); -f(2146955265, 4095); -f(2147479552, 4096); -f(2148003839, 4097); -f(4294434817, 8191); -f(4294959104, 8192); -f(4295483391, 8193); -f(8589393921, 16383); -f(8589918208, 16384); -f(8590442495, 16385); -f(17179312129, 32767); -f(17179836416, 32768); -f(17180360703, 32769); -f(34359148545, 65535); -f(34359672832, 65536); -f(34360197119, 65537); -f(68718821377, 131071); -f(68719345664, 131072); -f(68719869951, 131073); -f(137438167041, 262143); -f(137438691328, 262144); -f(137439215615, 262145); -f(274876858369, 524287); -x = 524288; -f(0, 0); -f(524288, 1); -f(1048576, 2); -f(1572864, 3); -f(2097152, 4); -f(2621440, 5); -f(3670016, 7); -f(4194304, 8); -f(4718592, 9); -f(7864320, 15); -f(8388608, 16); -f(8912896, 17); -f(16252928, 31); -f(16777216, 32); -f(17301504, 33); -f(33030144, 63); -f(33554432, 64); -f(34078720, 65); -f(66584576, 127); -f(67108864, 128); -f(67633152, 129); -f(133693440, 255); -f(134217728, 256); -f(134742016, 257); -f(267911168, 511); -f(268435456, 512); -f(268959744, 513); -f(536346624, 1023); -f(536870912, 1024); -f(537395200, 1025); -f(1073217536, 2047); -f(1073741824, 2048); -f(1074266112, 2049); -f(2146959360, 4095); -f(2147483648, 4096); -f(2148007936, 4097); -f(4294443008, 8191); -f(4294967296, 8192); -f(4295491584, 8193); -f(8589410304, 16383); -f(8589934592, 16384); -f(8590458880, 16385); -f(17179344896, 32767); -f(17179869184, 32768); -f(17180393472, 32769); -f(34359214080, 65535); -f(34359738368, 65536); -f(34360262656, 65537); -f(68718952448, 131071); -f(68719476736, 131072); -f(68720001024, 131073); -f(137438429184, 262143); -f(137438953472, 262144); -f(137439477760, 262145); -f(274877382656, 524287); -f(274877906944, 524288); -x = 524289; -f(0, 0); -f(524289, 1); -f(1048578, 2); -f(1572867, 3); -f(2097156, 4); -f(2621445, 5); -f(3670023, 7); -f(4194312, 8); -f(4718601, 9); -f(7864335, 15); -f(8388624, 16); -f(8912913, 17); -f(16252959, 31); -f(16777248, 32); -f(17301537, 33); -f(33030207, 63); -f(33554496, 64); -f(34078785, 65); -f(66584703, 127); -f(67108992, 128); -f(67633281, 129); -f(133693695, 255); -f(134217984, 256); -f(134742273, 257); -f(267911679, 511); -f(268435968, 512); -f(268960257, 513); -f(536347647, 1023); -f(536871936, 1024); -f(537396225, 1025); -f(1073219583, 2047); -f(1073743872, 2048); -f(1074268161, 2049); -f(2146963455, 4095); -f(2147487744, 4096); -f(2148012033, 4097); -f(4294451199, 8191); -f(4294975488, 8192); -f(4295499777, 8193); -f(8589426687, 16383); -f(8589950976, 16384); -f(8590475265, 16385); -f(17179377663, 32767); -f(17179901952, 32768); -f(17180426241, 32769); -f(34359279615, 65535); -f(34359803904, 65536); -f(34360328193, 65537); -f(68719083519, 131071); -f(68719607808, 131072); -f(68720132097, 131073); -f(137438691327, 262143); -f(137439215616, 262144); -f(137439739905, 262145); -f(274877906943, 524287); -f(274878431232, 524288); -f(274878955521, 524289); -x = 1048575; -f(0, 0); -f(1048575, 1); -f(2097150, 2); -f(3145725, 3); -f(4194300, 4); -f(5242875, 5); -f(7340025, 7); -f(8388600, 8); -f(9437175, 9); -f(15728625, 15); -f(16777200, 16); -f(17825775, 17); -f(32505825, 31); -f(33554400, 32); -f(34602975, 33); -f(66060225, 63); -f(67108800, 64); -f(68157375, 65); -f(133169025, 127); -f(134217600, 128); -f(135266175, 129); -f(267386625, 255); -f(268435200, 256); -f(269483775, 257); -f(535821825, 511); -f(536870400, 512); -f(537918975, 513); -f(1072692225, 1023); -f(1073740800, 1024); -f(1074789375, 1025); -f(2146433025, 2047); -f(2147481600, 2048); -f(2148530175, 2049); -f(4293914625, 4095); -f(4294963200, 4096); -f(4296011775, 4097); -f(8588877825, 8191); -f(8589926400, 8192); -f(8590974975, 8193); -f(17178804225, 16383); -f(17179852800, 16384); -f(17180901375, 16385); -f(34358657025, 32767); -f(34359705600, 32768); -f(34360754175, 32769); -f(68718362625, 65535); -f(68719411200, 65536); -f(68720459775, 65537); -f(137437773825, 131071); -f(137438822400, 131072); -f(137439870975, 131073); -f(274876596225, 262143); -f(274877644800, 262144); -f(274878693375, 262145); -f(549754241025, 524287); -f(549755289600, 524288); -f(549756338175, 524289); -f(1099509530625, 1048575); -x = 1048576; -f(0, 0); -f(1048576, 1); -f(2097152, 2); -f(3145728, 3); -f(4194304, 4); -f(5242880, 5); -f(7340032, 7); -f(8388608, 8); -f(9437184, 9); -f(15728640, 15); -f(16777216, 16); -f(17825792, 17); -f(32505856, 31); -f(33554432, 32); -f(34603008, 33); -f(66060288, 63); -f(67108864, 64); -f(68157440, 65); -f(133169152, 127); -f(134217728, 128); -f(135266304, 129); -f(267386880, 255); -f(268435456, 256); -f(269484032, 257); -f(535822336, 511); -f(536870912, 512); -f(537919488, 513); -f(1072693248, 1023); -f(1073741824, 1024); -f(1074790400, 1025); -f(2146435072, 2047); -f(2147483648, 2048); -f(2148532224, 2049); -f(4293918720, 4095); -f(4294967296, 4096); -f(4296015872, 4097); -f(8588886016, 8191); -f(8589934592, 8192); -f(8590983168, 8193); -f(17178820608, 16383); -f(17179869184, 16384); -f(17180917760, 16385); -f(34358689792, 32767); -f(34359738368, 32768); -f(34360786944, 32769); -f(68718428160, 65535); -f(68719476736, 65536); -f(68720525312, 65537); -f(137437904896, 131071); -f(137438953472, 131072); -f(137440002048, 131073); -f(274876858368, 262143); -f(274877906944, 262144); -f(274878955520, 262145); -f(549754765312, 524287); -f(549755813888, 524288); -f(549756862464, 524289); -f(1099510579200, 1048575); -f(1099511627776, 1048576); -x = 1048577; -f(0, 0); -f(1048577, 1); -f(2097154, 2); -f(3145731, 3); -f(4194308, 4); -f(5242885, 5); -f(7340039, 7); -f(8388616, 8); -f(9437193, 9); -f(15728655, 15); -f(16777232, 16); -f(17825809, 17); -f(32505887, 31); -f(33554464, 32); -f(34603041, 33); -f(66060351, 63); -f(67108928, 64); -f(68157505, 65); -f(133169279, 127); -f(134217856, 128); -f(135266433, 129); -f(267387135, 255); -f(268435712, 256); -f(269484289, 257); -f(535822847, 511); -f(536871424, 512); -f(537920001, 513); -f(1072694271, 1023); -f(1073742848, 1024); -f(1074791425, 1025); -f(2146437119, 2047); -f(2147485696, 2048); -f(2148534273, 2049); -f(4293922815, 4095); -f(4294971392, 4096); -f(4296019969, 4097); -f(8588894207, 8191); -f(8589942784, 8192); -f(8590991361, 8193); -f(17178836991, 16383); -f(17179885568, 16384); -f(17180934145, 16385); -f(34358722559, 32767); -f(34359771136, 32768); -f(34360819713, 32769); -f(68718493695, 65535); -f(68719542272, 65536); -f(68720590849, 65537); -f(137438035967, 131071); -f(137439084544, 131072); -f(137440133121, 131073); -f(274877120511, 262143); -f(274878169088, 262144); -f(274879217665, 262145); -f(549755289599, 524287); -f(549756338176, 524288); -f(549757386753, 524289); -f(1099511627775, 1048575); -f(1099512676352, 1048576); -f(1099513724929, 1048577); -x = 2097151; -f(0, 0); -f(2097151, 1); -f(4194302, 2); -f(6291453, 3); -f(8388604, 4); -f(10485755, 5); -f(14680057, 7); -f(16777208, 8); -f(18874359, 9); -f(31457265, 15); -f(33554416, 16); -f(35651567, 17); -f(65011681, 31); -f(67108832, 32); -f(69205983, 33); -f(132120513, 63); -f(134217664, 64); -f(136314815, 65); -f(266338177, 127); -f(268435328, 128); -f(270532479, 129); -f(534773505, 255); -f(536870656, 256); -f(538967807, 257); -f(1071644161, 511); -f(1073741312, 512); -f(1075838463, 513); -f(2145385473, 1023); -f(2147482624, 1024); -f(2149579775, 1025); -f(4292868097, 2047); -f(4294965248, 2048); -f(4297062399, 2049); -f(8587833345, 4095); -f(8589930496, 4096); -f(8592027647, 4097); -f(17177763841, 8191); -f(17179860992, 8192); -f(17181958143, 8193); -f(34357624833, 16383); -f(34359721984, 16384); -f(34361819135, 16385); -f(68717346817, 32767); -f(68719443968, 32768); -f(68721541119, 32769); -f(137436790785, 65535); -f(137438887936, 65536); -f(137440985087, 65537); -f(274875678721, 131071); -f(274877775872, 131072); -f(274879873023, 131073); -f(549753454593, 262143); -f(549755551744, 262144); -f(549757648895, 262145); -f(1099509006337, 524287); -f(1099511103488, 524288); -f(1099513200639, 524289); -f(2199020109825, 1048575); -f(2199022206976, 1048576); -f(2199024304127, 1048577); -f(4398042316801, 2097151); -x = 2097152; -f(0, 0); -f(2097152, 1); -f(4194304, 2); -f(6291456, 3); -f(8388608, 4); -f(10485760, 5); -f(14680064, 7); -f(16777216, 8); -f(18874368, 9); -f(31457280, 15); -f(33554432, 16); -f(35651584, 17); -f(65011712, 31); -f(67108864, 32); -f(69206016, 33); -f(132120576, 63); -f(134217728, 64); -f(136314880, 65); -f(266338304, 127); -f(268435456, 128); -f(270532608, 129); -f(534773760, 255); -f(536870912, 256); -f(538968064, 257); -f(1071644672, 511); -f(1073741824, 512); -f(1075838976, 513); -f(2145386496, 1023); -f(2147483648, 1024); -f(2149580800, 1025); -f(4292870144, 2047); -f(4294967296, 2048); -f(4297064448, 2049); -f(8587837440, 4095); -f(8589934592, 4096); -f(8592031744, 4097); -f(17177772032, 8191); -f(17179869184, 8192); -f(17181966336, 8193); -f(34357641216, 16383); -f(34359738368, 16384); -f(34361835520, 16385); -f(68717379584, 32767); -f(68719476736, 32768); -f(68721573888, 32769); -f(137436856320, 65535); -f(137438953472, 65536); -f(137441050624, 65537); -f(274875809792, 131071); -f(274877906944, 131072); -f(274880004096, 131073); -f(549753716736, 262143); -f(549755813888, 262144); -f(549757911040, 262145); -f(1099509530624, 524287); -f(1099511627776, 524288); -f(1099513724928, 524289); -f(2199021158400, 1048575); -f(2199023255552, 1048576); -f(2199025352704, 1048577); -f(4398044413952, 2097151); -f(4398046511104, 2097152); -x = 2097153; -f(0, 0); -f(2097153, 1); -f(4194306, 2); -f(6291459, 3); -f(8388612, 4); -f(10485765, 5); -f(14680071, 7); -f(16777224, 8); -f(18874377, 9); -f(31457295, 15); -f(33554448, 16); -f(35651601, 17); -f(65011743, 31); -f(67108896, 32); -f(69206049, 33); -f(132120639, 63); -f(134217792, 64); -f(136314945, 65); -f(266338431, 127); -f(268435584, 128); -f(270532737, 129); -f(534774015, 255); -f(536871168, 256); -f(538968321, 257); -f(1071645183, 511); -f(1073742336, 512); -f(1075839489, 513); -f(2145387519, 1023); -f(2147484672, 1024); -f(2149581825, 1025); -f(4292872191, 2047); -f(4294969344, 2048); -f(4297066497, 2049); -f(8587841535, 4095); -f(8589938688, 4096); -f(8592035841, 4097); -f(17177780223, 8191); -f(17179877376, 8192); -f(17181974529, 8193); -f(34357657599, 16383); -f(34359754752, 16384); -f(34361851905, 16385); -f(68717412351, 32767); -f(68719509504, 32768); -f(68721606657, 32769); -f(137436921855, 65535); -f(137439019008, 65536); -f(137441116161, 65537); -f(274875940863, 131071); -f(274878038016, 131072); -f(274880135169, 131073); -f(549753978879, 262143); -f(549756076032, 262144); -f(549758173185, 262145); -f(1099510054911, 524287); -f(1099512152064, 524288); -f(1099514249217, 524289); -f(2199022206975, 1048575); -f(2199024304128, 1048576); -f(2199026401281, 1048577); -f(4398046511103, 2097151); -f(4398048608256, 2097152); -f(4398050705409, 2097153); -x = 4194303; -f(0, 0); -f(4194303, 1); -f(8388606, 2); -f(12582909, 3); -f(16777212, 4); -f(20971515, 5); -f(29360121, 7); -f(33554424, 8); -f(37748727, 9); -f(62914545, 15); -f(67108848, 16); -f(71303151, 17); -f(130023393, 31); -f(134217696, 32); -f(138411999, 33); -f(264241089, 63); -f(268435392, 64); -f(272629695, 65); -f(532676481, 127); -f(536870784, 128); -f(541065087, 129); -f(1069547265, 255); -f(1073741568, 256); -f(1077935871, 257); -f(2143288833, 511); -f(2147483136, 512); -f(2151677439, 513); -f(4290771969, 1023); -f(4294966272, 1024); -f(4299160575, 1025); -f(8585738241, 2047); -f(8589932544, 2048); -f(8594126847, 2049); -f(17175670785, 4095); -f(17179865088, 4096); -f(17184059391, 4097); -f(34355535873, 8191); -f(34359730176, 8192); -f(34363924479, 8193); -f(68715266049, 16383); -f(68719460352, 16384); -f(68723654655, 16385); -f(137434726401, 32767); -f(137438920704, 32768); -f(137443115007, 32769); -f(274873647105, 65535); -f(274877841408, 65536); -f(274882035711, 65537); -f(549751488513, 131071); -f(549755682816, 131072); -f(549759877119, 131073); -f(1099507171329, 262143); -f(1099511365632, 262144); -f(1099515559935, 262145); -f(2199018536961, 524287); -f(2199022731264, 524288); -f(2199026925567, 524289); -f(4398041268225, 1048575); -f(4398045462528, 1048576); -f(4398049656831, 1048577); -f(8796086730753, 2097151); -f(8796090925056, 2097152); -f(8796095119359, 2097153); -f(17592177655809, 4194303); -x = 4194304; -f(0, 0); -f(4194304, 1); -f(8388608, 2); -f(12582912, 3); -f(16777216, 4); -f(20971520, 5); -f(29360128, 7); -f(33554432, 8); -f(37748736, 9); -f(62914560, 15); -f(67108864, 16); -f(71303168, 17); -f(130023424, 31); -f(134217728, 32); -f(138412032, 33); -f(264241152, 63); -f(268435456, 64); -f(272629760, 65); -f(532676608, 127); -f(536870912, 128); -f(541065216, 129); -f(1069547520, 255); -f(1073741824, 256); -f(1077936128, 257); -f(2143289344, 511); -f(2147483648, 512); -f(2151677952, 513); -f(4290772992, 1023); -f(4294967296, 1024); -f(4299161600, 1025); -f(8585740288, 2047); -f(8589934592, 2048); -f(8594128896, 2049); -f(17175674880, 4095); -f(17179869184, 4096); -f(17184063488, 4097); -f(34355544064, 8191); -f(34359738368, 8192); -f(34363932672, 8193); -f(68715282432, 16383); -f(68719476736, 16384); -f(68723671040, 16385); -f(137434759168, 32767); -f(137438953472, 32768); -f(137443147776, 32769); -f(274873712640, 65535); -f(274877906944, 65536); -f(274882101248, 65537); -f(549751619584, 131071); -f(549755813888, 131072); -f(549760008192, 131073); -f(1099507433472, 262143); -f(1099511627776, 262144); -f(1099515822080, 262145); -f(2199019061248, 524287); -f(2199023255552, 524288); -f(2199027449856, 524289); -f(4398042316800, 1048575); -f(4398046511104, 1048576); -f(4398050705408, 1048577); -f(8796088827904, 2097151); -f(8796093022208, 2097152); -f(8796097216512, 2097153); -f(17592181850112, 4194303); -f(17592186044416, 4194304); -x = 4194305; -f(0, 0); -f(4194305, 1); -f(8388610, 2); -f(12582915, 3); -f(16777220, 4); -f(20971525, 5); -f(29360135, 7); -f(33554440, 8); -f(37748745, 9); -f(62914575, 15); -f(67108880, 16); -f(71303185, 17); -f(130023455, 31); -f(134217760, 32); -f(138412065, 33); -f(264241215, 63); -f(268435520, 64); -f(272629825, 65); -f(532676735, 127); -f(536871040, 128); -f(541065345, 129); -f(1069547775, 255); -f(1073742080, 256); -f(1077936385, 257); -f(2143289855, 511); -f(2147484160, 512); -f(2151678465, 513); -f(4290774015, 1023); -f(4294968320, 1024); -f(4299162625, 1025); -f(8585742335, 2047); -f(8589936640, 2048); -f(8594130945, 2049); -f(17175678975, 4095); -f(17179873280, 4096); -f(17184067585, 4097); -f(34355552255, 8191); -f(34359746560, 8192); -f(34363940865, 8193); -f(68715298815, 16383); -f(68719493120, 16384); -f(68723687425, 16385); -f(137434791935, 32767); -f(137438986240, 32768); -f(137443180545, 32769); -f(274873778175, 65535); -f(274877972480, 65536); -f(274882166785, 65537); -f(549751750655, 131071); -f(549755944960, 131072); -f(549760139265, 131073); -f(1099507695615, 262143); -f(1099511889920, 262144); -f(1099516084225, 262145); -f(2199019585535, 524287); -f(2199023779840, 524288); -f(2199027974145, 524289); -f(4398043365375, 1048575); -f(4398047559680, 1048576); -f(4398051753985, 1048577); -f(8796090925055, 2097151); -f(8796095119360, 2097152); -f(8796099313665, 2097153); -f(17592186044415, 4194303); -f(17592190238720, 4194304); -f(17592194433025, 4194305); -x = 8388607; -f(0, 0); -f(8388607, 1); -f(16777214, 2); -f(25165821, 3); -f(33554428, 4); -f(41943035, 5); -f(58720249, 7); -f(67108856, 8); -f(75497463, 9); -f(125829105, 15); -f(134217712, 16); -f(142606319, 17); -f(260046817, 31); -f(268435424, 32); -f(276824031, 33); -f(528482241, 63); -f(536870848, 64); -f(545259455, 65); -f(1065353089, 127); -f(1073741696, 128); -f(1082130303, 129); -f(2139094785, 255); -f(2147483392, 256); -f(2155871999, 257); -f(4286578177, 511); -f(4294966784, 512); -f(4303355391, 513); -f(8581544961, 1023); -f(8589933568, 1024); -f(8598322175, 1025); -f(17171478529, 2047); -f(17179867136, 2048); -f(17188255743, 2049); -f(34351345665, 4095); -f(34359734272, 4096); -f(34368122879, 4097); -f(68711079937, 8191); -f(68719468544, 8192); -f(68727857151, 8193); -f(137430548481, 16383); -f(137438937088, 16384); -f(137447325695, 16385); -f(274869485569, 32767); -f(274877874176, 32768); -f(274886262783, 32769); -f(549747359745, 65535); -f(549755748352, 65536); -f(549764136959, 65537); -f(1099503108097, 131071); -f(1099511496704, 131072); -f(1099519885311, 131073); -f(2199014604801, 262143); -f(2199022993408, 262144); -f(2199031382015, 262145); -f(4398037598209, 524287); -f(4398045986816, 524288); -f(4398054375423, 524289); -f(8796083585025, 1048575); -f(8796091973632, 1048576); -f(8796100362239, 1048577); -f(17592175558657, 2097151); -f(17592183947264, 2097152); -f(17592192335871, 2097153); -f(35184359505921, 4194303); -f(35184367894528, 4194304); -f(35184376283135, 4194305); -f(70368727400449, 8388607); -x = 8388608; -f(0, 0); -f(8388608, 1); -f(16777216, 2); -f(25165824, 3); -f(33554432, 4); -f(41943040, 5); -f(58720256, 7); -f(67108864, 8); -f(75497472, 9); -f(125829120, 15); -f(134217728, 16); -f(142606336, 17); -f(260046848, 31); -f(268435456, 32); -f(276824064, 33); -f(528482304, 63); -f(536870912, 64); -f(545259520, 65); -f(1065353216, 127); -f(1073741824, 128); -f(1082130432, 129); -f(2139095040, 255); -f(2147483648, 256); -f(2155872256, 257); -f(4286578688, 511); -f(4294967296, 512); -f(4303355904, 513); -f(8581545984, 1023); -f(8589934592, 1024); -f(8598323200, 1025); -f(17171480576, 2047); -f(17179869184, 2048); -f(17188257792, 2049); -f(34351349760, 4095); -f(34359738368, 4096); -f(34368126976, 4097); -f(68711088128, 8191); -f(68719476736, 8192); -f(68727865344, 8193); -f(137430564864, 16383); -f(137438953472, 16384); -f(137447342080, 16385); -f(274869518336, 32767); -f(274877906944, 32768); -f(274886295552, 32769); -f(549747425280, 65535); -f(549755813888, 65536); -f(549764202496, 65537); -f(1099503239168, 131071); -f(1099511627776, 131072); -f(1099520016384, 131073); -f(2199014866944, 262143); -f(2199023255552, 262144); -f(2199031644160, 262145); -f(4398038122496, 524287); -f(4398046511104, 524288); -f(4398054899712, 524289); -f(8796084633600, 1048575); -f(8796093022208, 1048576); -f(8796101410816, 1048577); -f(17592177655808, 2097151); -f(17592186044416, 2097152); -f(17592194433024, 2097153); -f(35184363700224, 4194303); -f(35184372088832, 4194304); -f(35184380477440, 4194305); -f(70368735789056, 8388607); -f(70368744177664, 8388608); -x = 8388609; -f(0, 0); -f(8388609, 1); -f(16777218, 2); -f(25165827, 3); -f(33554436, 4); -f(41943045, 5); -f(58720263, 7); -f(67108872, 8); -f(75497481, 9); -f(125829135, 15); -f(134217744, 16); -f(142606353, 17); -f(260046879, 31); -f(268435488, 32); -f(276824097, 33); -f(528482367, 63); -f(536870976, 64); -f(545259585, 65); -f(1065353343, 127); -f(1073741952, 128); -f(1082130561, 129); -f(2139095295, 255); -f(2147483904, 256); -f(2155872513, 257); -f(4286579199, 511); -f(4294967808, 512); -f(4303356417, 513); -f(8581547007, 1023); -f(8589935616, 1024); -f(8598324225, 1025); -f(17171482623, 2047); -f(17179871232, 2048); -f(17188259841, 2049); -f(34351353855, 4095); -f(34359742464, 4096); -f(34368131073, 4097); -f(68711096319, 8191); -f(68719484928, 8192); -f(68727873537, 8193); -f(137430581247, 16383); -f(137438969856, 16384); -f(137447358465, 16385); -f(274869551103, 32767); -f(274877939712, 32768); -f(274886328321, 32769); -f(549747490815, 65535); -f(549755879424, 65536); -f(549764268033, 65537); -f(1099503370239, 131071); -f(1099511758848, 131072); -f(1099520147457, 131073); -f(2199015129087, 262143); -f(2199023517696, 262144); -f(2199031906305, 262145); -f(4398038646783, 524287); -f(4398047035392, 524288); -f(4398055424001, 524289); -f(8796085682175, 1048575); -f(8796094070784, 1048576); -f(8796102459393, 1048577); -f(17592179752959, 2097151); -f(17592188141568, 2097152); -f(17592196530177, 2097153); -f(35184367894527, 4194303); -f(35184376283136, 4194304); -f(35184384671745, 4194305); -f(70368744177663, 8388607); -f(70368752566272, 8388608); -f(70368760954881, 8388609); -x = 16777215; -f(0, 0); -f(16777215, 1); -f(33554430, 2); -f(50331645, 3); -f(67108860, 4); -f(83886075, 5); -f(117440505, 7); -f(134217720, 8); -f(150994935, 9); -f(251658225, 15); -f(268435440, 16); -f(285212655, 17); -f(520093665, 31); -f(536870880, 32); -f(553648095, 33); -f(1056964545, 63); -f(1073741760, 64); -f(1090518975, 65); -f(2130706305, 127); -f(2147483520, 128); -f(2164260735, 129); -f(4278189825, 255); -f(4294967040, 256); -f(4311744255, 257); -f(8573156865, 511); -f(8589934080, 512); -f(8606711295, 513); -f(17163090945, 1023); -f(17179868160, 1024); -f(17196645375, 1025); -f(34342959105, 2047); -f(34359736320, 2048); -f(34376513535, 2049); -f(68702695425, 4095); -f(68719472640, 4096); -f(68736249855, 4097); -f(137422168065, 8191); -f(137438945280, 8192); -f(137455722495, 8193); -f(274861113345, 16383); -f(274877890560, 16384); -f(274894667775, 16385); -f(549739003905, 32767); -f(549755781120, 32768); -f(549772558335, 32769); -f(1099494785025, 65535); -f(1099511562240, 65536); -f(1099528339455, 65537); -f(2199006347265, 131071); -f(2199023124480, 131072); -f(2199039901695, 131073); -f(4398029471745, 262143); -f(4398046248960, 262144); -f(4398063026175, 262145); -f(8796075720705, 524287); -f(8796092497920, 524288); -f(8796109275135, 524289); -f(17592168218625, 1048575); -f(17592184995840, 1048576); -f(17592201773055, 1048577); -f(35184353214465, 2097151); -f(35184369991680, 2097152); -f(35184386768895, 2097153); -f(70368723206145, 4194303); -f(70368739983360, 4194304); -f(70368756760575, 4194305); -f(140737463189505, 8388607); -f(140737479966720, 8388608); -f(140737496743935, 8388609); -f(281474943156225, 16777215); -x = 16777216; -f(0, 0); -f(16777216, 1); -f(33554432, 2); -f(50331648, 3); -f(67108864, 4); -f(83886080, 5); -f(117440512, 7); -f(134217728, 8); -f(150994944, 9); -f(251658240, 15); -f(268435456, 16); -f(285212672, 17); -f(520093696, 31); -f(536870912, 32); -f(553648128, 33); -f(1056964608, 63); -f(1073741824, 64); -f(1090519040, 65); -f(2130706432, 127); -f(2147483648, 128); -f(2164260864, 129); -f(4278190080, 255); -f(4294967296, 256); -f(4311744512, 257); -f(8573157376, 511); -f(8589934592, 512); -f(8606711808, 513); -f(17163091968, 1023); -f(17179869184, 1024); -f(17196646400, 1025); -f(34342961152, 2047); -f(34359738368, 2048); -f(34376515584, 2049); -f(68702699520, 4095); -f(68719476736, 4096); -f(68736253952, 4097); -f(137422176256, 8191); -f(137438953472, 8192); -f(137455730688, 8193); -f(274861129728, 16383); -f(274877906944, 16384); -f(274894684160, 16385); -f(549739036672, 32767); -f(549755813888, 32768); -f(549772591104, 32769); -f(1099494850560, 65535); -f(1099511627776, 65536); -f(1099528404992, 65537); -f(2199006478336, 131071); -f(2199023255552, 131072); -f(2199040032768, 131073); -f(4398029733888, 262143); -f(4398046511104, 262144); -f(4398063288320, 262145); -f(8796076244992, 524287); -f(8796093022208, 524288); -f(8796109799424, 524289); -f(17592169267200, 1048575); -f(17592186044416, 1048576); -f(17592202821632, 1048577); -f(35184355311616, 2097151); -f(35184372088832, 2097152); -f(35184388866048, 2097153); -f(70368727400448, 4194303); -f(70368744177664, 4194304); -f(70368760954880, 4194305); -f(140737471578112, 8388607); -f(140737488355328, 8388608); -f(140737505132544, 8388609); -f(281474959933440, 16777215); -f(281474976710656, 16777216); -x = 16777217; -f(0, 0); -f(16777217, 1); -f(33554434, 2); -f(50331651, 3); -f(67108868, 4); -f(83886085, 5); -f(117440519, 7); -f(134217736, 8); -f(150994953, 9); -f(251658255, 15); -f(268435472, 16); -f(285212689, 17); -f(520093727, 31); -f(536870944, 32); -f(553648161, 33); -f(1056964671, 63); -f(1073741888, 64); -f(1090519105, 65); -f(2130706559, 127); -f(2147483776, 128); -f(2164260993, 129); -f(4278190335, 255); -f(4294967552, 256); -f(4311744769, 257); -f(8573157887, 511); -f(8589935104, 512); -f(8606712321, 513); -f(17163092991, 1023); -f(17179870208, 1024); -f(17196647425, 1025); -f(34342963199, 2047); -f(34359740416, 2048); -f(34376517633, 2049); -f(68702703615, 4095); -f(68719480832, 4096); -f(68736258049, 4097); -f(137422184447, 8191); -f(137438961664, 8192); -f(137455738881, 8193); -f(274861146111, 16383); -f(274877923328, 16384); -f(274894700545, 16385); -f(549739069439, 32767); -f(549755846656, 32768); -f(549772623873, 32769); -f(1099494916095, 65535); -f(1099511693312, 65536); -f(1099528470529, 65537); -f(2199006609407, 131071); -f(2199023386624, 131072); -f(2199040163841, 131073); -f(4398029996031, 262143); -f(4398046773248, 262144); -f(4398063550465, 262145); -f(8796076769279, 524287); -f(8796093546496, 524288); -f(8796110323713, 524289); -f(17592170315775, 1048575); -f(17592187092992, 1048576); -f(17592203870209, 1048577); -f(35184357408767, 2097151); -f(35184374185984, 2097152); -f(35184390963201, 2097153); -f(70368731594751, 4194303); -f(70368748371968, 4194304); -f(70368765149185, 4194305); -f(140737479966719, 8388607); -f(140737496743936, 8388608); -f(140737513521153, 8388609); -f(281474976710655, 16777215); -f(281474993487872, 16777216); -f(281475010265089, 16777217); -x = 33554431; -f(0, 0); -f(33554431, 1); -f(67108862, 2); -f(100663293, 3); -f(134217724, 4); -f(167772155, 5); -f(234881017, 7); -f(268435448, 8); -f(301989879, 9); -f(503316465, 15); -f(536870896, 16); -f(570425327, 17); -f(1040187361, 31); -f(1073741792, 32); -f(1107296223, 33); -f(2113929153, 63); -f(2147483584, 64); -f(2181038015, 65); -f(4261412737, 127); -f(4294967168, 128); -f(4328521599, 129); -f(8556379905, 255); -f(8589934336, 256); -f(8623488767, 257); -f(17146314241, 511); -f(17179868672, 512); -f(17213423103, 513); -f(34326182913, 1023); -f(34359737344, 1024); -f(34393291775, 1025); -f(68685920257, 2047); -f(68719474688, 2048); -f(68753029119, 2049); -f(137405394945, 4095); -f(137438949376, 4096); -f(137472503807, 4097); -f(274844344321, 8191); -f(274877898752, 8192); -f(274911453183, 8193); -f(549722243073, 16383); -f(549755797504, 16384); -f(549789351935, 16385); -f(1099478040577, 32767); -f(1099511595008, 32768); -f(1099545149439, 32769); -f(2198989635585, 65535); -f(2199023190016, 65536); -f(2199056744447, 65537); -f(4398012825601, 131071); -f(4398046380032, 131072); -f(4398079934463, 131073); -f(8796059205633, 262143); -f(8796092760064, 262144); -f(8796126314495, 262145); -f(17592151965697, 524287); -f(17592185520128, 524288); -f(17592219074559, 524289); -f(35184337485825, 1048575); -f(35184371040256, 1048576); -f(35184404594687, 1048577); -f(70368708526081, 2097151); -f(70368742080512, 2097152); -f(70368775634943, 2097153); -f(140737450606593, 4194303); -f(140737484161024, 4194304); -f(140737517715455, 4194305); -f(281474934767617, 8388607); -f(281474968322048, 8388608); -f(281475001876479, 8388609); -f(562949903089665, 16777215); -f(562949936644096, 16777216); -f(562949970198527, 16777217); -f(1125899839733761, 33554431); -x = 33554432; -f(0, 0); -f(33554432, 1); -f(67108864, 2); -f(100663296, 3); -f(134217728, 4); -f(167772160, 5); -f(234881024, 7); -f(268435456, 8); -f(301989888, 9); -f(503316480, 15); -f(536870912, 16); -f(570425344, 17); -f(1040187392, 31); -f(1073741824, 32); -f(1107296256, 33); -f(2113929216, 63); -f(2147483648, 64); -f(2181038080, 65); -f(4261412864, 127); -f(4294967296, 128); -f(4328521728, 129); -f(8556380160, 255); -f(8589934592, 256); -f(8623489024, 257); -f(17146314752, 511); -f(17179869184, 512); -f(17213423616, 513); -f(34326183936, 1023); -f(34359738368, 1024); -f(34393292800, 1025); -f(68685922304, 2047); -f(68719476736, 2048); -f(68753031168, 2049); -f(137405399040, 4095); -f(137438953472, 4096); -f(137472507904, 4097); -f(274844352512, 8191); -f(274877906944, 8192); -f(274911461376, 8193); -f(549722259456, 16383); -f(549755813888, 16384); -f(549789368320, 16385); -f(1099478073344, 32767); -f(1099511627776, 32768); -f(1099545182208, 32769); -f(2198989701120, 65535); -f(2199023255552, 65536); -f(2199056809984, 65537); -f(4398012956672, 131071); -f(4398046511104, 131072); -f(4398080065536, 131073); -f(8796059467776, 262143); -f(8796093022208, 262144); -f(8796126576640, 262145); -f(17592152489984, 524287); -f(17592186044416, 524288); -f(17592219598848, 524289); -f(35184338534400, 1048575); -f(35184372088832, 1048576); -f(35184405643264, 1048577); -f(70368710623232, 2097151); -f(70368744177664, 2097152); -f(70368777732096, 2097153); -f(140737454800896, 4194303); -f(140737488355328, 4194304); -f(140737521909760, 4194305); -f(281474943156224, 8388607); -f(281474976710656, 8388608); -f(281475010265088, 8388609); -f(562949919866880, 16777215); -f(562949953421312, 16777216); -f(562949986975744, 16777217); -f(1125899873288192, 33554431); -f(1125899906842624, 33554432); -x = 33554433; -f(0, 0); -f(33554433, 1); -f(67108866, 2); -f(100663299, 3); -f(134217732, 4); -f(167772165, 5); -f(234881031, 7); -f(268435464, 8); -f(301989897, 9); -f(503316495, 15); -f(536870928, 16); -f(570425361, 17); -f(1040187423, 31); -f(1073741856, 32); -f(1107296289, 33); -f(2113929279, 63); -f(2147483712, 64); -f(2181038145, 65); -f(4261412991, 127); -f(4294967424, 128); -f(4328521857, 129); -f(8556380415, 255); -f(8589934848, 256); -f(8623489281, 257); -f(17146315263, 511); -f(17179869696, 512); -f(17213424129, 513); -f(34326184959, 1023); -f(34359739392, 1024); -f(34393293825, 1025); -f(68685924351, 2047); -f(68719478784, 2048); -f(68753033217, 2049); -f(137405403135, 4095); -f(137438957568, 4096); -f(137472512001, 4097); -f(274844360703, 8191); -f(274877915136, 8192); -f(274911469569, 8193); -f(549722275839, 16383); -f(549755830272, 16384); -f(549789384705, 16385); -f(1099478106111, 32767); -f(1099511660544, 32768); -f(1099545214977, 32769); -f(2198989766655, 65535); -f(2199023321088, 65536); -f(2199056875521, 65537); -f(4398013087743, 131071); -f(4398046642176, 131072); -f(4398080196609, 131073); -f(8796059729919, 262143); -f(8796093284352, 262144); -f(8796126838785, 262145); -f(17592153014271, 524287); -f(17592186568704, 524288); -f(17592220123137, 524289); -f(35184339582975, 1048575); -f(35184373137408, 1048576); -f(35184406691841, 1048577); -f(70368712720383, 2097151); -f(70368746274816, 2097152); -f(70368779829249, 2097153); -f(140737458995199, 4194303); -f(140737492549632, 4194304); -f(140737526104065, 4194305); -f(281474951544831, 8388607); -f(281474985099264, 8388608); -f(281475018653697, 8388609); -f(562949936644095, 16777215); -f(562949970198528, 16777216); -f(562950003752961, 16777217); -f(1125899906842623, 33554431); -f(1125899940397056, 33554432); -f(1125899973951489, 33554433); -x = 67108863; -f(0, 0); -f(67108863, 1); -f(134217726, 2); -f(201326589, 3); -f(268435452, 4); -f(335544315, 5); -f(469762041, 7); -f(536870904, 8); -f(603979767, 9); -f(1006632945, 15); -f(1073741808, 16); -f(1140850671, 17); -f(2080374753, 31); -f(2147483616, 32); -f(2214592479, 33); -f(4227858369, 63); -f(4294967232, 64); -f(4362076095, 65); -f(8522825601, 127); -f(8589934464, 128); -f(8657043327, 129); -f(17112760065, 255); -f(17179868928, 256); -f(17246977791, 257); -f(34292628993, 511); -f(34359737856, 512); -f(34426846719, 513); -f(68652366849, 1023); -f(68719475712, 1024); -f(68786584575, 1025); -f(137371842561, 2047); -f(137438951424, 2048); -f(137506060287, 2049); -f(274810793985, 4095); -f(274877902848, 4096); -f(274945011711, 4097); -f(549688696833, 8191); -f(549755805696, 8192); -f(549822914559, 8193); -f(1099444502529, 16383); -f(1099511611392, 16384); -f(1099578720255, 16385); -f(2198956113921, 32767); -f(2199023222784, 32768); -f(2199090331647, 32769); -f(4397979336705, 65535); -f(4398046445568, 65536); -f(4398113554431, 65537); -f(8796025782273, 131071); -f(8796092891136, 131072); -f(8796159999999, 131073); -f(17592118673409, 262143); -f(17592185782272, 262144); -f(17592252891135, 262145); -f(35184304455681, 524287); -f(35184371564544, 524288); -f(35184438673407, 524289); -f(70368676020225, 1048575); -f(70368743129088, 1048576); -f(70368810237951, 1048577); -f(140737419149313, 2097151); -f(140737486258176, 2097152); -f(140737553367039, 2097153); -f(281474905407489, 4194303); -f(281474972516352, 4194304); -f(281475039625215, 4194305); -f(562949877923841, 8388607); -f(562949945032704, 8388608); -f(562950012141567, 8388609); -f(1125899822956545, 16777215); -f(1125899890065408, 16777216); -f(1125899957174271, 16777217); -x = 67108864; -f(0, 0); -f(67108864, 1); -f(134217728, 2); -f(201326592, 3); -f(268435456, 4); -f(335544320, 5); -f(469762048, 7); -f(536870912, 8); -f(603979776, 9); -f(1006632960, 15); -f(1073741824, 16); -f(1140850688, 17); -f(2080374784, 31); -f(2147483648, 32); -f(2214592512, 33); -f(4227858432, 63); -f(4294967296, 64); -f(4362076160, 65); -f(8522825728, 127); -f(8589934592, 128); -f(8657043456, 129); -f(17112760320, 255); -f(17179869184, 256); -f(17246978048, 257); -f(34292629504, 511); -f(34359738368, 512); -f(34426847232, 513); -f(68652367872, 1023); -f(68719476736, 1024); -f(68786585600, 1025); -f(137371844608, 2047); -f(137438953472, 2048); -f(137506062336, 2049); -f(274810798080, 4095); -f(274877906944, 4096); -f(274945015808, 4097); -f(549688705024, 8191); -f(549755813888, 8192); -f(549822922752, 8193); -f(1099444518912, 16383); -f(1099511627776, 16384); -f(1099578736640, 16385); -f(2198956146688, 32767); -f(2199023255552, 32768); -f(2199090364416, 32769); -f(4397979402240, 65535); -f(4398046511104, 65536); -f(4398113619968, 65537); -f(8796025913344, 131071); -f(8796093022208, 131072); -f(8796160131072, 131073); -f(17592118935552, 262143); -f(17592186044416, 262144); -f(17592253153280, 262145); -f(35184304979968, 524287); -f(35184372088832, 524288); -f(35184439197696, 524289); -f(70368677068800, 1048575); -f(70368744177664, 1048576); -f(70368811286528, 1048577); -f(140737421246464, 2097151); -f(140737488355328, 2097152); -f(140737555464192, 2097153); -f(281474909601792, 4194303); -f(281474976710656, 4194304); -f(281475043819520, 4194305); -f(562949886312448, 8388607); -f(562949953421312, 8388608); -f(562950020530176, 8388609); -f(1125899839733760, 16777215); -f(1125899906842624, 16777216); -f(1125899973951488, 16777217); -x = 67108865; -f(0, 0); -f(67108865, 1); -f(134217730, 2); -f(201326595, 3); -f(268435460, 4); -f(335544325, 5); -f(469762055, 7); -f(536870920, 8); -f(603979785, 9); -f(1006632975, 15); -f(1073741840, 16); -f(1140850705, 17); -f(2080374815, 31); -f(2147483680, 32); -f(2214592545, 33); -f(4227858495, 63); -f(4294967360, 64); -f(4362076225, 65); -f(8522825855, 127); -f(8589934720, 128); -f(8657043585, 129); -f(17112760575, 255); -f(17179869440, 256); -f(17246978305, 257); -f(34292630015, 511); -f(34359738880, 512); -f(34426847745, 513); -f(68652368895, 1023); -f(68719477760, 1024); -f(68786586625, 1025); -f(137371846655, 2047); -f(137438955520, 2048); -f(137506064385, 2049); -f(274810802175, 4095); -f(274877911040, 4096); -f(274945019905, 4097); -f(549688713215, 8191); -f(549755822080, 8192); -f(549822930945, 8193); -f(1099444535295, 16383); -f(1099511644160, 16384); -f(1099578753025, 16385); -f(2198956179455, 32767); -f(2199023288320, 32768); -f(2199090397185, 32769); -f(4397979467775, 65535); -f(4398046576640, 65536); -f(4398113685505, 65537); -f(8796026044415, 131071); -f(8796093153280, 131072); -f(8796160262145, 131073); -f(17592119197695, 262143); -f(17592186306560, 262144); -f(17592253415425, 262145); -f(35184305504255, 524287); -f(35184372613120, 524288); -f(35184439721985, 524289); -f(70368678117375, 1048575); -f(70368745226240, 1048576); -f(70368812335105, 1048577); -f(140737423343615, 2097151); -f(140737490452480, 2097152); -f(140737557561345, 2097153); -f(281474913796095, 4194303); -f(281474980904960, 4194304); -f(281475048013825, 4194305); -f(562949894701055, 8388607); -f(562949961809920, 8388608); -f(562950028918785, 8388609); -f(1125899856510975, 16777215); -f(1125899923619840, 16777216); -f(1125899990728705, 16777217); -x = 134217727; -f(0, 0); -f(134217727, 1); -f(268435454, 2); -f(402653181, 3); -f(536870908, 4); -f(671088635, 5); -f(939524089, 7); -f(1073741816, 8); -f(1207959543, 9); -f(2013265905, 15); -f(2147483632, 16); -f(2281701359, 17); -f(4160749537, 31); -f(4294967264, 32); -f(4429184991, 33); -f(8455716801, 63); -f(8589934528, 64); -f(8724152255, 65); -f(17045651329, 127); -f(17179869056, 128); -f(17314086783, 129); -f(34225520385, 255); -f(34359738112, 256); -f(34493955839, 257); -f(68585258497, 511); -f(68719476224, 512); -f(68853693951, 513); -f(137304734721, 1023); -f(137438952448, 1024); -f(137573170175, 1025); -f(274743687169, 2047); -f(274877904896, 2048); -f(275012122623, 2049); -f(549621592065, 4095); -f(549755809792, 4096); -f(549890027519, 4097); -f(1099377401857, 8191); -f(1099511619584, 8192); -f(1099645837311, 8193); -f(2198889021441, 16383); -f(2199023239168, 16384); -f(2199157456895, 16385); -f(4397912260609, 32767); -f(4398046478336, 32768); -f(4398180696063, 32769); -f(8795958738945, 65535); -f(8796092956672, 65536); -f(8796227174399, 65537); -f(17592051695617, 131071); -f(17592185913344, 131072); -f(17592320131071, 131073); -f(35184237608961, 262143); -f(35184371826688, 262144); -f(35184506044415, 262145); -f(70368609435649, 524287); -f(70368743653376, 524288); -f(70368877871103, 524289); -f(140737353089025, 1048575); -f(140737487306752, 1048576); -f(140737621524479, 1048577); -f(281474840395777, 2097151); -f(281474974613504, 2097152); -f(281475108831231, 2097153); -f(562949815009281, 4194303); -f(562949949227008, 4194304); -f(562950083444735, 4194305); -f(1125899764236289, 8388607); -f(1125899898454016, 8388608); -f(1125900032671743, 8388609); -x = 134217728; -f(0, 0); -f(134217728, 1); -f(268435456, 2); -f(402653184, 3); -f(536870912, 4); -f(671088640, 5); -f(939524096, 7); -f(1073741824, 8); -f(1207959552, 9); -f(2013265920, 15); -f(2147483648, 16); -f(2281701376, 17); -f(4160749568, 31); -f(4294967296, 32); -f(4429185024, 33); -f(8455716864, 63); -f(8589934592, 64); -f(8724152320, 65); -f(17045651456, 127); -f(17179869184, 128); -f(17314086912, 129); -f(34225520640, 255); -f(34359738368, 256); -f(34493956096, 257); -f(68585259008, 511); -f(68719476736, 512); -f(68853694464, 513); -f(137304735744, 1023); -f(137438953472, 1024); -f(137573171200, 1025); -f(274743689216, 2047); -f(274877906944, 2048); -f(275012124672, 2049); -f(549621596160, 4095); -f(549755813888, 4096); -f(549890031616, 4097); -f(1099377410048, 8191); -f(1099511627776, 8192); -f(1099645845504, 8193); -f(2198889037824, 16383); -f(2199023255552, 16384); -f(2199157473280, 16385); -f(4397912293376, 32767); -f(4398046511104, 32768); -f(4398180728832, 32769); -f(8795958804480, 65535); -f(8796093022208, 65536); -f(8796227239936, 65537); -f(17592051826688, 131071); -f(17592186044416, 131072); -f(17592320262144, 131073); -f(35184237871104, 262143); -f(35184372088832, 262144); -f(35184506306560, 262145); -f(70368609959936, 524287); -f(70368744177664, 524288); -f(70368878395392, 524289); -f(140737354137600, 1048575); -f(140737488355328, 1048576); -f(140737622573056, 1048577); -f(281474842492928, 2097151); -f(281474976710656, 2097152); -f(281475110928384, 2097153); -f(562949819203584, 4194303); -f(562949953421312, 4194304); -f(562950087639040, 4194305); -f(1125899772624896, 8388607); -f(1125899906842624, 8388608); -f(1125900041060352, 8388609); -x = 134217729; -f(0, 0); -f(134217729, 1); -f(268435458, 2); -f(402653187, 3); -f(536870916, 4); -f(671088645, 5); -f(939524103, 7); -f(1073741832, 8); -f(1207959561, 9); -f(2013265935, 15); -f(2147483664, 16); -f(2281701393, 17); -f(4160749599, 31); -f(4294967328, 32); -f(4429185057, 33); -f(8455716927, 63); -f(8589934656, 64); -f(8724152385, 65); -f(17045651583, 127); -f(17179869312, 128); -f(17314087041, 129); -f(34225520895, 255); -f(34359738624, 256); -f(34493956353, 257); -f(68585259519, 511); -f(68719477248, 512); -f(68853694977, 513); -f(137304736767, 1023); -f(137438954496, 1024); -f(137573172225, 1025); -f(274743691263, 2047); -f(274877908992, 2048); -f(275012126721, 2049); -f(549621600255, 4095); -f(549755817984, 4096); -f(549890035713, 4097); -f(1099377418239, 8191); -f(1099511635968, 8192); -f(1099645853697, 8193); -f(2198889054207, 16383); -f(2199023271936, 16384); -f(2199157489665, 16385); -f(4397912326143, 32767); -f(4398046543872, 32768); -f(4398180761601, 32769); -f(8795958870015, 65535); -f(8796093087744, 65536); -f(8796227305473, 65537); -f(17592051957759, 131071); -f(17592186175488, 131072); -f(17592320393217, 131073); -f(35184238133247, 262143); -f(35184372350976, 262144); -f(35184506568705, 262145); -f(70368610484223, 524287); -f(70368744701952, 524288); -f(70368878919681, 524289); -f(140737355186175, 1048575); -f(140737489403904, 1048576); -f(140737623621633, 1048577); -f(281474844590079, 2097151); -f(281474978807808, 2097152); -f(281475113025537, 2097153); -f(562949823397887, 4194303); -f(562949957615616, 4194304); -f(562950091833345, 4194305); -f(1125899781013503, 8388607); -f(1125899915231232, 8388608); -f(1125900049448961, 8388609); -x = 268435455; -f(0, 0); -f(268435455, 1); -f(536870910, 2); -f(805306365, 3); -f(1073741820, 4); -f(1342177275, 5); -f(1879048185, 7); -f(2147483640, 8); -f(2415919095, 9); -f(4026531825, 15); -f(4294967280, 16); -f(4563402735, 17); -f(8321499105, 31); -f(8589934560, 32); -f(8858370015, 33); -f(16911433665, 63); -f(17179869120, 64); -f(17448304575, 65); -f(34091302785, 127); -f(34359738240, 128); -f(34628173695, 129); -f(68451041025, 255); -f(68719476480, 256); -f(68987911935, 257); -f(137170517505, 511); -f(137438952960, 512); -f(137707388415, 513); -f(274609470465, 1023); -f(274877905920, 1024); -f(275146341375, 1025); -f(549487376385, 2047); -f(549755811840, 2048); -f(550024247295, 2049); -f(1099243188225, 4095); -f(1099511623680, 4096); -f(1099780059135, 4097); -f(2198754811905, 8191); -f(2199023247360, 8192); -f(2199291682815, 8193); -f(4397778059265, 16383); -f(4398046494720, 16384); -f(4398314930175, 16385); -f(8795824553985, 32767); -f(8796092989440, 32768); -f(8796361424895, 32769); -f(17591917543425, 65535); -f(17592185978880, 65536); -f(17592454414335, 65537); -f(35184103522305, 131071); -f(35184371957760, 131072); -f(35184640393215, 131073); -f(70368475480065, 262143); -f(70368743915520, 262144); -f(70369012350975, 262145); -f(140737219395585, 524287); -f(140737487831040, 524288); -f(140737756266495, 524289); -f(281474707226625, 1048575); -f(281474975662080, 1048576); -f(281475244097535, 1048577); -f(562949682888705, 2097151); -f(562949951324160, 2097152); -f(562950219759615, 2097153); -f(1125899634212865, 4194303); -f(1125899902648320, 4194304); -f(1125900171083775, 4194305); -x = 268435456; -f(0, 0); -f(268435456, 1); -f(536870912, 2); -f(805306368, 3); -f(1073741824, 4); -f(1342177280, 5); -f(1879048192, 7); -f(2147483648, 8); -f(2415919104, 9); -f(4026531840, 15); -f(4294967296, 16); -f(4563402752, 17); -f(8321499136, 31); -f(8589934592, 32); -f(8858370048, 33); -f(16911433728, 63); -f(17179869184, 64); -f(17448304640, 65); -f(34091302912, 127); -f(34359738368, 128); -f(34628173824, 129); -f(68451041280, 255); -f(68719476736, 256); -f(68987912192, 257); -f(137170518016, 511); -f(137438953472, 512); -f(137707388928, 513); -f(274609471488, 1023); -f(274877906944, 1024); -f(275146342400, 1025); -f(549487378432, 2047); -f(549755813888, 2048); -f(550024249344, 2049); -f(1099243192320, 4095); -f(1099511627776, 4096); -f(1099780063232, 4097); -f(2198754820096, 8191); -f(2199023255552, 8192); -f(2199291691008, 8193); -f(4397778075648, 16383); -f(4398046511104, 16384); -f(4398314946560, 16385); -f(8795824586752, 32767); -f(8796093022208, 32768); -f(8796361457664, 32769); -f(17591917608960, 65535); -f(17592186044416, 65536); -f(17592454479872, 65537); -f(35184103653376, 131071); -f(35184372088832, 131072); -f(35184640524288, 131073); -f(70368475742208, 262143); -f(70368744177664, 262144); -f(70369012613120, 262145); -f(140737219919872, 524287); -f(140737488355328, 524288); -f(140737756790784, 524289); -f(281474708275200, 1048575); -f(281474976710656, 1048576); -f(281475245146112, 1048577); -f(562949684985856, 2097151); -f(562949953421312, 2097152); -f(562950221856768, 2097153); -f(1125899638407168, 4194303); -f(1125899906842624, 4194304); -f(1125900175278080, 4194305); -x = 268435457; -f(0, 0); -f(268435457, 1); -f(536870914, 2); -f(805306371, 3); -f(1073741828, 4); -f(1342177285, 5); -f(1879048199, 7); -f(2147483656, 8); -f(2415919113, 9); -f(4026531855, 15); -f(4294967312, 16); -f(4563402769, 17); -f(8321499167, 31); -f(8589934624, 32); -f(8858370081, 33); -f(16911433791, 63); -f(17179869248, 64); -f(17448304705, 65); -f(34091303039, 127); -f(34359738496, 128); -f(34628173953, 129); -f(68451041535, 255); -f(68719476992, 256); -f(68987912449, 257); -f(137170518527, 511); -f(137438953984, 512); -f(137707389441, 513); -f(274609472511, 1023); -f(274877907968, 1024); -f(275146343425, 1025); -f(549487380479, 2047); -f(549755815936, 2048); -f(550024251393, 2049); -f(1099243196415, 4095); -f(1099511631872, 4096); -f(1099780067329, 4097); -f(2198754828287, 8191); -f(2199023263744, 8192); -f(2199291699201, 8193); -f(4397778092031, 16383); -f(4398046527488, 16384); -f(4398314962945, 16385); -f(8795824619519, 32767); -f(8796093054976, 32768); -f(8796361490433, 32769); -f(17591917674495, 65535); -f(17592186109952, 65536); -f(17592454545409, 65537); -f(35184103784447, 131071); -f(35184372219904, 131072); -f(35184640655361, 131073); -f(70368476004351, 262143); -f(70368744439808, 262144); -f(70369012875265, 262145); -f(140737220444159, 524287); -f(140737488879616, 524288); -f(140737757315073, 524289); -f(281474709323775, 1048575); -f(281474977759232, 1048576); -f(281475246194689, 1048577); -f(562949687083007, 2097151); -f(562949955518464, 2097152); -f(562950223953921, 2097153); -f(1125899642601471, 4194303); -f(1125899911036928, 4194304); -f(1125900179472385, 4194305); -x = 536870911; -f(0, 0); -f(536870911, 1); -f(1073741822, 2); -f(1610612733, 3); -f(2147483644, 4); -f(2684354555, 5); -f(3758096377, 7); -f(4294967288, 8); -f(4831838199, 9); -f(8053063665, 15); -f(8589934576, 16); -f(9126805487, 17); -f(16642998241, 31); -f(17179869152, 32); -f(17716740063, 33); -f(33822867393, 63); -f(34359738304, 64); -f(34896609215, 65); -f(68182605697, 127); -f(68719476608, 128); -f(69256347519, 129); -f(136902082305, 255); -f(137438953216, 256); -f(137975824127, 257); -f(274341035521, 511); -f(274877906432, 512); -f(275414777343, 513); -f(549218941953, 1023); -f(549755812864, 1024); -f(550292683775, 1025); -f(1098974754817, 2047); -f(1099511625728, 2048); -f(1100048496639, 2049); -f(2198486380545, 4095); -f(2199023251456, 4096); -f(2199560122367, 4097); -f(4397509632001, 8191); -f(4398046502912, 8192); -f(4398583373823, 8193); -f(8795556134913, 16383); -f(8796093005824, 16384); -f(8796629876735, 16385); -f(17591649140737, 32767); -f(17592186011648, 32768); -f(17592722882559, 32769); -f(35183835152385, 65535); -f(35184372023296, 65536); -f(35184908894207, 65537); -f(70368207175681, 131071); -f(70368744046592, 131072); -f(70369280917503, 131073); -f(140736951222273, 262143); -f(140737488093184, 262144); -f(140738024964095, 262145); -f(281474439315457, 524287); -f(281474976186368, 524288); -f(281475513057279, 524289); -f(562949415501825, 1048575); -f(562949952372736, 1048576); -f(562950489243647, 1048577); -f(1125899367874561, 2097151); -f(1125899904745472, 2097152); -f(1125900441616383, 2097153); -x = 536870912; -f(0, 0); -f(536870912, 1); -f(1073741824, 2); -f(1610612736, 3); -f(2147483648, 4); -f(2684354560, 5); -f(3758096384, 7); -f(4294967296, 8); -f(4831838208, 9); -f(8053063680, 15); -f(8589934592, 16); -f(9126805504, 17); -f(16642998272, 31); -f(17179869184, 32); -f(17716740096, 33); -f(33822867456, 63); -f(34359738368, 64); -f(34896609280, 65); -f(68182605824, 127); -f(68719476736, 128); -f(69256347648, 129); -f(136902082560, 255); -f(137438953472, 256); -f(137975824384, 257); -f(274341036032, 511); -f(274877906944, 512); -f(275414777856, 513); -f(549218942976, 1023); -f(549755813888, 1024); -f(550292684800, 1025); -f(1098974756864, 2047); -f(1099511627776, 2048); -f(1100048498688, 2049); -f(2198486384640, 4095); -f(2199023255552, 4096); -f(2199560126464, 4097); -f(4397509640192, 8191); -f(4398046511104, 8192); -f(4398583382016, 8193); -f(8795556151296, 16383); -f(8796093022208, 16384); -f(8796629893120, 16385); -f(17591649173504, 32767); -f(17592186044416, 32768); -f(17592722915328, 32769); -f(35183835217920, 65535); -f(35184372088832, 65536); -f(35184908959744, 65537); -f(70368207306752, 131071); -f(70368744177664, 131072); -f(70369281048576, 131073); -f(140736951484416, 262143); -f(140737488355328, 262144); -f(140738025226240, 262145); -f(281474439839744, 524287); -f(281474976710656, 524288); -f(281475513581568, 524289); -f(562949416550400, 1048575); -f(562949953421312, 1048576); -f(562950490292224, 1048577); -f(1125899369971712, 2097151); -f(1125899906842624, 2097152); -f(1125900443713536, 2097153); -x = 536870913; -f(0, 0); -f(536870913, 1); -f(1073741826, 2); -f(1610612739, 3); -f(2147483652, 4); -f(2684354565, 5); -f(3758096391, 7); -f(4294967304, 8); -f(4831838217, 9); -f(8053063695, 15); -f(8589934608, 16); -f(9126805521, 17); -f(16642998303, 31); -f(17179869216, 32); -f(17716740129, 33); -f(33822867519, 63); -f(34359738432, 64); -f(34896609345, 65); -f(68182605951, 127); -f(68719476864, 128); -f(69256347777, 129); -f(136902082815, 255); -f(137438953728, 256); -f(137975824641, 257); -f(274341036543, 511); -f(274877907456, 512); -f(275414778369, 513); -f(549218943999, 1023); -f(549755814912, 1024); -f(550292685825, 1025); -f(1098974758911, 2047); -f(1099511629824, 2048); -f(1100048500737, 2049); -f(2198486388735, 4095); -f(2199023259648, 4096); -f(2199560130561, 4097); -f(4397509648383, 8191); -f(4398046519296, 8192); -f(4398583390209, 8193); -f(8795556167679, 16383); -f(8796093038592, 16384); -f(8796629909505, 16385); -f(17591649206271, 32767); -f(17592186077184, 32768); -f(17592722948097, 32769); -f(35183835283455, 65535); -f(35184372154368, 65536); -f(35184909025281, 65537); -f(70368207437823, 131071); -f(70368744308736, 131072); -f(70369281179649, 131073); -f(140736951746559, 262143); -f(140737488617472, 262144); -f(140738025488385, 262145); -f(281474440364031, 524287); -f(281474977234944, 524288); -f(281475514105857, 524289); -f(562949417598975, 1048575); -f(562949954469888, 1048576); -f(562950491340801, 1048577); -f(1125899372068863, 2097151); -f(1125899908939776, 2097152); -f(1125900445810689, 2097153); -x = 1073741823; -f(0, 0); -f(1073741823, 1); -f(2147483646, 2); -f(3221225469, 3); -f(4294967292, 4); -f(5368709115, 5); -f(7516192761, 7); -f(8589934584, 8); -f(9663676407, 9); -f(16106127345, 15); -f(17179869168, 16); -f(18253610991, 17); -f(33285996513, 31); -f(34359738336, 32); -f(35433480159, 33); -f(67645734849, 63); -f(68719476672, 64); -f(69793218495, 65); -f(136365211521, 127); -f(137438953344, 128); -f(138512695167, 129); -f(273804164865, 255); -f(274877906688, 256); -f(275951648511, 257); -f(548682071553, 511); -f(549755813376, 512); -f(550829555199, 513); -f(1098437884929, 1023); -f(1099511626752, 1024); -f(1100585368575, 1025); -f(2197949511681, 2047); -f(2199023253504, 2048); -f(2200096995327, 2049); -f(4396972765185, 4095); -f(4398046507008, 4096); -f(4399120248831, 4097); -f(8795019272193, 8191); -f(8796093014016, 8192); -f(8797166755839, 8193); -f(17591112286209, 16383); -f(17592186028032, 16384); -f(17593259769855, 16385); -f(35183298314241, 32767); -f(35184372056064, 32768); -f(35185445797887, 32769); -f(70367670370305, 65535); -f(70368744112128, 65536); -f(70369817853951, 65537); -f(140736414482433, 131071); -f(140737488224256, 131072); -f(140738561966079, 131073); -f(281473902706689, 262143); -f(281474976448512, 262144); -f(281476050190335, 262145); -f(562948879155201, 524287); -f(562949952897024, 524288); -f(562951026638847, 524289); -f(1125898832052225, 1048575); -f(1125899905794048, 1048576); -f(1125900979535871, 1048577); -x = 1073741824; -f(0, 0); -f(1073741824, 1); -f(2147483648, 2); -f(3221225472, 3); -f(4294967296, 4); -f(5368709120, 5); -f(7516192768, 7); -f(8589934592, 8); -f(9663676416, 9); -f(16106127360, 15); -f(17179869184, 16); -f(18253611008, 17); -f(33285996544, 31); -f(34359738368, 32); -f(35433480192, 33); -f(67645734912, 63); -f(68719476736, 64); -f(69793218560, 65); -f(136365211648, 127); -f(137438953472, 128); -f(138512695296, 129); -f(273804165120, 255); -f(274877906944, 256); -f(275951648768, 257); -f(548682072064, 511); -f(549755813888, 512); -f(550829555712, 513); -f(1098437885952, 1023); -f(1099511627776, 1024); -f(1100585369600, 1025); -f(2197949513728, 2047); -f(2199023255552, 2048); -f(2200096997376, 2049); -f(4396972769280, 4095); -f(4398046511104, 4096); -f(4399120252928, 4097); -f(8795019280384, 8191); -f(8796093022208, 8192); -f(8797166764032, 8193); -f(17591112302592, 16383); -f(17592186044416, 16384); -f(17593259786240, 16385); -f(35183298347008, 32767); -f(35184372088832, 32768); -f(35185445830656, 32769); -f(70367670435840, 65535); -f(70368744177664, 65536); -f(70369817919488, 65537); -f(140736414613504, 131071); -f(140737488355328, 131072); -f(140738562097152, 131073); -f(281473902968832, 262143); -f(281474976710656, 262144); -f(281476050452480, 262145); -f(562948879679488, 524287); -f(562949953421312, 524288); -f(562951027163136, 524289); -f(1125898833100800, 1048575); -f(1125899906842624, 1048576); -f(1125900980584448, 1048577); -x = 1073741825; -f(0, 0); -f(1073741825, 1); -f(2147483650, 2); -f(3221225475, 3); -f(4294967300, 4); -f(5368709125, 5); -f(7516192775, 7); -f(8589934600, 8); -f(9663676425, 9); -f(16106127375, 15); -f(17179869200, 16); -f(18253611025, 17); -f(33285996575, 31); -f(34359738400, 32); -f(35433480225, 33); -f(67645734975, 63); -f(68719476800, 64); -f(69793218625, 65); -f(136365211775, 127); -f(137438953600, 128); -f(138512695425, 129); -f(273804165375, 255); -f(274877907200, 256); -f(275951649025, 257); -f(548682072575, 511); -f(549755814400, 512); -f(550829556225, 513); -f(1098437886975, 1023); -f(1099511628800, 1024); -f(1100585370625, 1025); -f(2197949515775, 2047); -f(2199023257600, 2048); -f(2200096999425, 2049); -f(4396972773375, 4095); -f(4398046515200, 4096); -f(4399120257025, 4097); -f(8795019288575, 8191); -f(8796093030400, 8192); -f(8797166772225, 8193); -f(17591112318975, 16383); -f(17592186060800, 16384); -f(17593259802625, 16385); -f(35183298379775, 32767); -f(35184372121600, 32768); -f(35185445863425, 32769); -f(70367670501375, 65535); -f(70368744243200, 65536); -f(70369817985025, 65537); -f(140736414744575, 131071); -f(140737488486400, 131072); -f(140738562228225, 131073); -f(281473903230975, 262143); -f(281474976972800, 262144); -f(281476050714625, 262145); -f(562948880203775, 524287); -f(562949953945600, 524288); -f(562951027687425, 524289); -f(1125898834149375, 1048575); -f(1125899907891200, 1048576); -f(1125900981633025, 1048577); -x = 2147483647; -f(0, 0); -f(2147483647, 1); -f(4294967294, 2); -f(6442450941, 3); -f(8589934588, 4); -f(10737418235, 5); -f(15032385529, 7); -f(17179869176, 8); -f(19327352823, 9); -f(32212254705, 15); -f(34359738352, 16); -f(36507221999, 17); -f(66571993057, 31); -f(68719476704, 32); -f(70866960351, 33); -f(135291469761, 63); -f(137438953408, 64); -f(139586437055, 65); -f(272730423169, 127); -f(274877906816, 128); -f(277025390463, 129); -f(547608329985, 255); -f(549755813632, 256); -f(551903297279, 257); -f(1097364143617, 511); -f(1099511627264, 512); -f(1101659110911, 513); -f(2196875770881, 1023); -f(2199023254528, 1024); -f(2201170738175, 1025); -f(4395899025409, 2047); -f(4398046509056, 2048); -f(4400193992703, 2049); -f(8793945534465, 4095); -f(8796093018112, 4096); -f(8798240501759, 4097); -f(17590038552577, 8191); -f(17592186036224, 8192); -f(17594333519871, 8193); -f(35182224588801, 16383); -f(35184372072448, 16384); -f(35186519556095, 16385); -f(70366596661249, 32767); -f(70368744144896, 32768); -f(70370891628543, 32769); -f(140735340806145, 65535); -f(140737488289792, 65536); -f(140739635773439, 65537); -f(281472829095937, 131071); -f(281474976579584, 131072); -f(281477124063231, 131073); -f(562947805675521, 262143); -f(562949953159168, 262144); -f(562952100642815, 262145); -f(1125897758834689, 524287); -f(1125899906318336, 524288); -f(1125902053801983, 524289); -x = 2147483648; -f(0, 0); -f(2147483648, 1); -f(4294967296, 2); -f(6442450944, 3); -f(8589934592, 4); -f(10737418240, 5); -f(15032385536, 7); -f(17179869184, 8); -f(19327352832, 9); -f(32212254720, 15); -f(34359738368, 16); -f(36507222016, 17); -f(66571993088, 31); -f(68719476736, 32); -f(70866960384, 33); -f(135291469824, 63); -f(137438953472, 64); -f(139586437120, 65); -f(272730423296, 127); -f(274877906944, 128); -f(277025390592, 129); -f(547608330240, 255); -f(549755813888, 256); -f(551903297536, 257); -f(1097364144128, 511); -f(1099511627776, 512); -f(1101659111424, 513); -f(2196875771904, 1023); -f(2199023255552, 1024); -f(2201170739200, 1025); -f(4395899027456, 2047); -f(4398046511104, 2048); -f(4400193994752, 2049); -f(8793945538560, 4095); -f(8796093022208, 4096); -f(8798240505856, 4097); -f(17590038560768, 8191); -f(17592186044416, 8192); -f(17594333528064, 8193); -f(35182224605184, 16383); -f(35184372088832, 16384); -f(35186519572480, 16385); -f(70366596694016, 32767); -f(70368744177664, 32768); -f(70370891661312, 32769); -f(140735340871680, 65535); -f(140737488355328, 65536); -f(140739635838976, 65537); -f(281472829227008, 131071); -f(281474976710656, 131072); -f(281477124194304, 131073); -f(562947805937664, 262143); -f(562949953421312, 262144); -f(562952100904960, 262145); -f(1125897759358976, 524287); -f(1125899906842624, 524288); -f(1125902054326272, 524289); -x = 2147483649; -f(0, 0); -f(2147483649, 1); -f(4294967298, 2); -f(6442450947, 3); -f(8589934596, 4); -f(10737418245, 5); -f(15032385543, 7); -f(17179869192, 8); -f(19327352841, 9); -f(32212254735, 15); -f(34359738384, 16); -f(36507222033, 17); -f(66571993119, 31); -f(68719476768, 32); -f(70866960417, 33); -f(135291469887, 63); -f(137438953536, 64); -f(139586437185, 65); -f(272730423423, 127); -f(274877907072, 128); -f(277025390721, 129); -f(547608330495, 255); -f(549755814144, 256); -f(551903297793, 257); -f(1097364144639, 511); -f(1099511628288, 512); -f(1101659111937, 513); -f(2196875772927, 1023); -f(2199023256576, 1024); -f(2201170740225, 1025); -f(4395899029503, 2047); -f(4398046513152, 2048); -f(4400193996801, 2049); -f(8793945542655, 4095); -f(8796093026304, 4096); -f(8798240509953, 4097); -f(17590038568959, 8191); -f(17592186052608, 8192); -f(17594333536257, 8193); -f(35182224621567, 16383); -f(35184372105216, 16384); -f(35186519588865, 16385); -f(70366596726783, 32767); -f(70368744210432, 32768); -f(70370891694081, 32769); -f(140735340937215, 65535); -f(140737488420864, 65536); -f(140739635904513, 65537); -f(281472829358079, 131071); -f(281474976841728, 131072); -f(281477124325377, 131073); -f(562947806199807, 262143); -f(562949953683456, 262144); -f(562952101167105, 262145); -f(1125897759883263, 524287); -f(1125899907366912, 524288); -f(1125902054850561, 524289); -x = 4294967295; -f(0, 0); -f(4294967295, 1); -f(8589934590, 2); -f(12884901885, 3); -f(17179869180, 4); -f(21474836475, 5); -f(30064771065, 7); -f(34359738360, 8); -f(38654705655, 9); -f(64424509425, 15); -f(68719476720, 16); -f(73014444015, 17); -f(133143986145, 31); -f(137438953440, 32); -f(141733920735, 33); -f(270582939585, 63); -f(274877906880, 64); -f(279172874175, 65); -f(545460846465, 127); -f(549755813760, 128); -f(554050781055, 129); -f(1095216660225, 255); -f(1099511627520, 256); -f(1103806594815, 257); -f(2194728287745, 511); -f(2199023255040, 512); -f(2203318222335, 513); -f(4393751542785, 1023); -f(4398046510080, 1024); -f(4402341477375, 1025); -f(8791798052865, 2047); -f(8796093020160, 2048); -f(8800387987455, 2049); -f(17587891073025, 4095); -f(17592186040320, 4096); -f(17596481007615, 4097); -f(35180077113345, 8191); -f(35184372080640, 8192); -f(35188667047935, 8193); -f(70364449193985, 16383); -f(70368744161280, 16384); -f(70373039128575, 16385); -f(140733193355265, 32767); -f(140737488322560, 32768); -f(140741783289855, 32769); -f(281470681677825, 65535); -f(281474976645120, 65536); -f(281479271612415, 65537); -f(562945658322945, 131071); -f(562949953290240, 131072); -f(562954248257535, 131073); -f(1125895611613185, 262143); -f(1125899906580480, 262144); -f(1125904201547775, 262145); -x = 4294967296; -f(0, 0); -f(4294967296, 1); -f(8589934592, 2); -f(12884901888, 3); -f(17179869184, 4); -f(21474836480, 5); -f(30064771072, 7); -f(34359738368, 8); -f(38654705664, 9); -f(64424509440, 15); -f(68719476736, 16); -f(73014444032, 17); -f(133143986176, 31); -f(137438953472, 32); -f(141733920768, 33); -f(270582939648, 63); -f(274877906944, 64); -f(279172874240, 65); -f(545460846592, 127); -f(549755813888, 128); -f(554050781184, 129); -f(1095216660480, 255); -f(1099511627776, 256); -f(1103806595072, 257); -f(2194728288256, 511); -f(2199023255552, 512); -f(2203318222848, 513); -f(4393751543808, 1023); -f(4398046511104, 1024); -f(4402341478400, 1025); -f(8791798054912, 2047); -f(8796093022208, 2048); -f(8800387989504, 2049); -f(17587891077120, 4095); -f(17592186044416, 4096); -f(17596481011712, 4097); -f(35180077121536, 8191); -f(35184372088832, 8192); -f(35188667056128, 8193); -f(70364449210368, 16383); -f(70368744177664, 16384); -f(70373039144960, 16385); -f(140733193388032, 32767); -f(140737488355328, 32768); -f(140741783322624, 32769); -f(281470681743360, 65535); -f(281474976710656, 65536); -f(281479271677952, 65537); -f(562945658454016, 131071); -f(562949953421312, 131072); -f(562954248388608, 131073); -f(1125895611875328, 262143); -f(1125899906842624, 262144); -f(1125904201809920, 262145); -x = 4294967297; -f(0, 0); -f(4294967297, 1); -f(8589934594, 2); -f(12884901891, 3); -f(17179869188, 4); -f(21474836485, 5); -f(30064771079, 7); -f(34359738376, 8); -f(38654705673, 9); -f(64424509455, 15); -f(68719476752, 16); -f(73014444049, 17); -f(133143986207, 31); -f(137438953504, 32); -f(141733920801, 33); -f(270582939711, 63); -f(274877907008, 64); -f(279172874305, 65); -f(545460846719, 127); -f(549755814016, 128); -f(554050781313, 129); -f(1095216660735, 255); -f(1099511628032, 256); -f(1103806595329, 257); -f(2194728288767, 511); -f(2199023256064, 512); -f(2203318223361, 513); -f(4393751544831, 1023); -f(4398046512128, 1024); -f(4402341479425, 1025); -f(8791798056959, 2047); -f(8796093024256, 2048); -f(8800387991553, 2049); -f(17587891081215, 4095); -f(17592186048512, 4096); -f(17596481015809, 4097); -f(35180077129727, 8191); -f(35184372097024, 8192); -f(35188667064321, 8193); -f(70364449226751, 16383); -f(70368744194048, 16384); -f(70373039161345, 16385); -f(140733193420799, 32767); -f(140737488388096, 32768); -f(140741783355393, 32769); -f(281470681808895, 65535); -f(281474976776192, 65536); -f(281479271743489, 65537); -f(562945658585087, 131071); -f(562949953552384, 131072); -f(562954248519681, 131073); -f(1125895612137471, 262143); -f(1125899907104768, 262144); -f(1125904202072065, 262145); -x = 8589934591; -f(0, 0); -f(8589934591, 1); -f(17179869182, 2); -f(25769803773, 3); -f(34359738364, 4); -f(42949672955, 5); -f(60129542137, 7); -f(68719476728, 8); -f(77309411319, 9); -f(128849018865, 15); -f(137438953456, 16); -f(146028888047, 17); -f(266287972321, 31); -f(274877906912, 32); -f(283467841503, 33); -f(541165879233, 63); -f(549755813824, 64); -f(558345748415, 65); -f(1090921693057, 127); -f(1099511627648, 128); -f(1108101562239, 129); -f(2190433320705, 255); -f(2199023255296, 256); -f(2207613189887, 257); -f(4389456576001, 511); -f(4398046510592, 512); -f(4406636445183, 513); -f(8787503086593, 1023); -f(8796093021184, 1024); -f(8804682955775, 1025); -f(17583596107777, 2047); -f(17592186042368, 2048); -f(17600775976959, 2049); -f(35175782150145, 4095); -f(35184372084736, 4096); -f(35192962019327, 4097); -f(70360154234881, 8191); -f(70368744169472, 8192); -f(70377334104063, 8193); -f(140728898404353, 16383); -f(140737488338944, 16384); -f(140746078273535, 16385); -f(281466386743297, 32767); -f(281474976677888, 32768); -f(281483566612479, 32769); -f(562941363421185, 65535); -f(562949953355776, 65536); -f(562958543290367, 65537); -f(1125891316776961, 131071); -f(1125899906711552, 131072); -f(1125908496646143, 131073); -x = 8589934592; -f(0, 0); -f(8589934592, 1); -f(17179869184, 2); -f(25769803776, 3); -f(34359738368, 4); -f(42949672960, 5); -f(60129542144, 7); -f(68719476736, 8); -f(77309411328, 9); -f(128849018880, 15); -f(137438953472, 16); -f(146028888064, 17); -f(266287972352, 31); -f(274877906944, 32); -f(283467841536, 33); -f(541165879296, 63); -f(549755813888, 64); -f(558345748480, 65); -f(1090921693184, 127); -f(1099511627776, 128); -f(1108101562368, 129); -f(2190433320960, 255); -f(2199023255552, 256); -f(2207613190144, 257); -f(4389456576512, 511); -f(4398046511104, 512); -f(4406636445696, 513); -f(8787503087616, 1023); -f(8796093022208, 1024); -f(8804682956800, 1025); -f(17583596109824, 2047); -f(17592186044416, 2048); -f(17600775979008, 2049); -f(35175782154240, 4095); -f(35184372088832, 4096); -f(35192962023424, 4097); -f(70360154243072, 8191); -f(70368744177664, 8192); -f(70377334112256, 8193); -f(140728898420736, 16383); -f(140737488355328, 16384); -f(140746078289920, 16385); -f(281466386776064, 32767); -f(281474976710656, 32768); -f(281483566645248, 32769); -f(562941363486720, 65535); -f(562949953421312, 65536); -f(562958543355904, 65537); -f(1125891316908032, 131071); -f(1125899906842624, 131072); -f(1125908496777216, 131073); -x = 8589934593; -f(0, 0); -f(8589934593, 1); -f(17179869186, 2); -f(25769803779, 3); -f(34359738372, 4); -f(42949672965, 5); -f(60129542151, 7); -f(68719476744, 8); -f(77309411337, 9); -f(128849018895, 15); -f(137438953488, 16); -f(146028888081, 17); -f(266287972383, 31); -f(274877906976, 32); -f(283467841569, 33); -f(541165879359, 63); -f(549755813952, 64); -f(558345748545, 65); -f(1090921693311, 127); -f(1099511627904, 128); -f(1108101562497, 129); -f(2190433321215, 255); -f(2199023255808, 256); -f(2207613190401, 257); -f(4389456577023, 511); -f(4398046511616, 512); -f(4406636446209, 513); -f(8787503088639, 1023); -f(8796093023232, 1024); -f(8804682957825, 1025); -f(17583596111871, 2047); -f(17592186046464, 2048); -f(17600775981057, 2049); -f(35175782158335, 4095); -f(35184372092928, 4096); -f(35192962027521, 4097); -f(70360154251263, 8191); -f(70368744185856, 8192); -f(70377334120449, 8193); -f(140728898437119, 16383); -f(140737488371712, 16384); -f(140746078306305, 16385); -f(281466386808831, 32767); -f(281474976743424, 32768); -f(281483566678017, 32769); -f(562941363552255, 65535); -f(562949953486848, 65536); -f(562958543421441, 65537); -f(1125891317039103, 131071); -f(1125899906973696, 131072); -f(1125908496908289, 131073); -x = 17179869183; -f(0, 0); -f(17179869183, 1); -f(34359738366, 2); -f(51539607549, 3); -f(68719476732, 4); -f(85899345915, 5); -f(120259084281, 7); -f(137438953464, 8); -f(154618822647, 9); -f(257698037745, 15); -f(274877906928, 16); -f(292057776111, 17); -f(532575944673, 31); -f(549755813856, 32); -f(566935683039, 33); -f(1082331758529, 63); -f(1099511627712, 64); -f(1116691496895, 65); -f(2181843386241, 127); -f(2199023255424, 128); -f(2216203124607, 129); -f(4380866641665, 255); -f(4398046510848, 256); -f(4415226380031, 257); -f(8778913152513, 511); -f(8796093021696, 512); -f(8813272890879, 513); -f(17575006174209, 1023); -f(17592186043392, 1024); -f(17609365912575, 1025); -f(35167192217601, 2047); -f(35184372086784, 2048); -f(35201551955967, 2049); -f(70351564304385, 4095); -f(70368744173568, 4096); -f(70385924042751, 4097); -f(140720308477953, 8191); -f(140737488347136, 8192); -f(140754668216319, 8193); -f(281457796825089, 16383); -f(281474976694272, 16384); -f(281492156563455, 16385); -f(562932773519361, 32767); -f(562949953388544, 32768); -f(562967133257727, 32769); -f(1125882726907905, 65535); -f(1125899906777088, 65536); -f(1125917086646271, 65537); -x = 17179869184; -f(0, 0); -f(17179869184, 1); -f(34359738368, 2); -f(51539607552, 3); -f(68719476736, 4); -f(85899345920, 5); -f(120259084288, 7); -f(137438953472, 8); -f(154618822656, 9); -f(257698037760, 15); -f(274877906944, 16); -f(292057776128, 17); -f(532575944704, 31); -f(549755813888, 32); -f(566935683072, 33); -f(1082331758592, 63); -f(1099511627776, 64); -f(1116691496960, 65); -f(2181843386368, 127); -f(2199023255552, 128); -f(2216203124736, 129); -f(4380866641920, 255); -f(4398046511104, 256); -f(4415226380288, 257); -f(8778913153024, 511); -f(8796093022208, 512); -f(8813272891392, 513); -f(17575006175232, 1023); -f(17592186044416, 1024); -f(17609365913600, 1025); -f(35167192219648, 2047); -f(35184372088832, 2048); -f(35201551958016, 2049); -f(70351564308480, 4095); -f(70368744177664, 4096); -f(70385924046848, 4097); -f(140720308486144, 8191); -f(140737488355328, 8192); -f(140754668224512, 8193); -f(281457796841472, 16383); -f(281474976710656, 16384); -f(281492156579840, 16385); -f(562932773552128, 32767); -f(562949953421312, 32768); -f(562967133290496, 32769); -f(1125882726973440, 65535); -f(1125899906842624, 65536); -f(1125917086711808, 65537); -x = 17179869185; -f(0, 0); -f(17179869185, 1); -f(34359738370, 2); -f(51539607555, 3); -f(68719476740, 4); -f(85899345925, 5); -f(120259084295, 7); -f(137438953480, 8); -f(154618822665, 9); -f(257698037775, 15); -f(274877906960, 16); -f(292057776145, 17); -f(532575944735, 31); -f(549755813920, 32); -f(566935683105, 33); -f(1082331758655, 63); -f(1099511627840, 64); -f(1116691497025, 65); -f(2181843386495, 127); -f(2199023255680, 128); -f(2216203124865, 129); -f(4380866642175, 255); -f(4398046511360, 256); -f(4415226380545, 257); -f(8778913153535, 511); -f(8796093022720, 512); -f(8813272891905, 513); -f(17575006176255, 1023); -f(17592186045440, 1024); -f(17609365914625, 1025); -f(35167192221695, 2047); -f(35184372090880, 2048); -f(35201551960065, 2049); -f(70351564312575, 4095); -f(70368744181760, 4096); -f(70385924050945, 4097); -f(140720308494335, 8191); -f(140737488363520, 8192); -f(140754668232705, 8193); -f(281457796857855, 16383); -f(281474976727040, 16384); -f(281492156596225, 16385); -f(562932773584895, 32767); -f(562949953454080, 32768); -f(562967133323265, 32769); -f(1125882727038975, 65535); -f(1125899906908160, 65536); -f(1125917086777345, 65537); -- 2.7.4