<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">Signed-off-by: Guillaume Charifi <guillaume.charifi@sfr.fr></p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">---</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;"> dlls/msvcrt/string.c | 63 ++++++++++++++++++++++++++++++++++++++++++++</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;"> 1 file changed, 63 insertions(+)</p>
<br /><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">diff --git a/dlls/msvcrt/string.c b/dlls/msvcrt/string.c</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">index 4d09405094d..6d1500cb194 100644</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">--- a/dlls/msvcrt/string.c</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+++ b/dlls/msvcrt/string.c</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">@@ -2527,6 +2527,7 @@ int __cdecl memcmp(const void *ptr1, const void *ptr2,</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">size_t n) __ASM_CFI(".cfi_adjust_cfa_offset -8\n\t") \</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">     "popq " SRC_REG "\n\t" \</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">     __ASM_CFI(".cfi_adjust_cfa_offset -8\n\t")</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;"> #endif</p>
<br /><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;"> void * __cdecl sse2_memmove(void *dst, const void *src, size_t n);</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">@@ -2732,6 +2733,64 @@ __ASM_GLOBAL_FUNC( sse2_memmove,</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">         MEMMOVE_CLEANUP</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">         "ret" )</p>
<br /><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+#undef DEST_REG</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+#undef SRC_REG</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+#undef LEN_REG</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+#undef TMP_REG</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+#ifdef __i386__</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+#define DEST_REG "%edi"</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+#define SRC_REG "%eax"</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+#define LEN_REG "%ecx"</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+#define TMP_REG</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+#define MEMSET_INIT \</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+    "pushl " DEST_REG "\n\t" \</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+    __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t") \</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+    "movl 8(%esp), " DEST_REG "\n\t" \</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+    "movl 12(%esp), " SRC_REG "\n\t" \</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+    "movl 16(%esp), " LEN_REG "\n\t"</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+#define MEMSET_CLEANUP \</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+    "movl 8(%esp), %eax\n\t" \</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+    "popl " DEST_REG "\n\t" \</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+    __ASM_CFI(".cfi_adjust_cfa_offset -4\n\t")</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+#else</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+#define DEST_REG "%rdi"</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+#define SRC_REG "%rax"</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+#define LEN_REG "%rcx"</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+#define TMP_REG "%r9"</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+#define MEMSET_INIT \</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+    "pushq " DEST_REG "\n\t" \</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+    __ASM_CFI(".cfi_adjust_cfa_offset 8\n\t") \</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+    "movq %rcx, " DEST_REG "\n\t" \</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+    "movq %rdx, " SRC_REG "\n\t" \</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+    "movq %r8, " LEN_REG "\n\t" \</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+    "movq " DEST_REG ", " TMP_REG "\n\t"</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+#define MEMSET_CLEANUP \</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+    "movq " TMP_REG ", %rax\n\t" \</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+    "popq " DEST_REG "\n\t" \</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+    __ASM_CFI(".cfi_adjust_cfa_offset -8\n\t")</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+#endif</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+void * __cdecl ermsb_memset(void *dst, int c, size_t n);</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+__ASM_GLOBAL_FUNC( ermsb_memset,</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+        MEMSET_INIT</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+        "rep stosb\n\t"</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+        MEMSET_CLEANUP</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+        "ret" )</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+#undef DEST_REG</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+#undef SRC_REG</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+#undef LEN_REG</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+#undef TMP_REG</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;"> #endif</p>
<br /><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;"> /*********************************************************************</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">@@ -2860,9 +2919,13 @@ void * __cdecl memcpy(void *dst, const void *src,</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">size_t n) */</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;"> void* __cdecl memset(void *dst, int c, size_t n)</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;"> {</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+#if defined(__i386__) || defined(__x86_64__)</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+    return ermsb_memset(dst, c, n);</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+#else</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">     volatile unsigned char *d = dst;  /* avoid gcc optimizations */</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">     while (n--) *d++ = c;</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">     return dst;</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">+#endif</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;"> }</p>
<br /><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;"> /*********************************************************************</p>
<br /><br /></body>
</html>