public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] i386: Add AVX10.1 related macros
@ 2024-01-10  7:34 Haochen Jiang
  2024-01-10  7:58 ` Liu, Hongtao
  0 siblings, 1 reply; 7+ messages in thread
From: Haochen Jiang @ 2024-01-10  7:34 UTC (permalink / raw)
  To: gcc-patches; +Cc: hongtao.liu, ubizjak, burnus, sandra

Hi all,

This patch aims to add AVX10.1 related macros for libgomp's request. The
request comes following:

https://gcc.gnu.org/pipermail/gcc-patches/2024-January/642025.html

Ok for trunk?

Thx,
Haochen

gcc/ChangeLog:

	PR target/113288
	* config/i386/i386-c.cc (ix86_target_macros_internal):
	Add __AVX10_1__, __AVX10_1_256__ and __AVX10_1_512__.
---
 gcc/config/i386/i386-c.cc | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gcc/config/i386/i386-c.cc b/gcc/config/i386/i386-c.cc
index c3ae984670b..366b560158a 100644
--- a/gcc/config/i386/i386-c.cc
+++ b/gcc/config/i386/i386-c.cc
@@ -735,6 +735,13 @@ ix86_target_macros_internal (HOST_WIDE_INT isa_flag,
     def_or_undef (parse_in, "__EVEX512__");
   if (isa_flag2 & OPTION_MASK_ISA2_USER_MSR)
     def_or_undef (parse_in, "__USER_MSR__");
+  if (isa_flag2 & OPTION_MASK_ISA2_AVX10_1_256)
+    {
+      def_or_undef (parse_in, "__AVX10_1_256__");
+      def_or_undef (parse_in, "__AVX10_1__");
+    }
+  if (isa_flag2 & OPTION_MASK_ISA2_AVX10_1_512)
+    def_or_undef (parse_in, "__AVX10_1_512__");
   if (TARGET_IAMCU)
     {
       def_or_undef (parse_in, "__iamcu");
-- 
2.31.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH] i386: Add AVX10.1 related macros
  2024-01-10  7:34 [PATCH] i386: Add AVX10.1 related macros Haochen Jiang
@ 2024-01-10  7:58 ` Liu, Hongtao
  2024-01-10  9:43   ` Richard Biener
  0 siblings, 1 reply; 7+ messages in thread
From: Liu, Hongtao @ 2024-01-10  7:58 UTC (permalink / raw)
  To: Jiang, Haochen, gcc-patches; +Cc: ubizjak, burnus, sandra



> -----Original Message-----
> From: Jiang, Haochen <haochen.jiang@intel.com>
> Sent: Wednesday, January 10, 2024 3:35 PM
> To: gcc-patches@gcc.gnu.org
> Cc: Liu, Hongtao <hongtao.liu@intel.com>; ubizjak@gmail.com; burnus@net-
> b.de; sandra@codesourcery.com
> Subject: [PATCH] i386: Add AVX10.1 related macros
> 
> Hi all,
> 
> This patch aims to add AVX10.1 related macros for libgomp's request. The
> request comes following:
> 
> https://gcc.gnu.org/pipermail/gcc-patches/2024-January/642025.html
> 
> Ok for trunk?
> 
> Thx,
> Haochen
> 
> gcc/ChangeLog:
> 
> 	PR target/113288
> 	* config/i386/i386-c.cc (ix86_target_macros_internal):
> 	Add __AVX10_1__, __AVX10_1_256__ and __AVX10_1_512__.
> ---
>  gcc/config/i386/i386-c.cc | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/gcc/config/i386/i386-c.cc b/gcc/config/i386/i386-c.cc index
> c3ae984670b..366b560158a 100644
> --- a/gcc/config/i386/i386-c.cc
> +++ b/gcc/config/i386/i386-c.cc
> @@ -735,6 +735,13 @@ ix86_target_macros_internal (HOST_WIDE_INT
> isa_flag,
>      def_or_undef (parse_in, "__EVEX512__");
>    if (isa_flag2 & OPTION_MASK_ISA2_USER_MSR)
>      def_or_undef (parse_in, "__USER_MSR__");
> +  if (isa_flag2 & OPTION_MASK_ISA2_AVX10_1_256)
> +    {
> +      def_or_undef (parse_in, "__AVX10_1_256__");
> +      def_or_undef (parse_in, "__AVX10_1__");
I think this is not needed, others LGTM.
> +    }
> +  if (isa_flag2 & OPTION_MASK_ISA2_AVX10_1_512)
> +    def_or_undef (parse_in, "__AVX10_1_512__");
>    if (TARGET_IAMCU)
>      {
>        def_or_undef (parse_in, "__iamcu");
> --
> 2.31.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] i386: Add AVX10.1 related macros
  2024-01-10  7:58 ` Liu, Hongtao
