Re: [PATCH rdma-core 2/2] mlx5: Convert explicitly to signed char

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 30, 2017 at 10:49:52AM -0600, Jason Gunthorpe wrote:
> On Wed, Aug 30, 2017 at 05:19:24PM +0300, Yishai Hadas wrote:
> > From: Leon Romanovsky <leonro@xxxxxxxxxxxx>
> >
> > The 0x80 value is a canonical way to mark as not-used in intrinsics
> > function calls.
>
> This commit message is not good, try:
>
> _mm_shuffle_epi8 requires 0x80 to set the output byte to zero, but
> _mm_set_epi8() accepts char. If gcc is compiling in a configuration
> with a signed char then it can produce a -Werror=overflow warning.
>
> And this fix is wrong, since it just moves the warning to
> configurations that have an unsigned char. (eg -funsigned-char)

I have gut feeling that with such option "-funsigned-char" half of the
world will break.

>
> It is really broken that the _mm_set_epi uses a char as input :|
>
> I think you need to do this instead:
>
> #include <limits.h>
> #if CHAR_MIN < 0
> #define SHUFFLE_IGNORE  -128
> #else
> #define SHUFFLE_IGNORE  0x80
> #endif
>
> Jason
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux