Re: Re: [PATCH v3] RISC-V:Optimize the MASK opt generation

2023-10-06 Thread Feng Wang
Hi, Kito & Jeff
Due to National Day reasons, I was unable to reply to the email in a timely 
manner. 
Thank you for making the necessary changes to this patch. For the introduction 
of this bug, 
I will also carefully summarize my experience and lessons to avoid the 
recurrence of such problems. 
Thank you again!
--
Feng Wang
>Proposed fix, and verified with "mawk" and "gawk -P" (gawk with posix
>mode) on my linux also some other report it work on freebsd, just wait
>review :)
>
>https://gcc.gnu.org/pipermail/gcc-patches/2023-October/631785.html
>
>On Tue, Oct 3, 2023 at 2:07 AM Jeff Law  wrote:
>>
>>
>>
>> On 10/2/23 12:03, David Edelsohn wrote:
>> > On Mon, Oct 2, 2023 at 1:59 PM Jeff Law > > > wrote:
>> >
>> >
>> >
>> > On 10/2/23 11:20, David Edelsohn wrote:
>> >  > Wang,
>> >  >
>> >  > The AWK portions of this patch broke bootstrap on AIX.
>> >  >
>> >  > Also, the AWK portions are common code, not RISC-V specific.  I
>> > don't
>> >  > see anywhere that the common portions of the patch were reviewed or
>> >  > approved by anyone with authority to approve the changes to the
>> > AWK files.
>> >  >
>> >  > This patch should not have been committed without approval by a
>> > reviewer
>> >  > with authority for that portion of the compiler and should have been
>> >  > tested on targets other than RISC-V if common parts of the
>> > compiler were
>> >  > changed.
>> > I acked the generic bits.  So the lack of testing on another target is
>> > on me.
>> >
>> >
>> > Hi, Jeff
>> >
>> > Sorry. I didn't see a comment from a global reviewer in the V3 thread.
>> NP.
>>
>> >
>> > I am using Gawk on AIX.  After the change, I see a parse error from
>> > gawk.  I'm rebuilding with a checkout just before the change to confirm
>> > that it was the source of the error, and it seems to be past that
>> > failure location.  I didn't keep the exact error.  Once I get past this
>> > build cycle, I'll reproduce it.
>> I think there's already a patch circulating which fixes this.  It broke
>> at least one other platform.  Hopefully it'll all be sorted out today.
>>
>>
>> jeff

Re: [PATCH v3] RISC-V:Optimize the MASK opt generation

2023-10-03 Thread Jeff Law




On 10/2/23 20:38, Kito Cheng wrote:

Proposed fix, and verified with "mawk" and "gawk -P" (gawk with posix
mode) on my linux also some other report it work on freebsd, just wait
review :)

https://gcc.gnu.org/pipermail/gcc-patches/2023-October/631785.html

OK
jeff


Re: [PATCH v3] RISC-V:Optimize the MASK opt generation

2023-10-03 Thread David Edelsohn
The patch works on AIX.

I have Gawk installed, but it is a very old release before
multi-dimensional array support was added.

Thanks, David


On Mon, Oct 2, 2023 at 10:38 PM Kito Cheng  wrote:

> Proposed fix, and verified with "mawk" and "gawk -P" (gawk with posix
> mode) on my linux also some other report it work on freebsd, just wait
> review :)
>
> https://gcc.gnu.org/pipermail/gcc-patches/2023-October/631785.html
>
> On Tue, Oct 3, 2023 at 2:07 AM Jeff Law  wrote:
> >
> >
> >
> > On 10/2/23 12:03, David Edelsohn wrote:
> > > On Mon, Oct 2, 2023 at 1:59 PM Jeff Law  > > > wrote:
> > >
> > >
> > >
> > > On 10/2/23 11:20, David Edelsohn wrote:
> > >  > Wang,
> > >  >
> > >  > The AWK portions of this patch broke bootstrap on AIX.
> > >  >
> > >  > Also, the AWK portions are common code, not RISC-V specific.  I
> > > don't
> > >  > see anywhere that the common portions of the patch were
> reviewed or
> > >  > approved by anyone with authority to approve the changes to the
> > > AWK files.
> > >  >
> > >  > This patch should not have been committed without approval by a
> > > reviewer
> > >  > with authority for that portion of the compiler and should have
> been
> > >  > tested on targets other than RISC-V if common parts of the
> > > compiler were
> > >  > changed.
> > > I acked the generic bits.  So the lack of testing on another
> target is
> > > on me.
> > >
> > >
> > > Hi, Jeff
> > >
> > > Sorry. I didn't see a comment from a global reviewer in the V3 thread.
> > NP.
> >
> > >
> > > I am using Gawk on AIX.  After the change, I see a parse error from
> > > gawk.  I'm rebuilding with a checkout just before the change to confirm
> > > that it was the source of the error, and it seems to be past that
> > > failure location.  I didn't keep the exact error.  Once I get past this
> > > build cycle, I'll reproduce it.
> > I think there's already a patch circulating which fixes this.  It broke
> > at least one other platform.  Hopefully it'll all be sorted out today.
> >
> >
> > jeff
>


Re: [PATCH v3] RISC-V:Optimize the MASK opt generation

2023-10-02 Thread Kito Cheng
Proposed fix, and verified with "mawk" and "gawk -P" (gawk with posix
mode) on my linux also some other report it work on freebsd, just wait
review :)

https://gcc.gnu.org/pipermail/gcc-patches/2023-October/631785.html

