freebsd-dev/sys
Mateusz Guzik af366d353b amd64: implement strlen in assembly
The C variant in libkern performs excessive branching to find the
non-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 is a starting point for copyinstr
which operates on words instead of bytes.

Tested with glibc test suite.

Sample results (calls/s):

Haswell:
$(perl -e "print 'A' x 3"):
stock:	211198039
patched:338626619
asm:	465609618

$(perl -e "print 'A' x 100"):
stock:	 83151997
patched: 98285919
asm:	120719888

AMD EPYC 7R32:
$(perl -e "print 'A' x 3"):
stock:	282523617
asm:	491498172

$(perl -e "print 'A' x 100"):
stock:	114857172
asm:	112082057
2021-02-08 19:15:21 +00:00
..
amd64 amd64: implement strlen in assembly 2021-02-08 19:15:21 +00:00
arm Remove obsolete code gated on _ARM_ARCH_* 2021-01-28 10:41:45 +00:00
arm64 arm64: optimize set_syscall_retval() 2021-02-08 10:46:47 +00:00
bsm
cam Exclude reserved iSCSI Target Transfer Tag. 2021-01-24 13:58:29 -05:00
cddl arm64: Improve DDB backtrace support 2021-02-01 14:15:57 +00:00
compat epoll: Store epoll_event udata member in ext member of kevent. 2021-02-08 02:46:14 +03:00
conf amd64: implement strlen in assembly 2021-02-08 19:15:21 +00:00
contrib ipfilter: Use the softn (NAT softc) host map size in ip_nat6 calculation. 2021-02-05 18:39:38 -08:00
crypto armv8crypto: Extract GCM state into a structure 2021-02-08 09:19:10 -05:00
ddb
dev vt: terminal size can grow too big with small font 2021-02-08 18:00:37 +02:00
dts Remove DTS files for arm boards we don't support 2021-01-27 10:02:01 +00:00
fs msdosfs: fix vnode leak with msdosfs_rename() 2021-01-31 21:37:44 +00:00
gdb
geom opencrypto: Introduce crypto_dispatch_async() 2021-02-08 09:19:19 -05:00
gnu
i386 Fix a typo. 2021-01-27 21:52:41 -08:00
isa
kern ktls: Make configuration sysctls available as tunables 2021-02-08 09:19:02 -05:00
kgssapi opencrypto: Introduce crypto_dispatch_async() 2021-02-08 09:19:19 -05:00
libkern Restore the augmented strlen commentary 2021-02-08 19:15:21 +00:00
mips mips: fix NLM platforms breakage caused by e0a0a3ef 2021-01-31 23:56:22 -08:00
modules zfs: update zfs_config.h to match OpenZFS gf11b09dec 2021-02-01 22:21:33 +01:00
net Enable multipath routing by default. 2021-02-03 08:49:58 +00:00
net80211
netgraph netgraph/ng_base: Allow larger BINARY2ASCII conversions 2021-02-08 14:31:58 +01:00
netinet Allow setting alias port ranges in libalias and ipfw. This will allow a system 2021-02-02 13:24:17 -08:00
netinet6 Fix unused-function waring when compiling with FIB_ALGO. 2021-01-30 23:25:56 +00:00
netipsec opencrypto: Introduce crypto_dispatch_async() 2021-02-08 09:19:19 -05:00
netpfil Allow setting alias port ranges in libalias and ipfw. This will allow a system 2021-02-02 13:24:17 -08:00
netsmb
nfs
nfsclient
nfsserver
nlm
ofed Fix mismerge in OFED update 2021-02-04 13:58:24 -05:00
opencrypto ktls: Avoid wakeups and locking for synchronous callbacks 2021-02-08 09:19:27 -05:00
powerpc powerpc64: Fix boot on virtual-mode OF (PowerMac G5) 2021-02-07 16:13:55 -06:00
riscv riscv: add SBI system reset extension 2021-01-27 19:19:54 -04:00
rpc
security
sys libkern: use compiler builtins for strcpy, strcmp and strlen 2021-02-08 19:15:21 +00:00
teken
tests
tools syscalls.master: Add a new syscall type: RESERVED 2021-01-26 18:27:44 +00:00
ufs Revert 2d4422e799, Eliminate lock order reversal in UFS ffs_unmount(). 2021-01-30 00:03:37 -08:00
vm Add a VM flag to prevent reclaim on a failed contig allocation 2021-02-03 16:16:51 -05:00
x86 x86: use compiler intrinsics for bswap* 2021-02-01 04:53:23 +00:00
xdr
xen
Makefile