Thanks Robin, that looks like much better than the v2, let me update it to 
PATCH v3.

Pan

-----Original Message-----
From: Robin Dapp <rdapp....@gmail.com> 
Sent: Wednesday, June 14, 2023 4:27 PM
To: Li, Pan2 <pan2...@intel.com>; gcc-patches@gcc.gnu.org
Cc: rdapp....@gmail.com; juzhe.zh...@rivai.ai; jeffreya...@gmail.com; Wang, 
Yanzhang <yanzhang.w...@intel.com>; kito.ch...@gmail.com
Subject: Re: [PATCH v2] RISC-V: Bugfix for vec_init repeating auto 
vectorization in RV32

Hi Pan,

> This patch would like to fix one bug exported by RV32 test case
> multiple_rgroup_run-2.c. The mask should be restricted by elen in
> vector, and the condition between the vmv.s.x and the vmv.v.x should
> take inner_bits_size rather than constants.

exported -> exposed.

How about something like:

"When constructing a vector mask from individual elements we wrongly
assumed that we can broadcast BITS_PER_WORD (i.e. XLEN).  The maximum
is actually the vector element length (i.e. ELEN).  This patch fixes
this."?

> +  /* We restrict the limit to the elen of RVV. For example:
> +     -march=zve32*, the ELEN is 32.
> +     -march=zve64*, the ELEN is 64.
> +     The related vmv.v.x/vmv.s.x is restricted to ELEN as above, we cannot
> +     take care of case like below when ELEN=32
> +     vsetvil e64,m1
> +     vmv.v.x/vmv.s.x
> +   */

/* Here we construct a mask pattern that will later be broadcast
   to a vector register.  The maximum broadcast size for vmv.v.x/vmv.s.x
   is determined by the length of a vector element (ELEN) and not by
   XLEN so make sure we do not exceed it.  One example is -march=zve32*
   which mandates ELEN == 32 but can be combined with -march=rv64
   with XLEN == 64.  */

Regards
 Robin

Reply via email to