On Tue, Oct 3, 2023 at 2:07 AM Jeff Law  wrote:
>
>
>
> On 10/2/23 12:03, David Edelsohn wrote:
> > On Mon, Oct 2, 2023 at 1:59 PM Jeff Law  > > wrote:
> >
> >
> >
> > On 10/2/23 11:20, David Edelsohn wrote:
> >  > Wang,
> >  >
> >  > The AWK portions of this patch broke bootstrap on AIX.
> >  >
> >  > Also, the AWK portions are common code, not RISC-V specific.  I
> > don't
> >  > see anywhere that the common portions of the patch were reviewed or
> >  > approved by anyone with authority to approve the changes to the
> > AWK files.
> >  >
> >  > This patch should not have been committed without approval by a
> > reviewer
> >  > with authority for that portion of the compiler and should have been
> >  > tested on targets other than RISC-V if common parts of the
> > compiler were
> >  > changed.
> > I acked the generic bits.  So the lack of testing on another target is
> > on me.
> >
> >
> > Hi, Jeff
> >
> > Sorry. I didn't see a comment from a global reviewer in the V3 thread.
> NP.
>
> >
> > I am using Gawk on AIX.  After the change, I see a parse error from
> > gawk.  I'm rebuilding with a checkout just before the change to confirm
> > that it was the source of the error, and it seems to be past that
> > failure location.  I didn't keep the exact error.  Once I get past this
> > build cycle, I'll reproduce it.
> I think there's already a patch circulating which fixes this.  It broke
> at least one other platform.  Hopefully it'll all be sorted out today.
>
>
> jeff


Re: [PATCH v3] RISC-V:Optimize the MASK opt generation

2023-10-02 Thread Jeff Law




On 10/2/23 12:03, David Edelsohn wrote:
On Mon, Oct 2, 2023 at 1:59 PM Jeff Law > wrote:




On 10/2/23 11:20, David Edelsohn wrote:
 > Wang,
 >
 > The AWK portions of this patch broke bootstrap on AIX.
 >
 > Also, the AWK portions are common code, not RISC-V specific.  I
don't
 > see anywhere that the common portions of the patch were reviewed or
 > approved by anyone with authority to approve the changes to the
AWK files.
 >
 > This patch should not have been committed without approval by a
reviewer
 > with authority for that portion of the compiler and should have been
 > tested on targets other than RISC-V if common parts of the
compiler were
 > changed.
I acked the generic bits.  So the lack of testing on another target is
on me.


Hi, Jeff

Sorry. I didn't see a comment from a global reviewer in the V3 thread.

NP.



I am using Gawk on AIX.  After the change, I see a parse error from 
gawk.  I'm rebuilding with a checkout just before the change to confirm 
that it was the source of the error, and it seems to be past that 
failure location.  I didn't keep the exact error.  Once I get past this 
build cycle, I'll reproduce it.
I think there's already a patch circulating which fixes this.  It broke 
at least one other platform.  Hopefully it'll all be sorted out today.



jeff


Re: [PATCH v3] RISC-V:Optimize the MASK opt generation

2023-10-02 Thread David Edelsohn
On Mon, Oct 2, 2023 at 1:59 PM Jeff Law  wrote:

>
>
> On 10/2/23 11:20, David Edelsohn wrote:
> > Wang,
> >
> > The AWK portions of this patch broke bootstrap on AIX.
> >
> > Also, the AWK portions are common code, not RISC-V specific.  I don't
> > see anywhere that the common portions of the patch were reviewed or
> > approved by anyone with authority to approve the changes to the AWK
> files.
> >
> > This patch should not have been committed without approval by a reviewer
> > with authority for that portion of the compiler and should have been
> > tested on targets other than RISC-V if common parts of the compiler were
> > changed.
> I acked the generic bits.  So the lack of testing on another target is
> on me.
>

Hi, Jeff

Sorry. I didn't see a comment from a global reviewer in the V3 thread.

I am using Gawk on AIX.  After the change, I see a parse error from gawk.
I'm rebuilding with a checkout just before the change to confirm that it
was the source of the error, and it seems to be past that failure
location.  I didn't keep the exact error.  Once I get past this build
cycle, I'll reproduce it.

Thanks, David


Re: [PATCH v3] RISC-V:Optimize the MASK opt generation

2023-10-02 Thread Jeff Law




On 10/2/23 11:20, David Edelsohn wrote:

Wang,

The AWK portions of this patch broke bootstrap on AIX.

Also, the AWK portions are common code, not RISC-V specific.  I don't 
see anywhere that the common portions of the patch were reviewed or 
approved by anyone with authority to approve the changes to the AWK files.


This patch should not have been committed without approval by a reviewer 
with authority for that portion of the compiler and should have been 
tested on targets other than RISC-V if common parts of the compiler were 
changed.
I acked the generic bits.  So the lack of testing on another target is 
on me.


jeff


Re: [PATCH v3] RISC-V:Optimize the MASK opt generation

2023-10-02 Thread David Edelsohn
Wang,

The AWK portions of this patch broke bootstrap on AIX.

Also, the AWK portions are common code, not RISC-V specific.  I don't see
anywhere that the common portions of the patch were reviewed or approved by
anyone with authority to approve the changes to the AWK files.

This patch should not have been committed without approval by a reviewer
with authority for that portion of the compiler and should have been tested
on targets other than RISC-V if common parts of the compiler were changed.

Thanks, David


Re: Re: [PATCH v3] RISC-V:Optimize the MASK opt generation

