lkml.org 
[lkml]   [2013]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] tile: optimize strnlen using SIMD instructions
From
Hi Ken,

On Thu, Aug 1, 2013 at 11:55 PM, Ken Steele <ken@tilera.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


\
 
 \ /
  Last update: 2013-08-02 00:01    [W:0.054 / U:0.824 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site