[PATCH v2 2/2] Enable libmvec support for AArch64

Szabolcs Nagy szabolcs.nagy@arm.com
Tue Apr 11 14:06:12 GMT 2023


The 04/11/2023 10:59, Joe Ramsay via Libc-alpha wrote:
> This patch enables libmvec on AArch64. The proposed change is mainly
> implementing build infrastructure to add the new routines to ABI,
> tests and benchmarks. I have demonstrated how this all fits together
> by adding implementations for vector cos, in both single and double
> precision, targeting both Advanced SIMD and SVE.
> 
> The implementations of the routines themselves are just loops over the
> scalar routine from libm for now, as we are more concerned with
> getting the plumbing right at this point. We plan to contribute vector
> routines from the Arm Optimized Routines repo that are compliant with
> requirements described in the libmvec wiki.
> 
> Building libmvec requires minimum GCC 10 for SVE ACLE. To avoid raising
> the minimum GCC by such a big jump, we allow users to disable libmvec
> if their compiler is too old.
> 
> Note that at this point users have to manually call the vector math
> functions. This seems to be acceptable to some downstream users.
> 

you can put the rest of the commit message bellow a ---
and then patchwork and git am knows it's not part of the
commit message.

> Thanks,
> Joe
> 
> Changes to v1:
>   * Code formatting
>   * Refactor ARCH-specific checks in libmvec benchtests
>   * Always build SVE benchtests and exit early if unsupported
>   * Improve unsupported config error message
> ---

make check seems to use the new libm-test-ulps for all
math tests, not just libmvec ones.. i think the updates
should just go into the existing libm-test-ulps not
into a new file.

you can regenerate the file with

make -j$(nproc) regen-ulps
cp builddir/math/NewUlps srcdir/sysdeps/aarch64/libm-test-ulps

and then review the git diff.

> diff --git a/sysdeps/aarch64/fpu/libm-test-ulps b/sysdeps/aarch64/fpu/libm-test-ulps
> new file mode 100644
> index 0000000000..3449c8dfbb
> --- /dev/null
> +++ b/sysdeps/aarch64/fpu/libm-test-ulps
> @@ -0,0 +1,7 @@
> +Function: "cos_advsimd":
> +double: 2
> +float: 2
> +
> +Function: "cos_sve":
> +double: 2
> +float: 2
> diff --git a/sysdeps/aarch64/fpu/libm-test-ulps-name b/sysdeps/aarch64/fpu/libm-test-ulps-name
> new file mode 100644
> index 0000000000..1f66c5cda0
> --- /dev/null
> +++ b/sysdeps/aarch64/fpu/libm-test-ulps-name
> @@ -0,0 +1 @@
> +AArch64


More information about the Libc-alpha mailing list