2023-09-06 Thread Feng Wang
Thanks reminder, I should rebase again.
--
Feng Wang
>Hi,
>
>I will need to notify you that x_riscv_xventana_subext,
>MASK_XVENTANACONDOPS and TARGET_XVENTANACONDOPS are added (I think you
>want to rewrite those definitions like the rest).  Also, be careful not
>to remove TARGET_ZICOND_LIKE.
>
>Thanks,
>Tsukasa
>
>On 2023/09/06 11:02, Feng Wang wrote:
>> This patch rebases the change of "[PATCH] RISC-V: Optimize the MASK opt
>> generation" and add the new explanation in the options.texi.
>> Please check the detail info on the
>> "https://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg302295.html;
>> gcc/ChangeLog:
>>
>> * config/riscv/riscv-opts.h (MASK_ZICSR):
>> (MASK_ZIFENCEI): Delete;
>> (MASK_ZIHINTNTL):    Ditto;
>> (MASK_ZIHINTPAUSE):  Ditto;
>> (TARGET_ZICSR):  Ditto;
>> (TARGET_ZIFENCEI):   Ditto;
>> (TARGET_ZIHINTNTL):  Ditto;
>> (TARGET_ZIHINTPAUSE):Ditto;
>> (MASK_ZAWRS):    Ditto;
>> (TARGET_ZAWRS):  Ditto;
>> (MASK_ZBA):  Ditto;
>> (MASK_ZBB):  Ditto;
>> (MASK_ZBC):  Ditto;
>> (MASK_ZBS):  Ditto;
>> (TARGET_ZBA):    Ditto;
>> (TARGET_ZBB):    Ditto;
>> (TARGET_ZBC):    Ditto;
>> (TARGET_ZBS):    Ditto;
>> (MASK_ZFINX):    Ditto;
>> (MASK_ZDINX):    Ditto;
>> (MASK_ZHINX):    Ditto;
>> (MASK_ZHINXMIN): Ditto;
>> (TARGET_ZFINX):  Ditto;
>> (TARGET_ZDINX):  Ditto;
>> (TARGET_ZHINX):  Ditto;
>> (TARGET_ZHINXMIN):   Ditto;
>> (MASK_ZBKB): Ditto;
>> (MASK_ZBKC): Ditto;
>> (MASK_ZBKX): Ditto;
>> (MASK_ZKNE): Ditto;
>> (MASK_ZKND): Ditto;
>> (MASK_ZKNH): Ditto;
>> (MASK_ZKR):  Ditto;
>> (MASK_ZKSED):    Ditto;
>> (MASK_ZKSH): Ditto;
>> (MASK_ZKT):  Ditto;
>> (TARGET_ZBKB):   Ditto;
>> (TARGET_ZBKC):   Ditto;
>> (TARGET_ZBKX):   Ditto;
>> (TARGET_ZKNE):   Ditto;
>> (TARGET_ZKND):   Ditto;
>> (TARGET_ZKNH):   Ditto;
>> (TARGET_ZKR):    Ditto;
>> (TARGET_ZKSED):  Ditto;
>> (TARGET_ZKSH):   Ditto;
>> (TARGET_ZKT):    Ditto;
>> (MASK_ZTSO): Ditto;
>> (TARGET_ZTSO):   Ditto;
>> (MASK_VECTOR_ELEN_32):   Ditto;
>> (MASK_VECTOR_ELEN_64):   Ditto;
>> (MASK_VECTOR_ELEN_FP_32):Ditto;
>> (MASK_VECTOR_ELEN_FP_64):Ditto;
>> (MASK_VECTOR_ELEN_FP_16):Ditto;
>> (TARGET_VECTOR_ELEN_32): Ditto;
>> (TARGET_VECTOR_ELEN_64): Ditto;
>> (TARGET_VECTOR_ELEN_FP_32):Ditto;
>> (TARGET_VECTOR_ELEN_FP_64):Ditto;
>> (TARGET_VECTOR_ELEN_FP_16):Ditto;
>>  (MASK_ZVBB):   Ditto;
>> (MASK_ZVBC):   Ditto;
>> (TARGET_ZVBB): Ditto;
>> (TARGET_ZVBC): Ditto;
>> (MASK_ZVKG):   Ditto;
>> (MASK_ZVKNED): Ditto;
>> (MASK_ZVKNHA): Ditto;
>> (MASK_ZVKNHB): Ditto;
>> (MASK_ZVKSED): Ditto;
>> (MASK_ZVKSH):  Ditto;
>> (MASK_ZVKN):   Ditto;
>> (MASK_ZVKNC):  Ditto;
>> (MASK_ZVKNG):  Ditto;
>> (MASK_ZVKS):   Ditto;
>> (MASK_ZVKSC):  Ditto;
>> (MASK_ZVKSG):  Ditto;
>> (MASK_ZVKT):   Ditto;
>> (TARGET_ZVKG): Ditto;
>> (TARGET_ZVKNED):   Ditto;
>> (TARGET_ZVKNHA):   Ditto;
>> (TARGET_ZVKNHB):   Ditto;
>> (TARGET_ZVKSED):   Ditto;
>> (TARGET_ZVKSH):    Ditto;
>> (TARGET_ZVKN): Ditto;
>> (TARGET_ZVKNC):    Ditto;
>> (TARGET_ZVKNG):    Ditto;
>> (TARGET_ZVKS): Ditto;
>> (TARGET_ZVKSC):    Ditto;
>> (TARGET_ZVKSG):    Ditto;
>> (TARGET_ZVKT): Ditto;
>> (MASK_ZVL32B): Ditto;
>> (MASK_ZVL64B): Ditto;
>> (MASK_ZVL128B):    Ditto;
>> (MASK_ZVL256B):    Ditto;
>> (MASK_ZVL512B):    Ditto;
>> (MASK_ZVL1024B):   Ditto;
>> (MASK_ZVL2048B):   Ditto;
>> (MASK_ZVL4096B):   Ditto;
>> (MASK_ZVL8192B):   Ditto;
>> (MASK_ZVL16384B):  Ditto;
>> (MASK_ZVL32768B):  Ditto;
>> (MASK_ZVL65536B):  Ditto;
>> (TARGET_ZVL32B):   Ditto;
>> (TARGET_ZVL64B):   Ditto;
>> (TARGET_ZVL128B):  Ditto;
>> (TARGET_ZVL256B):  Ditto;
>> (TARGET_ZVL512B):  Ditto;
>> (TARGET_ZVL1024B): Ditto;
>> (TARGET_ZVL2048B): Ditto;
>> 

Re: [PATCH v3] RISC-V:Optimize the MASK opt generation

2023-09-06 Thread Tsukasa OI via Gcc-patches
Hi,

I will need to notify you that x_riscv_xventana_subext,
MASK_XVENTANACONDOPS and TARGET_XVENTANACONDOPS are added (I think you
want to rewrite those definitions like the rest).  Also, be careful not
to remove TARGET_ZICOND_LIKE.

Thanks,
Tsukasa

