freebsd-skq/lib/libc/amd64
mjg c0d4f73b46 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
..
gen Remove support for SYS_sys_exit in favor of SYS_exit. 2018-06-01 22:09:27 +00:00
stdlib
string amd64: handle small memset buffers with overlapping stores 2018-11-16 00:44:22 +00:00
sys Convert amd64_get/set_fs/gsbase to ifunc. 2018-10-30 00:11:30 +00:00
_fpmath.h libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
arith.h
gd_qnan.h
Makefile.inc Correct an misunderstanding of MDSRCS. 2017-03-02 17:07:28 +00:00
Symbol.map Reimplement brk() and sbrk() to avoid the use of _end. 2018-06-04 19:35:15 +00:00
SYS.h General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00