diff mbox series

Fix gcc.target/i386/avx512vpopcntdqvl-vpopcnt*-1.c FAILs

Message ID 20171228151837.GI1833@tucnak
State New
Headers show
Series Fix gcc.target/i386/avx512vpopcntdqvl-vpopcnt*-1.c FAILs | expand

Commit Message

Jakub Jelinek Dec. 28, 2017, 3:18 p.m. UTC
Hi!

Binutils had vpopcnt[dq] support since ~ January, but only for the 512-bit
instructions, only in ~ October further support for the AVX512VPOPCNTDQ |
AVX512VL instructions has been added.  So, if one is using gas in between
those two, these two tests FAIL to assemble.

Fixed thusly (tests will be UNSUPPORTED not just with as that doesn't
support vpopcnt[dq] at all, but also one that only supports
vpopcnt[dq] %zmmN, ..., but should work with more recent binutils), regtested
on x86_64-linux, ok for trunk?

2017-12-28  Jakub Jelinek  <jakub@redhat.com>

	* gcc.target/i386/i386.exp
	(check_effective_target_avx512vpopcntdqvl): New proc.
	* gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c: Use
	avx512vpopcntdqvl effective target rather than avx512vpopcntdq.
	* gcc.target/i386/avx512vpopcntdqvl-vpopcntq-1.c: Likewise.


	Jakub

Comments

Uros Bizjak Dec. 30, 2017, 9:14 a.m. UTC | #1
On Thu, Dec 28, 2017 at 4:18 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> Binutils had vpopcnt[dq] support since ~ January, but only for the 512-bit
> instructions, only in ~ October further support for the AVX512VPOPCNTDQ |
> AVX512VL instructions has been added.  So, if one is using gas in between
> those two, these two tests FAIL to assemble.
>
> Fixed thusly (tests will be UNSUPPORTED not just with as that doesn't
> support vpopcnt[dq] at all, but also one that only supports
> vpopcnt[dq] %zmmN, ..., but should work with more recent binutils), regtested
> on x86_64-linux, ok for trunk?
>
> 2017-12-28  Jakub Jelinek  <jakub@redhat.com>
>
>         * gcc.target/i386/i386.exp
>         (check_effective_target_avx512vpopcntdqvl): New proc.
>         * gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c: Use
>         avx512vpopcntdqvl effective target rather than avx512vpopcntdq.
>         * gcc.target/i386/avx512vpopcntdqvl-vpopcntq-1.c: Likewise.

OK.

Thanks,
Uros.

> --- gcc/testsuite/gcc.target/i386/i386.exp.jj   2017-12-22 14:00:02.809638667 +0100
> +++ gcc/testsuite/gcc.target/i386/i386.exp      2017-12-28 16:09:25.702051624 +0100
> @@ -410,6 +410,19 @@ proc check_effective_target_avx512vpopcn
>      } "-mavx512vpopcntdq" ]
>  }
>
> +# Return 1 if avx512_vpopcntdq & avx512vl instructions can be compiled.
> +proc check_effective_target_avx512vpopcntdqvl { } {
> +    return [check_no_compiler_messages avx512vpopcntdqvl object {
> +        typedef int __v8si __attribute__ ((__vector_size__ (32)));
> +
> +        __v8si
> +        _mm256_popcnt_epi32 (__v8si __A)
> +        {
> +            return (__v8si) __builtin_ia32_vpopcountd_v8si ((__v8si) __A);
> +        }
> +    } "-mavx512vpopcntdq -mavx512vl" ]
> +}
> +
>  # Return 1 if gfni instructions can be compiled.
>  proc check_effective_target_gfni { } {
>      return [check_no_compiler_messages gfni object {
> --- gcc/testsuite/gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c.jj     2017-12-22 14:00:02.785638973 +0100
> +++ gcc/testsuite/gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c        2017-12-28 16:12:20.427156937 +0100
> @@ -1,7 +1,7 @@
>  /* { dg-do run } */
>  /* { dg-options "-O2 -mavx512vpopcntdq -mavx512bw -mavx512vl" } */
>  /* { dg-require-effective-target avx512vl } */
> -/* { dg-require-effective-target avx512vpopcntdq } */
> +/* { dg-require-effective-target avx512vpopcntdqvl } */
>  /* { dg-require-effective-target avx512bw } */
>
>  #define AVX512VL
> --- gcc/testsuite/gcc.target/i386/avx512vpopcntdqvl-vpopcntq-1.c.jj     2017-12-22 14:00:02.784638986 +0100
> +++ gcc/testsuite/gcc.target/i386/avx512vpopcntdqvl-vpopcntq-1.c        2017-12-28 16:12:28.269161404 +0100
> @@ -1,7 +1,7 @@
>  /* { dg-do run } */
>  /* { dg-options "-O2 -mavx512vl -mavx512vpopcntdq" } */
>  /* { dg-require-effective-target avx512vl } */
> -/* { dg-require-effective-target avx512vpopcntdq } */
> +/* { dg-require-effective-target avx512vpopcntdqvl } */
>
>  #define AVX512VL
>  #define AVX512F_LEN 256
>
>         Jakub
Uros Bizjak Dec. 30, 2017, 9:18 a.m. UTC | #2
On Thu, Dec 28, 2017 at 4:18 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> Binutils had vpopcnt[dq] support since ~ January, but only for the 512-bit
> instructions, only in ~ October further support for the AVX512VPOPCNTDQ |
> AVX512VL instructions has been added.  So, if one is using gas in between
> those two, these two tests FAIL to assemble.
>
> Fixed thusly (tests will be UNSUPPORTED not just with as that doesn't
> support vpopcnt[dq] at all, but also one that only supports
> vpopcnt[dq] %zmmN, ..., but should work with more recent binutils), regtested
> on x86_64-linux, ok for trunk?
>
> 2017-12-28  Jakub Jelinek  <jakub@redhat.com>
>
>         * gcc.target/i386/i386.exp
>         (check_effective_target_avx512vpopcntdqvl): New proc.
>         * gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c: Use
>         avx512vpopcntdqvl effective target rather than avx512vpopcntdq.
>         * gcc.target/i386/avx512vpopcntdqvl-vpopcntq-1.c: Likewise.
>
> --- gcc/testsuite/gcc.target/i386/i386.exp.jj   2017-12-22 14:00:02.809638667 +0100
> +++ gcc/testsuite/gcc.target/i386/i386.exp      2017-12-28 16:09:25.702051624 +0100
> @@ -410,6 +410,19 @@ proc check_effective_target_avx512vpopcn
>      } "-mavx512vpopcntdq" ]
>  }
>
> +# Return 1 if avx512_vpopcntdq & avx512vl instructions can be compiled.

