[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMo8BfJEG1L125+pTq3Ke0mD__gm8u7mqJxUf9UkPXLpjBgrUg@mail.gmail.com>
Date: Fri, 2 Aug 2013 00:42:48 +0400
From: Max Filippov <jcmvbkbc@...il.com>
To: Ken Steele <ken@...era.com>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] tile: optimize strnlen using SIMD instructions
Hi Ken,
On Thu, Aug 1, 2013 at 11:55 PM, Ken Steele <ken@...era.com> wrote:
> + /* Read the first word, but force bytes before the string to be nonzero.
> + * This expression works because we know shift counts are taken mod 32.
> + */
> + v = *p | ((1 << (s_int << 3)) - 1);
This expression potentially has undefined behaviour according to C99, 6.5.7:3.
IOW it may work, but it doesn't always have to.
--
Thanks.
-- Max
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists