aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/amd64/string/memmove.S
Commit message (Collapse)AuthorAgeFilesLines
* amd64: Stop using REP MOVSB for backward memmove()s.Alexander Motin2022-06-301-8/+0
| | | | | | | | | | | | | | | | | | | | | | Enhanced REP MOVSB feature of CPUs starting from Ivy Bridge makes REP MOVSB the fastest way to copy memory in most of cases. However Intel Optimization Reference Manual says: "setting the DF to force REP MOVSB to copy bytes from high towards low addresses will expe- rience significant performance degradation". Measurements on Intel Cascade Lake and Alder Lake, same as on AMD Zen3 show that it can drop throughput to as low as 2.5-3.5GB/s, comparing to ~10-30GB/s of REP MOVSQ or hand-rolled loop, used for non-ERMS CPUs. This patch keeps ERMS use for forward ordered memory copies, but removes it for backward overlapped moves where it does not work. This is just a cosmetic sync with kernel, since libc does not use ERMS at this time. Reviewed by: mjg MFC after: 2 weeks (cherry picked from commit f22068d91bf53696ee13a69685e809d35776ec3f)
* amd64: add missing ALIGN_TEXT to loops in memset and memmoveMateusz Guzik2021-06-261-0/+2
| | | | (cherry picked from commit 164c3b81848bc81dc200b12370999474225447a3)
* MFC r341272,r341273,r341351Mateusz Guzik2018-12-191-70/+78
| | | | | | | | | amd64: tidy up copying backwards in memmove amd64: remove stale attribution for memmove work amd64: handle small memmove buffers with overlapping stores Notes: svn path=/stable/12/; revision=342240
* MFC r341364Mateusz Guzik2018-12-191-0/+30
| | | | | | | amd64: align target memmove buffer to 16 bytes before using rep movs Notes: svn path=/stable/12/; revision=342238
* amd64: import updated kernel memmove to libcMateusz Guzik2018-10-131-4/+269
| | | | | | | | | | | | | | bcopy is left alone as it is expected to be converted to a C func. Due to header mess ALIGN_TEXT is temporarily defined explicitly in memmove.S Reviewed by: kib Approved by: re (gjb) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17538 Notes: svn path=/head/; revision=339347
* Remove duplicate .note.GNU-stack section declaration. bcopy alreadyKonstantin Belousov2011-02-041-2/+0
| | | | | | | | | made the neccessary provisions. Reported by: arundel Notes: svn path=/head/; revision=218303
* Add section .note.GNU-stack for assembly files used by 386 and amd64.Konstantin Belousov2011-01-071-0/+2
| | | | Notes: svn path=/head/; revision=217106
* Add machine-specific, optimized implementations of bcopy, bzero, memcpy,Alan Cox2005-04-071-0/+5
memmove, and memset. PR: 73111 Submitted by: Ville-Pertti Keinonen <will@iki.fi> (taken from NetBSD) MFC after: 3 weeks Notes: svn path=/head/; revision=144730