]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Move most libmvec test contents from .c to .h files.
authorJoseph Myers <joseph@codesourcery.com>
Wed, 15 Feb 2017 01:13:15 +0000 (01:13 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Wed, 15 Feb 2017 01:13:15 +0000 (01:13 +0000)
The libmvec tests put substantive, architecture-specific contents in
.c files such as test-double-vlen4.c, so making those files
architecture-specific and causing issues for generating such files
automatically when splitting up tests by function.

This patch moves all the substantive contents to .h files, so the .c
files only include the .h file and then libm-test.c.  This allows for
automatic generation of per-function .c files in future.  The .h files
in turn #include or #include_next the architecture-independent file
and add the architecture-specific definitions to that.  (Splitting by
function should in fact allow the TEST_VECTOR_* macros to be replaced
by sysdeps makefile information on which functions to test in each
case, removing the need for gen-libm-have-vector-test.sh as well as
removing the need for some of the architecture-specific headers.)

Tested for x86_64.

* sysdeps/x86_64/fpu/test-double-vlen2.c: Move most contents to,
and include ...
* sysdeps/x86_64/fpu/test-double-vlen2.h: ... here.  New file.
* sysdeps/x86_64/fpu/test-double-vlen4-avx2.c: Move most contents
to, and include ...
* sysdeps/x86_64/fpu/test-double-vlen4-avx2.h: ... here.  New
file.
* sysdeps/x86_64/fpu/test-double-vlen4.c: Move most contents to,
and include ...
* sysdeps/x86_64/fpu/test-double-vlen4.h: ... here.  New file.
* sysdeps/x86_64/fpu/test-double-vlen8.c: Move most contents to,
and include ...
* sysdeps/x86_64/fpu/test-double-vlen8.h: ... here.  New file.
* sysdeps/x86_64/fpu/test-float-vlen16.c: Move most contents to,
and include ...
* sysdeps/x86_64/fpu/test-float-vlen16.h: ... here.  New file.
* sysdeps/x86_64/fpu/test-float-vlen4.c: Move most contents to,
and include ...
* sysdeps/x86_64/fpu/test-float-vlen4.h: ... here.  New file.
* sysdeps/x86_64/fpu/test-float-vlen8-avx2.c: Move most contents
to, and include ...
* sysdeps/x86_64/fpu/test-float-vlen8-avx2.h: ... here.  New file.
* sysdeps/x86_64/fpu/test-float-vlen8.c: Move most contents to,
and include ...
* sysdeps/x86_64/fpu/test-float-vlen8.h: ... here.  New file.

17 files changed:
ChangeLog
sysdeps/x86_64/fpu/test-double-vlen2.c
sysdeps/x86_64/fpu/test-double-vlen2.h [new file with mode: 0644]
sysdeps/x86_64/fpu/test-double-vlen4-avx2.c
sysdeps/x86_64/fpu/test-double-vlen4-avx2.h [new file with mode: 0644]
sysdeps/x86_64/fpu/test-double-vlen4.c
sysdeps/x86_64/fpu/test-double-vlen4.h [new file with mode: 0644]
sysdeps/x86_64/fpu/test-double-vlen8.c
sysdeps/x86_64/fpu/test-double-vlen8.h [new file with mode: 0644]
sysdeps/x86_64/fpu/test-float-vlen16.c
sysdeps/x86_64/fpu/test-float-vlen16.h [new file with mode: 0644]
sysdeps/x86_64/fpu/test-float-vlen4.c
sysdeps/x86_64/fpu/test-float-vlen4.h [new file with mode: 0644]
sysdeps/x86_64/fpu/test-float-vlen8-avx2.c
sysdeps/x86_64/fpu/test-float-vlen8-avx2.h [new file with mode: 0644]
sysdeps/x86_64/fpu/test-float-vlen8.c
sysdeps/x86_64/fpu/test-float-vlen8.h [new file with mode: 0644]

index f83f37ad7c982a0ce67a99cc88d556a86d58bb28..b040928a3339eedaba2d37c4a9b9466de513deba 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,31 @@
+2017-02-15  Joseph Myers  <joseph@codesourcery.com>
+
+       * sysdeps/x86_64/fpu/test-double-vlen2.c: Move most contents to,
+       and include ...
+       * sysdeps/x86_64/fpu/test-double-vlen2.h: ... here.  New file.
+       * sysdeps/x86_64/fpu/test-double-vlen4-avx2.c: Move most contents
+       to, and include ...
+       * sysdeps/x86_64/fpu/test-double-vlen4-avx2.h: ... here.  New
+       file.
+       * sysdeps/x86_64/fpu/test-double-vlen4.c: Move most contents to,
+       and include ...
+       * sysdeps/x86_64/fpu/test-double-vlen4.h: ... here.  New file.
+       * sysdeps/x86_64/fpu/test-double-vlen8.c: Move most contents to,
+       and include ...
+       * sysdeps/x86_64/fpu/test-double-vlen8.h: ... here.  New file.
+       * sysdeps/x86_64/fpu/test-float-vlen16.c: Move most contents to,
+       and include ...
+       * sysdeps/x86_64/fpu/test-float-vlen16.h: ... here.  New file.
+       * sysdeps/x86_64/fpu/test-float-vlen4.c: Move most contents to,
+       and include ...
+       * sysdeps/x86_64/fpu/test-float-vlen4.h: ... here.  New file.
+       * sysdeps/x86_64/fpu/test-float-vlen8-avx2.c: Move most contents
+       to, and include ...
+       * sysdeps/x86_64/fpu/test-float-vlen8-avx2.h: ... here.  New file.
+       * sysdeps/x86_64/fpu/test-float-vlen8.c: Move most contents to,
+       and include ...
+       * sysdeps/x86_64/fpu/test-float-vlen8.h: ... here.  New file.
+
 2017-02-14  Joseph Myers  <joseph@codesourcery.com>
 
        * math/libm-test-support.h: Do not include <math-tests-arch.h>
index 3745e2841df38d07182872413d3f747ca551d502..b706f2aa9f6c65a4018b073915a1dbbf34b52bc8 100644 (file)
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include "test-double-vlen2.h"
-
-#define TEST_VECTOR_cos 1
-#define TEST_VECTOR_sin 1
-#define TEST_VECTOR_sincos 1
-#define TEST_VECTOR_log 1
-#define TEST_VECTOR_exp 1
-#define TEST_VECTOR_pow 1
+#include <test-double-vlen2.h>
 
 #include "libm-test.c"
diff --git a/sysdeps/x86_64/fpu/test-double-vlen2.h b/sysdeps/x86_64/fpu/test-double-vlen2.h
new file mode 100644 (file)
index 0000000..3e3ef8e
--- /dev/null
@@ -0,0 +1,26 @@
+/* Tests for SSE ISA versions of vector math functions.
+   Copyright (C) 2014-2017 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/>.  */
+
+#include_next <test-double-vlen2.h>
+
+#define TEST_VECTOR_cos 1
+#define TEST_VECTOR_sin 1
+#define TEST_VECTOR_sincos 1
+#define TEST_VECTOR_log 1
+#define TEST_VECTOR_exp 1
+#define TEST_VECTOR_pow 1
index 49f9d817841fafd208fb0dd7d632773ae319399d..ccf2d15ffa6ccfd7cf8fb7ca9c64a888438d7273 100644 (file)
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include "test-double-vlen4.h"
-
-#undef VEC_SUFF
-#define VEC_SUFF _vlen4_avx2
-
-#define TEST_VECTOR_cos 1
-#define TEST_VECTOR_sin 1
-#define TEST_VECTOR_sincos 1
-#define TEST_VECTOR_log 1
-#define TEST_VECTOR_exp 1
-#define TEST_VECTOR_pow 1
-
-#define REQUIRE_AVX2
+#include <test-double-vlen4-avx2.h>
 
 #include "libm-test.c"
diff --git a/sysdeps/x86_64/fpu/test-double-vlen4-avx2.h b/sysdeps/x86_64/fpu/test-double-vlen4-avx2.h
new file mode 100644 (file)
index 0000000..a15d4be
--- /dev/null
@@ -0,0 +1,25 @@
+/* Tests for AVX2 ISA versions of vector math functions.
+   Copyright (C) 2014-2017 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/>.  */
+
+#include <test-double-vlen4.h>
+
+#undef VEC_SUFF
+#define VEC_SUFF _vlen4_avx2
+
+#undef REQUIRE_AVX
+#define REQUIRE_AVX2
index 96acc15f0e55327b80aef2a19aa84aaab05b80cc..f039207d1fb66869e608feba5250281bb2de2e24 100644 (file)
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include "test-double-vlen4.h"
-
-#define TEST_VECTOR_cos 1
-#define TEST_VECTOR_sin 1
-#define TEST_VECTOR_sincos 1
-#define TEST_VECTOR_log 1
-#define TEST_VECTOR_exp 1
-#define TEST_VECTOR_pow 1
-
-#define REQUIRE_AVX
+#include <test-double-vlen4.h>
 
 #include "libm-test.c"
diff --git a/sysdeps/x86_64/fpu/test-double-vlen4.h b/sysdeps/x86_64/fpu/test-double-vlen4.h
new file mode 100644 (file)
index 0000000..396b771
--- /dev/null
@@ -0,0 +1,28 @@
+/* Tests for AVX ISA versions of vector math functions.
+   Copyright (C) 2014-2017 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/>.  */
+
+#include_next <test-double-vlen4.h>
+
+#define TEST_VECTOR_cos 1
+#define TEST_VECTOR_sin 1
+#define TEST_VECTOR_sincos 1
+#define TEST_VECTOR_log 1
+#define TEST_VECTOR_exp 1
+#define TEST_VECTOR_pow 1
+
+#define REQUIRE_AVX
index 6decfc6b25621228a1248809abd698329caf8e6c..04db81ac4198430af5e62e6a589ca5a876a9be17 100644 (file)
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include "test-double-vlen8.h"
-
-#define TEST_VECTOR_cos 1
-#define TEST_VECTOR_sin 1
-#define TEST_VECTOR_sincos 1
-#define TEST_VECTOR_log 1
-#define TEST_VECTOR_exp 1
-#define TEST_VECTOR_pow 1
-
-#define REQUIRE_AVX512F
+#include <test-double-vlen8.h>
 
 #include "libm-test.c"
diff --git a/sysdeps/x86_64/fpu/test-double-vlen8.h b/sysdeps/x86_64/fpu/test-double-vlen8.h
new file mode 100644 (file)
index 0000000..3809774
--- /dev/null
@@ -0,0 +1,28 @@
+/* Tests for AVX-512 versions of vector math functions.
+   Copyright (C) 2014-2017 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/>.  */
+
+#include_next <test-double-vlen8.h>
+
+#define TEST_VECTOR_cos 1
+#define TEST_VECTOR_sin 1
+#define TEST_VECTOR_sincos 1
+#define TEST_VECTOR_log 1
+#define TEST_VECTOR_exp 1
+#define TEST_VECTOR_pow 1
+
+#define REQUIRE_AVX512F
index e8266c1cab5425baa05b9aefaa98bba9b79ad06b..13a31d076d22b18927add5fd9ad2e43f86e6510c 100644 (file)
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include "test-float-vlen16.h"
-
-#define TEST_VECTOR_cosf 1
-#define TEST_VECTOR_sinf 1
-#define TEST_VECTOR_sincosf 1
-#define TEST_VECTOR_logf 1
-#define TEST_VECTOR_expf 1
-#define TEST_VECTOR_powf 1
-
-#define REQUIRE_AVX512F
+#include <test-float-vlen16.h>
 
 #include "libm-test.c"
diff --git a/sysdeps/x86_64/fpu/test-float-vlen16.h b/sysdeps/x86_64/fpu/test-float-vlen16.h
new file mode 100644 (file)
index 0000000..0f1658f
--- /dev/null
@@ -0,0 +1,28 @@
+/* Tests for AVX-512 ISA versions of vector math functions.
+   Copyright (C) 2014-2017 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/>.  */
+
+#include_next <test-float-vlen16.h>
+
+#define TEST_VECTOR_cosf 1
+#define TEST_VECTOR_sinf 1
+#define TEST_VECTOR_sincosf 1
+#define TEST_VECTOR_logf 1
+#define TEST_VECTOR_expf 1
+#define TEST_VECTOR_powf 1
+
+#define REQUIRE_AVX512F
index 747e15f91f9ec2d5855b15caed0c2dff2fc42bed..78bc99c127989f37abd5ed6408d685d4939ce683 100644 (file)
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include "test-float-vlen4.h"
-
-#define TEST_VECTOR_cosf 1
-#define TEST_VECTOR_sinf 1
-#define TEST_VECTOR_sincosf 1
-#define TEST_VECTOR_logf 1
-#define TEST_VECTOR_expf 1
-#define TEST_VECTOR_powf 1
+#include <test-float-vlen4.h>
 
 #include "libm-test.c"
diff --git a/sysdeps/x86_64/fpu/test-float-vlen4.h b/sysdeps/x86_64/fpu/test-float-vlen4.h
new file mode 100644 (file)
index 0000000..0831a21
--- /dev/null
@@ -0,0 +1,26 @@
+/* Tests for SSE ISA versions of vector math functions.
+   Copyright (C) 2014-2017 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/>.  */
+
+#include_next <test-float-vlen4.h>
+
+#define TEST_VECTOR_cosf 1
+#define TEST_VECTOR_sinf 1
+#define TEST_VECTOR_sincosf 1
+#define TEST_VECTOR_logf 1
+#define TEST_VECTOR_expf 1
+#define TEST_VECTOR_powf 1
index 4c6d4b5cc4b23286981e293ff854d7ae19b02a77..bb1f70ee328ad90bbf398e160e1368305c16302f 100644 (file)
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include "test-float-vlen8.h"
-
-#undef VEC_SUFF
-#define VEC_SUFF _vlen8_avx2
-
-#define TEST_VECTOR_cosf 1
-#define TEST_VECTOR_sinf 1
-#define TEST_VECTOR_sincosf 1
-#define TEST_VECTOR_logf 1
-#define TEST_VECTOR_expf 1
-#define TEST_VECTOR_powf 1
-
-#define REQUIRE_AVX2
+#include <test-float-vlen8-avx2.h>
 
 #include "libm-test.c"
diff --git a/sysdeps/x86_64/fpu/test-float-vlen8-avx2.h b/sysdeps/x86_64/fpu/test-float-vlen8-avx2.h
new file mode 100644 (file)
index 0000000..4967f9d
--- /dev/null
@@ -0,0 +1,25 @@
+/* Tests for AVX2 ISA versions of vector math functions.
+   Copyright (C) 2014-2017 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/>.  */
+
+#include <test-float-vlen8.h>
+
+#undef VEC_SUFF
+#define VEC_SUFF _vlen8_avx2
+
+#undef REQUIRE_AVX
+#define REQUIRE_AVX2
index efb11b157fce4f6d806a18ed5edbba4ce66cf857..fb50fd7a752867361c5bfbe9ddad7d8004d05156 100644 (file)
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include "test-float-vlen8.h"
-
-#define TEST_VECTOR_cosf 1
-#define TEST_VECTOR_sinf 1
-#define TEST_VECTOR_sincosf 1
-#define TEST_VECTOR_logf 1
-#define TEST_VECTOR_expf 1
-#define TEST_VECTOR_powf 1
-
-#define REQUIRE_AVX
+#include <test-float-vlen8.h>
 
 #include "libm-test.c"
diff --git a/sysdeps/x86_64/fpu/test-float-vlen8.h b/sysdeps/x86_64/fpu/test-float-vlen8.h
new file mode 100644 (file)
index 0000000..a6bfebf
--- /dev/null
@@ -0,0 +1,28 @@
+/* Tests for AVX ISA versions of vector math functions.
+   Copyright (C) 2014-2017 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/>.  */
+
+#include_next <test-float-vlen8.h>
+
+#define TEST_VECTOR_cosf 1
+#define TEST_VECTOR_sinf 1
+#define TEST_VECTOR_sincosf 1
+#define TEST_VECTOR_logf 1
+#define TEST_VECTOR_expf 1
+#define TEST_VECTOR_powf 1
+
+#define REQUIRE_AVX