x86-64: Add test-vector-abi.h for vector ABI test

Message ID 20211014035435.6339-1-hjl.tools@gmail.com
State New
Headers show
Series
  • x86-64: Add test-vector-abi.h for vector ABI test
Related show

Commit Message

Add a template for vector ABI test and use it for vector sincos/sincosf
ABI tests.
---
 sysdeps/x86_64/fpu/Makefile                   |  6 ---
 .../fpu/test-double-libmvec-sincos-avx.c      |  1 +
 .../fpu/test-double-libmvec-sincos-avx2.c     |  3 +-
 .../fpu/test-double-libmvec-sincos-avx512.c   |  3 +-
 .../fpu/test-double-libmvec-sincos-main.c     |  2 +-
 .../x86_64/fpu/test-double-libmvec-sincos.c   | 45 +------------------
 .../fpu/test-float-libmvec-sincosf-avx.c      |  3 +-
 .../fpu/test-float-libmvec-sincosf-avx2.c     |  3 +-
 .../fpu/test-float-libmvec-sincosf-avx512.c   |  3 +-
 .../fpu/test-float-libmvec-sincosf-main.c     |  2 +-
 .../x86_64/fpu/test-float-libmvec-sincosf.c   | 45 +------------------
 sysdeps/x86_64/fpu/test-vector-abi.h          | 41 +++++++++++++++++
 12 files changed, 56 insertions(+), 101 deletions(-)
 create mode 100644 sysdeps/x86_64/fpu/test-vector-abi.h

-- 
2.31.1

Comments

On Wed, Oct 13, 2021 at 11:54 PM H.J. Lu via Libc-alpha
<libc-alpha@sourceware.org> wrote:
>

> Add a template for vector ABI test and use it for vector sincos/sincosf

> ABI tests.

> ---

>  sysdeps/x86_64/fpu/Makefile                   |  6 ---

>  .../fpu/test-double-libmvec-sincos-avx.c      |  1 +

>  .../fpu/test-double-libmvec-sincos-avx2.c     |  3 +-

>  .../fpu/test-double-libmvec-sincos-avx512.c   |  3 +-

>  .../fpu/test-double-libmvec-sincos-main.c     |  2 +-

>  .../x86_64/fpu/test-double-libmvec-sincos.c   | 45 +------------------

>  .../fpu/test-float-libmvec-sincosf-avx.c      |  3 +-

>  .../fpu/test-float-libmvec-sincosf-avx2.c     |  3 +-

>  .../fpu/test-float-libmvec-sincosf-avx512.c   |  3 +-

>  .../fpu/test-float-libmvec-sincosf-main.c     |  2 +-

>  .../x86_64/fpu/test-float-libmvec-sincosf.c   | 45 +------------------

>  sysdeps/x86_64/fpu/test-vector-abi.h          | 41 +++++++++++++++++

>  12 files changed, 56 insertions(+), 101 deletions(-)

>  create mode 100644 sysdeps/x86_64/fpu/test-vector-abi.h

>

> diff --git a/sysdeps/x86_64/fpu/Makefile b/sysdeps/x86_64/fpu/Makefile

> index 1b4406380d..6643f77c5d 100644

> --- a/sysdeps/x86_64/fpu/Makefile

> +++ b/sysdeps/x86_64/fpu/Makefile

> @@ -108,19 +108,13 @@ CFLAGS-test-double-vlen4-avx2-wrappers.c = $(double-vlen4-arch-ext2-cflags)

>  CFLAGS-test-float-vlen8-avx2-wrappers.c = $(float-vlen8-arch-ext2-cflags)

>

>  CFLAGS-test-double-libmvec-sincos-main.c = $(libmvec-sincos-cflags)

> -CFLAGS-test-double-libmvec-sincos-avx.c = -DREQUIRE_AVX

>  CFLAGS-test-double-libmvec-sincos-avx-main.c = $(libmvec-sincos-cflags) $(double-vlen4-arch-ext-cflags)

