This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/12123] SIGBUS on strstr_sse42 due to bad alignment


http://sourceware.org/bugzilla/show_bug.cgi?id=12123

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> 2010-10-26 06:46:10 UTC ---
There are

static inline __m128i
__m128i_strloadu (const unsigned char * p)
{
  int offset = ((size_t) p & (16 - 1));

  if (offset && (int) ((size_t) p & 0xfff) > 0xff0)
    {   
      __m128i a = _mm_load_si128 ((__m128i *) (p - offset));
      __m128i zero = _mm_setzero_si128 (); 
      int bmsk = _mm_movemask_epi8 (_mm_cmpeq_epi8 (a, zero));
      if ((bmsk >> offset) != 0)
        return __m128i_shift_right (a, offset);
    }   
  return _mm_loadu_si128 ((__m128i *) p); 
}

It can load from unaligned address. I have no problems
with gcc 4.5.1 and glibc mainline on 32bit Intel Core i7.
What failures did you see with "make check" in glibc?

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]