bdiv_s64.inc 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896
  1. type
  2. { TSInt64Bit1Test }
  3. TSInt64Bit1Test = class(TSInt64DivTest)
  4. protected
  5. function GetDivisor: Int64; override;
  6. procedure DoTestIteration(Iteration: Integer); override;
  7. public
  8. function TestTitle: shortstring; override;
  9. end;
  10. { TSInt64Bit1ModTest }
  11. TSInt64Bit1ModTest = class(TSInt64ModTest)
  12. protected
  13. function GetDivisor: Int64; override;
  14. procedure DoTestIteration(Iteration: Integer); override;
  15. public
  16. function TestTitle: shortstring; override;
  17. end;
  18. { TSInt64Bit10Test }
  19. TSInt64Bit10Test = class(TSInt64DivTest)
  20. protected
  21. function GetDivisor: Int64; override;
  22. procedure DoTestIteration(Iteration: Integer); override;
  23. public
  24. function TestTitle: shortstring; override;
  25. end;
  26. { TSInt64Bit10ModTest }
  27. TSInt64Bit10ModTest = class(TSInt64ModTest)
  28. protected
  29. function GetDivisor: Int64; override;
  30. procedure DoTestIteration(Iteration: Integer); override;
  31. public
  32. function TestTitle: shortstring; override;
  33. end;
  34. { TSInt64Bit18Test }
  35. TSInt64Bit18Test = class(TSInt64DivTest)
  36. protected
  37. function GetDivisor: Int64; override;
  38. procedure DoTestIteration(Iteration: Integer); override;
  39. public
  40. function TestTitle: shortstring; override;
  41. end;
  42. { TSInt64Bit18ModTest }
  43. TSInt64Bit18ModTest = class(TSInt64ModTest)
  44. protected
  45. function GetDivisor: Int64; override;
  46. procedure DoTestIteration(Iteration: Integer); override;
  47. public
  48. function TestTitle: shortstring; override;
  49. end;
  50. { TSInt64Bit24Test }
  51. TSInt64Bit24Test = class(TSInt64DivTest)
  52. protected
  53. function GetDivisor: Int64; override;
  54. procedure DoTestIteration(Iteration: Integer); override;
  55. public
  56. function TestTitle: shortstring; override;
  57. end;
  58. { TSInt64Bit24ModTest }
  59. TSInt64Bit24ModTest = class(TSInt64ModTest)
  60. protected
  61. function GetDivisor: Int64; override;
  62. procedure DoTestIteration(Iteration: Integer); override;
  63. public
  64. function TestTitle: shortstring; override;
  65. end;
  66. { TSInt64Bit100Test }
  67. TSInt64Bit100Test = class(TSInt64DivTest)
  68. protected
  69. function GetDivisor: Int64; override;
  70. procedure DoTestIteration(Iteration: Integer); override;
  71. public
  72. function TestTitle: shortstring; override;
  73. end;
  74. { TSInt64Bit100ModTest }
  75. TSInt64Bit100ModTest = class(TSInt64ModTest)
  76. protected
  77. function GetDivisor: Int64; override;
  78. procedure DoTestIteration(Iteration: Integer); override;
  79. public
  80. function TestTitle: shortstring; override;
  81. end;
  82. { TSInt64Bit153Test }
  83. const
  84. FS64_153Input: array[$0..$F] of Int64 =
  85. (0, 1, 152, 153, 154, -1, -152, -153, -154,
  86. 8000000000000000117, 8000000000000000118, 8000000000000000119,
  87. -8000000000000000117, -8000000000000000118, -8000000000000000119,
  88. Int64($8000000000000000));
  89. type
  90. TSInt64Bit153Test = class(TSInt64DivTest)
  91. protected
  92. function GetDivisor: Int64; override;
  93. procedure DoTestIteration(Iteration: Integer); override;
  94. public
  95. function TestTitle: shortstring; override;
  96. end;
  97. { TSInt64Bit153ModTest }
  98. TSInt64Bit153ModTest = class(TSInt64ModTest)
  99. protected
  100. function GetDivisor: Int64; override;
  101. procedure DoTestIteration(Iteration: Integer); override;
  102. public
  103. function TestTitle: shortstring; override;
  104. end;
  105. { TSInt64Bit1461Test }
  106. const
  107. FS64_1461Input: array[$0..$F] of Int64 =
  108. (0, 1, 1460, 1461, 1462, -1, -1460, -1461, -1462,
  109. 8000000000000000582, 8000000000000000583, 8000000000000000584,
  110. -8000000000000000582, -8000000000000000583, -8000000000000000584,
  111. Int64($8000000000000000));
  112. type
  113. TSInt64Bit1461Test = class(TSInt64DivTest)
  114. protected
  115. function GetDivisor: Int64; override;
  116. procedure DoTestIteration(Iteration: Integer); override;
  117. public
  118. function TestTitle: shortstring; override;
  119. end;
  120. { TSInt64Bit1461ModTest }
  121. TSInt64Bit1461ModTest = class(TSInt64ModTest)
  122. protected
  123. function GetDivisor: Int64; override;
  124. procedure DoTestIteration(Iteration: Integer); override;
  125. public
  126. function TestTitle: shortstring; override;
  127. end;
  128. { TSInt64Bit10000Test }
  129. const
  130. FS64_10000Input: array[$0..$F] of Int64 =
  131. (0, 1, 9999, 10000, 10001, -1, -9999, -10000, -10001,
  132. 7999999999999999999, 8000000000000000000, 8000000000000000001,
  133. -7999999999999999999, -8000000000000000000, -8000000000000000001,
  134. Int64($8000000000000000));
  135. type
  136. TSInt64Bit10000Test = class(TSInt64DivTest)
  137. protected
  138. function GetDivisor: Int64; override;
  139. procedure DoTestIteration(Iteration: Integer); override;
  140. public
  141. function TestTitle: shortstring; override;
  142. end;
  143. { TSInt64Bit10000ModTest }
  144. TSInt64Bit10000ModTest = class(TSInt64ModTest)
  145. protected
  146. function GetDivisor: Int64; override;
  147. procedure DoTestIteration(Iteration: Integer); override;
  148. public
  149. function TestTitle: shortstring; override;
  150. end;
  151. { TSInt64Bit86400000Test }
  152. const
  153. FS64_86400000Input: array[$0..$F] of Int64 =
  154. (0, 1, 86399999, 86400000, 86400001, -1, -86399999, -86400000, -86400001,
  155. 8639999999999999999, 8640000000000000000, 8640000000000000001,
  156. -8639999999999999999, -8640000000000000000, -8640000000000000001,
  157. Int64($8000000000000000));
  158. type
  159. TSInt64Bit86400000Test = class(TSInt64DivTest)
  160. protected
  161. function GetDivisor: Int64; override;
  162. procedure DoTestIteration(Iteration: Integer); override;
  163. public
  164. function TestTitle: shortstring; override;
  165. end;
  166. { TSInt64Bit86400000ModTest }
  167. TSInt64Bit86400000ModTest = class(TSInt64ModTest)
  168. protected
  169. function GetDivisor: Int64; override;
  170. procedure DoTestIteration(Iteration: Integer); override;
  171. public
  172. function TestTitle: shortstring; override;
  173. end;
  174. { TSInt64Bit3ModCmpTest }
  175. TSInt64Bit3ModCmpTest = class(TSInt64ModCmpTest)
  176. protected
  177. function GetDivisor: Int64; override;
  178. procedure DoTestIteration(Iteration: Integer); override;
  179. public
  180. function TestTitle: shortstring; override;
  181. end;
  182. { TSInt64Bit10000ModCmpTest }
  183. TSInt64Bit10000ModCmpTest = class(TSInt64ModCmpTest)
  184. protected
  185. function GetDivisor: Int64; override;
  186. procedure DoTestIteration(Iteration: Integer); override;
  187. public
  188. function TestTitle: shortstring; override;
  189. end;
  190. { TSInt64Bit86400000ModCmpTest }
  191. TSInt64Bit86400000ModCmpTest = class(TSInt64ModCmpTest)
  192. protected
  193. function GetDivisor: Int64; override;
  194. procedure DoTestIteration(Iteration: Integer); override;
  195. public
  196. function TestTitle: shortstring; override;
  197. end;
  198. { TSInt64Bit1Test }
  199. function TSInt64Bit1Test.TestTitle: shortstring;
  200. begin
  201. Result := 'Signed 64-bit division by 1';
  202. end;
  203. function TSInt64Bit1Test.GetDivisor: Int64;
  204. begin
  205. Result := 1;
  206. end;
  207. procedure TSInt64Bit1Test.DoTestIteration(Iteration: Integer);
  208. var
  209. Numerator, Answer: Int64;
  210. Index, X: Integer;
  211. begin
  212. Index := Iteration and $FF;
  213. case Index of
  214. 0:
  215. Numerator := Int64($8000000000000000);
  216. 1:
  217. Numerator := Int64($8000000000000006);
  218. 2:
  219. Numerator := Int64($8000000000000007);
  220. 253:
  221. Numerator := Int64($7FFFFFFFFFFFFFF9);
  222. 254:
  223. Numerator := Int64($7FFFFFFFFFFFFFFA);
  224. 255:
  225. Numerator := Int64($7FFFFFFFFFFFFFFF);
  226. else
  227. Numerator := Index - 128;
  228. end;
  229. FInputArray[Index] := Numerator;
  230. for X := 0 to INTERNAL_LOOPS - 1 do
  231. Answer := Numerator div 1;
  232. FResultArray[Index] := Answer;
  233. end;
  234. { TSInt64Bit1ModTest }
  235. function TSInt64Bit1ModTest.TestTitle: shortstring;
  236. begin
  237. Result := 'Signed 64-bit modulus by 1';
  238. end;
  239. function TSInt64Bit1ModTest.GetDivisor: Int64;
  240. begin
  241. Result := 1;
  242. end;
  243. procedure TSInt64Bit1ModTest.DoTestIteration(Iteration: Integer);
  244. var
  245. Numerator, Answer: Int64;
  246. Index, X: Integer;
  247. begin
  248. Index := Iteration and $FF;
  249. case Index of
  250. 0:
  251. Numerator := Int64($8000000000000000);
  252. 1:
  253. Numerator := Int64($8000000000000006);
  254. 2:
  255. Numerator := Int64($8000000000000007);
  256. 253:
  257. Numerator := Int64($7FFFFFFFFFFFFFF9);
  258. 254:
  259. Numerator := Int64($7FFFFFFFFFFFFFFA);
  260. 255:
  261. Numerator := Int64($7FFFFFFFFFFFFFFF);
  262. else
  263. Numerator := Index - 128;
  264. end;
  265. FInputArray[Index] := Numerator;
  266. for X := 0 to INTERNAL_LOOPS - 1 do
  267. Answer := Numerator mod 1;
  268. FResultArray[Index] := Answer;
  269. end;
  270. { TSInt64Bit10Test }
  271. function TSInt64Bit10Test.TestTitle: shortstring;
  272. begin
  273. Result := 'Signed 64-bit division by 10';
  274. end;
  275. function TSInt64Bit10Test.GetDivisor: Int64;
  276. begin
  277. Result := 10;
  278. end;
  279. procedure TSInt64Bit10Test.DoTestIteration(Iteration: Integer);
  280. var
  281. Numerator, Answer: Int64;
  282. Index, X: Integer;
  283. begin
  284. Index := Iteration and $FF;
  285. case Index of
  286. 0:
  287. Numerator := Int64($8000000000000000);
  288. 1:
  289. Numerator := Int64($8000000000000006);
  290. 2:
  291. Numerator := Int64($8000000000000007);
  292. 253:
  293. Numerator := Int64($7FFFFFFFFFFFFFF9);
  294. 254:
  295. Numerator := Int64($7FFFFFFFFFFFFFFA);
  296. 255:
  297. Numerator := Int64($7FFFFFFFFFFFFFFF);
  298. else
  299. Numerator := Index - 128;
  300. end;
  301. FInputArray[Index] := Numerator;
  302. for X := 0 to INTERNAL_LOOPS - 1 do
  303. Answer := Numerator div 10;
  304. FResultArray[Index] := Answer;
  305. end;
  306. { TSInt64Bit10ModTest }
  307. function TSInt64Bit10ModTest.TestTitle: shortstring;
  308. begin
  309. Result := 'Signed 64-bit modulus by 10';
  310. end;
  311. function TSInt64Bit10ModTest.GetDivisor: Int64;
  312. begin
  313. Result := 10;
  314. end;
  315. procedure TSInt64Bit10ModTest.DoTestIteration(Iteration: Integer);
  316. var
  317. Numerator, Answer: Int64;
  318. Index, X: Integer;
  319. begin
  320. Index := Iteration and $FF;
  321. case Index of
  322. 0:
  323. Numerator := Int64($8000000000000000);
  324. 1:
  325. Numerator := Int64($8000000000000006);
  326. 2:
  327. Numerator := Int64($8000000000000007);
  328. 253:
  329. Numerator := Int64($7FFFFFFFFFFFFFF9);
  330. 254:
  331. Numerator := Int64($7FFFFFFFFFFFFFFA);
  332. 255:
  333. Numerator := Int64($7FFFFFFFFFFFFFFF);
  334. else
  335. Numerator := Index - 128;
  336. end;
  337. FInputArray[Index] := Numerator;
  338. for X := 0 to INTERNAL_LOOPS - 1 do
  339. Answer := Numerator mod 10;
  340. FResultArray[Index] := Answer;
  341. end;
  342. { TSInt64Bit18Test }
  343. function TSInt64Bit18Test.TestTitle: shortstring;
  344. begin
  345. Result := 'Signed 64-bit division by 18';
  346. end;
  347. function TSInt64Bit18Test.GetDivisor: Int64;
  348. begin
  349. Result := 18;
  350. end;
  351. procedure TSInt64Bit18Test.DoTestIteration(Iteration: Integer);
  352. var
  353. Numerator, Answer: Int64;
  354. Index, X: Integer;
  355. begin
  356. Index := Iteration and $FF;
  357. Numerator := Index - 128;
  358. FInputArray[Index] := Numerator;
  359. for X := 0 to INTERNAL_LOOPS - 1 do
  360. Answer := Numerator div 18;
  361. FResultArray[Index] := Answer;
  362. end;
  363. { TSInt64Bit18ModTest }
  364. function TSInt64Bit18ModTest.TestTitle: shortstring;
  365. begin
  366. Result := 'Signed 64-bit modulus by 18';
  367. end;
  368. function TSInt64Bit18ModTest.GetDivisor: Int64;
  369. begin
  370. Result := 18;
  371. end;
  372. procedure TSInt64Bit18ModTest.DoTestIteration(Iteration: Integer);
  373. var
  374. Numerator, Answer: Int64;
  375. Index, X: Integer;
  376. begin
  377. Index := Iteration and $FF;
  378. Numerator := Index - 128;
  379. FInputArray[Index] := Numerator;
  380. for X := 0 to INTERNAL_LOOPS - 1 do
  381. Answer := Numerator mod 18;
  382. FResultArray[Index] := Answer;
  383. end;
  384. { TSInt64Bit24Test }
  385. function TSInt64Bit24Test.TestTitle: shortstring;
  386. begin
  387. Result := 'Signed 64-bit division by 24';
  388. end;
  389. function TSInt64Bit24Test.GetDivisor: Int64;
  390. begin
  391. Result := 24;
  392. end;
  393. procedure TSInt64Bit24Test.DoTestIteration(Iteration: Integer);
  394. var
  395. Numerator, Answer: Int64;
  396. Index, X: Integer;
  397. begin
  398. Index := Iteration and $FF;
  399. Numerator := Index - 128;
  400. FInputArray[Index] := Numerator;
  401. for X := 0 to INTERNAL_LOOPS - 1 do
  402. Answer := Numerator div 24;
  403. FResultArray[Index] := Answer;
  404. end;
  405. { TSInt64Bit24ModTest }
  406. function TSInt64Bit24ModTest.TestTitle: shortstring;
  407. begin
  408. Result := 'Signed 64-bit modulus by 24';
  409. end;
  410. function TSInt64Bit24ModTest.GetDivisor: Int64;
  411. begin
  412. Result := 24;
  413. end;
  414. procedure TSInt64Bit24ModTest.DoTestIteration(Iteration: Integer);
  415. var
  416. Numerator, Answer: Int64;
  417. Index, X: Integer;
  418. begin
  419. Index := Iteration and $FF;
  420. Numerator := Index - 128;
  421. FInputArray[Index] := Numerator;
  422. for X := 0 to INTERNAL_LOOPS - 1 do
  423. Answer := Numerator mod 24;
  424. FResultArray[Index] := Answer;
  425. end;
  426. { TSInt64Bit100Test }
  427. function TSInt64Bit100Test.TestTitle: shortstring;
  428. begin
  429. Result := 'Signed 64-bit division by 100';
  430. end;
  431. function TSInt64Bit100Test.GetDivisor: Int64;
  432. begin
  433. Result := 100;
  434. end;
  435. procedure TSInt64Bit100Test.DoTestIteration(Iteration: Integer);
  436. var
  437. Numerator, Answer: Int64;
  438. Index, X: Integer;
  439. begin
  440. Index := Iteration and $FF;
  441. case Index of
  442. 0:
  443. Numerator := Int64($8000000000000000);
  444. 1:
  445. Numerator := Int64($8000000000000008);
  446. 2:
  447. Numerator := Int64($8000000000000009);
  448. 253:
  449. Numerator := Int64($7FFFFFFFFFFFFFF7);
  450. 254:
  451. Numerator := Int64($7FFFFFFFFFFFFFF8);
  452. 255:
  453. Numerator := Int64($7FFFFFFFFFFFFFFF);
  454. else
  455. Numerator := Index - 128;
  456. end;
  457. FInputArray[Index] := Numerator;
  458. for X := 0 to INTERNAL_LOOPS - 1 do
  459. Answer := Numerator div 100;
  460. FResultArray[Index] := Answer;
  461. end;
  462. { TSInt64Bit100ModTest }
  463. function TSInt64Bit100ModTest.TestTitle: shortstring;
  464. begin
  465. Result := 'Signed 64-bit modulus by 100';
  466. end;
  467. function TSInt64Bit100ModTest.GetDivisor: Int64;
  468. begin
  469. Result := 100;
  470. end;
  471. procedure TSInt64Bit100ModTest.DoTestIteration(Iteration: Integer);
  472. var
  473. Numerator, Answer: Int64;
  474. Index, X: Integer;
  475. begin
  476. Index := Iteration and $FF;
  477. case Index of
  478. 0:
  479. Numerator := Int64($8000000000000000);
  480. 1:
  481. Numerator := Int64($8000000000000008);
  482. 2:
  483. Numerator := Int64($8000000000000009);
  484. 253:
  485. Numerator := Int64($7FFFFFFFFFFFFFF7);
  486. 254:
  487. Numerator := Int64($7FFFFFFFFFFFFFF8);
  488. 255:
  489. Numerator := Int64($7FFFFFFFFFFFFFFF);
  490. else
  491. Numerator := Index - 128;
  492. end;
  493. FInputArray[Index] := Numerator;
  494. for X := 0 to INTERNAL_LOOPS - 1 do
  495. Answer := Numerator mod 100;
  496. FResultArray[Index] := Answer;
  497. end;
  498. { TSInt64Bit153Test }
  499. function TSInt64Bit153Test.TestTitle: shortstring;
  500. begin
  501. Result := 'Signed 64-bit division by 153';
  502. end;
  503. function TSInt64Bit153Test.GetDivisor: Int64;
  504. begin
  505. Result := 153;
  506. end;
  507. procedure TSInt64Bit153Test.DoTestIteration(Iteration: Integer);
  508. var
  509. Numerator, Answer: Int64;
  510. Index, X: Integer;
  511. begin
  512. Index := Iteration and $FF;
  513. Numerator := FS64_153Input[Index and $F];
  514. FInputArray[Index] := Numerator;
  515. for X := 0 to INTERNAL_LOOPS - 1 do
  516. Answer := Numerator div 153;
  517. FResultArray[Index] := Answer;
  518. end;
  519. { TSInt64Bit153ModTest }
  520. function TSInt64Bit153ModTest.TestTitle: shortstring;
  521. begin
  522. Result := 'Signed 64-bit modulus by 153';
  523. end;
  524. function TSInt64Bit153ModTest.GetDivisor: Int64;
  525. begin
  526. Result := 153;
  527. end;
  528. procedure TSInt64Bit153ModTest.DoTestIteration(Iteration: Integer);
  529. var
  530. Numerator, Answer: Int64;
  531. Index, X: Integer;
  532. begin
  533. Index := Iteration and $FF;
  534. Numerator := FS64_153Input[Index and $F];
  535. FInputArray[Index] := Numerator;
  536. for X := 0 to INTERNAL_LOOPS - 1 do
  537. Answer := Numerator mod 153;
  538. FResultArray[Index] := Answer;
  539. end;
  540. { TSInt64Bit1461Test }
  541. function TSInt64Bit1461Test.TestTitle: shortstring;
  542. begin
  543. Result := 'Signed 64-bit division by 1,461';
  544. end;
  545. function TSInt64Bit1461Test.GetDivisor: Int64;
  546. begin
  547. Result := 1461;
  548. end;
  549. procedure TSInt64Bit1461Test.DoTestIteration(Iteration: Integer);
  550. var
  551. Numerator, Answer: Int64;
  552. Index, X: Integer;
  553. begin
  554. Index := Iteration and $FF;
  555. Numerator := FS64_1461Input[Index and $F];
  556. FInputArray[Index] := Numerator;
  557. for X := 0 to INTERNAL_LOOPS - 1 do
  558. Answer := Numerator div 1461;
  559. FResultArray[Index] := Answer;
  560. end;
  561. { TSInt64Bit1461ModTest }
  562. function TSInt64Bit1461ModTest.TestTitle: shortstring;
  563. begin
  564. Result := 'Signed 64-bit modulus by 1,461';
  565. end;
  566. function TSInt64Bit1461ModTest.GetDivisor: Int64;
  567. begin
  568. Result := 1461;
  569. end;
  570. procedure TSInt64Bit1461ModTest.DoTestIteration(Iteration: Integer);
  571. var
  572. Numerator, Answer: Int64;
  573. Index, X: Integer;
  574. begin
  575. Index := Iteration and $FF;
  576. Numerator := FS64_1461Input[Index and $F];
  577. FInputArray[Index] := Numerator;
  578. for X := 0 to INTERNAL_LOOPS - 1 do
  579. Answer := Numerator mod 1461;
  580. FResultArray[Index] := Answer;
  581. end;
  582. { TSInt64Bit10000Test }
  583. function TSInt64Bit10000Test.TestTitle: shortstring;
  584. begin
  585. Result := 'Signed 64-bit division by 10,000 (Currency)';
  586. end;
  587. function TSInt64Bit10000Test.GetDivisor: Int64;
  588. begin
  589. Result := 10000;
  590. end;
  591. procedure TSInt64Bit10000Test.DoTestIteration(Iteration: Integer);
  592. var
  593. Numerator, Answer: Int64;
  594. Index, X: Integer;
  595. begin
  596. Index := Iteration and $FF;
  597. Numerator := FS64_10000Input[Index and $F];
  598. FInputArray[Index] := Numerator;
  599. for X := 0 to INTERNAL_LOOPS - 1 do
  600. Answer := Numerator div 10000;
  601. FResultArray[Index] := Answer;
  602. end;
  603. { TSInt64Bit10000ModTest }
  604. function TSInt64Bit10000ModTest.TestTitle: shortstring;
  605. begin
  606. Result := 'Signed 64-bit modulus by 10,000 (Currency)';
  607. end;
  608. function TSInt64Bit10000ModTest.GetDivisor: Int64;
  609. begin
  610. Result := 10000;
  611. end;
  612. procedure TSInt64Bit10000ModTest.DoTestIteration(Iteration: Integer);
  613. var
  614. Numerator, Answer: Int64;
  615. Index, X: Integer;
  616. begin
  617. Index := Iteration and $FF;
  618. Numerator := FS64_10000Input[Index and $F];
  619. FInputArray[Index] := Numerator;
  620. for X := 0 to INTERNAL_LOOPS - 1 do
  621. Answer := Numerator mod 10000;
  622. FResultArray[Index] := Answer;
  623. end;
  624. { TSInt64Bit86400000Test }
  625. function TSInt64Bit86400000Test.TestTitle: shortstring;
  626. begin
  627. Result := 'Signed 64-bit division by 86,400,000';
  628. end;
  629. function TSInt64Bit86400000Test.GetDivisor: Int64;
  630. begin
  631. Result := 86400000;
  632. end;
  633. procedure TSInt64Bit86400000Test.DoTestIteration(Iteration: Integer);
  634. var
  635. Numerator, Answer: Int64;
  636. Index, X: Integer;
  637. begin
  638. Index := Iteration and $FF;
  639. Numerator := FS64_86400000Input[Index and $F];
  640. FInputArray[Index] := Numerator;
  641. for X := 0 to INTERNAL_LOOPS - 1 do
  642. Answer := Numerator div 86400000;
  643. FResultArray[Index] := Answer;
  644. end;
  645. { TSInt64Bit86400000ModTest }
  646. function TSInt64Bit86400000ModTest.TestTitle: shortstring;
  647. begin
  648. Result := 'Signed 64-bit modulus by 86,400,000';
  649. end;
  650. function TSInt64Bit86400000ModTest.GetDivisor: Int64;
  651. begin
  652. Result := 86400000;
  653. end;
  654. procedure TSInt64Bit86400000ModTest.DoTestIteration(Iteration: Integer);
  655. var
  656. Numerator, Answer: Int64;
  657. Index, X: Integer;
  658. begin
  659. Index := Iteration and $FF;
  660. Numerator := FS64_86400000Input[Index and $F];
  661. FInputArray[Index] := Numerator;
  662. for X := 0 to INTERNAL_LOOPS - 1 do
  663. Answer := Numerator mod 86400000;
  664. FResultArray[Index] := Answer;
  665. end;
  666. { TSInt64Bit3ModCmpTest }
  667. function TSInt64Bit3ModCmpTest.TestTitle: shortstring;
  668. begin
  669. Result := 'Signed 64-bit (n mod 3) = 0';
  670. end;
  671. function TSInt64Bit3ModCmpTest.GetDivisor: Int64;
  672. begin
  673. Result := 3;
  674. end;
  675. procedure TSInt64Bit3ModCmpTest.DoTestIteration(Iteration: Integer);
  676. var
  677. Numerator: Int64; Answer: Boolean;
  678. Index, X: Integer;
  679. begin
  680. Index := Iteration and $FF;
  681. case Index of
  682. 0:
  683. Numerator := Int64($8000000000000000);
  684. 1:
  685. Numerator := Int64($8000000000000006);
  686. 2:
  687. Numerator := Int64($8000000000000007);
  688. 253:
  689. Numerator := Int64($7FFFFFFFFFFFFFF9);
  690. 254:
  691. Numerator := Int64($7FFFFFFFFFFFFFFA);
  692. 255:
  693. Numerator := Int64($7FFFFFFFFFFFFFFF);
  694. else
  695. Numerator := Index - 128;
  696. end;
  697. FInputArray[Index] := Numerator;
  698. for X := 0 to INTERNAL_LOOPS - 1 do
  699. Answer := (Numerator mod 3) = 0;
  700. FResultArray[Index] := Answer;
  701. end;
  702. { TSInt64Bit10000ModCmpTest }
  703. function TSInt64Bit10000ModCmpTest.TestTitle: shortstring;
  704. begin
  705. Result := 'Signed 64-bit (n mod 10,000) = 0 (Currency)';
  706. end;
  707. function TSInt64Bit10000ModCmpTest.GetDivisor: Int64;
  708. begin
  709. Result := 10000;
  710. end;
  711. procedure TSInt64Bit10000ModCmpTest.DoTestIteration(Iteration: Integer);
  712. var
  713. Numerator: Int64; Answer: Boolean;
  714. Index, X: Integer;
  715. begin
  716. Index := Iteration and $FF;
  717. Numerator := FS64_10000Input[Index and $F];
  718. FInputArray[Index] := Numerator;
  719. for X := 0 to INTERNAL_LOOPS - 1 do
  720. Answer := (Numerator mod 10000) = 0;
  721. FResultArray[Index] := Answer;
  722. end;
  723. { TSInt64Bit86400000ModCmpTest }
  724. function TSInt64Bit86400000ModCmpTest.TestTitle: shortstring;
  725. begin
  726. Result := 'Signed 64-bit (n mod 86,400,000) = 0';
  727. end;
  728. function TSInt64Bit86400000ModCmpTest.GetDivisor: Int64;
  729. begin
  730. Result := 86400000;
  731. end;
  732. procedure TSInt64Bit86400000ModCmpTest.DoTestIteration(Iteration: Integer);
  733. var
  734. Numerator: Int64; Answer: Boolean;
  735. Index, X: Integer;
  736. begin
  737. Index := Iteration and $FF;
  738. Numerator := FS64_86400000Input[Index and $F];
  739. FInputArray[Index] := Numerator;
  740. for X := 0 to INTERNAL_LOOPS - 1 do
  741. Answer := (Numerator mod 86400000) = 0;
  742. FResultArray[Index] := Answer;
  743. end;