summaryrefslogtreecommitdiff
path: root/lib/math/test_div64.c
AgeCommit message (Collapse)Author
2024-10-28lib/math/test_div64: add some edge cases relevant to __div64_const32()Nicolas Pitre
Be sure to test the extreme cases with and without bias. Signed-off-by: Nicolas Pitre <npitre@baylibre.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2021-04-23lib/math/test_div64: Correct the spelling of "dividend"Maciej W. Rozycki
The word is spelt with a final "d" of course. What a massive messup! Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2021-04-21lib/math/test_div64: Fix error message formattingMaciej W. Rozycki
Align the expected result with one actually produced for easier visual comparison; this has to take into account what the format specifiers will actually produce rather than the characters they consist of. E.g.: test_div64: ERROR: 10000000ab275080 / 00000009 => 01c71c71da20d00e,00000002 test_div64: ERROR: expected value => 0000000013045e47,00000001 (with a failure induced by setting bit #60 of the divident). Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2021-04-21lib/math: Add a `do_div' test moduleMaciej W. Rozycki
Implement a module for correctness and performance evaluation for the `do_div' function, often handled in an optimised manner by platform code. Use a somewhat randomly generated set of inputs that is supposed to be representative, using the same set of divisors twice, expressed as a constant and as a variable each, so as to verify the implementation for both cases should they be handled by different code execution paths. Reference results were produced with GNU bc. At the conclusion output the total execution time elapsed. Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>