mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:27:34 +00:00
Add a fast memcpy() using MMX when we're moving >= 1KB.
This is a nice speedup for WindowServer. I'll eventually have to do this with SSE but the kernel doesn't support SSE yet so this is it for now.
This commit is contained in:
parent
e29060620f
commit
1f159eaab0
6 changed files with 70 additions and 3 deletions
|
@ -9,8 +9,14 @@
|
|||
|
||||
#include <AK/Types.h>
|
||||
|
||||
void* mmx_memcpy(void* to, const void* from, size_t);
|
||||
|
||||
ALWAYS_INLINE void fast_dword_copy(dword* dest, const dword* src, size_t count)
|
||||
{
|
||||
if (count >= 256) {
|
||||
mmx_memcpy(dest, src, count * sizeof(count));
|
||||
return;
|
||||
}
|
||||
asm volatile(
|
||||
"rep movsl\n"
|
||||
: "=S"(src), "=D"(dest), "=c"(count)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue