Hi Yury,

> -----Original Message-----
> From: Yury Khrustalev <[email protected]>
> Sent: 16 October 2025 16:37
> To: [email protected]
> Cc: Tamar Christina <[email protected]>; Srinath Parvathaneni
> <[email protected]>; Tejas Belagod <[email protected]>;
> [email protected]; [email protected]; [email protected];
> [email protected]; [email protected]
> Subject: [PATCH v3 1/2] Fix comments for boolean vector modes
> 
> gcc/
>       * machmode.def (VECTOR_BOOL_MODE): Fix comment.
>       * mode-classes.def (MODE_VECTOR_BOOL): Update comment.
> ---
>  gcc/machmode.def     | 12 ++++++------
>  gcc/mode-classes.def |  2 +-
>  2 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/gcc/machmode.def b/gcc/machmode.def
> index ccdd2e8b6be..3045adb85fa 100644
> --- a/gcc/machmode.def
> +++ b/gcc/machmode.def
> @@ -148,12 +148,12 @@ along with GCC; see the file COPYING3.  If not see
>       mode, with smaller numbers indicating a higher priority.
> 
>       VECTOR_BOOL_MODE (NAME, COUNT, COMPONENT, BYTESIZE)
> -        Create a vector mode called NAME that contains COUNT boolean
> -        elements and occupies BYTESIZE bytes in total.  Each boolean
> -        element is of COMPONENT type and occupies (COUNT * BITS_PER_UNIT)
> /
> -        BYTESIZE bits, with the element at index 0 occupying the lsb of the
> -        first byte in memory.  Only the lowest bit of each element is
> -        significant.
> +     Create a vector mode called NAME that contains COUNT boolean
> +     elements and occupies BYTESIZE bytes in total.  Each boolean
> +     element is of COMPONENT type and occupies ((BYTESIZE *
> BITS_PER_UNIT)
> +     / COUNT) bits, with the element at index 0 occupying the lsb of the
> +     first byte in memory.  Only the lowest bit of each element is
> +     significant.
> 

I think this is good,

>       OPAQUE_MODE (NAME, BYTESIZE)
>          Create an opaque mode called NAME that is BYTESIZE bytes wide.
> diff --git a/gcc/mode-classes.def b/gcc/mode-classes.def
> index e05081eaf64..79512f28ebf 100644
> --- a/gcc/mode-classes.def
> +++ b/gcc/mode-classes.def
> @@ -30,7 +30,7 @@ along with GCC; see the file COPYING3.  If not see
>    DEF_MODE_CLASS (MODE_DECIMAL_FLOAT),       /* decimal floating point */
>          \
>    DEF_MODE_CLASS (MODE_COMPLEX_INT),         /* complex numbers */
>          \
>    DEF_MODE_CLASS (MODE_COMPLEX_FLOAT),
>                  \
> -  DEF_MODE_CLASS (MODE_VECTOR_BOOL), /* vectors of single bits */
>          \
> +  DEF_MODE_CLASS (MODE_VECTOR_BOOL), /* packed boolean vectors */
>          \

This one is a bit confusing to me due to the term "packed".  Packed to me 
indicates
all the bits are sequential, so e.g. 0x0011 but in this case the vector would 
be 0x0101
with an element size of 2 bits.  So I think the original comment was more 
accurate.

Thanks,
Tamar

>    DEF_MODE_CLASS (MODE_VECTOR_INT),  /* SIMD vectors */
>          \
>    DEF_MODE_CLASS (MODE_VECTOR_FRACT),        /* SIMD vectors */
>          \
>    DEF_MODE_CLASS (MODE_VECTOR_UFRACT),       /* SIMD vectors */
>                  \
> --
> 2.47.3

Reply via email to