lkml.org 
[lkml]   [1999]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] strlen
> Here is an optimized strlen function for i586+ processors, it works by
> testing 4 bytes at a time and averages 1.8 clock cycles per byte (scas =
> 4n).

This, I think, is a problem on i386. You _cannot_ read beyond the end of the
string (might be on an other, unmapped page), but you don't know that until
you do, when doing 4 bytes at a time. I mean: You can only know that you
went to far...

ia64 DOES allow this by doing the memload conditional and allowing
soft/local pagefaults to end the loop. Ask the Trilian guys about this if
you want to know more...

Greetings,
Arjan van de Ven

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:54    [W:0.060 / U:1.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site