diff mbox series

i386: Add -mavx512vl for pr117304-1.c

Message ID 20241107030319.586526-1-lin1.hu@intel.com
State New
Headers show
Series i386: Add -mavx512vl for pr117304-1.c | expand

Commit Message

Hu, Lin1 Nov. 7, 2024, 3:03 a.m. UTC
Hi, all

Testing pr117304-1.c in a machine with only avx2 generates some 
different hints, so add -mavx512vl at its option list.

Bootstrapped and regtested on x86-64-pc-linux-gnu.
I think it is an obvious commit, but I still waiting for some while.
If someone have other suggestion.

BRs,
Lin

gcc/testsuite/ChangeLog:

	* gcc.target/i386/pr117304-1.c: Add -mavx512vl.
---
 gcc/testsuite/gcc.target/i386/pr117304-1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

liuhongt Nov. 7, 2024, 3:40 a.m. UTC | #1
> -----Original Message-----
> From: Hu, Lin1 <lin1.hu@intel.com>
> Sent: Thursday, November 7, 2024 11:03 AM
> To: gcc-patches@gcc.gnu.org
> Cc: Liu, Hongtao <hongtao.liu@intel.com>; ubizjak@gmail.com
> Subject: [PATCH] i386: Add -mavx512vl for pr117304-1.c
> 
> Hi, all
> 
> Testing pr117304-1.c in a machine with only avx2 generates some different
> hints, so add -mavx512vl at its option list.
Didn't quite understand, what kind of hint it is, why avx512vl is needed?
> 
> Bootstrapped and regtested on x86-64-pc-linux-gnu.
> I think it is an obvious commit, but I still waiting for some while.
> If someone have other suggestion.
> 
> BRs,
> Lin
> 
> gcc/testsuite/ChangeLog:
> 
> 	* gcc.target/i386/pr117304-1.c: Add -mavx512vl.
> ---
>  gcc/testsuite/gcc.target/i386/pr117304-1.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gcc/testsuite/gcc.target/i386/pr117304-1.c
> b/gcc/testsuite/gcc.target/i386/pr117304-1.c
> index fc1c5bfd3e3..da26f4bd1b7 100644
> --- a/gcc/testsuite/gcc.target/i386/pr117304-1.c
> +++ b/gcc/testsuite/gcc.target/i386/pr117304-1.c
> @@ -1,6 +1,6 @@
>  /* PR target/117304 */
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -mavx512f -mno-evex512" } */
> +/* { dg-options "-O2 -mavx512f -mno-evex512 -mavx512vl" } */
> 
>  typedef __attribute__((__vector_size__(32))) int __v8si;  typedef
> __attribute__((__vector_size__(32))) unsigned int __v8su;
> --
> 2.31.1
Hu, Lin1 Nov. 7, 2024, 6:03 a.m. UTC | #2
> -----Original Message-----
> From: Liu, Hongtao <hongtao.liu@intel.com>
> Sent: Thursday, November 7, 2024 11:41 AM
> To: Hu, Lin1 <lin1.hu@intel.com>; gcc-patches@gcc.gnu.org
> Cc: ubizjak@gmail.com
> Subject: RE: [PATCH] i386: Add -mavx512vl for pr117304-1.c
> 
> 
> 
> > -----Original Message-----
> > From: Hu, Lin1 <lin1.hu@intel.com>
> > Sent: Thursday, November 7, 2024 11:03 AM
> > To: gcc-patches@gcc.gnu.org
> > Cc: Liu, Hongtao <hongtao.liu@intel.com>; ubizjak@gmail.com
> > Subject: [PATCH] i386: Add -mavx512vl for pr117304-1.c
> >
> > Hi, all
> >
> > Testing pr117304-1.c in a machine with only avx2 generates some
> > different hints, so add -mavx512vl at its option list.
> Didn't quite understand, what kind of hint it is, why avx512vl is needed?

When I cherry-pick this patch based releases/gcc-14, I found if without -mavx512vl, the hint will be __builtin_ia32_cvtdq2ps256 rather than __builtin_ia32_cvtudq2ps128_mask. Based on lookup_name_fuzzy's comment " Look for the closest match for NAME within the currently valid scopes.", I think the hint is right. And the trunk's hint is wrong only with -mavx512f -mevex512. To avoid someone change back the hint output, so I want to add the option -mavx512vl, so the hint is right for now.

BRs,
Lin