On 2023/09/06 11:02, Feng Wang wrote:
> This patch rebases the change of "[PATCH] RISC-V: Optimize the MASK opt
> generation" and add the new explanation in the options.texi.
> Please check the detail info on the
> "https://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg302295.html;
> gcc/ChangeLog:
> 
> * config/riscv/riscv-opts.h (MASK_ZICSR):
> (MASK_ZIFENCEI): Delete;
> (MASK_ZIHINTNTL):Ditto;
> (MASK_ZIHINTPAUSE):  Ditto;
> (TARGET_ZICSR):  Ditto;
> (TARGET_ZIFENCEI):   Ditto;
> (TARGET_ZIHINTNTL):  Ditto;
> (TARGET_ZIHINTPAUSE):Ditto;
> (MASK_ZAWRS):Ditto;
> (TARGET_ZAWRS):  Ditto;
> (MASK_ZBA):  Ditto;
> (MASK_ZBB):  Ditto;
> (MASK_ZBC):  Ditto;
> (MASK_ZBS):  Ditto;
> (TARGET_ZBA):Ditto;
> (TARGET_ZBB):Ditto;
> (TARGET_ZBC):Ditto;
> (TARGET_ZBS):Ditto;
> (MASK_ZFINX):Ditto;
> (MASK_ZDINX):Ditto;
> (MASK_ZHINX):Ditto;
> (MASK_ZHINXMIN): Ditto;
> (TARGET_ZFINX):  Ditto;
> (TARGET_ZDINX):  Ditto;
> (TARGET_ZHINX):  Ditto;
> (TARGET_ZHINXMIN):   Ditto;
> (MASK_ZBKB): Ditto;
> (MASK_ZBKC): Ditto;
> (MASK_ZBKX): Ditto;
> (MASK_ZKNE): Ditto;
> (MASK_ZKND): Ditto;
> (MASK_ZKNH): Ditto;
> (MASK_ZKR):  Ditto;
> (MASK_ZKSED):Ditto;
> (MASK_ZKSH): Ditto;
> (MASK_ZKT):  Ditto;
> (TARGET_ZBKB):   Ditto;
> (TARGET_ZBKC):   Ditto;
> (TARGET_ZBKX):   Ditto;
> (TARGET_ZKNE):   Ditto;
> (TARGET_ZKND):   Ditto;
> (TARGET_ZKNH):   Ditto;
> (TARGET_ZKR):Ditto;
> (TARGET_ZKSED):  Ditto;
> (TARGET_ZKSH):   Ditto;
> (TARGET_ZKT):Ditto;
> (MASK_ZTSO): Ditto;
> (TARGET_ZTSO):   Ditto;
> (MASK_VECTOR_ELEN_32):   Ditto;
> (MASK_VECTOR_ELEN_64):   Ditto;
> (MASK_VECTOR_ELEN_FP_32):Ditto;
> (MASK_VECTOR_ELEN_FP_64):Ditto;
> (MASK_VECTOR_ELEN_FP_16):Ditto;
> (TARGET_VECTOR_ELEN_32): Ditto;
> (TARGET_VECTOR_ELEN_64): Ditto;
> (TARGET_VECTOR_ELEN_FP_32):Ditto;
> (TARGET_VECTOR_ELEN_FP_64):Ditto;
> (TARGET_VECTOR_ELEN_FP_16):Ditto;
>  (MASK_ZVBB):   Ditto;
> (MASK_ZVBC):   Ditto;
> (TARGET_ZVBB): Ditto;
> (TARGET_ZVBC): Ditto;
> (MASK_ZVKG):   Ditto;
> (MASK_ZVKNED): Ditto;
> (MASK_ZVKNHA): Ditto;
> (MASK_ZVKNHB): Ditto;
> (MASK_ZVKSED): Ditto;
> (MASK_ZVKSH):  Ditto;
> (MASK_ZVKN):   Ditto;
> (MASK_ZVKNC):  Ditto;
> (MASK_ZVKNG):  Ditto;
> (MASK_ZVKS):   Ditto;
> (MASK_ZVKSC):  Ditto;
> (MASK_ZVKSG):  Ditto;
> (MASK_ZVKT):   Ditto;
> (TARGET_ZVKG): Ditto;
> (TARGET_ZVKNED):   Ditto;
> (TARGET_ZVKNHA):   Ditto;
> (TARGET_ZVKNHB):   Ditto;
> (TARGET_ZVKSED):   Ditto;
> (TARGET_ZVKSH):Ditto;
> (TARGET_ZVKN): Ditto;
> (TARGET_ZVKNC):Ditto;
> (TARGET_ZVKNG):Ditto;
> (TARGET_ZVKS): Ditto;
> (TARGET_ZVKSC):Ditto;
> (TARGET_ZVKSG):Ditto;
> (TARGET_ZVKT): Ditto;
> (MASK_ZVL32B): Ditto;
> (MASK_ZVL64B): Ditto;
> (MASK_ZVL128B):Ditto;
> (MASK_ZVL256B):Ditto;
> (MASK_ZVL512B):Ditto;
> (MASK_ZVL1024B):   Ditto;
> (MASK_ZVL2048B):   Ditto;
> (MASK_ZVL4096B):   Ditto;
> (MASK_ZVL8192B):   Ditto;
> (MASK_ZVL16384B):  Ditto;
> (MASK_ZVL32768B):  Ditto;
> (MASK_ZVL65536B):  Ditto;
> (TARGET_ZVL32B):   Ditto;
> (TARGET_ZVL64B):   Ditto;
> (TARGET_ZVL128B):  Ditto;
> (TARGET_ZVL256B):  Ditto;
> (TARGET_ZVL512B):  Ditto;
> (TARGET_ZVL1024B): Ditto;
> (TARGET_ZVL2048B): Ditto;
> (TARGET_ZVL4096B): Ditto;
> (TARGET_ZVL8192B): Ditto;
> (TARGET_ZVL16384B):Ditto;
> (TARGET_ZVL32768B):Ditto;
> (TARGET_ZVL65536B):Ditto;
> 

Re: Re: [PATCH v3] RISC-V:Optimize the MASK opt generation

2023-09-06 Thread Kito Cheng via Gcc-patches
I saw RVC has MASK_RVC and TARGET_RVC in options.h?