Perhaps we should say:

# Return 1 if variable-length avx512_vpopcntdq instructions can be compiled.

Uros.

> +proc check_effective_target_avx512vpopcntdqvl { } {
> +    return [check_no_compiler_messages avx512vpopcntdqvl object {
> +        typedef int __v8si __attribute__ ((__vector_size__ (32)));
> +
> +        __v8si
> +        _mm256_popcnt_epi32 (__v8si __A)
> +        {
> +            return (__v8si) __builtin_ia32_vpopcountd_v8si ((__v8si) __A);
> +        }
> +    } "-mavx512vpopcntdq -mavx512vl" ]
> +}
> +
>  # Return 1 if gfni instructions can be compiled.
>  proc check_effective_target_gfni { } {
>      return [check_no_compiler_messages gfni object {
> --- gcc/testsuite/gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c.jj     2017-12-22 14:00:02.785638973 +0100
> +++ gcc/testsuite/gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c        2017-12-28 16:12:20.427156937 +0100
> @@ -1,7 +1,7 @@
>  /* { dg-do run } */
>  /* { dg-options "-O2 -mavx512vpopcntdq -mavx512bw -mavx512vl" } */
>  /* { dg-require-effective-target avx512vl } */
> -/* { dg-require-effective-target avx512vpopcntdq } */
> +/* { dg-require-effective-target avx512vpopcntdqvl } */
>  /* { dg-require-effective-target avx512bw } */
>
>  #define AVX512VL
> --- gcc/testsuite/gcc.target/i386/avx512vpopcntdqvl-vpopcntq-1.c.jj     2017-12-22 14:00:02.784638986 +0100
> +++ gcc/testsuite/gcc.target/i386/avx512vpopcntdqvl-vpopcntq-1.c        2017-12-28 16:12:28.269161404 +0100
> @@ -1,7 +1,7 @@
>  /* { dg-do run } */
>  /* { dg-options "-O2 -mavx512vl -mavx512vpopcntdq" } */
>  /* { dg-require-effective-target avx512vl } */
> -/* { dg-require-effective-target avx512vpopcntdq } */
> +/* { dg-require-effective-target avx512vpopcntdqvl } */
>
>  #define AVX512VL
>  #define AVX512F_LEN 256
>
>         Jakub
diff mbox series

Patch

--- gcc/testsuite/gcc.target/i386/i386.exp.jj	2017-12-22 14:00:02.809638667 +0100
+++ gcc/testsuite/gcc.target/i386/i386.exp	2017-12-28 16:09:25.702051624 +0100
@@ -410,6 +410,19 @@  proc check_effective_target_avx512vpopcn
     } "-mavx512vpopcntdq" ]
 }
 
+# Return 1 if avx512_vpopcntdq & avx512vl instructions can be compiled.
+proc check_effective_target_avx512vpopcntdqvl { } {
+    return [check_no_compiler_messages avx512vpopcntdqvl object {
+        typedef int __v8si __attribute__ ((__vector_size__ (32)));
+
+        __v8si
+        _mm256_popcnt_epi32 (__v8si __A)
+        {
+            return (__v8si) __builtin_ia32_vpopcountd_v8si ((__v8si) __A);
+        }
+    } "-mavx512vpopcntdq -mavx512vl" ]
+}
+
 # Return 1 if gfni instructions can be compiled.
 proc check_effective_target_gfni { } {
     return [check_no_compiler_messages gfni object {
--- gcc/testsuite/gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c.jj	2017-12-22 14:00:02.785638973 +0100
+++ gcc/testsuite/gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c	2017-12-28 16:12:20.427156937 +0100
@@ -1,7 +1,7 @@ 
 /* { dg-do run } */
 /* { dg-options "-O2 -mavx512vpopcntdq -mavx512bw -mavx512vl" } */
 /* { dg-require-effective-target avx512vl } */
-/* { dg-require-effective-target avx512vpopcntdq } */
+/* { dg-require-effective-target avx512vpopcntdqvl } */
 /* { dg-require-effective-target avx512bw } */
 
 #define AVX512VL
--- gcc/testsuite/gcc.target/i386/avx512vpopcntdqvl-vpopcntq-1.c.jj	2017-12-22 14:00:02.784638986 +0100
+++ gcc/testsuite/gcc.target/i386/avx512vpopcntdqvl-vpopcntq-1.c	2017-12-28 16:12:28.269161404 +0100
@@ -1,7 +1,7 @@ 
 /* { dg-do run } */
 /* { dg-options "-O2 -mavx512vl -mavx512vpopcntdq" } */
 /* { dg-require-effective-target avx512vl } */
-/* { dg-require-effective-target avx512vpopcntdq } */
+/* { dg-require-effective-target avx512vpopcntdqvl } */
 
 #define AVX512VL
 #define AVX512F_LEN 256