aarch64: Add vector implementations of cos routines
commitaed39a3aa3ea68b14dce3395fb14b1416541e6c6
authorJoe Ramsay <Joe.Ramsay@arm.com>
Wed, 28 Jun 2023 11:19:36 +0000 (28 12:19 +0100)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Fri, 30 Jun 2023 08:04:10 +0000 (30 09:04 +0100)
tree38f866205e31b1bef745122636dbaa61922cb1cc
parent84e93afc734a3c30e35ed2d21466a44259ac577e
aarch64: Add vector implementations of cos routines

Replace the loop-over-scalar placeholder routines with optimised
implementations from Arm Optimized Routines (AOR).

Also add some headers containing utilities for aarch64 libmvec
routines, and update libm-test-ulps.

Data tables for new routines are used via a pointer with a
barrier on it, in order to prevent overly aggressive constant
inlining in GCC. This allows a single adrp, combined with offset
loads, to be used for every constant in the table.

Special-case handlers are marked NOINLINE in order to confine the
save/restore overhead of switching from vector to normal calling
standard. This way we only incur the extra memory access in the
exceptional cases. NOINLINE definitions have been moved to
math_private.h in order to reduce duplication.

AOR exposes a config option, WANT_SIMD_EXCEPT, to enable
selective masking (and later fixing up) of invalid lanes, in
order to trigger fp exceptions correctly (AdvSIMD only). This is
tested and maintained in AOR, however it is configured off at
source level here for performance reasons. We keep the
WANT_SIMD_EXCEPT blocks in routine sources to greatly simplify
the upstreaming process from AOR to glibc.

Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
13 files changed:
sysdeps/aarch64/fpu/advsimd_utils.h [deleted file]
sysdeps/aarch64/fpu/cos_advsimd.c
sysdeps/aarch64/fpu/cos_sve.c
sysdeps/aarch64/fpu/cosf_advsimd.c
sysdeps/aarch64/fpu/cosf_sve.c
sysdeps/aarch64/fpu/sv_math.h [new file with mode: 0644]
sysdeps/aarch64/fpu/sve_utils.h [deleted file]
sysdeps/aarch64/fpu/v_math.h [new file with mode: 0644]
sysdeps/aarch64/fpu/vecmath_config.h [new file with mode: 0644]
sysdeps/aarch64/libm-test-ulps
sysdeps/generic/math_private.h
sysdeps/ieee754/dbl-64/math_config.h
sysdeps/ieee754/flt-32/math_config.h