> -CFLAGS-test-double-libmvec-sincos-avx2.c = -DREQUIRE_AVX2

>  CFLAGS-test-double-libmvec-sincos-avx2-main.c = $(libmvec-sincos-cflags) $(double-vlen4-arch-ext2-cflags)

> -CFLAGS-test-double-libmvec-sincos-avx512.c = -DREQUIRE_AVX512F

>  CFLAGS-test-double-libmvec-sincos-avx512-main.c = $(libmvec-sincos-cflags) $(double-vlen8-arch-ext-cflags)

>

>  CFLAGS-test-float-libmvec-sincosf-main.c = $(libmvec-sincos-cflags)

> -CFLAGS-test-float-libmvec-sincosf-avx.c = -DREQUIRE_AVX

>  CFLAGS-test-float-libmvec-sincosf-avx-main.c = $(libmvec-sincos-cflags) $(float-vlen8-arch-ext-cflags)

> -CFLAGS-test-float-libmvec-sincosf-avx2.c = -DREQUIRE_AVX2

>  CFLAGS-test-float-libmvec-sincosf-avx2-main.c = $(libmvec-sincos-cflags) $(float-vlen8-arch-ext2-cflags)

> -CFLAGS-test-float-libmvec-sincosf-avx512.c = -DREQUIRE_AVX512F

>  CFLAGS-test-float-libmvec-sincosf-avx512-main.c = $(libmvec-sincos-cflags) $(float-vlen16-arch-ext-cflags)

>  endif

>  endif

> diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx.c b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx.c

> index 896f1bcbaf..fbc0dbe3d9 100644

> --- a/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx.c

> +++ b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx.c

> @@ -1 +1,2 @@

> +#define REQUIRE_AVX

>  #include "test-double-libmvec-sincos.c"


Should this be: #include "test-vector-abi.h"?

If so can test-double-libmvec-sincos.c be deleted?

> diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx2.c b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx2.c

> index 896f1bcbaf..8725907915 100644

> --- a/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx2.c

> +++ b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx2.c

> @@ -1 +1,2 @@

> -#include "test-double-libmvec-sincos.c"

> +#define REQUIRE_AVX2

> +#include "test-vector-abi.h"

> diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx512.c b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx512.c

> index 896f1bcbaf..c0f24ceaee 100644

> --- a/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx512.c

> +++ b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx512.c

> @@ -1 +1,2 @@

> -#include "test-double-libmvec-sincos.c"

> +#define REQUIRE_AVX512F

> +#include "test-vector-abi.h"

> diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-sincos-main.c b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-main.c

> index 0fe2369099..48fade87c3 100644

> --- a/sysdeps/x86_64/fpu/test-double-libmvec-sincos-main.c

> +++ b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-main.c

> @@ -24,7 +24,7 @@ double* s_ptrs[N];

>  double* c_ptrs[N];

>

>  int

> -test_sincos_abi (void)

> +test_vector_abi (void)

