opnsense-src/sys
Mateusz Guzik 9535440569 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

(cherry picked from commit 5fa12fe0cd)
2021-04-10 13:53:46 +00:00
..
amd64 amd64: implement strlen in assembly, take 2 2021-04-10 13:53:46 +00:00
arm arm64: Add support for bcm2838 RNG 2021-03-20 11:12:13 +01:00
arm64 arm64: Add support for the RK805/RK808 RTC 2021-04-10 09:34:03 +10:00
bsm Add aio_writev and aio_readv 2021-01-02 19:57:58 -07:00
cam cam: Don't permit crashdumps on non-pollable devices. 2021-03-22 13:37:38 -07:00
cddl Teach DTrace that unaligned accesses are OK on aarch64, not just x86. 2021-03-25 09:17:38 -04:00
compat Reduce chance of RCU deadlock in the LinuxKPI by implementing the section 2021-04-06 12:23:08 +02:00
conf amd64: implement strlen in assembly, take 2 2021-04-10 13:53:46 +00:00
contrib zfs: merge OpenZFS master-891568c99 2021-04-04 15:19:09 +02:00
crypto armv8crypto: note derivation in armv8_crypto_wrap.c 2021-03-22 13:14:51 -03:00
ddb ddb: add ability to print user registers 2021-01-08 14:53:06 -04:00
dev sys/dev/md: Drop unncessary __GLOBL(mfs_root) 2021-04-10 14:01:05 +01:00
dts Switch to the new device-tree vendor tree 2021-01-15 20:08:39 +01:00
fs devfs: fix use count leak when using TIOCSCTTY 2021-04-10 05:57:55 +00:00
gdb gdb(4): allow bulk write of registers 2020-12-23 14:37:05 -04:00
geom gmirror: Pre-allocate the timeout event structure 2021-03-17 21:24:20 -04:00
gnu Remove the old dts imported tree. 2021-01-15 20:09:55 +01:00
i386 x86: clear %db registers in new process 2021-04-06 03:47:34 +03:00
isa Move back the isa non-PNP driver deadline to FreeBSD 14. 2021-03-08 16:02:44 -07:00
kern Unbreak MSG_CMSG_CLOEXEC 2021-04-10 13:52:15 +01:00
kgssapi State kgssapi dependency on xdr. 2020-09-17 22:29:38 +00:00
libkern random(9): Restore historical [0,2^31-1] output range and related man documention. 2021-03-25 17:57:02 +11:00
mips nlmrsa: Mark deprecated for 14. 2021-03-22 15:52:52 -07:00
modules AMD-vi: Fix IOMMU device interrupts being overridden 2021-04-07 18:55:38 +08:00
net Fix fib algo rebuild delay calculation. 2021-04-08 20:15:04 +00:00
net80211 net80211: Fix a typo in a comment 2021-03-20 11:13:31 +01:00
netgraph netgraph/ng_car: Add color marking code 2021-02-26 13:29:39 +01:00
netinet tcp: Perform simple fast retransmit when SACK Blocks are missing on SACK session 2021-04-08 23:12:26 +02:00
netinet6 Flush remaining routes from the routing table during VNET shutdown. 2021-03-13 20:19:17 +00:00
netipsec Convert unmapped mbufs before computing checksums in IPsec. 2021-01-19 11:52:00 -08:00
netpfil dummynet: Move timekeeping information into dn_cfg 2021-04-07 17:25:54 +02:00
netsmb net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
nfs nfs: clean up empty lines in .c and .h files 2020-09-01 21:25:39 +00:00
nfsclient nfs: clean up empty lines in .c and .h files 2020-09-01 21:25:39 +00:00
nfsserver nfs: Mark unused statistics variable as reserved 2020-11-18 04:35:49 +00:00
nlm nlm: clean up empty lines in .c and .h files 2020-09-01 22:14:52 +00:00
ofed MFC 4e38478c59: 2021-04-01 11:19:42 +02:00
opencrypto opencrypto: Make cryptosoft attach silently 2021-03-12 12:21:09 -05:00
powerpc [PowerPC] Remove unused IPI type count tracking. 2021-04-06 22:10:40 -05:00
riscv riscv: fix errors in some atomic type aliases 2021-03-08 10:03:01 -04:00
rpc nfs-over-tls: handle res.gid.gid_val correctly for memory allocation 2021-01-12 13:59:52 -08:00
security close_range: add audit support 2021-03-17 22:22:48 +00:00
sys vfs: replace vfs_smr_quiesce with vfs_smr_synchronize 2021-04-10 05:57:56 +00:00
teken loader: implement framebuffer console 2021-01-02 21:41:36 +02:00
tests Enable running fib tests inside vnet jail. 2021-01-17 20:32:26 +00:00
tools Switch to the new device-tree vendor tree 2021-01-15 20:08:39 +01:00
ufs FFS extattr: fix handling of the tail 2021-03-04 21:07:25 +02:00
vm Style 2021-04-07 06:32:40 +03:00
x86 Rename _cscan_atomic.h and _cscan_bus.h to atomic_san.h and bus_san.h 2021-03-15 11:39:11 -04:00
xdr xdr: clean up empty lines in .c and .h files 2020-09-01 22:13:28 +00:00
xen xen: remove .swp file from public headers 2021-01-11 18:14:11 +01:00
Makefile