@ 2024-01-10  9:43   ` Richard Biener
  2024-01-11  1:16     ` Liu, Hongtao
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Biener @ 2024-01-10  9:43 UTC (permalink / raw)
  To: Liu, Hongtao; +Cc: Jiang, Haochen, gcc-patches, ubizjak, burnus, sandra

On Wed, Jan 10, 2024 at 9:01 AM Liu, Hongtao <hongtao.liu@intel.com> wrote:
>
>
>
> > -----Original Message-----
> > From: Jiang, Haochen <haochen.jiang@intel.com>
> > Sent: Wednesday, January 10, 2024 3:35 PM
> > To: gcc-patches@gcc.gnu.org
> > Cc: Liu, Hongtao <hongtao.liu@intel.com>; ubizjak@gmail.com; burnus@net-
> > b.de; sandra@codesourcery.com
> > Subject: [PATCH] i386: Add AVX10.1 related macros
> >
> > Hi all,
> >
> > This patch aims to add AVX10.1 related macros for libgomp's request. The
> > request comes following:
> >
> > https://gcc.gnu.org/pipermail/gcc-patches/2024-January/642025.html
> >
> > Ok for trunk?
> >
> > Thx,
> > Haochen
> >
> > gcc/ChangeLog:
> >
> >       PR target/113288
> >       * config/i386/i386-c.cc (ix86_target_macros_internal):
> >       Add __AVX10_1__, __AVX10_1_256__ and __AVX10_1_512__.
> > ---
> >  gcc/config/i386/i386-c.cc | 7 +++++++
> >  1 file changed, 7 insertions(+)
> >
> > diff --git a/gcc/config/i386/i386-c.cc b/gcc/config/i386/i386-c.cc index
> > c3ae984670b..366b560158a 100644
> > --- a/gcc/config/i386/i386-c.cc
> > +++ b/gcc/config/i386/i386-c.cc
> > @@ -735,6 +735,13 @@ ix86_target_macros_internal (HOST_WIDE_INT
> > isa_flag,
> >      def_or_undef (parse_in, "__EVEX512__");
> >    if (isa_flag2 & OPTION_MASK_ISA2_USER_MSR)
> >      def_or_undef (parse_in, "__USER_MSR__");
> > +  if (isa_flag2 & OPTION_MASK_ISA2_AVX10_1_256)
> > +    {
> > +      def_or_undef (parse_in, "__AVX10_1_256__");
> > +      def_or_undef (parse_in, "__AVX10_1__");
> I think this is not needed, others LGTM.

So __AVX10_1_256__ and __AVX10_1_512__ are redundant
with __AVX10_1__ and __EVEX512__, right?

> > +    }
> > +  if (isa_flag2 & OPTION_MASK_ISA2_AVX10_1_512)
> > +    def_or_undef (parse_in, "__AVX10_1_512__");
> >    if (TARGET_IAMCU)
> >      {
> >        def_or_undef (parse_in, "__iamcu");
> > --
> > 2.31.1
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH] i386: Add AVX10.1 related macros
  2024-01-10  9:43   ` Richard Biener
@ 2024-01-11  1:16     ` Liu, Hongtao
  2024-01-11  8:18       ` Richard Biener
  0 siblings, 1 reply; 7+ messages in thread
From: Liu, Hongtao @ 2024-01-11  1:16 UTC (permalink / raw)
  To: Richard Biener; +Cc: Jiang, Haochen, gcc-patches, ubizjak, burnus, sandra



> -----Original Message-----
> From: Richard Biener <richard.guenther@gmail.com>
> Sent: Wednesday, January 10, 2024 5:44 PM
> To: Liu, Hongtao <hongtao.liu@intel.com>
> Cc: Jiang, Haochen <haochen.jiang@intel.com>; gcc-patches@gcc.gnu.org;
> ubizjak@gmail.com; burnus@net-b.de; sandra@codesourcery.com
> Subject: Re: [PATCH] i386: Add AVX10.1 related macros
> 
> On Wed, Jan 10, 2024 at 9:01 AM Liu, Hongtao <hongtao.liu@intel.com>
> wrote:
> >
> >
> >
> > > -----Original Message-----
> > > From: Jiang, Haochen <haochen.jiang@intel.com>
> > > Sent: Wednesday, January 10, 2024 3:35 PM
> > > To: gcc-patches@gcc.gnu.org
> > > Cc: Liu, Hongtao <hongtao.liu@intel.com>; ubizjak@gmail.com;
> > > burnus@net- b.de; sandra@codesourcery.com
> > > Subject: [PATCH] i386: Add AVX10.1 related macros
> > >
> > > Hi all,
> > >
> > > This patch aims to add AVX10.1 related macros for libgomp's request.
> > > The request comes following:
> > >
> > > https://gcc.gnu.org/pipermail/gcc-patches/2024-January/642025.html
> > >
> > > Ok for trunk?
> > >
> > > Thx,
> > > Haochen
> > >
> > > gcc/ChangeLog:
> > >
> > >       PR target/113288
> > >       * config/i386/i386-c.cc (ix86_target_macros_internal):
> > >       Add __AVX10_1__, __AVX10_1_256__ and __AVX10_1_512__.
> > > ---
> > >  gcc/config/i386/i386-c.cc | 7 +++++++
> > >  1 file changed, 7 insertions(+)
> > >
> > > diff --git a/gcc/config/i386/i386-c.cc b/gcc/config/i386/i386-c.cc
> > > index c3ae984670b..366b560158a 100644
> > > --- a/gcc/config/i386/i386-c.cc
> > > +++ b/gcc/config/i386/i386-c.cc
> > > @@ -735,6 +735,13 @@ ix86_target_macros_internal (HOST_WIDE_INT
> > > isa_flag,
> > >      def_or_undef (parse_in, "__EVEX512__");
> > >    if (isa_flag2 & OPTION_MASK_ISA2_USER_MSR)
> > >      def_or_undef (parse_in, "__USER_MSR__");
> > > +  if (isa_flag2 & OPTION_MASK_ISA2_AVX10_1_256)
> > > +    {
> > > +      def_or_undef (parse_in, "__AVX10_1_256__");
> > > +      def_or_undef (parse_in, "__AVX10_1__");
> > I think this is not needed, others LGTM.
> 
> So __AVX10_1_256__ and __AVX10_1_512__ are redundant with
> __AVX10_1__ and __EVEX512__, right?
No, I mean __AVX10_1__ is redundant of __AVX10_1_256__ since -mavx10.1 is just alias of -mavx10.1-256.
We want explicit __AVX10_1_256__ and __AVX10_1_512__ and don't want mix __EVEX512__ with AVX10(They are related in their internal implementation, but we don't want the user to control the vector length of avx10 with -mno-evex512, -mno-evex512 is supposed for the existing AVX512).
> 
> > > +    }
> > > +  if (isa_flag2 & OPTION_MASK_ISA2_AVX10_1_512)
> > > +    def_or_undef (parse_in, "__AVX10_1_512__");
> > >    if (TARGET_IAMCU)
> > >      {
> > >        def_or_undef (parse_in, "__iamcu");
> > > --
> > > 2.31.1
> >

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] i386: Add AVX10.1 related macros
  2024-01-11  1:16     ` Liu, Hongtao
@ 2024-01-11  8:18       ` Richard Biener
  2024-01-12  2:54         ` Jiang, Haochen
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Biener @ 2024-01-11  8:18 UTC (permalink / raw)
  To: Liu, Hongtao; +Cc: Jiang, Haochen, gcc-patches, ubizjak, burnus, sandra

On Thu, Jan 11, 2024 at 2:16 AM Liu, Hongtao <hongtao.liu@intel.com> wrote:
>
>
>
> > -----Original Message-----
> > From: Richard Biener <richard.guenther@gmail.com>
> > Sent: Wednesday, January 10, 2024 5:44 PM
> > To: Liu, Hongtao <hongtao.liu@intel.com>
> > Cc: Jiang, Haochen <haochen.jiang@intel.com>; gcc-patches@gcc.gnu.org;
> > ubizjak@gmail.com; burnus@net-b.de; sandra@codesourcery.com
> > Subject: Re: [PATCH] i386: Add AVX10.1 related macros
> >
> > On Wed, Jan 10, 2024 at 9:01 AM Liu, Hongtao <hongtao.liu@intel.com>
> > wrote:
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Jiang, Haochen <haochen.jiang@intel.com>
> > > > Sent: Wednesday, January 10, 2024 3:35 PM
> > > > To: gcc-patches@gcc.gnu.org
> > > > Cc: Liu, Hongtao <hongtao.liu@intel.com>; ubizjak@gmail.com;
> > > > burnus@net- b.de; sandra@codesourcery.com
> > > > Subject: [PATCH] i386: Add AVX10.1 related macros
> > > >
> > > > Hi all,
> > > >
> > > > This patch aims to add AVX10.1 related macros for libgomp's request.
> > > > The request comes following:
> > > >
> > > > https://gcc.gnu.org/pipermail/gcc-patches/2024-January/642025.html
> > > >
> > > > Ok for trunk?
> > > >
> > > > Thx,
> > > > Haochen
> > > >
> > > > gcc/ChangeLog:
> > > >
> > > >       PR target/113288
> > > >       * config/i386/i386-c.cc (ix86_target_macros_internal):
> > > >       Add __AVX10_1__, __AVX10_1_256__ and __AVX10_1_512__.
> > > > ---
> > > >  gcc/config/i386/i386-c.cc | 7 +++++++
> > > >  1 file changed, 7 insertions(+)
> > > >
> > > > diff --git a/gcc/config/i386/i386-c.cc b/gcc/config/i386/i386-c.cc
> > > > index c3ae984670b..366b560158a 100644
> > > > --- a/gcc/config/i386/i386-c.cc
> > > > +++ b/gcc/config/i386/i386-c.cc
> > > > @@ -735,6 +735,13 @@ ix86_target_macros_internal (HOST_WIDE_INT
> > > > isa_flag,
> > > >      def_or_undef (parse_in, "__EVEX512__");
> > > >    if (isa_flag2 & OPTION_MASK_ISA2_USER_MSR)
> > > >      def_or_undef (parse_in, "__USER_MSR__");
> > > > +  if (isa_flag2 & OPTION_MASK_ISA2_AVX10_1_256)
> > > > +    {
> > > > +      def_or_undef (parse_in, "__AVX10_1_256__");
> > > > +      def_or_undef (parse_in, "__AVX10_1__");
> > > I think this is not needed, others LGTM.
> >
> > So __AVX10_1_256__ and __AVX10_1_512__ are redundant with
> > __AVX10_1__ and __EVEX512__, right?
> No, I mean __AVX10_1__ is redundant of __AVX10_1_256__ since -mavx10.1 is just alias of -mavx10.1-256.
> We want explicit __AVX10_1_256__ and __AVX10_1_512__ and don't want mix __EVEX512__ with AVX10(They are related in their internal implementation, but we don't want the user to control the vector length of avx10 with -mno-evex512, -mno-evex512 is supposed for the existing AVX512).

Ah, that makes sense.

> > > > +    }
> > > > +  if (isa_flag2 & OPTION_MASK_ISA2_AVX10_1_512)
> > > > +    def_or_undef (parse_in, "__AVX10_1_512__");
> > > >    if (TARGET_IAMCU)
> > > >      {
> > > >        def_or_undef (parse_in, "__iamcu");
> > > > --
> > > > 2.31.1
> > >

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH] i386: Add AVX10.1 related macros
  2024-01-11  8:18       ` Richard Biener
@ 2024-01-12  2:54         ` Jiang, Haochen
  2024-01-12  3:28           ` Hongtao Liu
  0 siblings, 1 reply; 7+ messages in thread
From: Jiang, Haochen @ 2024-01-12  2:54 UTC (permalink / raw)
  To: Richard Biener, Liu, Hongtao; +Cc: gcc-patches, ubizjak, burnus, sandra

> -----Original Message-----
> From: Richard Biener <richard.guenther@gmail.com>
> Sent: Thursday, January 11, 2024 4:19 PM
> To: Liu, Hongtao <hongtao.liu@intel.com>
> Cc: Jiang, Haochen <haochen.jiang@intel.com>; gcc-patches@gcc.gnu.org;
> ubizjak@gmail.com; burnus@net-b.de; sandra@codesourcery.com
> Subject: Re: [PATCH] i386: Add AVX10.1 related macros
> 
> On Thu, Jan 11, 2024 at 2:16 AM Liu, Hongtao <hongtao.liu@intel.com>
> wrote:
> >
> >
> >
> > > -----Original Message-----
> > > From: Richard Biener <richard.guenther@gmail.com>
> > > Sent: Wednesday, January 10, 2024 5:44 PM
> > > To: Liu, Hongtao <hongtao.liu@intel.com>
> > > Cc: Jiang, Haochen <haochen.jiang@intel.com>;
> > > gcc-patches@gcc.gnu.org; ubizjak@gmail.com; burnus@net-b.de;
> > > sandra@codesourcery.com
> > > Subject: Re: [PATCH] i386: Add AVX10.1 related macros
> > >
> > > On Wed, Jan 10, 2024 at 9:01 AM Liu, Hongtao <hongtao.liu@intel.com>
> > > wrote:
> > > >
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: Jiang, Haochen <haochen.jiang@intel.com>
> > > > > Sent: Wednesday, January 10, 2024 3:35 PM
> > > > > To: gcc-patches@gcc.gnu.org
> > > > > Cc: Liu, Hongtao <hongtao.liu@intel.com>; ubizjak@gmail.com;
> > > > > burnus@net- b.de; sandra@codesourcery.com
> > > > > Subject: [PATCH] i386: Add AVX10.1 related macros
> > > > >
> > > > > Hi all,
> > > > >
> > > > > This patch aims to add AVX10.1 related macros for libgomp's request.
> > > > > The request comes following:
> > > > >
> > > > > https://gcc.gnu.org/pipermail/gcc-patches/2024-January/642025.ht
> > > > > ml
> > > > >
> > > > > Ok for trunk?
> > > > >
> > > > > Thx,
> > > > > Haochen
> > > > >
> > > > > gcc/ChangeLog:
> > > > >
> > > > >       PR target/113288
> > > > >       * config/i386/i386-c.cc (ix86_target_macros_internal):
> > > > >       Add __AVX10_1__, __AVX10_1_256__ and __AVX10_1_512__.
> > > > > ---
> > > > >  gcc/config/i386/i386-c.cc | 7 +++++++
> > > > >  1 file changed, 7 insertions(+)
> > > > >
> > > > > diff --git a/gcc/config/i386/i386-c.cc
> > > > > b/gcc/config/i386/i386-c.cc index c3ae984670b..366b560158a
> > > > > 100644
> > > > > --- a/gcc/config/i386/i386-c.cc
> > > > > +++ b/gcc/config/i386/i386-c.cc
> > > > > @@ -735,6 +735,13 @@ ix86_target_macros_internal
> (HOST_WIDE_INT
> > > > > isa_flag,
> > > > >      def_or_undef (parse_in, "__EVEX512__");
> > > > >    if (isa_flag2 & OPTION_MASK_ISA2_USER_MSR)
> > > > >      def_or_undef (parse_in, "__USER_MSR__");
> > > > > +  if (isa_flag2 & OPTION_MASK_ISA2_AVX10_1_256)
> > > > > +    {
> > > > > +      def_or_undef (parse_in, "__AVX10_1_256__");
> > > > > +      def_or_undef (parse_in, "__AVX10_1__");
> > > > I think this is not needed, others LGTM.
> > >
> > > So __AVX10_1_256__ and __AVX10_1_512__ are redundant with
> > > __AVX10_1__ and __EVEX512__, right?
> > No, I mean __AVX10_1__ is redundant of __AVX10_1_256__ since -
> mavx10.1 is just alias of -mavx10.1-256.
> > We want explicit __AVX10_1_256__ and __AVX10_1_512__ and don't want
> mix __EVEX512__ with AVX10(They are related in their internal
> implementation, but we don't want the user to control the vector length of
> avx10 with -mno-evex512, -mno-evex512 is supposed for the existing
> AVX512).

Let's keep both of them if we prefer __AVX10_1_256__ since I just found
that LLVM got macro __AVX10_1__.

https://github.com/llvm/llvm-project/pull/67278/files#diff-7435d50346a810555df89deb1f879b767ee985ace43fb3990de17fb23a47f004

in file clang/lib/Basic/Targets/X86.cpp L774-777.

Thx,
Haochen

> 
> Ah, that makes sense.
> 
> > > > > +    }
> > > > > +  if (isa_flag2 & OPTION_MASK_ISA2_AVX10_1_512)
> > > > > +    def_or_undef (parse_in, "__AVX10_1_512__");
> > > > >    if (TARGET_IAMCU)
> > > > >      {
> > > > >        def_or_undef (parse_in, "__iamcu");
> > > > > --
> > > > > 2.31.1
> > > >

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] i386: Add AVX10.1 related macros
  2024-01-12  2:54         ` Jiang, Haochen
@ 2024-01-12  3:28           ` Hongtao Liu
  0 siblings, 0 replies; 7+ messages in thread
From: Hongtao Liu @ 2024-01-12  3:28 UTC (permalink / raw)
  To: Jiang, Haochen
  Cc: Richard Biener, Liu, Hongtao, gcc-patches, ubizjak, burnus, sandra

On Fri, Jan 12, 2024 at 10:55 AM Jiang, Haochen <haochen.jiang@intel.com> wrote:
>
> > -----Original Message-----
> > From: Richard Biener <richard.guenther@gmail.com>
> > Sent: Thursday, January 11, 2024 4:19 PM
> > To: Liu, Hongtao <hongtao.liu@intel.com>
> > Cc: Jiang, Haochen <haochen.jiang@intel.com>; gcc-patches@gcc.gnu.org;
> > ubizjak@gmail.com; burnus@net-b.de; sandra@codesourcery.com
> > Subject: Re: [PATCH] i386: Add AVX10.1 related macros
> >
> > On Thu, Jan 11, 2024 at 2:16 AM Liu, Hongtao <hongtao.liu@intel.com>
> > wrote:
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Richard Biener <richard.guenther@gmail.com>
> > > > Sent: Wednesday, January 10, 2024 5:44 PM
> > > > To: Liu, Hongtao <hongtao.liu@intel.com>
> > > > Cc: Jiang, Haochen <haochen.jiang@intel.com>;
> > > > gcc-patches@gcc.gnu.org; ubizjak@gmail.com; burnus@net-b.de;
> > > > sandra@codesourcery.com
> > > > Subject: Re: [PATCH] i386: Add AVX10.1 related macros
> > > >
> > > > On Wed, Jan 10, 2024 at 9:01 AM Liu, Hongtao <hongtao.liu@intel.com>
> > > > wrote:
> > > > >
> > > > >
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Jiang, Haochen <haochen.jiang@intel.com>
> > > > > > Sent: Wednesday, January 10, 2024 3:35 PM
> > > > > > To: gcc-patches@gcc.gnu.org
> > > > > > Cc: Liu, Hongtao <hongtao.liu@intel.com>; ubizjak@gmail.com;
> > > > > > burnus@net- b.de; sandra@codesourcery.com
> > > > > > Subject: [PATCH] i386: Add AVX10.1 related macros
> > > > > >
> > > > > > Hi all,
> > > > > >
> > > > > > This patch aims to add AVX10.1 related macros for libgomp's request.
> > > > > > The request comes following:
> > > > > >
> > > > > > https://gcc.gnu.org/pipermail/gcc-patches/2024-January/642025.ht
> > > > > > ml
> > > > > >
> > > > > > Ok for trunk?
> > > > > >
> > > > > > Thx,
> > > > > > Haochen
> > > > > >
> > > > > > gcc/ChangeLog:
> > > > > >
> > > > > >       PR target/113288
> > > > > >       * config/i386/i386-c.cc (ix86_target_macros_internal):
> > > > > >       Add __AVX10_1__, __AVX10_1_256__ and __AVX10_1_512__.
> > > > > > ---
> > > > > >  gcc/config/i386/i386-c.cc | 7 +++++++
> > > > > >  1 file changed, 7 insertions(+)
> > > > > >
> > > > > > diff --git a/gcc/config/i386/i386-c.cc
> > > > > > b/gcc/config/i386/i386-c.cc index c3ae984670b..366b560158a
> > > > > > 100644
> > > > > > --- a/gcc/config/i386/i386-c.cc
> > > > > > +++ b/gcc/config/i386/i386-c.cc
> > > > > > @@ -735,6 +735,13 @@ ix86_target_macros_internal
> > (HOST_WIDE_INT
> > > > > > isa_flag,
> > > > > >      def_or_undef (parse_in, "__EVEX512__");
> > > > > >    if (isa_flag2 & OPTION_MASK_ISA2_USER_MSR)
> > > > > >      def_or_undef (parse_in, "__USER_MSR__");
> > > > > > +  if (isa_flag2 & OPTION_MASK_ISA2_AVX10_1_256)
> > > > > > +    {
> > > > > > +      def_or_undef (parse_in, "__AVX10_1_256__");
> > > > > > +      def_or_undef (parse_in, "__AVX10_1__");
> > > > > I think this is not needed, others LGTM.
> > > >
> > > > So __AVX10_1_256__ and __AVX10_1_512__ are redundant with
> > > > __AVX10_1__ and __EVEX512__, right?
> > > No, I mean __AVX10_1__ is redundant of __AVX10_1_256__ since -
> > mavx10.1 is just alias of -mavx10.1-256.
> > > We want explicit __AVX10_1_256__ and __AVX10_1_512__ and don't want
> > mix __EVEX512__ with AVX10(They are related in their internal
> > implementation, but we don't want the user to control the vector length of
> > avx10 with -mno-evex512, -mno-evex512 is supposed for the existing
> > AVX512).
>
> Let's keep both of them if we prefer __AVX10_1_256__ since I just found
> that LLVM got macro __AVX10_1__.
>
> https://github.com/llvm/llvm-project/pull/67278/files#diff-7435d50346a810555df89deb1f879b767ee985ace43fb3990de17fb23a47f004
>
> in file clang/lib/Basic/Targets/X86.cpp L774-777.
Ok.
>
> Thx,
> Haochen
>
> >
> > Ah, that makes sense.
> >
> > > > > > +    }
> > > > > > +  if (isa_flag2 & OPTION_MASK_ISA2_AVX10_1_512)
> > > > > > +    def_or_undef (parse_in, "__AVX10_1_512__");
> > > > > >    if (TARGET_IAMCU)
> > > > > >      {
> > > > > >        def_or_undef (parse_in, "__iamcu");
> > > > > > --
> > > > > > 2.31.1
> > > > >



-- 
BR,
Hongtao

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-01-12  3:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-10  7:34 [PATCH] i386: Add AVX10.1 related macros Haochen Jiang
2024-01-10  7:58 ` Liu, Hongtao
2024-01-10  9:43   ` Richard Biener
2024-01-11  1:16     ` Liu, Hongtao
2024-01-11  8:18       ` Richard Biener
2024-01-12  2:54         ` Jiang, Haochen
2024-01-12  3:28           ` Hongtao Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).