mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-29 06:02:07 +03:00
AK: Fix bug in MMX memcpy() unaligned prologue handling.
This commit is contained in:
parent
7ce15f1c54
commit
27df572381
Notes:
sideshowbarker
2024-07-19 15:46:24 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/27df572381d
@ -12,12 +12,13 @@ void* mmx_memcpy(void* dest, const void* src, size_t len)
|
||||
|
||||
if ((dword)dest_ptr & 7) {
|
||||
dword prologue = 8 - ((dword)dest_ptr & 7);
|
||||
len -= prologue;
|
||||
asm volatile(
|
||||
"rep movsb\n"
|
||||
:: "S"(src_ptr), "D"(dest_ptr), "c"(prologue)
|
||||
: "=S"(src_ptr), "=D"(dest_ptr), "=c"(prologue)
|
||||
: "0"(src_ptr), "1"(dest_ptr), "2"(prologue)
|
||||
: "memory"
|
||||
);
|
||||
len -= prologue;
|
||||
}
|
||||
for (dword i = len / 64; i; --i) {
|
||||
asm volatile(
|
||||
|
Loading…
Reference in New Issue
Block a user