aboutsummaryrefslogtreecommitdiff
path: root/sys/conf/files.amd64
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2021-02-21 00:42:26 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2021-02-21 00:43:05 +0000
commit5fa12fe0cd203efcbb2ac21e7c3e3fb9b2f801ae (patch)
tree26c0e89facdcf4e4a23f7532a479eff61d75e638 /sys/conf/files.amd64
parent6e1d1bfcac77603541706807803a198c6d954d7c (diff)
downloadsrc-5fa12fe0cd203efcbb2ac21e7c3e3fb9b2f801ae.tar.gz
src-5fa12fe0cd203efcbb2ac21e7c3e3fb9b2f801ae.zip
amd64: implement strlen in assembly, take 2
Tested with glibc test suite. The C variant in libkern performs excessive branching to find the zero byte instead of using the bsfq instruction. The same code patched to use it is still slower than the routine implemented here as the compiler keeps neglecting to perform certain optimizations (like using leaq). On top of that the routine can be used as a starting point for copyinstr which operates on words intead of bytes. The previous attempt had an instance of swapped operands to andq when dealing with fully aligned case, which had a side effect of breaking the code for certain corner cases. Noted by jrtc27. Sample results: $(perl -e "print 'A' x 3"): stock: 211198039 patched:338626619 asm: 465609618 $(perl -e "print 'A' x 100"): stock: 83151997 patched: 98285919 asm: 120719888 Reviewed by: jhb, kib Differential Revision: https://reviews.freebsd.org/D28779
Diffstat (limited to 'sys/conf/files.amd64')
-rw-r--r--sys/conf/files.amd641
1 files changed, 0 insertions, 1 deletions
diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64
index 98a78a8b1ef9..395f501198f8 100644
--- a/sys/conf/files.amd64
+++ b/sys/conf/files.amd64
@@ -390,7 +390,6 @@ isa/syscons_isa.c optional sc
isa/vga_isa.c optional vga
kern/imgact_aout.c optional compat_aout
kern/link_elf_obj.c standard
-libkern/strlen.c standard
#
# IA32 binary support
#