[v11,12/12] Specify behavior of vec_init for scalable vector modes

Message ID 20260603151924.53706-13-chris.bazley@arm.com
State New
Headers
Series Extend BB SLP vectorization to use predicated tails |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gcc_check--master-arm success Test passed
linaro-tcwg-bot/tcwg_simplebootstrap_build--master-aarch64-bootstrap success Build passed
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_simplebootstrap_build--master-arm-bootstrap success Build passed

Commit Message

Christopher Bazley June 3, 2026, 3:19 p.m. UTC
  gcc/ChangeLog:

	* doc/md.texi: Update description of vec_init.
---
 gcc/doc/md.texi | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Comments

Richard Biener June 9, 2026, 11:01 a.m. UTC | #1
On Wed, Jun 3, 2026 at 5:21 PM Christopher Bazley <chris.bazley@arm.com> wrote:
>
> gcc/ChangeLog:
>
>         * doc/md.texi: Update description of vec_init.
> ---
>  gcc/doc/md.texi | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi
> index 5a2625ce986..dd11c5adaf5 100644
> --- a/gcc/doc/md.texi
> +++ b/gcc/doc/md.texi
> @@ -7501,7 +7501,9 @@ Initialize the vector to given values.  Operand 0 is the vector to initialize
>  and operand 1 is parallel containing values for individual fields.  The
>  @var{n} mode is the mode of the elements, should be either element mode of
>  the vector mode @var{m}, or a vector mode with the same element mode and
> -smaller number of elements.
> +smaller number of elements.  If @var{m} specifies a scalable vector mode,
> +then elements beyond the minimum number of elements implied by @var{m} are

"beyond the minimum number of elements as specified by operand 1" maybe?

Otherwise LGTM.  Can you split this and the expr.cc hunk with the
comments addressed
out from the series?

> +initialized to zero instead of using values from operand 1.
>
>  @mdindex vec_duplicate@var{m}
>  @item @samp{vec_duplicate@var{m}}
> --
> 2.43.0
>
  
Christopher Bazley June 10, 2026, 3:17 p.m. UTC | #2
Hi Richard,

On 09/06/2026 12:01, Richard Biener wrote:
> On Wed, Jun 3, 2026 at 5:21 PM Christopher Bazley <chris.bazley@arm.com> wrote:
>>
>> gcc/ChangeLog:
>>
>>          * doc/md.texi: Update description of vec_init.
>> ---
>>   gcc/doc/md.texi | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi
>> index 5a2625ce986..dd11c5adaf5 100644
>> --- a/gcc/doc/md.texi
>> +++ b/gcc/doc/md.texi
>> @@ -7501,7 +7501,9 @@ Initialize the vector to given values.  Operand 0 is the vector to initialize
>>   and operand 1 is parallel containing values for individual fields.  The
>>   @var{n} mode is the mode of the elements, should be either element mode of
>>   the vector mode @var{m}, or a vector mode with the same element mode and
>> -smaller number of elements.
>> +smaller number of elements.  If @var{m} specifies a scalable vector mode,
>> +then elements beyond the minimum number of elements implied by @var{m} are
> 
> "beyond the minimum number of elements as specified by operand 1" maybe?

I think that could be misinterpreted to mean that operand 1 specifies 
the minimum number of elements, but it does not.

How about "elements beyond the minimum number implied by @var{m}" to 
make it clearer that element values themselves are not implied by m?


> Otherwise LGTM.  Can you split this and the expr.cc hunk with the
> comments addressed
> out from the series?
I can combine them as a single patch if you prefer.

Thanks,
  
Richard Biener June 11, 2026, 11:46 a.m. UTC | #3
On Wed, Jun 10, 2026 at 5:18 PM Christopher Bazley <chris.bazley@arm.com> wrote:
>
>
> Hi Richard,
>
> On 09/06/2026 12:01, Richard Biener wrote:
> > On Wed, Jun 3, 2026 at 5:21 PM Christopher Bazley <chris.bazley@arm.com> wrote:
> >>
> >> gcc/ChangeLog:
> >>
> >>          * doc/md.texi: Update description of vec_init.
> >> ---
> >>   gcc/doc/md.texi | 4 +++-
> >>   1 file changed, 3 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi
> >> index 5a2625ce986..dd11c5adaf5 100644
> >> --- a/gcc/doc/md.texi
> >> +++ b/gcc/doc/md.texi
> >> @@ -7501,7 +7501,9 @@ Initialize the vector to given values.  Operand 0 is the vector to initialize
> >>   and operand 1 is parallel containing values for individual fields.  The
> >>   @var{n} mode is the mode of the elements, should be either element mode of
> >>   the vector mode @var{m}, or a vector mode with the same element mode and
> >> -smaller number of elements.
> >> +smaller number of elements.  If @var{m} specifies a scalable vector mode,
> >> +then elements beyond the minimum number of elements implied by @var{m} are
> >
> > "beyond the minimum number of elements as specified by operand 1" maybe?
>
> I think that could be misinterpreted to mean that operand 1 specifies
> the minimum number of elements, but it does not.
>
> How about "elements beyond the minimum number implied by @var{m}" to
> make it clearer that element values themselves are not implied by m?

Maybe  expand to "If @var{m} specifies a scalable vector mode,
then operand 1 only specifies the minimum number of elements implied
by @var{m} and elements beyond are zero initialized."?  I was wanting to
somehow phrase that operand 1 encodes only lower_bound number of
elements for VLA modes.

>
>
> > Otherwise LGTM.  Can you split this and the expr.cc hunk with the
> > comments addressed
> > out from the series?
> I can combine them as a single patch if you prefer.

Yes please.

> Thanks,
> --
> Christopher Bazley
> Staff Software Engineer, GNU Tools Team.
> Arm Ltd, 110 Fulbourn Road, Cambridge, CB1 9NJ, UK.
> http://www.arm.com/
  

Patch

diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi
index 5a2625ce986..dd11c5adaf5 100644
--- a/gcc/doc/md.texi
+++ b/gcc/doc/md.texi
@@ -7501,7 +7501,9 @@  Initialize the vector to given values.  Operand 0 is the vector to initialize
 and operand 1 is parallel containing values for individual fields.  The
 @var{n} mode is the mode of the elements, should be either element mode of
 the vector mode @var{m}, or a vector mode with the same element mode and
-smaller number of elements.
+smaller number of elements.  If @var{m} specifies a scalable vector mode,
+then elements beyond the minimum number of elements implied by @var{m} are
+initialized to zero instead of using values from operand 1.
 
 @mdindex vec_duplicate@var{m}
 @item @samp{vec_duplicate@var{m}}