]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/i386/i686/multiarch/memmove_chk.S
i386: memcpy functions with SSE2 unaligned load/store
[thirdparty/glibc.git] / sysdeps / i386 / i686 / multiarch / memmove_chk.S
index 3442ce15f1c4edf7e2e1e592bf7b964483c4cf33..fea9b543dfac2d671fe2da1975b3a896e6510f11 100644 (file)
@@ -35,6 +35,11 @@ ENTRY(__memmove_chk)
        jne     1f
        call    __init_cpu_features
 1:     leal    __memmove_chk_ia32@GOTOFF(%ebx), %eax
+       testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
+       jz      2f
+       leal    __memmove_chk_sse2_unaligned@GOTOFF(%ebx), %eax
+       testl   $bit_Fast_Unaligned_Load, FEATURE_OFFSET+index_Fast_Unaligned_Load+__cpu_features@GOTOFF(%ebx)
+       jnz     2f
        testl   $bit_SSSE3, CPUID_OFFSET+index_SSSE3+__cpu_features@GOTOFF(%ebx)
        jz      2f
        leal    __memmove_chk_ssse3@GOTOFF(%ebx), %eax
@@ -54,6 +59,11 @@ ENTRY(__memmove_chk)
        jne     1f
        call    __init_cpu_features
 1:     leal    __memmove_chk_ia32, %eax
+       testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features
+       jz      2f
+       leal    __memmove_chk_sse2_unaligned, %eax
+       testl   $bit_Fast_Unaligned_Load, FEATURE_OFFSET+index_Fast_Unaligned_Load+__cpu_features
+       jnz     2f
        testl   $bit_SSSE3, CPUID_OFFSET+index_SSSE3+__cpu_features
        jz      2f
        leal    __memmove_chk_ssse3, %eax
@@ -63,6 +73,18 @@ ENTRY(__memmove_chk)
 2:     ret
 END(__memmove_chk)
 
+       .type __memmove_chk_sse2_unaligned, @function
+       .p2align 4;
+__memmove_chk_sse2_unaligned:
+       cfi_startproc
+       CALL_MCOUNT
+       movl    12(%esp), %eax
+       cmpl    %eax, 16(%esp)
+       jb      __chk_fail
+       jmp     __memmove_sse2_unaligned
+       cfi_endproc
+       .size __memmove_chk_sse2_unaligned, .-__memmove_chk_sse2_unaligned
+
        .type __memmove_chk_ssse3, @function
        .p2align 4;
 __memmove_chk_ssse3: