Commit Graph

428 Commits

Author SHA1 Message Date
H.J. Lu eb35513d3d plot_strings.py: Replace np.complex with complex
Replace np.complex with complex to fix numpy error:

AttributeError: module 'numpy' has no attribute 'complex'.
`np.complex` was a deprecated alias for the builtin `complex`. To avoid this error in existing code, use `complex` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.complex128` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2025-10-22 07:52:54 +08:00
Adhemerval Zanella 1b8eb82845 benchtests: Improve fmod benchmark
The gcc implements fmod as a built-in for x86, so disable it to
benchmark the C implementation.

Also, make fmod and fmodf use the workload directive to measure
the reciprocal throughput.
2025-10-08 10:42:22 -03:00
Adhemerval Zanella e66fc31b7c benchtests: Add lgammaf_r benchmark
Random inputs in the range [-20.0,20.0].
2025-10-08 10:42:10 -03:00
Adhemerval Zanella 4324a1490e benchtests: Add remainderf benchtest
The inputs are based on fmodf-inputs.
Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>
2025-10-01 14:49:10 -03:00
Adhemerval Zanella 989b47acf0 benchtests: Add remainder benchtest
The inputs are based on fmod-inputs.
Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>
2025-10-01 14:49:10 -03:00
Luna Lamb 653e6c4fff AArch64: Implement AdvSIMD and SVE log10p1(f) routines
Vector variants of the new C23 log10p1 routines.

Note: Benchmark inputs for log10p1(f) are identical to log1p(f)

Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>
2025-09-27 12:45:59 +00:00
Luna Lamb db42732474 AArch64: Implement AdvSIMD and SVE log2p1(f) routines
Vector variants of the new C23 log2p1 routines.

Note: Benchmark inputs for log2p1(f) are identical to log1p(f).

Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>
2025-09-27 12:44:09 +00:00
Adhemerval Zanella 490cacb099 benchtests: Add workload for tgammaf-inputs 2025-09-23 10:29:24 -03:00
Wilco Dijkstra eba46f7077 benchtests: Fix warning in bench-strchr.c
Ensure benchtests compile with trunk GCC.
2025-09-22 12:42:57 +00:00
Adhemerval Zanella 1fdb73fb3c benchtests: Add workload directive for tgamma 2025-09-11 14:46:07 -03:00
Adhemerval Zanella 5abfa1365b benchtests: Add workload directive for erf and erfc 2025-09-11 14:46:07 -03:00
Adhemerval Zanella 56e4da7ca5 benchtests: Add workload for lgamma
Random inputs in range [-20.00,20.00].
Reviewed-by: DJ Delorie <dj@redhat.com>
2025-09-11 14:46:07 -03:00
Adhemerval Zanella 2c25058aa5 benchtests: Add workload for asinh
Random input in range [-10,10].
Reviewed-by: DJ Delorie <dj@redhat.com>
2025-09-11 14:46:07 -03:00
Adhemerval Zanella ddd8c33f87 benchtests: Add workload for acosh
Random inputs in range [1.00,21.00]
Reviewed-by: DJ Delorie <dj@redhat.com>
2025-09-11 14:46:07 -03:00
Hasaan Khan 8ced7815fb AArch64: Implement exp2m1 and exp10m1 routines
Vector variants of the new C23 exp2m1 & exp10m1 routines.

Note: Benchmark inputs for exp2m1 & exp10m1 are identical to exp2 & exp10
respectively, this also includes the floating point variations.

Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>
2025-09-02 16:50:24 +00:00
Paul Zimmermann 0a96e56017 added benchmark inputs for rsqrtf and rsqrt
Changes with respect to v1:
- added missing rsqrt and rsqrtf in bench-math
2025-08-27 08:28:28 +02:00
Paul Zimmermann 170606d82c add missing benchmark files for several C23 binary64 functions
These files were prepared together with Saban Houssein.
2025-08-26 17:08:43 +02:00
Wilco Dijkstra 122847e4a2 benchtests: Avoid truncation in random memcpy/memset benchmarks
Use uint16_t rather than uint8_t for the size arrays.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2025-08-12 11:15:58 +00:00
Wilco Dijkstra 011ef5b18c Revert "benchtests: Avoid overflow in random memcpy/memset benchmarks"
This reverts commit 09604542d3.
2025-08-04 17:31:51 +00:00
Wilco Dijkstra 09604542d3 benchtests: Avoid overflow in random memcpy/memset benchmarks
Use uint16_t rather than uint8_t for the size arrays.
2025-08-04 17:13:55 +00:00
Wilco Dijkstra 2df57ad95c benchtests: Cleanup bench-malloc-thread
Change duration to 3 seconds.  Add spaces before '('.

Reviewed-by: DJ Delorie <dj@redhat.com>
2025-08-02 14:18:23 +00:00
Paul Zimmermann 9716ee567a replace atan2-inputs with more meaningful inputs
Commit 934d88d used inputs with exponent generated at random in the
whole binary64 exponent range, which yields essentially very large
or very small values of |y/x|. Instead, this commit generates x, y at
random in [-10,10], which should better corresponds to real applications.
Reviewed-by: Florian Weimer <fweimer@redhat.com>
2025-07-29 13:25:59 +02:00
Adhemerval Zanella 14ca258cc5 benchtests: Add IPv6 inet_ntop benchmark
Random IP addresses in the full range.  There is no extra workload
to check the effectiveness '::' optimization for a set of 0-oct
sets (although it would be a possible workload).
Reviewed-by: DJ Delorie <dj@redhat.com>
2025-06-24 09:43:02 -03:00
Adhemerval Zanella e6ad9650fb benchtests: Add IPv4 inet_ntop benchmark
Random IP addresses in the full range.
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
Reviewed-by: DJ Delorie <dj@redhat.com>
2025-06-24 09:43:02 -03:00
Adhemerval Zanella 1d828b9ddc benchtests: Improve modf benchtest
It adds four ranges, which is how the generic implementation handles
normal numbers:

  1. Random inputs in the range [0.0, 1.0];
  2. Random inputs in the range [1.0, (double)(UINT64_C(1) << 52))];
  3. Random inputs in the range [(double)(UINT64_C(1) << 52), DBL_MAX];
  4. Random integral inputs in the range [0.0, (double)(UINT64_C(1) << 52)].

Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>
2025-06-13 11:30:12 -03:00
Adhemerval Zanella 619fd4e37b benchtests: Add modff benchtest
It adds four ranges, which is how the generic implementation handles
normal numbers:

  1. Random inputs in the range [0.0, 1.0];
  2. Random inputs in the range [1.0, (float)(1U << 23)];
  3. Random inputs in the range [(float)(1U << 23), FLT_MAX];
  4. Random integral inputs in the range [0.0, (float)(1U << 23)].

Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>
2025-06-13 11:29:39 -03:00
Wilco Dijkstra 7ad95d5506 libmvec: Add inputs for asinpi(f), acospi(f), atanpi(f) and atan2pi(f)
Add initial inputs for asinpi(f), acospi(f), atanpi(f) and atan2pi(f) based
on existing asin/acos/atan inputs.

Benchtests now works on the new libmvec function.

Reviewed-by: Yury Khrustalev <yury.khrustalev@arm.com>
2025-05-23 11:27:44 +00:00
Cupertino Miranda c6bf6d1897 benchtest: malloc tcache hotpath benchtest
Existing benchtests for malloc infrastructure seem to be rather generic
to test global malloc implementation performance.  This new benchtest
focus on reducing any non tcache related side effects, allowing to more
realistically predict performance impacts of tcache code changes.
The test was inpired in bench-[cm]alloc-thread code, with severe
simplifications:
 - forces single thread execution, reducing concurrency side-effects,
   like cache incoherence penalties due simultaneous writes to the same
   cache pages;
 - Focus on allocating and deallocating a single size for all the
   duration of the benchmark. Since all it does is allocate and
   deallocate, it will measure the tcache hotpath without any
   side-effects.
 - Allows to specify the allocation size as input argument.

Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>
2025-05-15 13:13:00 +00:00
Paul Zimmermann ad966bc4ef added benchtest inputs for log2l 2025-05-13 15:07:41 +02:00
Paul Zimmermann aa4c600483 added benchtest inputs for expl 2025-05-13 15:06:18 +02:00
Paul Zimmermann 2d9f479f37 added benchtest inputs for powl
changes in v2:
* fixed the missing Makefile entry in the first version
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2025-05-13 11:10:17 +02:00
Paul Zimmermann 442ddedc07 added benchtest inputs for fmal 2025-05-13 10:58:41 +02:00
Cupertino Miranda 77930e0447 benchtest: Correct shell script related to bench-malloc-thread
This patch changes the shell script that selects which arguments are used
for the execution of bench-malloc-thread.
The problem seems to have been introduced in commit:

  commit 2d6427a63c
  Author: Wangyang Guo <wangyang.guo@intel.com>
  Date:   Fri Nov 29 16:05:35 2024 +0800
  benchtests: Add calloc test

With current condition, the following error "/bin/sh: 3: [[: not found"
occurs when executing `make bench BENCHSET="malloc-thread"` and the else
path is taken, using incorrect arguments for bench test execution.

Error is reproducible in Debian based distros.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
2025-04-25 16:38:25 +02:00
Wilco Dijkstra dd003db8d1 benchtests: Increase iterations of bench-malloc-simple
Increase iterations so it runs for ~1 second on modern CPUs.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2025-03-18 17:13:28 +00:00
Sunil K Pandey c7c4a5906f x86_64: Add atanh with FMA
On SPR, it improves atanh bench performance by:

			Before		After		Improvement
reciprocal-throughput	15.1715		14.8628		2%
latency			57.1941		56.1883		2%

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2025-03-13 14:30:47 -07:00
Sunil K Pandey dded0d20f6 x86_64: Add sinh with FMA
On SPR, it improves sinh bench performance by:

			Before		After		Improvement
reciprocal-throughput	14.2017		11.815		17%
latency			36.4917		35.2114		4%

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2025-03-13 10:55:25 -07:00
Adhemerval Zanella 5e1a64736e benchtests: Remove wrong snippet from 360cce0b06 2025-03-13 10:30:43 -03:00
Adhemerval Zanella 360cce0b06 nptl: Check if thread is already terminated in sigcancel_handler (BZ 32782)
The SIGCANCEL signal handler should not issue __syscall_do_cancel,
which calls __do_cancel and __pthread_unwind, if the cancellation
is already in proces (and libgcc unwind is not reentrant).  Any
cancellation signal received after is ignored.

Checked on x86_64-linux-gnu and aarch64-linux-gnu.

Tested-by: Aurelien Jarno <aurelien@aurel32.net>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
2025-03-13 09:11:13 -03:00
Wilco Dijkstra 3a9fb97caf benchtests: Add random strlen benchmark
Add a new randomized strlen test similar to bench-random-memcpy.  Instead of
repeating the same call to strlen over and over again, it times a large number
of different strings.  The distribution of the string length and alignment is
based on SPEC2017.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2025-03-05 13:30:50 +00:00
Wilco Dijkstra dac7ea4a6f benchtests: Improve large memcpy/memset benchmarks
Adjust sizes between 64KB and 16MB and iterations based on length.
Remove incorrect uses of alloc_bufs since we're not interested in measuring
Linux clear_page time.  Use getpagesize() - 1 instead of 4095 when
aligning within a page.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2025-03-05 13:29:48 +00:00
Adhemerval Zanella 57d1fc9971 benchtests: Add tanpif
Random inputs in the range of [-4,4].

Reviewed-by: DJ Delorie <dj@redhat.com>
2025-02-12 16:31:54 -03:00
Adhemerval Zanella 10370a4d00 benchtests: Add sinpif
Random inputs in the range of [-4,4].

Reviewed-by: DJ Delorie <dj@redhat.com>
2025-02-12 16:31:51 -03:00
Adhemerval Zanella 180e97bee6 benchtests: Add cospif
Random inputs in the range of [-4,4].

Reviewed-by: DJ Delorie <dj@redhat.com>
2025-02-12 16:31:44 -03:00
Adhemerval Zanella 1700d306d4 benchtests: Add atanpif
Random inputs in the range of [-10,10].

Reviewed-by: DJ Delorie <dj@redhat.com>
2025-02-11 10:07:13 -03:00
Adhemerval Zanella ec9d2f3066 benchtests: Add atan2pif
Random inputs in the range of [-10,10].

Reviewed-by: DJ Delorie <dj@redhat.com>
2025-02-11 10:07:08 -03:00
Adhemerval Zanella 082ffa4ddc benchtests: Add asinpif
Random inputs in the range of [-1,1].

Reviewed-by: DJ Delorie <dj@redhat.com>
2025-02-11 10:07:02 -03:00
Adhemerval Zanella 3e0e782b29 benchtests: Add acospif
Random inputs in the range of [-1,1].

Reviewed-by: DJ Delorie <dj@redhat.com>
2025-02-11 10:06:56 -03:00
Florian Weimer 0b795abd62 benchtests: Add dummy in put files cospi, cospif, sinpi, sinpif, tanpi, tanpif
This fixes an AArch64 build failure:

python3 -B ../sysdeps/aarch64/fpu/scripts/bench_libmvec_advsimd.py bench-float-advsimd-cospi > …/benchtests/bench-float-advsimd-cospi.c
Traceback (most recent call last):
  File "…/sysdeps/aarch64/fpu/scripts/bench_libmvec_advsimd.py", line 106, in <module>
    main(sys.argv[1])
    ~~~~^^^^^^^^^^^^^
  File "…/sysdeps/aarch64/fpu/scripts/bench_libmvec_advsimd.py", line 81, in main
    with open(f"../benchtests/libmvec/{input_filename}") as f:
         ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

FileNotFoundError: [Errno 2] No such file or directory: '../benchtests/libmvec/cospif-inputs'
2025-01-16 19:59:58 +01:00
Paul Eggert 2642002380 Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
Adhemerval Zanella a2b0ff98a0 include/sys/cdefs.h: Add __attribute_optimization_barrier__
Add __attribute_optimization_barrier__ to disable inlining and cloning on a
function.  For Clang, expand it to

__attribute__ ((optnone))

Otherwise, expand it to

__attribute__ ((noinline, clone))

Co-Authored-By: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
2024-12-23 06:28:55 +08:00