> From: Andi Kleen <a...@firstfloor.org>
> Sent: Friday, August 29, 2025 1:22 PM
> 
> This patch should fix it. Please confirm.
> 
> 
> diff --git a/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-1.c
> b/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-1.c
> index e5be3a35538..cb576eb4498 100644
> --- a/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-1.c
> +++ b/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-1.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-mgfni -mavx512vl -mavx512bw -mavx512f -O3" } */
> +/* { dg-options "-mgfni -mavx512vl -mavx512bw -mavx512f -O3 -
> march=x86-64 -mtune=generic" } */
>  /* { dg-final { scan-assembler-times "vgf2p8affineqb" 14 } } */
> 
>  #ifndef N
> diff --git a/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-2.c
> b/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-2.c
> index 098361aa9ab..c46af84bdcc 100644
> --- a/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-2.c
> +++ b/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-2.c
> @@ -1,5 +1,5 @@
>  /* { dg-do run } */
> -/* { dg-options "-mgfni -mavx512vl -mavx512bw -mavx512f -O3 -Wno-shift-
> count-negative" } */
> +/* { dg-options "-mgfni -mavx512vl -mavx512bw -mavx512f -O3 -Wno-
> shift-count-negative -march=x86-64 -mtune=generic" } */
> 
>  #include <string.h>
> 
> diff --git a/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-3.c
> b/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-3.c
> index 9e5ae5d19f3..2099f4edddf 100644
> --- a/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-3.c
> +++ b/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-3.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-mgfni -mavx512bw -mavx512f -O3" } */
> +/* { dg-options "-mgfni -mavx512bw -mavx512f -O3 -march=x86-64 -
> mtune=generic" } */
>  /* { dg-final { scan-assembler-times "vgf2p8affineqb" 12 } } */
> 
>  /* Based on a test case from Andrew Pinski */
> diff --git a/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-5.c
> b/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-5.c
> index 65fb69227e6..b8489a659a5 100644
> --- a/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-5.c
> +++ b/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-5.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-mgfni -mavx -O3 -Wno-shift-count-negative" } */
> +/* { dg-options "-mgfni -mavx -O3 -Wno-shift-count-negative -march=x86-
> 64 -mtune=generic" } */
>  /* { dg-final { scan-assembler-times "vgf2p8affineqb" 31 } } */

At least -mtune=generic won't fix this from my side.

gcc.target/i386/shift-gf2p8affine-5.c: vgf2p8affineqb found 53 times
FAIL: gcc.target/i386/shift-gf2p8affine-5.c scan-assembler-times vgf2p8affineqb 
31

Thx,
Haochen

> 
>  #include "shift-gf2p8affine-2.c"
> diff --git a/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-6.c
> b/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-6.c
> index 3391debd6c5..bf8d3418b38 100644
> --- a/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-6.c
> +++ b/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-6.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-mgfni -O3 -Wno-shift-count-negative" } */
> +/* { dg-options "-mgfni -O3 -Wno-shift-count-negative -march=x86-64 -
> mtune=generic" } */
>  /* { dg-final { scan-assembler-times "vgf2p8affineqb" 0 } } */
> 
>  #include "shift-gf2p8affine-2.c"
> diff --git a/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-7.c
> b/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-7.c
> index 37ba0c80ef8..8e93bb32e5d 100644
> --- a/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-7.c
> +++ b/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-7.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-mgfni -mavx512vl -mavx512bw -mavx512f -O3 -Wno-shift-
> count-negative" } */
> +/* { dg-options "-mgfni -mavx512vl -mavx512bw -mavx512f -O3 -Wno-
> shift-count-negative -mtune=generic -march=x86-64" } */
>  /* { dg-final { scan-assembler-times "vgf2p8affineqb" 53 } } */
> 
>  #include "shift-gf2p8affine-2.c"

Reply via email to