From: 钟居哲 <juzhe.zhong@rivai.ai>
To: richard.sandiford <richard.sandiford@arm.com>,
gcc-patches <gcc-patches@gcc.gnu.org>
Cc: "Jeff Law" <jeffreyalaw@gmail.com>,
rdapp.gcc <rdapp.gcc@gmail.com>,
kito.cheng <kito.cheng@gmail.com>,
kito.cheng <kito.cheng@sifive.com>, palmer <palmer@dabbelt.com>,
palmer <palmer@rivosinc.com>
Subject: Re: Re: [PATCH V3] RISC-V: Fix bug of pre-calculated const vector mask for VNx1BI, VNx2BI and VNx4BI
Date: Thu, 29 Jun 2023 05:46:54 +0800 [thread overview]
Message-ID: <ED254658D3E0F5F9+2023062905465411284419@rivai.ai> (raw)
In-Reply-To: <mpt1qhv8gj8.fsf@arm.com>
[-- Attachment #1: Type: text/plain, Size: 1900 bytes --]
Ok. Plz go ahead commit this change with the testcases.
Then it won't block the following patches.
Thanks.
juzhe.zhong@rivai.ai
From: Richard Sandiford
Date: 2023-06-29 04:42
To: Robin Dapp via Gcc-patches
CC: 钟居哲; Jeff Law; Robin Dapp; kito.cheng; kito.cheng; palmer; palmer
Subject: Re: [PATCH V3] RISC-V: Fix bug of pre-calculated const vector mask for VNx1BI, VNx2BI and VNx4BI
Robin Dapp via Gcc-patches <gcc-patches@gcc.gnu.org> writes:
> Hi Juzhe,
>
> I find the bug description rather confusing. What I can see is that
> the constant in the literal pool is indeed wrong but how would DSE or
> so play a role there? Particularly only for the smaller modes?
>
> My suspicion would be that the constant in the literal/constant pool
> is wrong from start to finish.
>
> I just played around with the following hunk:
>
> diff --git a/gcc/varasm.cc b/gcc/varasm.cc
> index 542315f88cd..5223c08924f 100644
> --- a/gcc/varasm.cc
> +++ b/gcc/varasm.cc
> @@ -4061,7 +4061,7 @@ output_constant_pool_2 (fixed_size_mode mode, rtx x, unsigned int align)
> whole element. Often this is byte_mode and contains more
> than one element. */
> unsigned int nelts = GET_MODE_NUNITS (mode);
> - unsigned int elt_bits = GET_MODE_BITSIZE (mode) / nelts;
> + unsigned int elt_bits = GET_MODE_PRECISION (mode) / nelts;
> unsigned int int_bits = MAX (elt_bits, BITS_PER_UNIT);
> scalar_int_mode int_mode = int_mode_for_size (int_bits, 0).require ();
>
> With this all your examples pass for me. We then pack e.g. 16 VNx2BI elements
> into an int and not just 8. It would also explain why it works for modes
> where PRECISION == BITSIZE. Now it will certainly require a more thorough
> analysis but maybe it's a start?
Yeah. Preapproved for trunk & any necessary branches.
Thanks,
Richard
next prev parent reply other threads:[~2023-06-28 21:47 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-28 9:47 Juzhe-Zhong
2023-06-28 18:11 ` Jeff Law
2023-06-28 19:02 ` 钟居哲
2023-06-28 19:12 ` Robin Dapp
2023-06-28 20:42 ` Richard Sandiford
2023-06-28 21:46 ` 钟居哲 [this message]
2023-06-29 7:53 ` Richard Sandiford
2023-06-29 8:08 ` juzhe.zhong
2023-06-29 8:14 ` Robin Dapp
2023-06-29 8:18 ` juzhe.zhong
2023-06-29 8:53 ` Robin Dapp
2023-06-29 9:01 ` juzhe.zhong
2023-06-29 8:54 ` Richard Sandiford
2023-06-29 9:09 ` Robin Dapp
2023-06-29 9:23 ` juzhe.zhong
2023-06-29 11:22 ` Richard Biener
2023-06-29 11:38 ` Robin Dapp
2023-06-29 13:53 ` Kito Cheng
2023-06-29 14:04 ` Richard Sandiford
2023-06-29 14:12 ` Robin Dapp
2023-07-04 19:07 ` Robin Dapp
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=ED254658D3E0F5F9+2023062905465411284419@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.sandiford@arm.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).