This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 2/N] [x86_64] Vectorized math functions
- 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, 21 Nov 2014 17:55:31 +0000
- Subject: Re: [PATCH 2/N] [x86_64] Vectorized math functions
- Authentication-results: sourceware.org; auth=none
- References: <CAMXFM3vS-vKA7wDGRf-bA2JEGUag850_S4TEiARKfpiRP-f2Eg at mail dot gmail dot com>
On Thu, 20 Nov 2014, Andrew Senkevich wrote:
> +#ifndef TEST_MATHVEC
> +# define TEST_MATHVEC 0
> +#endif
Making this value explicit in each relevant test would better accord with
current glibc practice.
> +#ifndef INIT_ARCH_EXT
> +# define INIT_ARCH_EXT
> +# define CHECK_ARCH_EXT
> +#endif
Again it's worth considering how to avoid this pattern. Maybe a separate
math-tests-arch.h header, with the sysdeps/generic version having a
comment explaining the semantics of the macros and defining them to empty
(and the x86_64 version including the generic one when not doing vector
tests)?
> +#ifndef VEC_PREFIX
> +# define VEC_PREFIX
> +#endif
So far we have two ways of distinguishing (in libm-test-ulps) tests for
variants of functions: suffixes (for rounding modes) and type names such
as "double" and "ildoubl" (for the type and for whether the inline
variants are being tested). I don't think adding a third way is a good
idea. I suggest using suffixes (until we can unify things and get down to
a single way).
> +# define INIT_ARCH_EXT \
> + __init_cpu_features (); \
> + avx2_usable = __cpu_features.feature[index_AVX2_Usable] \
> + & bit_AVX2_Usable;
> +
> +# define CHECK_ARCH_EXT \
> + if (!avx2_usable) return;
Any macro expanding to statements should expand to a
do
{
...;
}
while (0)
block unless what it does (e.g. declaring variables to be used outside its
own expansion) is unsuitable for such a block.
--
Joseph S. Myers
joseph@codesourcery.com