bdiv_u32.inc 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065
  1. type
  2. { TUInt32Bit1Test }
  3. TUInt32Bit1Test = class(TUInt32DivTest)
  4. protected
  5. function GetDivisor: Cardinal; override;
  6. procedure DoTestIteration(Iteration: Integer); override;
  7. public
  8. function TestTitle: shortstring; override;
  9. end;
  10. { TUInt32Bit1ModTest }
  11. TUInt32Bit1ModTest = class(TUInt32ModTest)
  12. protected
  13. function GetDivisor: Cardinal; override;
  14. procedure DoTestIteration(Iteration: Integer); override;
  15. public
  16. function TestTitle: shortstring; override;
  17. end;
  18. { TUInt32Bit2Test }
  19. TUInt32Bit2Test = class(TUInt32DivTest)
  20. protected
  21. function GetDivisor: Cardinal; override;
  22. procedure DoTestIteration(Iteration: Integer); override;
  23. public
  24. function TestTitle: shortstring; override;
  25. end;
  26. { TUInt32Bit2ModTest }
  27. TUInt32Bit2ModTest = class(TUInt32ModTest)
  28. protected
  29. function GetDivisor: Cardinal; override;
  30. procedure DoTestIteration(Iteration: Integer); override;
  31. public
  32. function TestTitle: shortstring; override;
  33. end;
  34. { TUInt32Bit3Test }
  35. TUInt32Bit3Test = class(TUInt32DivTest)
  36. protected
  37. function GetDivisor: Cardinal; override;
  38. procedure DoTestIteration(Iteration: Integer); override;
  39. public
  40. function TestTitle: shortstring; override;
  41. end;
  42. { TUInt32Bit3ModTest }
  43. TUInt32Bit3ModTest = class(TUInt32ModTest)
  44. protected
  45. function GetDivisor: Cardinal; override;
  46. procedure DoTestIteration(Iteration: Integer); override;
  47. public
  48. function TestTitle: shortstring; override;
  49. end;
  50. { TUInt32Bit7Test }
  51. TUInt32Bit7Test = class(TUInt32DivTest)
  52. protected
  53. function GetDivisor: Cardinal; override;
  54. procedure DoTestIteration(Iteration: Integer); override;
  55. public
  56. function TestTitle: shortstring; override;
  57. end;
  58. { TUInt32Bit7ModTest }
  59. TUInt32Bit7ModTest = class(TUInt32ModTest)
  60. protected
  61. function GetDivisor: Cardinal; override;
  62. procedure DoTestIteration(Iteration: Integer); override;
  63. public
  64. function TestTitle: shortstring; override;
  65. end;
  66. { TUInt32Bit10Test }
  67. TUInt32Bit10Test = class(TUInt32DivTest)
  68. protected
  69. function GetDivisor: Cardinal; override;
  70. procedure DoTestIteration(Iteration: Integer); override;
  71. public
  72. function TestTitle: shortstring; override;
  73. end;
  74. { TUInt32Bit10ModTest }
  75. TUInt32Bit10ModTest = class(TUInt32ModTest)
  76. protected
  77. function GetDivisor: Cardinal; override;
  78. procedure DoTestIteration(Iteration: Integer); override;
  79. public
  80. function TestTitle: shortstring; override;
  81. end;
  82. { TUInt32Bit100Test }
  83. TUInt32Bit100Test = class(TUInt32DivTest)
  84. protected
  85. function GetDivisor: Cardinal; override;
  86. procedure DoTestIteration(Iteration: Integer); override;
  87. public
  88. function TestTitle: shortstring; override;
  89. end;
  90. { TUInt32Bit100ModTest }
  91. TUInt32Bit100ModTest = class(TUInt32ModTest)
  92. protected
  93. function GetDivisor: Cardinal; override;
  94. procedure DoTestIteration(Iteration: Integer); override;
  95. public
  96. function TestTitle: shortstring; override;
  97. end;
  98. { TUInt32Bit1000Test }
  99. const
  100. FU32_1000Input: array[$0..$F] of Cardinal =
  101. (0, 1, 999, 1000, 1001, 1999, 2000, 2001,
  102. 4294958999, 4294959000, 4294959001,
  103. $7FFFFFFE, $7FFFFFFF, $80000000, $80000001, $FFFFFFFF);
  104. type
  105. TUInt32Bit1000Test = class(TUInt32DivTest)
  106. protected
  107. function GetDivisor: Cardinal; override;
  108. procedure DoTestIteration(Iteration: Integer); override;
  109. public
  110. function TestTitle: shortstring; override;
  111. end;
  112. { TUInt32Bit1000ModTest }
  113. TUInt32Bit1000ModTest = class(TUInt32ModTest)
  114. protected
  115. function GetDivisor: Cardinal; override;
  116. procedure DoTestIteration(Iteration: Integer); override;
  117. public
  118. function TestTitle: shortstring; override;
  119. end;
  120. { TUInt32Bit60000Test }
  121. const
  122. FU32_60000Input: array[$0..$F] of Cardinal =
  123. (0, 1, 59999, 60000, 60001, 119999, 120000, 120001,
  124. 4294919999, 4294920000, 4294920001,
  125. $7FFFFFFE, $7FFFFFFF, $80000000, $80000001, $FFFFFFFF);
  126. type
  127. TUInt32Bit60000Test = class(TUInt32DivTest)
  128. protected
  129. function GetDivisor: Cardinal; override;
  130. procedure DoTestIteration(Iteration: Integer); override;
  131. public
  132. function TestTitle: shortstring; override;
  133. end;
  134. { TUInt32Bit60000ModTest }
  135. TUInt32Bit60000ModTest = class(TUInt32ModTest)
  136. protected
  137. function GetDivisor: Cardinal; override;
  138. procedure DoTestIteration(Iteration: Integer); override;
  139. public
  140. function TestTitle: shortstring; override;
  141. end;
  142. { TUInt32Bit146097Test }
  143. const
  144. FU32_146097Input: array[$0..$F] of Cardinal =
  145. (0, 1, 146096, 146097, 146098, 292193, 292194, 292195,
  146. 4294959605, 4294959606, 4294959607,
  147. $7FFFFFFE, $7FFFFFFF, $80000000, $80000001, $FFFFFFFF);
  148. type
  149. TUInt32Bit146097Test = class(TUInt32DivTest)
  150. protected
  151. function GetDivisor: Cardinal; override;
  152. procedure DoTestIteration(Iteration: Integer); override;
  153. public
  154. function TestTitle: shortstring; override;
  155. end;
  156. { TUInt32Bit146097ModTest }
  157. TUInt32Bit146097ModTest = class(TUInt32ModTest)
  158. protected
  159. function GetDivisor: Cardinal; override;
  160. procedure DoTestIteration(Iteration: Integer); override;
  161. public
  162. function TestTitle: shortstring; override;
  163. end;
  164. { TUInt32Bit3600000Test }
  165. const
  166. FU32_3600000Input: array[$0..$F] of Cardinal =
  167. (0, 1, 3599999, 3600000, 3600001, 7199999, 7200000, 7200001,
  168. 3600000000, 4294799999, 4294800000, 4294800001,
  169. $7FFFFFFF, $80000000, $80000001, $FFFFFFFF);
  170. type
  171. TUInt32Bit3600000Test = class(TUInt32DivTest)
  172. protected
  173. function GetDivisor: Cardinal; override;
  174. procedure DoTestIteration(Iteration: Integer); override;
  175. public
  176. function TestTitle: shortstring; override;
  177. end;
  178. { TUInt32Bit3600000ModTest }
  179. TUInt32Bit3600000ModTest = class(TUInt32ModTest)
  180. protected
  181. function GetDivisor: Cardinal; override;
  182. procedure DoTestIteration(Iteration: Integer); override;
  183. public
  184. function TestTitle: shortstring; override;
  185. end;
  186. { TUInt32Bit3ModCmpTest }
  187. TUInt32Bit3ModCmpTest = class(TUInt32ModCmpTest)
  188. protected
  189. function GetDivisor: Cardinal; override;
  190. procedure DoTestIteration(Iteration: Integer); override;
  191. public
  192. function TestTitle: shortstring; override;
  193. end;
  194. { TUInt32Bit10ModCmpTest }
  195. TUInt32Bit10ModCmpTest = class(TUInt32ModCmpTest)
  196. protected
  197. function GetDivisor: Cardinal; override;
  198. procedure DoTestIteration(Iteration: Integer); override;
  199. public
  200. function TestTitle: shortstring; override;
  201. end;
  202. { TUInt32Bit100ModCmpTest }
  203. TUInt32Bit100ModCmpTest = class(TUInt32ModCmpTest)
  204. protected
  205. function GetDivisor: Cardinal; override;
  206. procedure DoTestIteration(Iteration: Integer); override;
  207. public
  208. function TestTitle: shortstring; override;
  209. end;
  210. { TUInt32Bit400ModCmpTest }
  211. TUInt32Bit400ModCmpTest = class(TUInt32ModCmpTest)
  212. protected
  213. function GetDivisor: Cardinal; override;
  214. procedure DoTestIteration(Iteration: Integer); override;
  215. public
  216. function TestTitle: shortstring; override;
  217. end;
  218. { TUInt32Bit1000ModCmpTest }
  219. TUInt32Bit1000ModCmpTest = class(TUInt32ModCmpTest)
  220. protected
  221. function GetDivisor: Cardinal; override;
  222. procedure DoTestIteration(Iteration: Integer); override;
  223. public
  224. function TestTitle: shortstring; override;
  225. end;
  226. { TUInt32Bit1Test }
  227. function TUInt32Bit1Test.TestTitle: shortstring;
  228. begin
  229. Result := 'Unsigned 32-bit division by 1';
  230. end;
  231. function TUInt32Bit1Test.GetDivisor: Cardinal;
  232. begin
  233. Result := 1;
  234. end;
  235. procedure TUInt32Bit1Test.DoTestIteration(Iteration: Integer);
  236. var
  237. Numerator, Answer: Cardinal;
  238. Index, X: Integer;
  239. begin
  240. Index := Iteration and $FF;
  241. case Index of
  242. 253:
  243. Numerator := 4294967293;
  244. 254:
  245. Numerator := 4294967294;
  246. 255:
  247. Numerator := 4294967295;
  248. else
  249. Numerator := Cardinal(Index);
  250. end;
  251. FInputArray[Index] := Numerator;
  252. for X := 0 to INTERNAL_LOOPS - 1 do
  253. Answer := Numerator div 1;
  254. FResultArray[Index] := Answer;
  255. end;
  256. { TUInt32Bit1Test }
  257. function TUInt32Bit1ModTest.TestTitle: shortstring;
  258. begin
  259. Result := 'Unsigned 32-bit modulus by 1';
  260. end;
  261. function TUInt32Bit1ModTest.GetDivisor: Cardinal;
  262. begin
  263. Result := 1;
  264. end;
  265. procedure TUInt32Bit1ModTest.DoTestIteration(Iteration: Integer);
  266. var
  267. Numerator, Answer: Cardinal;
  268. Index, X: Integer;
  269. begin
  270. Index := Iteration and $FF;
  271. case Index of
  272. 253:
  273. Numerator := 4294967293;
  274. 254:
  275. Numerator := 4294967294;
  276. 255:
  277. Numerator := 4294967295;
  278. else
  279. Numerator := Cardinal(Index);
  280. end;
  281. FInputArray[Index] := Numerator;
  282. for X := 0 to INTERNAL_LOOPS - 1 do
  283. Answer := Numerator mod 1;
  284. FResultArray[Index] := Answer;
  285. end;
  286. { TUInt32Bit2Test }
  287. function TUInt32Bit2Test.TestTitle: shortstring;
  288. begin
  289. Result := 'Unsigned 32-bit division by 2';
  290. end;
  291. function TUInt32Bit2Test.GetDivisor: Cardinal;
  292. begin
  293. Result := 2;
  294. end;
  295. procedure TUInt32Bit2Test.DoTestIteration(Iteration: Integer);
  296. var
  297. Numerator, Answer: Cardinal;
  298. Index, X: Integer;
  299. begin
  300. Index := Iteration and $FF;
  301. case Index of
  302. 253:
  303. Numerator := 4294967293;
  304. 254:
  305. Numerator := 4294967294;
  306. 255:
  307. Numerator := 4294967295;
  308. else
  309. Numerator := Cardinal(Index);
  310. end;
  311. FInputArray[Index] := Numerator;
  312. for X := 0 to INTERNAL_LOOPS - 1 do
  313. Answer := Numerator div 2;
  314. FResultArray[Index] := Answer;
  315. end;
  316. { TUInt32Bit2ModTest }
  317. function TUInt32Bit2ModTest.TestTitle: shortstring;
  318. begin
  319. Result := 'Unsigned 32-bit modulus by 2';
  320. end;
  321. function TUInt32Bit2ModTest.GetDivisor: Cardinal;
  322. begin
  323. Result := 2;
  324. end;
  325. procedure TUInt32Bit2ModTest.DoTestIteration(Iteration: Integer);
  326. var
  327. Numerator, Answer: Cardinal;
  328. Index, X: Integer;
  329. begin
  330. Index := Iteration and $FF;
  331. case Index of
  332. 253:
  333. Numerator := 4294967293;
  334. 254:
  335. Numerator := 4294967294;
  336. 255:
  337. Numerator := 4294967295;
  338. else
  339. Numerator := Cardinal(Index);
  340. end;
  341. FInputArray[Index] := Numerator;
  342. for X := 0 to INTERNAL_LOOPS - 1 do
  343. Answer := Numerator mod 2;
  344. FResultArray[Index] := Answer;
  345. end;
  346. { TUInt32Bit3Test }
  347. function TUInt32Bit3Test.TestTitle: shortstring;
  348. begin
  349. Result := 'Unsigned 32-bit division by 3';
  350. end;
  351. function TUInt32Bit3Test.GetDivisor: Cardinal;
  352. begin
  353. Result := 3;
  354. end;
  355. procedure TUInt32Bit3Test.DoTestIteration(Iteration: Integer);
  356. var
  357. Numerator, Answer: Cardinal;
  358. Index, X: Integer;
  359. begin
  360. Index := Iteration and $FF;
  361. case Index of
  362. 254:
  363. Numerator := 4294967294;
  364. 255:
  365. Numerator := 4294967295;
  366. else
  367. Numerator := Cardinal(Index);
  368. end;
  369. FInputArray[Index] := Numerator;
  370. for X := 0 to INTERNAL_LOOPS - 1 do
  371. Answer := Numerator div 3;
  372. FResultArray[Index] := Answer;
  373. end;
  374. { TUInt32Bit3ModTest }
  375. function TUInt32Bit3ModTest.TestTitle: shortstring;
  376. begin
  377. Result := 'Unsigned 32-bit modulus by 3';
  378. end;
  379. function TUInt32Bit3ModTest.GetDivisor: Cardinal;
  380. begin
  381. Result := 3;
  382. end;
  383. procedure TUInt32Bit3ModTest.DoTestIteration(Iteration: Integer);
  384. var
  385. Numerator, Answer: Cardinal;
  386. Index, X: Integer;
  387. begin
  388. Index := Iteration and $FF;
  389. case Index of
  390. 254:
  391. Numerator := 4294967294;
  392. 255:
  393. Numerator := 4294967295;
  394. else
  395. Numerator := Cardinal(Index);
  396. end;
  397. FInputArray[Index] := Numerator;
  398. for X := 0 to INTERNAL_LOOPS - 1 do
  399. Answer := Numerator mod 3;
  400. FResultArray[Index] := Answer;
  401. end;
  402. { TUInt32Bit7Test }
  403. function TUInt32Bit7Test.TestTitle: shortstring;
  404. begin
  405. Result := 'Unsigned 32-bit division by 7';
  406. end;
  407. function TUInt32Bit7Test.GetDivisor: Cardinal;
  408. begin
  409. Result := 7;
  410. end;
  411. procedure TUInt32Bit7Test.DoTestIteration(Iteration: Integer);
  412. var
  413. Numerator, Answer: Cardinal;
  414. Index, X: Integer;
  415. begin
  416. Index := Iteration and $FF;
  417. case Index of
  418. 254:
  419. Numerator := 4294967294;
  420. 255:
  421. Numerator := 4294967295;
  422. else
  423. Numerator := Cardinal(Index);
  424. end;
  425. FInputArray[Index] := Numerator;
  426. for X := 0 to INTERNAL_LOOPS - 1 do
  427. Answer := Numerator div 7;
  428. FResultArray[Index] := Answer;
  429. end;
  430. { TUInt32Bit7ModTest }
  431. function TUInt32Bit7ModTest.TestTitle: shortstring;
  432. begin
  433. Result := 'Unsigned 32-bit modulus by 7';
  434. end;
  435. function TUInt32Bit7ModTest.GetDivisor: Cardinal;
  436. begin
  437. Result := 7;
  438. end;
  439. procedure TUInt32Bit7ModTest.DoTestIteration(Iteration: Integer);
  440. var
  441. Numerator, Answer: Cardinal;
  442. Index, X: Integer;
  443. begin
  444. Index := Iteration and $FF;
  445. case Index of
  446. 252:
  447. Numerator := 4294967291;
  448. 253:
  449. Numerator := 4294967292;
  450. 254:
  451. Numerator := 4294967293;
  452. 255:
  453. Numerator := 4294967295;
  454. else
  455. Numerator := Cardinal(Index);
  456. end;
  457. FInputArray[Index] := Numerator;
  458. for X := 0 to INTERNAL_LOOPS - 1 do
  459. Answer := Numerator mod 7;
  460. FResultArray[Index] := Answer;
  461. end;
  462. { TUInt32Bit10Test }
  463. function TUInt32Bit10Test.TestTitle: shortstring;
  464. begin
  465. Result := 'Unsigned 32-bit division by 10';
  466. end;
  467. function TUInt32Bit10Test.GetDivisor: Cardinal;
  468. begin
  469. Result := 10;
  470. end;
  471. procedure TUInt32Bit10Test.DoTestIteration(Iteration: Integer);
  472. var
  473. Numerator, Answer: Cardinal;
  474. Index, X: Integer;
  475. begin
  476. Index := Iteration and $FF;
  477. case Index of
  478. 253:
  479. Numerator := 4294967289;
  480. 254:
  481. Numerator := 4294967290;
  482. 255:
  483. Numerator := 4294967295;
  484. else
  485. Numerator := Cardinal(Index);
  486. end;
  487. FInputArray[Index] := Numerator;
  488. for X := 0 to INTERNAL_LOOPS - 1 do
  489. Answer := Numerator div 10;
  490. FResultArray[Index] := Answer;
  491. end;
  492. { TUInt32Bit10ModTest }
  493. function TUInt32Bit10ModTest.TestTitle: shortstring;
  494. begin
  495. Result := 'Unsigned 32-bit modulus by 10';
  496. end;
  497. function TUInt32Bit10ModTest.GetDivisor: Cardinal;
  498. begin
  499. Result := 10;
  500. end;
  501. procedure TUInt32Bit10ModTest.DoTestIteration(Iteration: Integer);
  502. var
  503. Numerator, Answer: Cardinal;
  504. Index, X: Integer;
  505. begin
  506. Index := Iteration and $FF;
  507. case Index of
  508. 253:
  509. Numerator := 4294967289;
  510. 254:
  511. Numerator := 4294967290;
  512. 255:
  513. Numerator := 4294967295;
  514. else
  515. Numerator := Cardinal(Index);
  516. end;
  517. FInputArray[Index] := Numerator;
  518. for X := 0 to INTERNAL_LOOPS - 1 do
  519. Answer := Numerator mod 10;
  520. FResultArray[Index] := Answer;
  521. end;
  522. { TUInt32Bit100Test }
  523. function TUInt32Bit100Test.TestTitle: shortstring;
  524. begin
  525. Result := 'Unsigned 32-bit division by 100';
  526. end;
  527. function TUInt32Bit100Test.GetDivisor: Cardinal;
  528. begin
  529. Result := 100;
  530. end;
  531. procedure TUInt32Bit100Test.DoTestIteration(Iteration: Integer);
  532. var
  533. Numerator, Answer: Cardinal;
  534. Index, X: Integer;
  535. begin
  536. Index := Iteration and $FF;
  537. case Index of
  538. 253:
  539. Numerator := 4294967199;
  540. 254:
  541. Numerator := 4294967200;
  542. 255:
  543. Numerator := 4294967295;
  544. else
  545. Numerator := Cardinal(Index);
  546. end;
  547. FInputArray[Index] := Numerator;
  548. for X := 0 to INTERNAL_LOOPS - 1 do
  549. Answer := Numerator div 100;
  550. FResultArray[Index] := Answer;
  551. end;
  552. { TUInt32Bit100ModTest }
  553. function TUInt32Bit100ModTest.TestTitle: shortstring;
  554. begin
  555. Result := 'Unsigned 32-bit modulus by 100';
  556. end;
  557. function TUInt32Bit100ModTest.GetDivisor: Cardinal;
  558. begin
  559. Result := 100;
  560. end;
  561. procedure TUInt32Bit100ModTest.DoTestIteration(Iteration: Integer);
  562. var
  563. Numerator, Answer: Cardinal;
  564. Index, X: Integer;
  565. begin
  566. Index := Iteration and $FF;
  567. case Index of
  568. 253:
  569. Numerator := 4294967199;
  570. 254:
  571. Numerator := 4294967200;
  572. 255:
  573. Numerator := 4294967295;
  574. else
  575. Numerator := Cardinal(Index);
  576. end;
  577. FInputArray[Index] := Numerator;
  578. for X := 0 to INTERNAL_LOOPS - 1 do
  579. Answer := Numerator mod 100;
  580. FResultArray[Index] := Answer;
  581. end;
  582. { TUInt32Bit1000Test }
  583. function TUInt32Bit1000Test.TestTitle: shortstring;
  584. begin
  585. Result := 'Unsigned 32-bit division by 1,000';
  586. end;
  587. function TUInt32Bit1000Test.GetDivisor: Cardinal;
  588. begin
  589. Result := 1000;
  590. end;
  591. procedure TUInt32Bit1000Test.DoTestIteration(Iteration: Integer);
  592. var
  593. Numerator, Answer: Cardinal;
  594. Index, X: Integer;
  595. begin
  596. Index := Iteration and $FF;
  597. Numerator := FU32_1000Input[Index and $F];
  598. FInputArray[Index] := Numerator;
  599. for X := 0 to INTERNAL_LOOPS - 1 do
  600. Answer := Numerator div 1000;
  601. FResultArray[Index] := Answer;
  602. end;
  603. { TUInt32Bit1000ModTest }
  604. function TUInt32Bit1000ModTest.TestTitle: shortstring;
  605. begin
  606. Result := 'Unsigned 32-bit modulus by 1,000';
  607. end;
  608. function TUInt32Bit1000ModTest.GetDivisor: Cardinal;
  609. begin
  610. Result := 1000;
  611. end;
  612. procedure TUInt32Bit1000ModTest.DoTestIteration(Iteration: Integer);
  613. var
  614. Numerator, Answer: Cardinal;
  615. Index, X: Integer;
  616. begin
  617. Index := Iteration and $FF;
  618. Numerator := FU32_1000Input[Index and $F];
  619. FInputArray[Index] := Numerator;
  620. for X := 0 to INTERNAL_LOOPS - 1 do
  621. Answer := Numerator mod 1000;
  622. FResultArray[Index] := Answer;
  623. end;
  624. { TUInt32Bit60000Test }
  625. function TUInt32Bit60000Test.TestTitle: shortstring;
  626. begin
  627. Result := 'Unsigned 32-bit division by 60,000';
  628. end;
  629. function TUInt32Bit60000Test.GetDivisor: Cardinal;
  630. begin
  631. Result := 60000;
  632. end;
  633. procedure TUInt32Bit60000Test.DoTestIteration(Iteration: Integer);
  634. var
  635. Numerator, Answer: Cardinal;
  636. Index, X: Integer;
  637. begin
  638. Index := Iteration and $FF;
  639. Numerator := FU32_60000Input[Index and $F];
  640. FInputArray[Index] := Numerator;
  641. for X := 0 to INTERNAL_LOOPS - 1 do
  642. Answer := Numerator div 60000;
  643. FResultArray[Index] := Answer;
  644. end;
  645. { TUInt32Bit60000ModTest }
  646. function TUInt32Bit60000ModTest.TestTitle: shortstring;
  647. begin
  648. Result := 'Unsigned 32-bit modulus by 60,000';
  649. end;
  650. function TUInt32Bit60000ModTest.GetDivisor: Cardinal;
  651. begin
  652. Result := 60000;
  653. end;
  654. procedure TUInt32Bit60000ModTest.DoTestIteration(Iteration: Integer);
  655. var
  656. Numerator, Answer: Cardinal;
  657. Index, X: Integer;
  658. begin
  659. Index := Iteration and $FF;
  660. Numerator := FU32_60000Input[Index and $F];
  661. FInputArray[Index] := Numerator;
  662. for X := 0 to INTERNAL_LOOPS - 1 do
  663. Answer := Numerator mod 60000;
  664. FResultArray[Index] := Answer;
  665. end;
  666. { TUInt32Bit146097Test }
  667. function TUInt32Bit146097Test.TestTitle: shortstring;
  668. begin
  669. Result := 'Unsigned 32-bit division by 146,097';
  670. end;
  671. function TUInt32Bit146097Test.GetDivisor: Cardinal;
  672. begin
  673. Result := 146097;
  674. end;
  675. procedure TUInt32Bit146097Test.DoTestIteration(Iteration: Integer);
  676. var
  677. Numerator, Answer: Cardinal;
  678. Index, X: Integer;
  679. begin
  680. Index := Iteration and $FF;
  681. Numerator := FU32_146097Input[Index and $F];
  682. FInputArray[Index] := Numerator;
  683. for X := 0 to INTERNAL_LOOPS - 1 do
  684. Answer := Numerator div 146097;
  685. FResultArray[Index] := Answer;
  686. end;
  687. { TUInt32Bit146097ModTest }
  688. function TUInt32Bit146097ModTest.TestTitle: shortstring;
  689. begin
  690. Result := 'Unsigned 32-bit modulus by 146,097';
  691. end;
  692. function TUInt32Bit146097ModTest.GetDivisor: Cardinal;
  693. begin
  694. Result := 146097;
  695. end;
  696. procedure TUInt32Bit146097ModTest.DoTestIteration(Iteration: Integer);
  697. var
  698. Numerator, Answer: Cardinal;
  699. Index, X: Integer;
  700. begin
  701. Index := Iteration and $FF;
  702. Numerator := FU32_146097Input[Index and $F];
  703. FInputArray[Index] := Numerator;
  704. for X := 0 to INTERNAL_LOOPS - 1 do
  705. Answer := Numerator mod 146097;
  706. FResultArray[Index] := Answer;
  707. end;
  708. { TUInt32Bit3600000Test }
  709. function TUInt32Bit3600000Test.TestTitle: shortstring;
  710. begin
  711. Result := 'Unsigned 32-bit division by 3,600,000';
  712. end;
  713. function TUInt32Bit3600000Test.GetDivisor: Cardinal;
  714. begin
  715. Result := 3600000;
  716. end;
  717. procedure TUInt32Bit3600000Test.DoTestIteration(Iteration: Integer);
  718. var
  719. Numerator, Answer: Cardinal;
  720. Index, X: Integer;
  721. begin
  722. Index := Iteration and $FF;
  723. Numerator := FU32_3600000Input[Index and $F];
  724. FInputArray[Index] := Numerator;
  725. for X := 0 to INTERNAL_LOOPS - 1 do
  726. Answer := Numerator div 3600000;
  727. FResultArray[Index] := Answer;
  728. end;
  729. { TUInt32Bit3600000ModTest }
  730. function TUInt32Bit3600000ModTest.TestTitle: shortstring;
  731. begin
  732. Result := 'Unsigned 32-bit modulus by 3,600,000';
  733. end;
  734. function TUInt32Bit3600000ModTest.GetDivisor: Cardinal;
  735. begin
  736. Result := 3600000;
  737. end;
  738. procedure TUInt32Bit3600000ModTest.DoTestIteration(Iteration: Integer);
  739. var
  740. Numerator, Answer: Cardinal;
  741. Index, X: Integer;
  742. begin
  743. Index := Iteration and $FF;
  744. Numerator := FU32_3600000Input[Index and $F];
  745. FInputArray[Index] := Numerator;
  746. for X := 0 to INTERNAL_LOOPS - 1 do
  747. Answer := Numerator mod 3600000;
  748. FResultArray[Index] := Answer;
  749. end;
  750. { TUInt32Bit3ModCmpTest }
  751. function TUInt32Bit3ModCmpTest.TestTitle: shortstring;
  752. begin
  753. Result := 'Unsigned 32-bit (n mod 3) = 0';
  754. end;
  755. function TUInt32Bit3ModCmpTest.GetDivisor: Cardinal;
  756. begin
  757. Result := 3;
  758. end;
  759. procedure TUInt32Bit3ModCmpTest.DoTestIteration(Iteration: Integer);
  760. var
  761. Numerator: Cardinal; Answer: Boolean;
  762. Index, X: Integer;
  763. begin
  764. Index := Iteration and $FF;
  765. case Index of
  766. 254:
  767. Numerator := 4294967294;
  768. 255:
  769. Numerator := 4294967295;
  770. else
  771. Numerator := Cardinal(Index);
  772. end;
  773. FInputArray[Index] := Numerator;
  774. for X := 0 to INTERNAL_LOOPS - 1 do
  775. Answer := (Numerator mod 3) = 0;
  776. FResultArray[Index] := Answer;
  777. end;
  778. { TUInt32Bit10ModCmpTest }
  779. function TUInt32Bit10ModCmpTest.TestTitle: shortstring;
  780. begin
  781. Result := 'Unsigned 32-bit (n mod 10) = 0';
  782. end;
  783. function TUInt32Bit10ModCmpTest.GetDivisor: Cardinal;
  784. begin
  785. Result := 10;
  786. end;
  787. procedure TUInt32Bit10ModCmpTest.DoTestIteration(Iteration: Integer);
  788. var
  789. Numerator: Cardinal; Answer: Boolean;
  790. Index, X: Integer;
  791. begin
  792. Index := Iteration and $FF;
  793. case Index of
  794. 254:
  795. Numerator := 4294967294;
  796. 255:
  797. Numerator := 4294967295;
  798. else
  799. Numerator := Cardinal(Index);
  800. end;
  801. FInputArray[Index] := Numerator;
  802. for X := 0 to INTERNAL_LOOPS - 1 do
  803. Answer := (Numerator mod 10) = 0;
  804. FResultArray[Index] := Answer;
  805. end;
  806. { TUInt32Bit100ModCmpTest }
  807. function TUInt32Bit100ModCmpTest.TestTitle: shortstring;
  808. begin
  809. Result := 'Unsigned 32-bit (n mod 100) = 0';
  810. end;
  811. function TUInt32Bit100ModCmpTest.GetDivisor: Cardinal;
  812. begin
  813. Result := 100;
  814. end;
  815. procedure TUInt32Bit100ModCmpTest.DoTestIteration(Iteration: Integer);
  816. var
  817. Numerator: Cardinal; Answer: Boolean;
  818. Index, X: Integer;
  819. begin
  820. Index := Iteration and $FF;
  821. case Index of
  822. 254:
  823. Numerator := 4294967294;
  824. 255:
  825. Numerator := 4294967295;
  826. else
  827. Numerator := Cardinal(Index);
  828. end;
  829. FInputArray[Index] := Numerator;
  830. for X := 0 to INTERNAL_LOOPS - 1 do
  831. Answer := (Numerator mod 100) = 0;
  832. FResultArray[Index] := Answer;
  833. end;
  834. { TUInt32Bit400ModCmpTest }
  835. function TUInt32Bit400ModCmpTest.TestTitle: shortstring;
  836. begin
  837. Result := 'Unsigned 32-bit (n mod 400) = 0';
  838. end;
  839. function TUInt32Bit400ModCmpTest.GetDivisor: Cardinal;
  840. begin
  841. Result := 400;
  842. end;
  843. procedure TUInt32Bit400ModCmpTest.DoTestIteration(Iteration: Integer);
  844. var
  845. Numerator: Cardinal; Answer: Boolean;
  846. Index, X: Integer;
  847. begin
  848. Index := Iteration and $FF;
  849. Numerator := FU32_1000Input[Index and $F];
  850. FInputArray[Index] := Numerator;
  851. for X := 0 to INTERNAL_LOOPS - 1 do
  852. Answer := (Numerator mod 400) = 0;
  853. FResultArray[Index] := Answer;
  854. end;
  855. { TUInt32Bit1000ModCmpTest }
  856. function TUInt32Bit1000ModCmpTest.TestTitle: shortstring;
  857. begin
  858. Result := 'Unsigned 32-bit (n mod 1,000) = 0';
  859. end;
  860. function TUInt32Bit1000ModCmpTest.GetDivisor: Cardinal;
  861. begin
  862. Result := 1000;
  863. end;
  864. procedure TUInt32Bit1000ModCmpTest.DoTestIteration(Iteration: Integer);
  865. var
  866. Numerator: Cardinal; Answer: Boolean;
  867. Index, X: Integer;
  868. begin
  869. Index := Iteration and $FF;
  870. Numerator := FU32_1000Input[Index and $F];
  871. FInputArray[Index] := Numerator;
  872. for X := 0 to INTERNAL_LOOPS - 1 do
  873. Answer := (Numerator mod 1000) = 0;
  874. FResultArray[Index] := Answer;
  875. end;