From: John Tsiombikas Date: Sun, 29 Apr 2018 05:14:27 +0000 (+0300) Subject: Merge branch 'master' of github.com:jtsiomb/pcboot X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=bootcensus;a=commitdiff_plain;h=b67fd9fe800511fb03d5c62bdf8a2100bb710968;hp=79be435fcf61613617025a2c4ef5fddf00a09178 Merge branch 'master' of github.com:jtsiomb/pcboot --- diff --git a/src/libc/string_asm.s b/src/libc/string_asm.s index 7bb6f40..ce9b19a 100644 --- a/src/libc/string_asm.s +++ b/src/libc/string_asm.s @@ -34,6 +34,7 @@ memset: mov %edi, %edx and $3, %edx + jz msmain jmp *mspre_tab(,%edx,4) mspre_tab: .long msmain, mspre1, mspre2, mspre3 @@ -84,6 +85,7 @@ memset16: mov %edi, %edx and $3, %edx + jz ms16main jmp *ms16pre_tab(,%edx,4) ms16pre_tab: .long ms16main, ms16pre1, ms16pre2, ms16pre3 @@ -145,27 +147,12 @@ memcpy: cmp $0, %ecx jz mcdone - mov %edi, %edx - and $3, %edx - jmp *mcpre_tab(,%edx,4) - -mcpre_tab: .long mcmain, mcpre1, mcpre2, mcpre3 -mcpre1: movsw - dec %ecx -mcpre2: movsw - dec %ecx -mcpre3: movsw - dec %ecx - jz mcdone - -mcmain: - push %ecx + mov %ecx, %edx shr $2, %ecx rep movsl - pop %ecx - and $3, %ecx - jmp *mcpost_tab(,%ecx,4) + and $3, %edx + jmp *mcpost_tab(,%edx,4) mcpost_tab: .long mcdone, mcpost1, mcpost2, mcpost3 mcpost3:movsb