>  {

>    int i;

>

> diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-sincos.c b/sysdeps/x86_64/fpu/test-double-libmvec-sincos.c

> index 5f9eb4914f..60261f83b8 100644

> --- a/sysdeps/x86_64/fpu/test-double-libmvec-sincos.c

> +++ b/sysdeps/x86_64/fpu/test-double-libmvec-sincos.c

> @@ -1,44 +1 @@

> -/* Test for vector sincos ABI.

> -   Copyright (C) 2016-2021 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

> -   <https://www.gnu.org/licenses/>.  */

> -

> -#include <math-tests-arch.h>

> -

> -extern int test_sincos_abi (void);

> -

> -int arch_check = 1;

> -

> -static void

> -check_arch (void)

> -{

> -  CHECK_ARCH_EXT;

> -  arch_check = 0;

> -}

> -

> -static int

> -do_test (void)

> -{

> -  check_arch ();

> -

> -  if (arch_check)

> -    return 77;

> -

> -  return test_sincos_abi ();

> -}

> -

> -#define TEST_FUNCTION do_test ()

> -#include "../../../test-skeleton.c"

> +#include "test-vector-abi.h"

> diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx.c b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx.c

> index 5b45f0a055..8e0fb492d7 100644

> --- a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx.c

> +++ b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx.c

> @@ -1 +1,2 @@

> -#include "test-float-libmvec-sincosf.c"

> +#define REQUIRE_AVX

> +#include "test-vector-abi.h"

> diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx2.c b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx2.c

> index 5b45f0a055..8725907915 100644

> --- a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx2.c

> +++ b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx2.c

> @@ -1 +1,2 @@

> -#include "test-float-libmvec-sincosf.c"

> +#define REQUIRE_AVX2

> +#include "test-vector-abi.h"

> diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx512.c b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx512.c

> index 5b45f0a055..c0f24ceaee 100644

> --- a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx512.c

> +++ b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx512.c

> @@ -1 +1,2 @@

> -#include "test-float-libmvec-sincosf.c"

> +#define REQUIRE_AVX512F

> +#include "test-vector-abi.h"

> diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-main.c b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-main.c

> index c7246cffc3..5166583194 100644

> --- a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-main.c

> +++ b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-main.c

> @@ -24,7 +24,7 @@ float *s_ptrs[N];

>  float *c_ptrs[N];

>

>  int

> -test_sincosf_abi (void)

> +test_vector_abi (void)

>  {

>    int i;

>    for(i = 0; i < N; i++)

> diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf.c b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf.c

> index 4538003e9c..60261f83b8 100644

> --- a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf.c

> +++ b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf.c

> @@ -1,44 +1 @@

> -/* Test for vector sincosf ABI.

> -   Copyright (C) 2016-2021 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

> -   <https://www.gnu.org/licenses/>.  */

> -

> -#include <math-tests-arch.h>

> -

> -extern int test_sincosf_abi (void);

> -

> -int arch_check = 1;

> -

> -static void

> -check_arch (void)

> -{

> -  CHECK_ARCH_EXT;

> -  arch_check = 0;

> -}

> -

> -static int

> -do_test (void)

> -{

> -  check_arch ();

> -

> -  if (arch_check)

> -    return 77;

> -

> -  return test_sincosf_abi ();

> -}

> -

> -#define TEST_FUNCTION do_test ()

> -#include "../../../test-skeleton.c"

> +#include "test-vector-abi.h"

> diff --git a/sysdeps/x86_64/fpu/test-vector-abi.h b/sysdeps/x86_64/fpu/test-vector-abi.h

> new file mode 100644

> index 0000000000..cde24e6021

> --- /dev/null

> +++ b/sysdeps/x86_64/fpu/test-vector-abi.h

> @@ -0,0 +1,41 @@

> +/* Test for vector ABI.

> +   Copyright (C) 2016-2021 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

> +   <https://www.gnu.org/licenses/>.  */

> +

> +#include <sys/platform/x86.h>

> +#include <support/test-driver.h>

> +

> +extern int test_vector_abi (void);

> +

> +static int

> +do_test (void)

> +{

> +#if defined REQUIRE_AVX

> +  if (!CPU_FEATURE_ACTIVE (AVX))

> +    return EXIT_UNSUPPORTED;

> +#elif defined REQUIRE_AVX2

> +  if (!CPU_FEATURE_ACTIVE (AVX2))

> +    return EXIT_UNSUPPORTED;

> +#elif defined REQUIRE_AVX512F

> +  if (!CPU_FEATURE_ACTIVE (AVX512F))

> +    return EXIT_UNSUPPORTED;

> +#endif

> +

> +  return test_vector_abi ();

> +}

> +

> +#include <support/test-driver.c>

> --

> 2.31.1

>

Patch

diff --git a/sysdeps/x86_64/fpu/Makefile b/sysdeps/x86_64/fpu/Makefile
index 1b4406380d..6643f77c5d 100644
--- a/sysdeps/x86_64/fpu/Makefile
+++ b/sysdeps/x86_64/fpu/Makefile
@@ -108,19 +108,13 @@  CFLAGS-test-double-vlen4-avx2-wrappers.c = $(double-vlen4-arch-ext2-cflags)
 CFLAGS-test-float-vlen8-avx2-wrappers.c = $(float-vlen8-arch-ext2-cflags)
 
 CFLAGS-test-double-libmvec-sincos-main.c = $(libmvec-sincos-cflags)
-CFLAGS-test-double-libmvec-sincos-avx.c = -DREQUIRE_AVX
 CFLAGS-test-double-libmvec-sincos-avx-main.c = $(libmvec-sincos-cflags) $(double-vlen4-arch-ext-cflags)
-CFLAGS-test-double-libmvec-sincos-avx2.c = -DREQUIRE_AVX2
 CFLAGS-test-double-libmvec-sincos-avx2-main.c = $(libmvec-sincos-cflags) $(double-vlen4-arch-ext2-cflags)
-CFLAGS-test-double-libmvec-sincos-avx512.c = -DREQUIRE_AVX512F
 CFLAGS-test-double-libmvec-sincos-avx512-main.c = $(libmvec-sincos-cflags) $(double-vlen8-arch-ext-cflags)
 
 CFLAGS-test-float-libmvec-sincosf-main.c = $(libmvec-sincos-cflags)
-CFLAGS-test-float-libmvec-sincosf-avx.c = -DREQUIRE_AVX
 CFLAGS-test-float-libmvec-sincosf-avx-main.c = $(libmvec-sincos-cflags) $(float-vlen8-arch-ext-cflags)
-CFLAGS-test-float-libmvec-sincosf-avx2.c = -DREQUIRE_AVX2
 CFLAGS-test-float-libmvec-sincosf-avx2-main.c = $(libmvec-sincos-cflags) $(float-vlen8-arch-ext2-cflags)
-CFLAGS-test-float-libmvec-sincosf-avx512.c = -DREQUIRE_AVX512F
 CFLAGS-test-float-libmvec-sincosf-avx512-main.c = $(libmvec-sincos-cflags) $(float-vlen16-arch-ext-cflags)
 endif
 endif
diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx.c b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx.c
index 896f1bcbaf..fbc0dbe3d9 100644
--- a/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx.c
+++ b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx.c
@@ -1 +1,2 @@ 
+#define REQUIRE_AVX
 #include "test-double-libmvec-sincos.c"
diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx2.c b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx2.c
index 896f1bcbaf..8725907915 100644
--- a/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx2.c
+++ b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx2.c
@@ -1 +1,2 @@ 
-#include "test-double-libmvec-sincos.c"
+#define REQUIRE_AVX2
+#include "test-vector-abi.h"
diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx512.c b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx512.c
index 896f1bcbaf..c0f24ceaee 100644
--- a/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx512.c
+++ b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx512.c
@@ -1 +1,2 @@ 
-#include "test-double-libmvec-sincos.c"
+#define REQUIRE_AVX512F
+#include "test-vector-abi.h"
diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-sincos-main.c b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-main.c
index 0fe2369099..48fade87c3 100644
--- a/sysdeps/x86_64/fpu/test-double-libmvec-sincos-main.c
+++ b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-main.c
@@ -24,7 +24,7 @@  double* s_ptrs[N];
 double* c_ptrs[N];
 
 int
-test_sincos_abi (void)
+test_vector_abi (void)
 {
   int i;
 
diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-sincos.c b/sysdeps/x86_64/fpu/test-double-libmvec-sincos.c
index 5f9eb4914f..60261f83b8 100644
--- a/sysdeps/x86_64/fpu/test-double-libmvec-sincos.c
+++ b/sysdeps/x86_64/fpu/test-double-libmvec-sincos.c
@@ -1,44 +1 @@ 
-/* Test for vector sincos ABI.
-   Copyright (C) 2016-2021 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
-   <https://www.gnu.org/licenses/>.  */
-
-#include <math-tests-arch.h>
-
-extern int test_sincos_abi (void);
-
-int arch_check = 1;
-
-static void
-check_arch (void)
-{
-  CHECK_ARCH_EXT;
-  arch_check = 0;
-}
-
-static int
-do_test (void)
-{
-  check_arch ();
-
-  if (arch_check)
-    return 77;
-
-  return test_sincos_abi ();
-}
-
-#define TEST_FUNCTION do_test ()
-#include "../../../test-skeleton.c"
+#include "test-vector-abi.h"
diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx.c b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx.c
index 5b45f0a055..8e0fb492d7 100644
--- a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx.c
+++ b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx.c
@@ -1 +1,2 @@ 
-#include "test-float-libmvec-sincosf.c"
+#define REQUIRE_AVX
+#include "test-vector-abi.h"
diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx2.c b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx2.c
index 5b45f0a055..8725907915 100644
--- a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx2.c
+++ b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx2.c
@@ -1 +1,2 @@ 
-#include "test-float-libmvec-sincosf.c"
+#define REQUIRE_AVX2
+#include "test-vector-abi.h"
diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx512.c b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx512.c
index 5b45f0a055..c0f24ceaee 100644
--- a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx512.c
+++ b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx512.c
@@ -1 +1,2 @@ 
-#include "test-float-libmvec-sincosf.c"
+#define REQUIRE_AVX512F
+#include "test-vector-abi.h"
diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-main.c b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-main.c
index c7246cffc3..5166583194 100644
--- a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-main.c
+++ b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-main.c
@@ -24,7 +24,7 @@  float *s_ptrs[N];
 float *c_ptrs[N];
 
 int
-test_sincosf_abi (void)
+test_vector_abi (void)
 {
   int i;
   for(i = 0; i < N; i++)
diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf.c b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf.c
index 4538003e9c..60261f83b8 100644
--- a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf.c
+++ b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf.c
@@ -1,44 +1 @@ 
-/* Test for vector sincosf ABI.
-   Copyright (C) 2016-2021 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
-   <https://www.gnu.org/licenses/>.  */
-
-#include <math-tests-arch.h>
-
-extern int test_sincosf_abi (void);
-
-int arch_check = 1;
-
-static void
-check_arch (void)
-{
-  CHECK_ARCH_EXT;
-  arch_check = 0;
-}
-
-static int
-do_test (void)
-{
-  check_arch ();
-
-  if (arch_check)
-    return 77;
-
-  return test_sincosf_abi ();
-}
-
-#define TEST_FUNCTION do_test ()
-#include "../../../test-skeleton.c"
+#include "test-vector-abi.h"
diff --git a/sysdeps/x86_64/fpu/test-vector-abi.h b/sysdeps/x86_64/fpu/test-vector-abi.h
new file mode 100644
index 0000000000..cde24e6021
--- /dev/null
+++ b/sysdeps/x86_64/fpu/test-vector-abi.h
@@ -0,0 +1,41 @@ 
+/* Test for vector ABI.
+   Copyright (C) 2016-2021 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <sys/platform/x86.h>
+#include <support/test-driver.h>
+
+extern int test_vector_abi (void);
+
+static int
+do_test (void)
+{
+#if defined REQUIRE_AVX
+  if (!CPU_FEATURE_ACTIVE (AVX))
+    return EXIT_UNSUPPORTED;
+#elif defined REQUIRE_AVX2
+  if (!CPU_FEATURE_ACTIVE (AVX2))
+    return EXIT_UNSUPPORTED;
+#elif defined REQUIRE_AVX512F
+  if (!CPU_FEATURE_ACTIVE (AVX512F))
+    return EXIT_UNSUPPORTED;
+#endif
+
+  return test_vector_abi ();
+}
+
+#include <support/test-driver.c>