> >
> > Bootstrapped and regtested on x86-64-pc-linux-gnu.
> > I think it is an obvious commit, but I still waiting for some while.
> > If someone have other suggestion.
> >
> > BRs,
> > Lin
> >
> > gcc/testsuite/ChangeLog:
> >
> > 	* gcc.target/i386/pr117304-1.c: Add -mavx512vl.
> > ---
> >  gcc/testsuite/gcc.target/i386/pr117304-1.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/gcc/testsuite/gcc.target/i386/pr117304-1.c
> > b/gcc/testsuite/gcc.target/i386/pr117304-1.c
> > index fc1c5bfd3e3..da26f4bd1b7 100644
> > --- a/gcc/testsuite/gcc.target/i386/pr117304-1.c
> > +++ b/gcc/testsuite/gcc.target/i386/pr117304-1.c
> > @@ -1,6 +1,6 @@
> >  /* PR target/117304 */
> >  /* { dg-do compile } */
> > -/* { dg-options "-O2 -mavx512f -mno-evex512" } */
> > +/* { dg-options "-O2 -mavx512f -mno-evex512 -mavx512vl" } */
> >
> >  typedef __attribute__((__vector_size__(32))) int __v8si;  typedef
> > __attribute__((__vector_size__(32))) unsigned int __v8su;
> > --
> > 2.31.1
Hongtao Liu Nov. 7, 2024, 6:06 a.m. UTC | #3
On Thu, Nov 7, 2024 at 2:04 PM Hu, Lin1 <lin1.hu@intel.com> wrote:
>
> > -----Original Message-----
> > From: Liu, Hongtao <hongtao.liu@intel.com>
> > Sent: Thursday, November 7, 2024 11:41 AM
> > To: Hu, Lin1 <lin1.hu@intel.com>; gcc-patches@gcc.gnu.org
> > Cc: ubizjak@gmail.com
> > Subject: RE: [PATCH] i386: Add -mavx512vl for pr117304-1.c
> >
> >
> >
> > > -----Original Message-----
> > > From: Hu, Lin1 <lin1.hu@intel.com>
> > > Sent: Thursday, November 7, 2024 11:03 AM
> > > To: gcc-patches@gcc.gnu.org
> > > Cc: Liu, Hongtao <hongtao.liu@intel.com>; ubizjak@gmail.com
> > > Subject: [PATCH] i386: Add -mavx512vl for pr117304-1.c
> > >
> > > Hi, all
> > >
> > > Testing pr117304-1.c in a machine with only avx2 generates some
> > > different hints, so add -mavx512vl at its option list.
> > Didn't quite understand, what kind of hint it is, why avx512vl is needed?
>
> When I cherry-pick this patch based releases/gcc-14, I found if without -mavx512vl, the hint will be __builtin_ia32_cvtdq2ps256 rather than __builtin_ia32_cvtudq2ps128_mask. Based on lookup_name_fuzzy's comment " Look for the closest match for NAME within the currently valid scopes.", I think the hint is right. And the trunk's hint is wrong only with -mavx512f -mevex512. To avoid someone change back the hint output, so I want to add the option -mavx512vl, so the hint is right for now.
Can we use regexp in the hint to avoid any change in the future?
>
> BRs,
> Lin
>
> > >
> > > Bootstrapped and regtested on x86-64-pc-linux-gnu.
> > > I think it is an obvious commit, but I still waiting for some while.
> > > If someone have other suggestion.
> > >
> > > BRs,
> > > Lin
> > >
> > > gcc/testsuite/ChangeLog:
> > >
> > >     * gcc.target/i386/pr117304-1.c: Add -mavx512vl.
> > > ---
> > >  gcc/testsuite/gcc.target/i386/pr117304-1.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/gcc/testsuite/gcc.target/i386/pr117304-1.c
> > > b/gcc/testsuite/gcc.target/i386/pr117304-1.c
> > > index fc1c5bfd3e3..da26f4bd1b7 100644
> > > --- a/gcc/testsuite/gcc.target/i386/pr117304-1.c
> > > +++ b/gcc/testsuite/gcc.target/i386/pr117304-1.c
> > > @@ -1,6 +1,6 @@
> > >  /* PR target/117304 */
> > >  /* { dg-do compile } */
> > > -/* { dg-options "-O2 -mavx512f -mno-evex512" } */
> > > +/* { dg-options "-O2 -mavx512f -mno-evex512 -mavx512vl" } */
> > >
> > >  typedef __attribute__((__vector_size__(32))) int __v8si;  typedef
> > > __attribute__((__vector_size__(32))) unsigned int __v8su;
> > > --
> > > 2.31.1
>
diff mbox series

Patch

diff --git a/gcc/testsuite/gcc.target/i386/pr117304-1.c b/gcc/testsuite/gcc.target/i386/pr117304-1.c
index fc1c5bfd3e3..da26f4bd1b7 100644
--- a/gcc/testsuite/gcc.target/i386/pr117304-1.c
+++ b/gcc/testsuite/gcc.target/i386/pr117304-1.c
@@ -1,6 +1,6 @@ 
 /* PR target/117304 */
 /* { dg-do compile } */
-/* { dg-options "-O2 -mavx512f -mno-evex512" } */
+/* { dg-options "-O2 -mavx512f -mno-evex512 -mavx512vl" } */
 
 typedef __attribute__((__vector_size__(32))) int __v8si;
 typedef __attribute__((__vector_size__(32))) unsigned int __v8su;