public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "juzhe.zhong@rivai.ai" <juzhe.zhong@rivai.ai>
To: "Richard Biener" <richard.guenther@gmail.com>,
	 jeffreyalaw <jeffreyalaw@gmail.com>
Cc: Kito.cheng <kito.cheng@sifive.com>,
	 gcc-patches <gcc-patches@gcc.gnu.org>,
	 kito.cheng <kito.cheng@gmail.com>,  palmer <palmer@dabbelt.com>,
	 palmer <palmer@rivosinc.com>,
	 "Robin Dapp" <rdapp.gcc@gmail.com>
Subject: Re: Re: [PATCH V2] RISC-V: Fix bug of pre-calculated const vector mask
Date: Wed, 28 Jun 2023 15:38:54 +0800	[thread overview]
Message-ID: <D8D53F7251CB3EEF+2023062815385337945610@rivai.ai> (raw)
In-Reply-To: <CAFiYyc0w6+mktRa=dwhHETbYOq7bg66zyBD2uM2NG7+X6H8=AQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1844 bytes --]

Hi, Richi. 
Thanks for taking care of this issue.

From my observation,  VNx2BI is using 2-bit mask: 00 = 0, 01 = 1
                                     VNx4BI is using 4-bit mask: 0000 = 0, 0001 = 1
This perfectly works for ARM SVE since this is the layout of ARM mask register.
However, RVV is always using compact mask that is using 1-bit mask.
That's why it doesn't work for RVV.

For X86, I think it wouldn't be the issue since X86 is always constant mask:
VECTOR_BOOL_MODE (NAME, COUNT, COMPONENT, BYTESIZE)

X86 can always adjust the compact bit by this define.
Wheras, RVV is scalable vector which always uses ADJUST_NUNTIS and ADJUST_BYTESIZE && ADJUST_PRECISION.
So this will make a confusion to GCC.

Thanks.


juzhe.zhong@rivai.ai
 
From: Richard Biener
Date: 2023-06-28 15:17
To: Jeff Law
CC: Kito Cheng; juzhe.zhong@rivai.ai; gcc-patches; kito.cheng; palmer; palmer; Robin Dapp
Subject: Re: [PATCH V2] RISC-V: Fix bug of pre-calculated const vector mask
On Wed, Jun 28, 2023 at 6:09 AM Jeff Law via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
>
>
> On 6/27/23 21:16, Kito Cheng wrote:
> > Do you mind giving some comments about what the difference between the
> > two versions?
> And I'd like a before/after assembly code with the example in the commit
> message.  I didn't see the same behavior when I tried it earlier today
> and ran out of time to dig into it further.
>
> Juzhe -- most folks wait ~1wk to ping patches, even codegen bugfixes.
> Pinging this fast runs the risk of irritating others.  Please be patient.
 
I think if we get constant mask expansion wrong this has to be fixed in
generic code.  ISTR fixing similar issues with AVX512 compact masks.
 
But maybe I'm misunderstanding the problem and the issue only
exists in the backend?
 
Richard.
 
> Jeff
 

  reply	other threads:[~2023-06-28  7:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-28  1:59 Juzhe-Zhong
2023-06-28  3:14 ` juzhe.zhong
2023-06-28  3:16   ` Kito Cheng
2023-06-28  3:19     ` juzhe.zhong
2023-06-28  4:09     ` Jeff Law
2023-06-28  6:01       ` Kito Cheng
2023-06-28  6:17         ` juzhe.zhong
2023-06-28  7:17       ` Richard Biener
2023-06-28  7:38         ` juzhe.zhong [this message]
2023-06-28  8:15         ` juzhe.zhong
2023-06-28  9:50     ` juzhe.zhong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D8D53F7251CB3EEF+2023062815385337945610@rivai.ai \
    --to=juzhe.zhong@rivai.ai \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jeffreyalaw@gmail.com \
    --cc=kito.cheng@gmail.com \
    --cc=kito.cheng@sifive.com \
    --cc=palmer@dabbelt.com \
    --cc=palmer@rivosinc.com \
    --cc=rdapp.gcc@gmail.com \
    --cc=richard.guenther@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).