public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* Re: [PATCH 0/3] Add tests for abs(), labs(), llabs() (BZ #30263)
@ 2023-04-03 20:01 Wilco Dijkstra
  0 siblings, 0 replies; 2+ messages in thread
From: Wilco Dijkstra @ 2023-04-03 20:01 UTC (permalink / raw)
  To: josimmon; +Cc: 'GNU C Library'

Hi Joe,

> Add testcases for abs(), labs(), and llabs().  Test the bounds of the
> given type, zero, and part of the full range of values for labs() and
> llabs().  Test the full range for abs().

How long do these tests take on older, slower cores? You're running
over 20 billion tests in total - at say 10 cycles per test a 2GHz CPU
would take 100 seconds which is way overkill for these basic functions.

Try using a larger increment (eg. prime) so that you cover the range
and the test will run within a second on a slow core. And for llabs it
makes sense to add tests for the carry when the bottom 32 bits are
zero to the top 32 bits (think 32-bit targets here).

Cheers,
Wilco

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 0/3] Add tests for abs(), labs(), llabs() (BZ #30263)
@ 2023-04-03 19:12 Joe Simmons-Talbott
  0 siblings, 0 replies; 2+ messages in thread
From: Joe Simmons-Talbott @ 2023-04-03 19:12 UTC (permalink / raw)
  To: libc-alpha; +Cc: Joe Simmons-Talbott

Add testcases for abs(), labs(), and llabs().  Test the bounds of the
given type, zero, and part of the full range of values for labs() and
llabs().  Test the full range for abs().

Joe Simmons-Talbott (3):
  stdlib: Add testcases for abs(). (BZ #30263)
  stdlib: Add testcases for labs(). (BZ #30263)
  stdlib: Add testcases for llabs(). (BZ #30263)

 stdlib/Makefile    |  7 +++++++
 stdlib/tst-abs.c   | 43 ++++++++++++++++++++++++++++++++++++++++
 stdlib/tst-labs.c  | 49 ++++++++++++++++++++++++++++++++++++++++++++++
 stdlib/tst-llabs.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 148 insertions(+)
 create mode 100644 stdlib/tst-abs.c
 create mode 100644 stdlib/tst-labs.c
 create mode 100644 stdlib/tst-llabs.c

-- 
2.39.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-03 20:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-03 20:01 [PATCH 0/3] Add tests for abs(), labs(), llabs() (BZ #30263) Wilco Dijkstra
  -- strict thread matches above, loose matches on Subject: below --
2023-04-03 19:12 Joe Simmons-Talbott

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).