[2/N,x86_64] Vectorized math functions
Commit Message
2014-11-26 19:26 GMT+03:00 Joseph Myers <joseph@codesourcery.com>:
> On Wed, 26 Nov 2014, Andrew Senkevich wrote:
>
>> +/* Macros used for architecture check in math tests runtime. */
>> +#define INIT_ARCH_EXT
>> +#define CHECK_ARCH_EXT
>
> I think the comments in the generic file need to say more about the
> semantics of these macros (in particular, that CHECK_ARCH_EXT should
> return if it determines, possibly using data set up by INIT_ARCH_EXT, that
> the test is running on hardware not supported by the function
> implementations to be tested).
Comments added.
ChangeLog
* math/libm-test.inc: START refactored.
* math/test-double.c (TEST_MATHVEC): Add define.
* math/test-float.c: Likewise.
* math/test-idouble.c: Likewise.
* math/test-ifloat.c: Likewise.
* math/test-ildoubl.c: Likewise.
* math/test-ldouble.c: Likewise.
* sysdeps/generic/math-tests-arch.h (INIT_ARCH_EXT, CHECK_ARCH_EXT):
New helper macros for runtime architecture check.
Is it OK for trunk?
--
WBR,
Andrew
Comments
On Tue, 2 Dec 2014, Andrew Senkevich wrote:
> Is it OK for trunk?
OK once the copyright assignment is in.
2014-12-03 1:41 GMT+03:00 Joseph Myers <joseph@codesourcery.com>:
> On Tue, 2 Dec 2014, Andrew Senkevich wrote:
>
>> Is it OK for trunk?
>
> OK once the copyright assignment is in.
Hi, Joseph, is it ok for commit with the following ChangeLog?
2014-12-28 Andrew Senkevich <andrew.senkevich@intel.com>
* math/libm-test.inc: START refactored.
* math/test-double.c (TEST_MATHVEC): Add define.
* math/test-float.c: Likewise.
* math/test-idouble.c: Likewise.
* math/test-ifloat.c: Likewise.
* math/test-ildoubl.c: Likewise.
* math/test-ldouble.c: Likewise.
* sysdeps/generic/math-tests-arch.h (INIT_ARCH_EXT, CHECK_ARCH_EXT):
New helper macros for runtime architecture check.
--
WBR,
Andrew
On Sun, 28 Dec 2014, Andrew Senkevich wrote:
> 2014-12-03 1:41 GMT+03:00 Joseph Myers <joseph@codesourcery.com>:
> > On Tue, 2 Dec 2014, Andrew Senkevich wrote:
> >
> >> Is it OK for trunk?
> >
> > OK once the copyright assignment is in.
>
> Hi, Joseph, is it ok for commit with the following ChangeLog?
I still don't see the assignment in copyright.list.
2014-12-30 20:00 GMT+03:00 Joseph Myers <joseph@codesourcery.com>:
> On Sun, 28 Dec 2014, Andrew Senkevich wrote:
>
>> 2014-12-03 1:41 GMT+03:00 Joseph Myers <joseph@codesourcery.com>:
>> > On Tue, 2 Dec 2014, Andrew Senkevich wrote:
>> >
>> >> Is it OK for trunk?
>> >
>> > OK once the copyright assignment is in.
>>
>> Hi, Joseph, is it ok for commit with the following ChangeLog?
>
> I still don't see the assignment in copyright.list.
Yes, there are no assignment in copyright.list but agreement between
Intel and FSF was achieved about contribution is possible from anyone
having @intel.com email. But may be FSF hasn't signed to formal
documents right now.
What do you think about it?
I have 17 patches (in format suitable for git am) and I am ready to send them.
--
WBR,
Andrew
On Tue, 30 Dec 2014, Andrew Senkevich wrote:
> 2014-12-30 20:00 GMT+03:00 Joseph Myers <joseph@codesourcery.com>:
> > On Sun, 28 Dec 2014, Andrew Senkevich wrote:
> >
> >> 2014-12-03 1:41 GMT+03:00 Joseph Myers <joseph@codesourcery.com>:
> >> > On Tue, 2 Dec 2014, Andrew Senkevich wrote:
> >> >
> >> >> Is it OK for trunk?
> >> >
> >> > OK once the copyright assignment is in.
> >>
> >> Hi, Joseph, is it ok for commit with the following ChangeLog?
> >
> > I still don't see the assignment in copyright.list.
>
> Yes, there are no assignment in copyright.list but agreement between
> Intel and FSF was achieved about contribution is possible from anyone
> having @intel.com email. But may be FSF hasn't signed to formal
> documents right now.
>
> What do you think about it?
As a GNU maintainer of glibc I need to wait for the assignment to appear
in copyright.list, or for the FSF to notify the GNU maintainers of glibc
in some other way.
2014-12-30 20:24 GMT+03:00 Joseph Myers <joseph@codesourcery.com>:
> On Tue, 30 Dec 2014, Andrew Senkevich wrote:
>
>> 2014-12-30 20:00 GMT+03:00 Joseph Myers <joseph@codesourcery.com>:
>> > On Sun, 28 Dec 2014, Andrew Senkevich wrote:
>> >
>> >> 2014-12-03 1:41 GMT+03:00 Joseph Myers <joseph@codesourcery.com>:
>> >> > On Tue, 2 Dec 2014, Andrew Senkevich wrote:
>> >> >
>> >> >> Is it OK for trunk?
>> >> >
>> >> > OK once the copyright assignment is in.
>> >>
>> >> Hi, Joseph, is it ok for commit with the following ChangeLog?
>> >
>> > I still don't see the assignment in copyright.list.
>>
>> Yes, there are no assignment in copyright.list but agreement between
>> Intel and FSF was achieved about contribution is possible from anyone
>> having @intel.com email. But may be FSF hasn't signed to formal
>> documents right now.
>>
>> What do you think about it?
>
> As a GNU maintainer of glibc I need to wait for the assignment to appear
> in copyright.list, or for the FSF to notify the GNU maintainers of glibc
> in some other way.
Clear. I hope it will be confirmed before commits closing... Will
check for it after several days...
--
WBR,
Andrew
@@ -126,6 +126,7 @@
#include <argp.h>
#include <tininess.h>
#include <math-tests.h>
+#include <math-tests-arch.h>
/* Structure for ulp data for a function, or the real or imaginary
part of a function. */
@@ -684,7 +685,7 @@ static void
test_single_errno (const char *test_name, int errno_value,
int expected_value, const char *expected_name)
{
-#ifndef TEST_INLINE
+#if !defined TEST_INLINE && !TEST_MATHVEC
if (errno_value == expected_value)
{
if (print_screen (1))
@@ -1690,9 +1691,18 @@ struct test_fFF_11_data
(ARRAY)[i].RM_##ROUNDING_MODE.extra2_expected); \
ROUND_RESTORE_ ## ROUNDING_MODE
+#if !TEST_MATHVEC
+# define VEC_SUFF
+#endif
+
+#define STR_CONCAT(a, b, c) __STRING (a##b##c)
+#define STR_CON3(a, b, c) STR_CONCAT (a, b, c)
+
/* Start and end the tests for a given function. */
-#define START(FUNC, EXACT) \
- const char *this_func = #FUNC; \
+#define START(FUNC, SUFF, EXACT) \
+ CHECK_ARCH_EXT; \
+ if (TEST_MATHVEC) return; \
+ const char *this_func = STR_CON3 (FUNC, SUFF, VEC_SUFF); \
init_max_error (this_func, EXACT)
#define END \
print_max_error (this_func)
@@ -1705,28 +1715,28 @@ struct test_fFF_11_data
{ \
do \
{ \
- START (FUNC, EXACT); \
+ START (FUNC,, EXACT); \
LOOP_MACRO (FUNC, ARRAY, , ## __VA_ARGS__); \
END_MACRO; \
} \
while (0); \
do \
{ \
- START (FUNC ## _downward, EXACT); \
+ START (FUNC, _downward, EXACT); \
LOOP_MACRO (FUNC, ARRAY, FE_DOWNWARD, ## __VA_ARGS__); \
END_MACRO; \
} \
while (0); \
do \
{ \
- START (FUNC ## _towardzero, EXACT); \
+ START (FUNC, _towardzero, EXACT); \
LOOP_MACRO (FUNC, ARRAY, FE_TOWARDZERO, ## __VA_ARGS__); \
END_MACRO; \
} \
while (0); \
do \
{ \
- START (FUNC ## _upward, EXACT); \
+ START (FUNC, _upward, EXACT); \
LOOP_MACRO (FUNC, ARRAY, FE_UPWARD, ## __VA_ARGS__); \
END_MACRO; \
} \
@@ -6034,7 +6044,7 @@ static const struct test_c_c_data cexp_test_data[] =
static void
cexp_test (void)
{
- START (cexp, 0);
+ START (cexp,, 0);
RUN_TEST_LOOP_c_c (cexp, cexp_test_data, );
END_COMPLEX;
}
@@ -7548,7 +7558,7 @@ static const struct test_if_f_data jn_test_data[] =
static void
jn_test (void)
{
- START (jn, 0);
+ START (jn,, 0);
RUN_TEST_LOOP_if_f (jn, jn_test_data, );
END;
}
@@ -9374,7 +9384,7 @@ static const struct test_f_f_data tgamma_test_data[] =
static void
tgamma_test (void)
{
- START (tgamma, 0);
+ START (tgamma,, 0);
RUN_TEST_LOOP_f_f (tgamma, tgamma_test_data, );
END;
}
@@ -9824,6 +9834,8 @@ main (int argc, char **argv)
initialize ();
printf (TEST_MSG);
+ INIT_ARCH_EXT;
+
check_ulp ();
/* Keep the tests a wee bit ordered (according to ISO C99). */
@@ -26,6 +26,7 @@
#define PRINTF_XEXPR "a"
#define PRINTF_NEXPR "f"
#define TEST_DOUBLE 1
+#define TEST_MATHVEC 0
#ifndef __NO_MATH_INLINES
# define __NO_MATH_INLINES
@@ -26,6 +26,7 @@
#define PRINTF_XEXPR "a"
#define PRINTF_NEXPR "f"
#define TEST_FLOAT 1
+#define TEST_MATHVEC 0
#ifndef __NO_MATH_INLINES
# define __NO_MATH_INLINES
@@ -26,6 +26,7 @@
#define PRINTF_XEXPR "a"
#define PRINTF_NEXPR "f"
#define TEST_DOUBLE 1
+#define TEST_MATHVEC 0
#define TEST_INLINE
#ifdef __NO_MATH_INLINES
@@ -26,6 +26,7 @@
#define PRINTF_XEXPR "a"
#define PRINTF_NEXPR "f"
#define TEST_FLOAT 1
+#define TEST_MATHVEC 0
#define TEST_INLINE 1
#ifdef __NO_MATH_INLINES
@@ -27,6 +27,7 @@
#define PRINTF_NEXPR "Lf"
#define TEST_INLINE
#define TEST_LDOUBLE 1
+#define TEST_MATHVEC 0
#ifdef __NO_MATH_INLINES
# undef __NO_MATH_INLINES
@@ -26,6 +26,7 @@
#define PRINTF_XEXPR "La"
#define PRINTF_NEXPR "Lf"
#define TEST_LDOUBLE 1
+#define TEST_MATHVEC 0
#ifndef __NO_MATH_INLINES
# define __NO_MATH_INLINES
b/sysdeps/generic/math-tests-arch.h
new file mode 100644
@@ -0,0 +1,24 @@
+/* Runtime architecture check for math tests.
+ Copyright (C) 2014 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* These macros used for architecture check in math tests runtime.
+ INIT_ARCH_EXT should set up for example some global variable which is
+ checked by CHECK_ARCH_EXT which produces return from individual test to
+ prevent run on hardware not supported by tested function implementation. */
+#define INIT_ARCH_EXT
+#define CHECK_ARCH_EXT