This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC] How to add vector math functions to Glibc
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Andrew Senkevich <andrew dot n dot senkevich at gmail dot com>
- Cc: libc-alpha <libc-alpha at sourceware dot org>
- Date: Fri, 14 Nov 2014 16:51:41 +0000
- Subject: Re: [RFC] How to add vector math functions to Glibc
- Authentication-results: sourceware.org; auth=none
- References: <CAMXFM3tjquzniXP1weqxSVFJyhXqsf2PHuyrrrmqp7K0ZzORqA at mail dot gmail dot com> <542AF92E dot 8090708 at lip6 dot fr> <Pine dot LNX dot 4 dot 64 dot 1409302003410 dot 12188 at digraph dot polyomino dot org dot uk> <CAMXFM3tuM_p6Acp4hzoQ2xzR=4BZqtw8NbezqY6h8V4Xx=5hUA at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1410021411420 dot 24886 at digraph dot polyomino dot org dot uk> <CAMXFM3uPiuJvSpgmt+8d0B1qh3QSA=TVx0ZExfojDVHzrscL8A at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1410091724031 dot 23641 at digraph dot polyomino dot org dot uk> <CAMXFM3uGOKqEAvGYew+9K7bmhObVmnP2u4kUOSh8_Cpwyk8s5g at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1410162141290 dot 32736 at digraph dot polyomino dot org dot uk> <CAMXFM3tf3EE-WenvnVohkFCkHR9Dy4QfaSiSHcw6Q-1o9QGW_Q at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1410211517340 dot 31277 at digraph dot polyomino dot org dot uk> <CAMXFM3t8xjQ7A6TF1SpY0GwzKpTQ9hZej4vKvSYHnnsxGkaONA at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1410232117130 dot 19073 at digraph dot polyomino dot org dot uk> <CAMXFM3vCm2u-Ntzshyqx6KfpvRoJ3boAOfje18b8qgTJJLc2fw at mail dot gmail dot com> <CAMXFM3v+KQ10t=T=sYVuxHfZVyh8WCw_Tbz6pHudtBKcGxGSjg at mail dot gmail dot com>
On Fri, 14 Nov 2014, Andrew Senkevich wrote:
> +#define __SIMD_DECL(function) __CONCAT(__DECL_SIMD_,function)
> +
> +#define __MATHCALL_VEC(function,suffix, args) \
> + __SIMD_DECL(__MATH_PRECNAME(function,suffix)) \
> + __MATHCALL(function,suffix, args)
Generally, throughout the patch, use GNU style: spaces before open
parentheses for calls to functions and function-like macros (not of course
in "#define func(args)" where C syntax doesn't allow that space) and after
commas.
> diff --git a/sysdeps/x86_64/configure.ac b/sysdeps/x86_64/configure.ac
> index c9f9a51..0b73d5b 100644
> --- a/sysdeps/x86_64/configure.ac
> +++ b/sysdeps/x86_64/configure.ac
> @@ -99,6 +99,15 @@ if test $libc_cv_cc_avx2 = yes; then
> fi
> LIBC_CONFIG_VAR([config-cflags-avx2], [$libc_cv_cc_avx2])
>
> +if test x"$build_mathvec" = xnotset; then
> + if test x"$base_machine" = xx86_64; then
No need for the base_machine test here; this configure fragment will never
be called for non-x86_64 machines. It's only preconfigure fragments that
need to check for an applicable machine, not configure ones.
> +LIBC_CONFIG_VAR([build-mathvec], [$build_mathvec])
I think the LIBC_CONFIG_VAR call belongs in the toplevel configure script
(after the sysdeps configure fragments have been run) - as does setting
build_mathvec to "no" if it's still "notset" after running the sysdeps
configure fragments.
--
Joseph S. Myers
joseph@codesourcery.com