On Wed, 2020-04-22 at 11:20 -0700, Carl Love wrote:
> GCC maintainers:
> 

Hi,


> The following is a trivial patch to fix a comment describing the
> intrinsic function _mm_movemask_epi8.  The comment was expanded to
> clarify the layout of the returned result. 

Something seems wrong there, see below.

> 
> The patch does not make any functional changes.
> 
> Please let me know if the patch is OK for mainline and backporting as
> appropriate.
> 
> Thanks.
> 
>                      Carl Love
> -------------------------------------------
> rs6000, Fix header comment for intrinsic function _mm_movemask_epi8
> 
> gcc/ChangeLog
> 
> 2020-04-22  Carl Love  <c...@us.ibm.com>
> 
>       * config/rs6000/emmintrin.h (_mm_movemask_epi8): Fix comment
> for the
>       function.


drop /for the function/

> 
> Signed-off-by: Carl Love <ca...@us.ibm.com>
> ---
>  gcc/config/rs6000/emmintrin.h | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/gcc/config/rs6000/emmintrin.h
> b/gcc/config/rs6000/emmintrin.h
> index 2462cf5bdac..0872a75c0de 100644
> --- a/gcc/config/rs6000/emmintrin.h
> +++ b/gcc/config/rs6000/emmintrin.h
> @@ -2033,7 +2033,9 @@ _mm_min_epu8 (__m128i __A, __m128i __B)
>  #ifdef _ARCH_PWR8
>  /* Intrinsic functions that require PowerISA 2.07 minimum.  */
> 
> -/* Creates a 4-bit mask from the most significant bits of the SPFP
> values.  */
> +/* Creates a 16-bit mask from the most significant bits of the
> sixteen 8-bit
> +   values.  The 16-bit result is placed in bits[48:63], bits [0:47]
> and
> +   bits [64:127] are  set to zero.  */


That function returns an int out of one of the elements of the result
vector.


extern __inline int __attribute__((__gnu_inline__, __always_inline__,
__artificial__))
_mm_movemask_epi8 (__m128i __A)
{
...
  __vector unsigned long long result;
...

So the description of the intermediate __vector unsigned long long
variable, if actually needed, would fit better near the assignment to
result.

  result = ((__vector unsigned long long)
            vec_vbpermq ((__vector unsigned char) __A,
                         (__vector unsigned char) perm_mask));

But then you would probably want to clarify that the return is only one
of those long long vector elements. 

#ifdef __LITTLE_ENDIAN__
  return result[1];
#else
  return result[0];
#end
if


thanks,
-Will

>  extern __inline int __attribute__((__gnu_inline__,
> __always_inline__, __artificial__))
>  _mm_movemask_epi8 (__m128i __A)
>  {

Reply via email to