On Wed, Sep 6, 2023 at 2:39 PM Feng Wang  wrote:
>
> According to the doc, take“Mask(VECTOR_ELEN_32)
> Var(riscv_vector_elen_flags)”as example,
> it just generates the OPTION_MASK_VECTOR_ELEN_32, will not generate 
> MASK_VECTOR_ELEN_32
> and TARGET_VECTOR_ELEN_32.
> Do you want to use "MASK(name) Var(other_flags)" to generate the MASK and 
> TARGET Macro?
> I think it will change a lot of code and the original meaning is changed.
> --
> Feng Wang
> >Reading the manual again, it seems I missed something in the manual
> >before, the MASK syntax already says we can specify Var to select the
> >variable other than target_flags, but I tried that not work when we
> >only declare Mask with Var (e.g. "Mask(VECTOR_ELEN_32)
> >Var(riscv_vector_elen_flags)" still using target_flags)
> >
> >So maybe we should just fix that instead of extending the syntax?
> >e.g.
> >Mask(VECTOR_ELEN_32)Var(riscv_vector_elen_flags)
> >rather than
> >Mask(VECTOR_ELEN_32)in TargetVariable(riscv_vector_elen_flags)
> >
> >
> >On Wed, Sep 6, 2023 at 10:03 AM Feng Wang  
> >wrote:
> >>
> >> This patch rebases the change of "[PATCH] RISC-V: Optimize the MASK opt
> >> generation" and add the new explanation in the options.texi.
> >> Please check the detail info on the
> >> "https://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg302295.html;
> >> gcc/ChangeLog:
> >>
> >> * config/riscv/riscv-opts.h (MASK_ZICSR):
> >> (MASK_ZIFENCEI): Delete;
> >> (MASK_ZIHINTNTL):Ditto;
> >> (MASK_ZIHINTPAUSE):  Ditto;
> >> (TARGET_ZICSR):  Ditto;
> >> (TARGET_ZIFENCEI):   Ditto;
> >> (TARGET_ZIHINTNTL):  Ditto;
> >> (TARGET_ZIHINTPAUSE):Ditto;
> >> (MASK_ZAWRS):Ditto;
> >> (TARGET_ZAWRS):  Ditto;
> >> (MASK_ZBA):  Ditto;
> >> (MASK_ZBB):  Ditto;
> >> (MASK_ZBC):  Ditto;
> >> (MASK_ZBS):  Ditto;
> >> (TARGET_ZBA):Ditto;
> >> (TARGET_ZBB):Ditto;
> >> (TARGET_ZBC):Ditto;
> >> (TARGET_ZBS):Ditto;
> >> (MASK_ZFINX):Ditto;
> >> (MASK_ZDINX):Ditto;
> >> (MASK_ZHINX):Ditto;
> >> (MASK_ZHINXMIN): Ditto;
> >> (TARGET_ZFINX):  Ditto;
> >> (TARGET_ZDINX):  Ditto;
> >> (TARGET_ZHINX):  Ditto;
> >> (TARGET_ZHINXMIN):   Ditto;
> >> (MASK_ZBKB): Ditto;
> >> (MASK_ZBKC): Ditto;
> >> (MASK_ZBKX): Ditto;
> >> (MASK_ZKNE): Ditto;
> >> (MASK_ZKND): Ditto;
> >> (MASK_ZKNH): Ditto;
> >> (MASK_ZKR):  Ditto;
> >> (MASK_ZKSED):Ditto;
> >> (MASK_ZKSH): Ditto;
> >> (MASK_ZKT):  Ditto;
> >> (TARGET_ZBKB):   Ditto;
> >> (TARGET_ZBKC):   Ditto;
> >> (TARGET_ZBKX):   Ditto;
> >> (TARGET_ZKNE):   Ditto;
> >> (TARGET_ZKND):   Ditto;
> >> (TARGET_ZKNH):   Ditto;
> >> (TARGET_ZKR):Ditto;
> >> (TARGET_ZKSED):  Ditto;
> >> (TARGET_ZKSH):   Ditto;
> >> (TARGET_ZKT):Ditto;
> >> (MASK_ZTSO): Ditto;
> >> (TARGET_ZTSO):   Ditto;
> >> (MASK_VECTOR_ELEN_32):   Ditto;
> >> (MASK_VECTOR_ELEN_64):   Ditto;
> >> (MASK_VECTOR_ELEN_FP_32):Ditto;
> >> (MASK_VECTOR_ELEN_FP_64):Ditto;
> >> (MASK_VECTOR_ELEN_FP_16):Ditto;
> >> (TARGET_VECTOR_ELEN_32): Ditto;
> >> (TARGET_VECTOR_ELEN_64): Ditto;
> >> (TARGET_VECTOR_ELEN_FP_32):Ditto;
> >> (TARGET_VECTOR_ELEN_FP_64):Ditto;
> >> (TARGET_VECTOR_ELEN_FP_16):Ditto;
> >>  (MASK_ZVBB):   Ditto;
> >> (MASK_ZVBC):   Ditto;
> >> (TARGET_ZVBB): Ditto;
> >> (TARGET_ZVBC): Ditto;
> >> (MASK_ZVKG):   Ditto;
> >> (MASK_ZVKNED): Ditto;
> >> (MASK_ZVKNHA): Ditto;
> >> (MASK_ZVKNHB): Ditto;
> >> (MASK_ZVKSED): Ditto;
> >> (MASK_ZVKSH):  Ditto;
> >> (MASK_ZVKN):   Ditto;
> >> (MASK_ZVKNC):  Ditto;
> >> (MASK_ZVKNG):  Ditto;
> >> (MASK_ZVKS):   Ditto;
> >> (MASK_ZVKSC):  Ditto;
> >> (MASK_ZVKSG):  Ditto;
> >> (MASK_ZVKT):   Ditto;
> >> (TARGET_ZVKG): Ditto;
> >> (TARGET_ZVKNED):   Ditto;
> >> (TARGET_ZVKNHA):   Ditto;
> >> (TARGET_ZVKNHB):   Ditto;
> >> (TARGET_ZVKSED):   Ditto;
> >> (TARGET_ZVKSH):Ditto;
> >> (TARGET_ZVKN): Ditto;
> >> (TARGET_ZVKNC):Ditto;
> >> (TARGET_ZVKNG):Ditto;
> >>

Re: Re: [PATCH v3] RISC-V:Optimize the MASK opt generation

2023-09-06 Thread Feng Wang
According to the doc, take“Mask(VECTOR_ELEN_32)    
Var(riscv_vector_elen_flags)”as example, 
it just generates the OPTION_MASK_VECTOR_ELEN_32, will not generate 
MASK_VECTOR_ELEN_32 
and TARGET_VECTOR_ELEN_32. 
Do you want to use "MASK(name) Var(other_flags)" to generate the MASK and 
TARGET Macro?
I think it will change a lot of code and the original meaning is changed.
--
Feng Wang
>Reading the manual again, it seems I missed something in the manual
>before, the MASK syntax already says we can specify Var to select the
>variable other than target_flags, but I tried that not work when we
>only declare Mask with Var (e.g. "Mask(VECTOR_ELEN_32)
>Var(riscv_vector_elen_flags)" still using target_flags)
>
>So maybe we should just fix that instead of extending the syntax?
>e.g.
>Mask(VECTOR_ELEN_32)    Var(riscv_vector_elen_flags)
>rather than
>Mask(VECTOR_ELEN_32)    in TargetVariable(riscv_vector_elen_flags)
>
>
>On Wed, Sep 6, 2023 at 10:03 AM Feng Wang  wrote:
>>
>> This patch rebases the change of "[PATCH] RISC-V: Optimize the MASK opt
>> generation" and add the new explanation in the options.texi.
>> Please check the detail info on the
>> "https://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg302295.html;
>> gcc/ChangeLog:
>>
>> * config/riscv/riscv-opts.h (MASK_ZICSR):
>> (MASK_ZIFENCEI): Delete;
>> (MASK_ZIHINTNTL):    Ditto;
>> (MASK_ZIHINTPAUSE):  Ditto;
>> (TARGET_ZICSR):  Ditto;
>> (TARGET_ZIFENCEI):   Ditto;
>> (TARGET_ZIHINTNTL):  Ditto;
>> (TARGET_ZIHINTPAUSE):Ditto;
>> (MASK_ZAWRS):    Ditto;
>> (TARGET_ZAWRS):  Ditto;
>> (MASK_ZBA):  Ditto;
>> (MASK_ZBB):  Ditto;
>> (MASK_ZBC):  Ditto;
>> (MASK_ZBS):  Ditto;
>> (TARGET_ZBA):    Ditto;
>> (TARGET_ZBB):    Ditto;
>> (TARGET_ZBC):    Ditto;
>> (TARGET_ZBS):    Ditto;
>> (MASK_ZFINX):    Ditto;
>> (MASK_ZDINX):    Ditto;
>> (MASK_ZHINX):    Ditto;
>> (MASK_ZHINXMIN): Ditto;
>> (TARGET_ZFINX):  Ditto;
>> (TARGET_ZDINX):  Ditto;
>> (TARGET_ZHINX):  Ditto;
>> (TARGET_ZHINXMIN):   Ditto;
>> (MASK_ZBKB): Ditto;
>> (MASK_ZBKC): Ditto;
>> (MASK_ZBKX): Ditto;
>> (MASK_ZKNE): Ditto;
>> (MASK_ZKND): Ditto;
>> (MASK_ZKNH): Ditto;
>> (MASK_ZKR):  Ditto;
>> (MASK_ZKSED):    Ditto;
>> (MASK_ZKSH): Ditto;
>> (MASK_ZKT):  Ditto;
>> (TARGET_ZBKB):   Ditto;
>> (TARGET_ZBKC):   Ditto;
>> (TARGET_ZBKX):   Ditto;
>> (TARGET_ZKNE):   Ditto;
>> (TARGET_ZKND):   Ditto;
>> (TARGET_ZKNH):   Ditto;
>> (TARGET_ZKR):    Ditto;
>> (TARGET_ZKSED):  Ditto;
>> (TARGET_ZKSH):   Ditto;
>> (TARGET_ZKT):    Ditto;
>> (MASK_ZTSO): Ditto;
>> (TARGET_ZTSO):   Ditto;
>> (MASK_VECTOR_ELEN_32):   Ditto;
>> (MASK_VECTOR_ELEN_64):   Ditto;
>> (MASK_VECTOR_ELEN_FP_32):Ditto;
>> (MASK_VECTOR_ELEN_FP_64):Ditto;
>> (MASK_VECTOR_ELEN_FP_16):Ditto;
>> (TARGET_VECTOR_ELEN_32): Ditto;
>> (TARGET_VECTOR_ELEN_64): Ditto;
>> (TARGET_VECTOR_ELEN_FP_32):Ditto;
>> (TARGET_VECTOR_ELEN_FP_64):Ditto;
>> (TARGET_VECTOR_ELEN_FP_16):Ditto;
>>  (MASK_ZVBB):   Ditto;
>> (MASK_ZVBC):   Ditto;
>> (TARGET_ZVBB): Ditto;
>> (TARGET_ZVBC): Ditto;
>> (MASK_ZVKG):   Ditto;
>> (MASK_ZVKNED): Ditto;
>> (MASK_ZVKNHA): Ditto;
>> (MASK_ZVKNHB): Ditto;
>> (MASK_ZVKSED): Ditto;
>> (MASK_ZVKSH):  Ditto;
>> (MASK_ZVKN):   Ditto;
>> (MASK_ZVKNC):  Ditto;
>> (MASK_ZVKNG):  Ditto;
>> (MASK_ZVKS):   Ditto;
>> (MASK_ZVKSC):  Ditto;
>> (MASK_ZVKSG):  Ditto;
>> (MASK_ZVKT):   Ditto;
>> (TARGET_ZVKG): Ditto;
>> (TARGET_ZVKNED):   Ditto;
>> (TARGET_ZVKNHA):   Ditto;
>> (TARGET_ZVKNHB):   Ditto;
>> (TARGET_ZVKSED):   Ditto;
>> (TARGET_ZVKSH):    Ditto;
>> (TARGET_ZVKN): Ditto;
>> (TARGET_ZVKNC):    Ditto;
>> (TARGET_ZVKNG):    Ditto;
>> (TARGET_ZVKS): Ditto;
>> (TARGET_ZVKSC):    Ditto;
>> (TARGET_ZVKSG):    Ditto;
>> (TARGET_ZVKT): Ditto;
>> (MASK_ZVL32B): Ditto;
>> (MASK_ZVL64B): Ditto;
>> (MASK_ZVL128B):    Ditto;
>> (MASK_ZVL256B):    Ditto;
>> 

Re: [PATCH v3] RISC-V:Optimize the MASK opt generation

2023-09-05 Thread Kito Cheng via Gcc-patches
Reading the manual again, it seems I missed something in the manual
before, the MASK syntax already says we can specify Var to select the
variable other than target_flags, but I tried that not work when we
only declare Mask with Var (e.g. "Mask(VECTOR_ELEN_32)
Var(riscv_vector_elen_flags)" still using target_flags)

So maybe we should just fix that instead of extending the syntax?
e.g.
Mask(VECTOR_ELEN_32)Var(riscv_vector_elen_flags)
rather than
Mask(VECTOR_ELEN_32)in TargetVariable(riscv_vector_elen_flags)


On Wed, Sep 6, 2023 at 10:03 AM Feng Wang  wrote:
>
> This patch rebases the change of "[PATCH] RISC-V: Optimize the MASK opt
> generation" and add the new explanation in the options.texi.
> Please check the detail info on the
> "https://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg302295.html;
> gcc/ChangeLog:
>
> * config/riscv/riscv-opts.h (MASK_ZICSR):
> (MASK_ZIFENCEI): Delete;
> (MASK_ZIHINTNTL):Ditto;
> (MASK_ZIHINTPAUSE):  Ditto;
> (TARGET_ZICSR):  Ditto;
> (TARGET_ZIFENCEI):   Ditto;
> (TARGET_ZIHINTNTL):  Ditto;
> (TARGET_ZIHINTPAUSE):Ditto;
> (MASK_ZAWRS):Ditto;
> (TARGET_ZAWRS):  Ditto;
> (MASK_ZBA):  Ditto;
> (MASK_ZBB):  Ditto;
> (MASK_ZBC):  Ditto;
> (MASK_ZBS):  Ditto;
> (TARGET_ZBA):Ditto;
> (TARGET_ZBB):Ditto;
> (TARGET_ZBC):Ditto;
> (TARGET_ZBS):Ditto;
> (MASK_ZFINX):Ditto;
> (MASK_ZDINX):Ditto;
> (MASK_ZHINX):Ditto;
> (MASK_ZHINXMIN): Ditto;
> (TARGET_ZFINX):  Ditto;
> (TARGET_ZDINX):  Ditto;
> (TARGET_ZHINX):  Ditto;
> (TARGET_ZHINXMIN):   Ditto;
> (MASK_ZBKB): Ditto;
> (MASK_ZBKC): Ditto;
> (MASK_ZBKX): Ditto;
> (MASK_ZKNE): Ditto;
> (MASK_ZKND): Ditto;
> (MASK_ZKNH): Ditto;
> (MASK_ZKR):  Ditto;
> (MASK_ZKSED):Ditto;
> (MASK_ZKSH): Ditto;
> (MASK_ZKT):  Ditto;
> (TARGET_ZBKB):   Ditto;
> (TARGET_ZBKC):   Ditto;
> (TARGET_ZBKX):   Ditto;
> (TARGET_ZKNE):   Ditto;
> (TARGET_ZKND):   Ditto;
> (TARGET_ZKNH):   Ditto;
> (TARGET_ZKR):Ditto;
> (TARGET_ZKSED):  Ditto;
> (TARGET_ZKSH):   Ditto;
> (TARGET_ZKT):Ditto;
> (MASK_ZTSO): Ditto;
> (TARGET_ZTSO):   Ditto;
> (MASK_VECTOR_ELEN_32):   Ditto;
> (MASK_VECTOR_ELEN_64):   Ditto;
> (MASK_VECTOR_ELEN_FP_32):Ditto;
> (MASK_VECTOR_ELEN_FP_64):Ditto;
> (MASK_VECTOR_ELEN_FP_16):Ditto;
> (TARGET_VECTOR_ELEN_32): Ditto;
> (TARGET_VECTOR_ELEN_64): Ditto;
> (TARGET_VECTOR_ELEN_FP_32):Ditto;
> (TARGET_VECTOR_ELEN_FP_64):Ditto;
> (TARGET_VECTOR_ELEN_FP_16):Ditto;
>  (MASK_ZVBB):   Ditto;
> (MASK_ZVBC):   Ditto;
> (TARGET_ZVBB): Ditto;
> (TARGET_ZVBC): Ditto;
> (MASK_ZVKG):   Ditto;
> (MASK_ZVKNED): Ditto;
> (MASK_ZVKNHA): Ditto;
> (MASK_ZVKNHB): Ditto;
> (MASK_ZVKSED): Ditto;
> (MASK_ZVKSH):  Ditto;
> (MASK_ZVKN):   Ditto;
> (MASK_ZVKNC):  Ditto;
> (MASK_ZVKNG):  Ditto;
> (MASK_ZVKS):   Ditto;
> (MASK_ZVKSC):  Ditto;
> (MASK_ZVKSG):  Ditto;
> (MASK_ZVKT):   Ditto;
> (TARGET_ZVKG): Ditto;
> (TARGET_ZVKNED):   Ditto;
> (TARGET_ZVKNHA):   Ditto;
> (TARGET_ZVKNHB):   Ditto;
> (TARGET_ZVKSED):   Ditto;
> (TARGET_ZVKSH):Ditto;
> (TARGET_ZVKN): Ditto;
> (TARGET_ZVKNC):Ditto;
> (TARGET_ZVKNG):Ditto;
> (TARGET_ZVKS): Ditto;
> (TARGET_ZVKSC):Ditto;
> (TARGET_ZVKSG):Ditto;
> (TARGET_ZVKT): Ditto;
> (MASK_ZVL32B): Ditto;
> (MASK_ZVL64B): Ditto;
> (MASK_ZVL128B):Ditto;
> (MASK_ZVL256B):Ditto;
> (MASK_ZVL512B):Ditto;
> (MASK_ZVL1024B):   Ditto;
> (MASK_ZVL2048B):   Ditto;
> (MASK_ZVL4096B):   Ditto;
> (MASK_ZVL8192B):   Ditto;
> (MASK_ZVL16384B):  Ditto;
> (MASK_ZVL32768B):  Ditto;
> (MASK_ZVL65536B):  Ditto;
> (TARGET_ZVL32B):   Ditto;
> (TARGET_ZVL64B):   Ditto;
> (TARGET_ZVL128B):  Ditto;
> (TARGET_ZVL256B):  Ditto;
> (TARGET_ZVL512B):  Ditto;
> 

[PATCH v3] RISC-V:Optimize the MASK opt generation

2023-09-05 Thread Feng Wang
This patch rebases the change of "[PATCH] RISC-V: Optimize the MASK opt
generation" and add the new explanation in the options.texi.
Please check the detail info on the
"https://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg302295.html;
gcc/ChangeLog:

* config/riscv/riscv-opts.h (MASK_ZICSR):
(MASK_ZIFENCEI): Delete;
(MASK_ZIHINTNTL):Ditto;
(MASK_ZIHINTPAUSE):  Ditto;
(TARGET_ZICSR):  Ditto;
(TARGET_ZIFENCEI):   Ditto;
(TARGET_ZIHINTNTL):  Ditto;
(TARGET_ZIHINTPAUSE):Ditto;
(MASK_ZAWRS):Ditto;
(TARGET_ZAWRS):  Ditto;
(MASK_ZBA):  Ditto;
(MASK_ZBB):  Ditto;
(MASK_ZBC):  Ditto;
(MASK_ZBS):  Ditto;
(TARGET_ZBA):Ditto;
(TARGET_ZBB):Ditto;
(TARGET_ZBC):Ditto;
(TARGET_ZBS):Ditto;
(MASK_ZFINX):Ditto;
(MASK_ZDINX):Ditto;
(MASK_ZHINX):Ditto;
(MASK_ZHINXMIN): Ditto;
(TARGET_ZFINX):  Ditto;
(TARGET_ZDINX):  Ditto;
(TARGET_ZHINX):  Ditto;
(TARGET_ZHINXMIN):   Ditto;
(MASK_ZBKB): Ditto;
(MASK_ZBKC): Ditto;
(MASK_ZBKX): Ditto;
(MASK_ZKNE): Ditto;
(MASK_ZKND): Ditto;
(MASK_ZKNH): Ditto;
(MASK_ZKR):  Ditto;
(MASK_ZKSED):Ditto;
(MASK_ZKSH): Ditto;
(MASK_ZKT):  Ditto;
(TARGET_ZBKB):   Ditto;
(TARGET_ZBKC):   Ditto;
(TARGET_ZBKX):   Ditto;
(TARGET_ZKNE):   Ditto;
(TARGET_ZKND):   Ditto;
(TARGET_ZKNH):   Ditto;
(TARGET_ZKR):Ditto;
(TARGET_ZKSED):  Ditto;
(TARGET_ZKSH):   Ditto;
(TARGET_ZKT):Ditto;
(MASK_ZTSO): Ditto;
(TARGET_ZTSO):   Ditto;
(MASK_VECTOR_ELEN_32):   Ditto;
(MASK_VECTOR_ELEN_64):   Ditto;
(MASK_VECTOR_ELEN_FP_32):Ditto;
(MASK_VECTOR_ELEN_FP_64):Ditto;
(MASK_VECTOR_ELEN_FP_16):Ditto;
(TARGET_VECTOR_ELEN_32): Ditto;
(TARGET_VECTOR_ELEN_64): Ditto;
(TARGET_VECTOR_ELEN_FP_32):Ditto;
(TARGET_VECTOR_ELEN_FP_64):Ditto;
(TARGET_VECTOR_ELEN_FP_16):Ditto;
 (MASK_ZVBB):   Ditto;
(MASK_ZVBC):   Ditto;
(TARGET_ZVBB): Ditto;
(TARGET_ZVBC): Ditto;
(MASK_ZVKG):   Ditto;
(MASK_ZVKNED): Ditto;
(MASK_ZVKNHA): Ditto;
(MASK_ZVKNHB): Ditto;
(MASK_ZVKSED): Ditto;
(MASK_ZVKSH):  Ditto;
(MASK_ZVKN):   Ditto;
(MASK_ZVKNC):  Ditto;
(MASK_ZVKNG):  Ditto;
(MASK_ZVKS):   Ditto;
(MASK_ZVKSC):  Ditto;
(MASK_ZVKSG):  Ditto;
(MASK_ZVKT):   Ditto;
(TARGET_ZVKG): Ditto;
(TARGET_ZVKNED):   Ditto;
(TARGET_ZVKNHA):   Ditto;
(TARGET_ZVKNHB):   Ditto;
(TARGET_ZVKSED):   Ditto;
(TARGET_ZVKSH):Ditto;
(TARGET_ZVKN): Ditto;
(TARGET_ZVKNC):Ditto;
(TARGET_ZVKNG):Ditto;
(TARGET_ZVKS): Ditto;
(TARGET_ZVKSC):Ditto;
(TARGET_ZVKSG):Ditto;
(TARGET_ZVKT): Ditto;
(MASK_ZVL32B): Ditto;
(MASK_ZVL64B): Ditto;
(MASK_ZVL128B):Ditto;
(MASK_ZVL256B):Ditto;
(MASK_ZVL512B):Ditto;
(MASK_ZVL1024B):   Ditto;
(MASK_ZVL2048B):   Ditto;
(MASK_ZVL4096B):   Ditto;
(MASK_ZVL8192B):   Ditto;
(MASK_ZVL16384B):  Ditto;
(MASK_ZVL32768B):  Ditto;
(MASK_ZVL65536B):  Ditto;
(TARGET_ZVL32B):   Ditto;
(TARGET_ZVL64B):   Ditto;
(TARGET_ZVL128B):  Ditto;
(TARGET_ZVL256B):  Ditto;
(TARGET_ZVL512B):  Ditto;
(TARGET_ZVL1024B): Ditto;
(TARGET_ZVL2048B): Ditto;
(TARGET_ZVL4096B): Ditto;
(TARGET_ZVL8192B): Ditto;
(TARGET_ZVL16384B):Ditto;
(TARGET_ZVL32768B):Ditto;
(TARGET_ZVL65536B):Ditto;
(MASK_ZICBOZ): Ditto;
(MASK_ZICBOM): Ditto;
(MASK_ZICBOP): Ditto;
(TARGET_ZICBOZ):   Ditto;
(TARGET_ZICBOM):   Ditto;
(TARGET_ZICBOP):   Ditto;
(MASK_ZICOND): Ditto;
(TARGET_ZICOND):   Ditto;
(MASK_ZFA):Ditto;
(TARGET_ZFA):  Ditto;
(MASK_ZFHMIN): Ditto;
(MASK_ZFH):Ditto;
(MASK_ZVFHMIN):Ditto;
(MASK_ZVFH):   Ditto;