mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:38:12 +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
|
@ -1,12 +1,18 @@
|
|||
#include "types.h"
|
||||
#include "Assertions.h"
|
||||
#include "kmalloc.h"
|
||||
#include <AK/StdLibExtras.h>
|
||||
#include <AK/Types.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
void memcpy(void *dest_ptr, const void *src_ptr, dword n)
|
||||
void memcpy(void* dest_ptr, const void* src_ptr, dword n)
|
||||
{
|
||||
if (n >= 1024) {
|
||||
mmx_memcpy(dest_ptr, src_ptr, n);
|
||||
return;
|
||||
}
|
||||
|
||||
dword dest = (dword)dest_ptr;
|
||||
dword src = (dword)src_ptr;
|
||||
// FIXME: Support starting at an unaligned address.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue