freebsd-skq/lib/libc
Mateusz Guzik 088ac3ef4b amd64: handle small memset buffers with overlapping stores
Instead of jumping to locations which store the exact number of bytes,
use displacement to move the destination.

In particular the following clears an area between 8-16 (inclusive)
branch-free:

movq    %r10,(%rdi)
movq    %r10,-8(%rdi,%rcx)

For instance for rcx of 10 the second line is rdi + 10 - 8 = rdi + 2.
Writing 8 bytes starting at that offset overlaps with 6 bytes written
previously and writes 2 new, giving 10 in total.

Provides a nice win for smaller stores. Other ones are erratic depending
on the microarchitecture.

General idea taken from NetBSD (restricted use of the trick) and bionic
string functions (use for various ranges like in this patch).

Reviewed by:	kib (previous version)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D17660
2018-11-16 00:44:22 +00:00
..
aarch64 Don't export _end on arm64 and riscv. 2018-06-01 23:42:10 +00:00
amd64 amd64: handle small memset buffers with overlapping stores 2018-11-16 00:44:22 +00:00
arm Revert r336773: it removed too much. 2018-07-27 21:25:01 +00:00
capability Replace dot-dot relative pathing with SRCTOP-relative paths where possible 2017-01-20 03:23:24 +00:00
compat-43 General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
db Remove "All rights reserved" from my files. 2018-05-10 06:41:08 +00:00
gdtoa libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
gen Add link to the setproctitle_fast function. 2018-10-20 22:25:57 +00:00
gmon mcount: tidy up ANSIfication 2018-10-20 22:39:35 +00:00
i386 amd64: depessimize userspace memcpy/memmove/bcopy 2018-09-17 15:49:35 +00:00
iconv libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
include Update userland arc4random() with OpenBSD's Chacha20 based arc4random(). 2018-08-19 17:40:50 +00:00
inet libc: fix cases of undefined behavior. 2018-08-07 15:24:19 +00:00
isc SPDX: more ISC-related files. 2017-12-08 17:52:53 +00:00
locale Fix WITHOUT_ICONV build after r340276. 2018-11-14 09:06:15 +00:00
md Replace dot-dot relative pathing with SRCTOP-relative paths where possible 2017-01-20 03:23:24 +00:00
mips Reimplement brk() and sbrk() to avoid the use of _end. 2018-06-04 19:35:15 +00:00
nameser SPDX: license IDs for some ISC-related files. 2017-12-08 15:57:29 +00:00
net Don't call stat(2) on nsswitch.conf(5) every time nsdispatch(3) 2018-11-10 23:07:46 +00:00
nls
posix1e Move mac.conf to lib/libc/posix1e/ 2018-09-18 01:40:37 +00:00
powerpc Reimplement brk() and sbrk() to avoid the use of _end. 2018-06-04 19:35:15 +00:00
powerpc64 Reimplement brk() and sbrk() to avoid the use of _end. 2018-06-04 19:35:15 +00:00
powerpcspe Fix fabs(3) for powerpcspe, this time for real 2018-07-26 14:42:20 +00:00
quad ANSIfy libc/quad 2018-10-21 00:20:40 +00:00
regex regex/engine.c: error: variable 'dp' set but not used 2018-07-14 09:29:45 +00:00
resolv Allow the use of TCP instead of UDP for queries by setting options usevc 2018-08-16 13:18:40 +00:00
riscv Fix setjmp for RISC-V: 2018-07-23 09:54:28 +00:00
rpc Fix CONFS to append the value in this case. 2018-09-18 01:38:44 +00:00
secure Carefully update stack guard bytes inside __guard_setup(). 2018-04-24 15:59:39 +00:00
softfloat Add implementations for clog(3), clogf(3), and clog(3). 2018-05-13 09:54:34 +00:00
sparc64 Reimplement brk() and sbrk() to avoid the use of _end. 2018-06-04 19:35:15 +00:00
stdio Follow up on r331936. gets_s(3) will also fail in the same way that 2018-10-23 14:16:02 +00:00
stdlib Provide set_constraint_handler_s(3) man page. 2018-08-19 14:39:57 +00:00
stdtime strptime: make %k and %l specifiers match their description in 2018-11-03 23:37:13 +00:00
string Avoid OOB reads in memmem(3). 2018-10-15 20:20:57 +00:00
sys fcntl.2: document an additional error condition 2018-11-15 16:13:25 +00:00
tests Connect libc/tests/time to the build, adding test cases for strptime() 2018-10-30 02:37:23 +00:00
uuid libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
x86/sys Fix a regression in r321608. 2017-08-13 14:42:23 +00:00
xdr General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
yp libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
libc_nossp.ldscript Add different libc ldscript: the one without libssp -- 2016-10-12 13:19:21 +00:00
libc.ldscript
Makefile Move libc linker ifunc test to build target only 2018-09-24 13:42:46 +00:00
Makefile.depend
Versions.def Create namespace for the symbols added during 13-CURRENT cycle. 2018-11-12 19:12:14 +00:00