tests.inc 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. Test:y_cell_ReverseBits0()
  2. {
  3. ASSERT(Cell_ReverseBits(0) == 0x00000000);
  4. ASSERT(Cell_ReverseBits(1) == 0x80000000);
  5. ASSERT(Cell_ReverseBits(2) == 0x40000000);
  6. ASSERT(Cell_ReverseBits(3) == 0xC0000000);
  7. ASSERT(Cell_ReverseBits(4) == 0x20000000);
  8. ASSERT(Cell_ReverseBits(0b01010101010) == 0b01010101010000000000000000000000);
  9. ASSERT(Cell_ReverseBits(0b1111000001111000011) == 0b11000011110000011110000000000000);
  10. }
  11. Test:y_cell_ExpandCompress()
  12. {
  13. new o, x, m, n;
  14. //printf("1");
  15. o = 0b11110000101001011100001100001111;
  16. m = 0b01010000000000000000000000000000;
  17. //PRINT(x);
  18. x = Cell_CompressRight(o, m);
  19. n = Cell_ExpandLeft(x, m);
  20. ASSERT(o & m == n);
  21. ASSERT(x == 0b00000000000000000000000000000011);
  22. //PRINT(n);
  23. //printf("2");
  24. o = 0b11110000101001011100001100001111;
  25. m = 0b01010101010100000000000000000000;
  26. //PRINT(x);
  27. x = Cell_CompressRight(o, m);
  28. n = Cell_ExpandLeft(x, m);
  29. ASSERT(o & m == n);
  30. ASSERT(x == 0b00000000000000000000000000110000);
  31. //PRINT(n);
  32. //printf("3");
  33. o = 0b11110000101001011100001100001111;
  34. m = 0b00111100000000000000000000000000;
  35. //PRINT(x);
  36. x = Cell_CompressRight(o, m);
  37. n = Cell_ExpandLeft(x, m);
  38. ASSERT(o & m == n);
  39. ASSERT(x == 0b00000000000000000000000000001100);
  40. //PRINT(n);
  41. //printf("4");
  42. o = 0b11110000101001011100001100001111;
  43. m = 0b00000000000000000000111111111111;
  44. //PRINT(x);
  45. x = Cell_CompressRight(o, m);
  46. n = Cell_ExpandLeft(x, m);
  47. ASSERT(o & m == n);
  48. ASSERT(x == 0b00000000000000000000001100001111);
  49. //PRINT(n);
  50. //printf("5");
  51. o = 0b11110000101001011100001100001111;
  52. m = 0b00000000000000000000111111000000;
  53. //PRINT(x);
  54. x = Cell_CompressRight(o, m);
  55. n = Cell_ExpandLeft(x, m);
  56. ASSERT(o & m == n);
  57. ASSERT(x == 0b00000000000000000000000000001100);
  58. //PRINT(n);
  59. //printf("6");
  60. o = 0b11110000101001011100001100001111;
  61. m = 0b00000110000000100001100001100000;
  62. //PRINT(x);
  63. x = Cell_CompressRight(o, m);
  64. n = Cell_ExpandLeft(x, m);
  65. ASSERT(o & m == n);
  66. ASSERT(x == 0b00000000000000000000000000000000);
  67. //PRINT(n);
  68. }
  69. // Test:y_cell_ReverseBits1()
  70. // {
  71. // for (new i = 0; i != 1000000; ++i)
  72. // {
  73. // new
  74. // count = 0;
  75. // for (new j = 0x80000000, k = 1; j; j >>>= 1, k <<= 1)
  76. // {
  77. // if (i & j) count |= k;
  78. // }
  79. // if (Cell_ReverseBits(i) != count)
  80. // {
  81. // ASSERT(Cell_ReverseBits(i) == count);
  82. // break;
  83. // }
  84. // }
  85. // }
  86. // Test:y_cell_ReverseBits2()
  87. // {
  88. // for (new i = 1000000000; i != 1000123000; ++i)
  89. // {
  90. // new
  91. // count = 0;
  92. // for (new j = 0x80000000, k = 1; j; j >>>= 1, k <<= 1)
  93. // {
  94. // if (i & j) count |= k;
  95. // }
  96. // if (Cell_ReverseBits(i) != count)
  97. // {
  98. // ASSERT(Cell_ReverseBits(i) == count);
  99. // break;
  100. // }
  101. // }
  102. // }
  103. // Test:y_cell_ReverseBits3()
  104. // {
  105. // for (new i = -999888; i != 0; ++i)
  106. // {
  107. // new
  108. // count = 0;
  109. // for (new j = 0x80000000, k = 1; j; j >>>= 1, k <<= 1)
  110. // {
  111. // if (i & j) count |= k;
  112. // }
  113. // if (Cell_ReverseBits(i) != count)
  114. // {
  115. // ASSERT(Cell_ReverseBits(i) == count);
  116. // break;
  117. // }
  118. // }
  119. // }
  120. Test:y_cell_ReverseNibbles0()
  121. {
  122. ASSERT(Cell_ReverseNibbles(0) == 0);
  123. ASSERT(Cell_ReverseNibbles(1) == 0x10000000);
  124. ASSERT(Cell_ReverseNibbles(2) == 0x20000000);
  125. ASSERT(Cell_ReverseNibbles(3) == 0x30000000);
  126. ASSERT(Cell_ReverseNibbles(4) == 0x40000000);
  127. ASSERT(Cell_ReverseNibbles(0b1010101010) == 0b10101010001000000000000000000000);
  128. ASSERT(Cell_ReverseNibbles(0b1111000001111000011) == 0b00111100001110000111000000000000);
  129. }
  130. // Test:y_cell_ReverseNibbles1()
  131. // {
  132. // for (new i = 0; i != 1000000; ++i)
  133. // {
  134. // new
  135. // count = 0,
  136. // k = i;
  137. // for (new j = 0; j != 8; ++j)
  138. // {
  139. // count <<= 4;
  140. // count |= k & 0x0F;
  141. // k >>>= 4;
  142. // }
  143. // if (Cell_ReverseNibbles(i) != count)
  144. // {
  145. // ASSERT(Cell_ReverseNibbles(i) == count);
  146. // break;
  147. // }
  148. // }
  149. // }
  150. // Test:y_cell_ReverseNibbles2()
  151. // {
  152. // for (new i = 1000000000; i != 1000123000; ++i)
  153. // {
  154. // new
  155. // count = 0,
  156. // k = i;
  157. // for (new j = 0; j != 8; ++j)
  158. // {
  159. // count <<= 4;
  160. // count |= k & 0x0F;
  161. // k >>>= 4;
  162. // }
  163. // if (Cell_ReverseNibbles(i) != count)
  164. // {
  165. // ASSERT(Cell_ReverseNibbles(i) == count);
  166. // break;
  167. // }
  168. // }
  169. // }
  170. // Test:y_cell_ReverseNibbles3()
  171. // {
  172. // for (new i = -999888; i != 0; ++i)
  173. // {
  174. // new
  175. // count = 0,
  176. // k = i;
  177. // for (new j = 0; j != 8; ++j)
  178. // {
  179. // count <<= 4;
  180. // count |= k & 0x0F;
  181. // k >>>= 4;
  182. // }
  183. // if (Cell_ReverseNibbles(i) != count)
  184. // {
  185. // ASSERT(Cell_ReverseNibbles(i) == count);
  186. // break;
  187. // }
  188. // }
  189. // }
  190. Test:y_cell_ReverseBytes0()
  191. {
  192. ASSERT(Cell_ReverseBytes(0) == 0);
  193. ASSERT(Cell_ReverseBytes(1) == 0x01000000);
  194. ASSERT(Cell_ReverseBytes(2) == 0x02000000);
  195. ASSERT(Cell_ReverseBytes(3) == 0x03000000);
  196. ASSERT(Cell_ReverseBytes(4) == 0x04000000);
  197. ASSERT(Cell_ReverseBytes(0b1010101010) == 0b10101010000000100000000000000000);
  198. ASSERT(Cell_ReverseBytes(0b1111000001111000011) == 0b11000011100000110000011100000000);
  199. }
  200. // Test:y_cell_ReverseBytes1()
  201. // {
  202. // for (new i = 0; i != 1000000; ++i)
  203. // {
  204. // new
  205. // count = 0,
  206. // k = i;
  207. // for (new j = 0; j != 4; ++j)
  208. // {
  209. // count <<= 8;
  210. // count |= k & 0xFF;
  211. // k >>>= 8;
  212. // }
  213. // if (Cell_ReverseBytes(i) != count)
  214. // {
  215. // ASSERT(Cell_ReverseBytes(i) == count);
  216. // break;
  217. // }
  218. // }
  219. // }
  220. // Test:y_cell_ReverseBytes2()
  221. // {
  222. // for (new i = 1000000000; i != 1000123000; ++i)
  223. // {
  224. // new
  225. // count = 0,
  226. // k = i;
  227. // for (new j = 0; j != 4; ++j)
  228. // {
  229. // count <<= 8;
  230. // count |= k & 0xFF;
  231. // k >>>= 8;
  232. // }
  233. // if (Cell_ReverseBytes(i) != count)
  234. // {
  235. // ASSERT(Cell_ReverseBytes(i) == count);
  236. // break;
  237. // }
  238. // }
  239. // }
  240. // Test:y_cell_ReverseBytes3()
  241. // {
  242. // for (new i = -999888; i != 0; ++i)
  243. // {
  244. // new
  245. // count = 0,
  246. // k = i;
  247. // for (new j = 0; j != 4; ++j)
  248. // {
  249. // count <<= 8;
  250. // count |= k & 0xFF;
  251. // k >>>= 8;
  252. // }
  253. // if (Cell_ReverseBytes(i) != count)
  254. // {
  255. // ASSERT(Cell_ReverseBytes(i) == count);
  256. // break;
  257. // }
  258. // }
  259. // }
  260. static stock y_cell_CountBits_v1(GLOBAL_TAG_TYPES:data)
  261. {
  262. static const
  263. scCount[256] =
  264. {
  265. 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4,
  266. 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
  267. 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
  268. 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
  269. 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
  270. 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
  271. 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
  272. 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
  273. 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
  274. 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
  275. 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
  276. 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
  277. 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
  278. 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
  279. 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
  280. 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8
  281. };
  282. return scCount[data >>> 24] + scCount[(data >>> 16) & 0xFF] + scCount[(data >>> 8) & 0xFF] + scCount[data & 0xFF];
  283. }
  284. static stock y_cell_CountBits_v2(GLOBAL_TAG_TYPES:data)
  285. {
  286. data = data - ((data >>> 1) & 0x55555555);
  287. data = (data & 0x33333333) + ((data >>> 2) & 0x33333333);
  288. return ((data + (data >>> 4) & 0xF0F0F0F) * 0x1010101) >>> 24;
  289. }
  290. static stock y_cell_CountBits_v3(GLOBAL_TAG_TYPES:data)
  291. {
  292. // This function is a perfect candidate for re-writing in pure assembly.
  293. // data = data - ((data >>> 1) & 0x55555555);
  294. #emit LOAD.S.pri data // From this point on, just use registers!
  295. #emit PUSH.pri
  296. #emit SHR.C.pri 1
  297. #emit CONST.alt 0x55555555
  298. #emit AND // No "AND.C" annoyingly.
  299. #emit POP.alt
  300. #emit SUB.alt
  301. // data = (data & 0x33333333) + ((data >>> 2) & 0x33333333);
  302. #emit PUSH.pri
  303. #emit SHR.C.pri 2
  304. #emit CONST.alt 0x33333333
  305. #emit AND
  306. #emit SWAP.pri // Put the second half of the code on the stack.
  307. #emit AND // "alt" is already the correct value.
  308. #emit POP.alt
  309. #emit ADD
  310. // return ((data + (data >>> 4) & 0xF0F0F0F) * 0x1010101) >>> 24;
  311. #emit MOVE.alt
  312. #emit SHR.C.pri 4
  313. #emit ADD
  314. #emit CONST.alt 0xF0F0F0F
  315. #emit AND
  316. #emit SMUL.C 0x1010101
  317. #emit SHR.C.pri 24
  318. #emit RETN
  319. return 0;
  320. }
  321. static stock y_cell_CountBits_v4(GLOBAL_TAG_TYPES:data)
  322. {
  323. static const
  324. scCount[256] =
  325. {
  326. 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4,
  327. 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
  328. 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
  329. 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
  330. 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
  331. 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
  332. 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
  333. 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
  334. 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
  335. 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
  336. 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
  337. 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
  338. 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
  339. 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
  340. 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
  341. 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8
  342. };
  343. // return scCount[data >>> 24] + scCount[(data >>> 16) & 0xFF] + scCount[(data >>> 8) & 0xFF] + scCount[data & 0xFF];
  344. #emit CONST.alt scCount // Get the address of the table.
  345. #emit ADDR.pri data // Get the address of the parameter.
  346. #emit PUSH.pri
  347. // Load the first value.
  348. #emit LODB.I 1
  349. #emit LIDX
  350. // Store the data.
  351. #emit SWAP.pri
  352. #emit PUSH.pri
  353. // Load the second value
  354. #emit ADD.C 1
  355. #emit LODB.I 1
  356. #emit LIDX
  357. // Store the data.
  358. #emit SWAP.pri
  359. #emit PUSH.pri
  360. // Load the third value
  361. #emit ADD.C 2
  362. #emit LODB.I 1
  363. #emit LIDX
  364. // Store the data.
  365. #emit SWAP.pri
  366. // Load the fourth value
  367. #emit ADD.C 3
  368. #emit LODB.I 1
  369. #emit LIDX
  370. // We now have a stack with three results, and a fourth in "pri".
  371. #emit POP.alt
  372. #emit ADD
  373. #emit POP.alt
  374. #emit ADD
  375. #emit POP.alt
  376. #emit ADD
  377. // Return.
  378. #emit RETN
  379. return 0;
  380. }
  381. Test:y_cell_CountBits0()
  382. {
  383. ASSERT(y_cell_CountBits_v4(0) == 0);
  384. ASSERT(y_cell_CountBits_v4(1) == 1);
  385. ASSERT(y_cell_CountBits_v4(2) == 1);
  386. ASSERT(y_cell_CountBits_v4(3) == 2);
  387. ASSERT(y_cell_CountBits_v4(4) == 1);
  388. ASSERT(y_cell_CountBits_v4(0b1010101010) == 5);
  389. ASSERT(y_cell_CountBits_v4(0b1111000001111000011) == 10);
  390. #if 0
  391. new
  392. t0, t1, t2, t3, t4;
  393. t0 = GetTickCount();
  394. for (new i = 0; i != 10000000; ++i)
  395. {
  396. for (new j = 1; j < 100000000; j *= 3)
  397. {
  398. y_cell_CountBits_v1(j);
  399. }
  400. }
  401. t1 = GetTickCount();
  402. printf("Time 1: %d", t1 - t0);
  403. t1 = GetTickCount();
  404. for (new i = 0; i != 10000000; ++i)
  405. {
  406. for (new j = 1; j < 100000000; j *= 3)
  407. {
  408. y_cell_CountBits_v2(j);
  409. }
  410. }
  411. t2 = GetTickCount();
  412. printf("Time 2: %d", t2 - t1);
  413. t2 = GetTickCount();
  414. for (new i = 0; i != 10000000; ++i)
  415. {
  416. for (new j = 1; j < 100000000; j *= 3)
  417. {
  418. y_cell_CountBits_v3(j);
  419. }
  420. }
  421. t3 = GetTickCount();
  422. printf("Time 3: %d", t3 - t2);
  423. t3 = GetTickCount();
  424. for (new i = 0; i != 10000000; ++i)
  425. {
  426. for (new j = 1; j < 100000000; j *= 3)
  427. {
  428. y_cell_CountBits_v4(j);
  429. }
  430. }
  431. t4 = GetTickCount();
  432. printf("Time 4: %d", t4 - t3);
  433. #endif
  434. }
  435. // Test:y_cell_CountBits1()
  436. // {
  437. // for (new i = 0; i != 1000000; ++i)
  438. // {
  439. // new
  440. // count = 0;
  441. // for (new j = 0x80000000; j; j >>>= 1)
  442. // {
  443. // if (i & j) ++count;
  444. // }
  445. // if (y_cell_CountBits_v4(i) != count)
  446. // {
  447. // ASSERT(y_cell_CountBits_v4(i) == count);
  448. // break;
  449. // }
  450. // }
  451. // }
  452. // Test:y_cell_CountBits2()
  453. // {
  454. // for (new i = 1000000000; i != 1000123000; ++i)
  455. // {
  456. // new
  457. // count = 0;
  458. // for (new j = 0x80000000; j; j >>>= 1)
  459. // {
  460. // if (i & j) ++count;
  461. // }
  462. // if (y_cell_CountBits_v4(i) != count)
  463. // {
  464. // ASSERT(y_cell_CountBits_v4(i) == count);
  465. // break;
  466. // }
  467. // }
  468. // }
  469. // Test:y_cell_CountBits3()
  470. // {
  471. // for (new i = -999888; i != 0; ++i)
  472. // {
  473. // new
  474. // count = 0;
  475. // for (new j = 0x80000000; j; j >>>= 1)
  476. // {
  477. // if (i & j) ++count;
  478. // }
  479. // if (y_cell_CountBits_v4(i) != count)
  480. // {
  481. // ASSERT(y_cell_CountBits_v4(i) == count);
  482. // break;
  483. // }
  484. // }
  485. // }
  486. Test:y_cell_GetLowestComponent()
  487. {
  488. ASSERT(Cell_GetLowestComponent(0) == 0);
  489. ASSERT(Cell_GetLowestComponent(1) == 1);
  490. ASSERT(Cell_GetLowestComponent(2) == 2);
  491. ASSERT(Cell_GetLowestComponent(6) == 2);
  492. ASSERT(Cell_GetLowestComponent(0x110) == 0x10);
  493. for (new i = 0; i != 32; ++i)
  494. {
  495. new
  496. k = 1 << i,
  497. l = k;
  498. ASSERT(Cell_GetLowestComponent(l) == k);
  499. l |= 2 << i;
  500. ASSERT(Cell_GetLowestComponent(l) == k);
  501. l |= 4 << i;
  502. ASSERT(Cell_GetLowestComponent(l) == k);
  503. l |= 8 << i;
  504. ASSERT(Cell_GetLowestComponent(l) == k);
  505. }
  506. }
  507. Test:y_cell_GetLowestBit()
  508. {
  509. ASSERT(Cell_GetLowestBit(0) == 0);
  510. ASSERT(Cell_GetLowestBit(1) == 0);
  511. ASSERT(Cell_GetLowestBit(0x800) == 11);
  512. ASSERT(Cell_GetLowestBit(0x111) == 0);
  513. ASSERT(Cell_GetLowestBit(6) == 1);
  514. for (new i = 0; i != 32; ++i)
  515. {
  516. new
  517. k = 1 << i;
  518. ASSERT(Cell_GetLowestBit(k) == i);
  519. k |= 2 << i;
  520. ASSERT(Cell_GetLowestBit(k) == i);
  521. k |= 4 << i;
  522. ASSERT(Cell_GetLowestBit(k) == i);
  523. k |= 8 << i;
  524. ASSERT(Cell_GetLowestBit(k) == i);
  525. }
  526. }
  527. Test:y_cell_GetLowestBitEx()
  528. {
  529. ASSERT(Cell_GetLowestBitEx(0) == 0);
  530. ASSERT(Cell_GetLowestBitEx(1) == 1);
  531. ASSERT(Cell_GetLowestBitEx(0x800) == 12);
  532. ASSERT(Cell_GetLowestBitEx(0x111) == 1);
  533. ASSERT(Cell_GetLowestBitEx(6) == 2);
  534. for (new i = 0; i != 32; ++i)
  535. {
  536. new
  537. k = 1 << i;
  538. ASSERT(Cell_GetLowestBitEx(k) == i + 1);
  539. k |= 2 << i;
  540. ASSERT(Cell_GetLowestBitEx(k) == i + 1);
  541. k |= 4 << i;
  542. ASSERT(Cell_GetLowestBitEx(k) == i + 1);
  543. k |= 8 << i;
  544. ASSERT(Cell_GetLowestBitEx(k) == i + 1);
  545. }
  546. }