]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC r213326: libc: Remove the i386 assembler version of strlen(3).
authorjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 19 Oct 2010 22:11:50 +0000 (22:11 +0000)
committerjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 19 Oct 2010 22:11:50 +0000 (22:11 +0000)
commit98b62827bc4d98866f4fa110da992f06cba0e811
treeed74b2f42b42f1d4a8df93100a952ecc40a6492d
parent560c22d4a3237a6977299bf33f8ce426da9459d2
MFC r213326: libc: Remove the i386 assembler version of strlen(3).

On anything modern, the C version, which processes a word at a time, is much
faster. The Intel optimization manual explicitly warns against using REP
prefixes with SCAS or CMPS, which is exactly what the assembler version
does.

A simple test on a Phenom II showed the C version, compiled with -O2, to be
about twice as fast determining the length of 100000 strings between 0 and
255 bytes long.

git-svn-id: svn://svn.freebsd.org/base/stable/8@214086 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
lib/libc/i386/string/Makefile.inc
lib/libc/i386/string/strlen.S [deleted file]