]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/i386/i686/multiarch/memset-sse2.S
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / sysdeps / i386 / i686 / multiarch / memset-sse2.S
index 02fe57f6b0241d5589cafeb1649ba1264f1ea82f..d03e647a3f5e62644c271e3fb8a8f18783d4e241 100644 (file)
@@ -1,5 +1,5 @@
 /* memset with SSE2
-   Copyright (C) 2010 Free Software Foundation, Inc.
+   Copyright (C) 2010-2015 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
 
 #include <sysdep.h>
 #include "asm-syntax.h"
    jump table with relative offsets.   */
 # define BRANCH_TO_JMPTBL_ENTRY(TABLE)                         \
     /* We first load PC into EBX.  */                          \
-    call       __i686.get_pc_thunk.bx;                         \
+    SETUP_PIC_REG(bx);                                         \
     /* Get the address of the jump table.  */                  \
     add                $(TABLE - .), %ebx;                             \
     /* Get the entry and convert the relative offset to the    \
        absolute address.  */                                   \
     add                (%ebx,%ecx,4), %ebx;                            \
     add                %ecx, %edx;                                     \
-    /* We loaded the jump table and adjuested EDX. Go.  */     \
+    /* We loaded the jump table and adjusted EDX. Go.  */      \
     jmp                *%ebx
-
-       .section        .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-       .globl  __i686.get_pc_thunk.bx
-       .hidden __i686.get_pc_thunk.bx
-       ALIGN (4)
-       .type   __i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
-       movl    (%esp), %ebx
-       ret
 #else
 # define ENTRANCE
 # define RETURN_END    ret
@@ -89,7 +79,7 @@ __i686.get_pc_thunk.bx:
 #endif
 
        .section .text.sse2,"ax",@progbits
-#if defined SHARED && !defined NOT_IN_libc && !defined USE_AS_BZERO
+#if defined SHARED && IS_IN (libc) && !defined USE_AS_BZERO
 ENTRY (__memset_chk_sse2)
        movl    12(%esp), %eax
        cmpl    %eax, 16(%esp)
@@ -243,7 +233,6 @@ L(32bytesormore):
        pxor    %xmm0, %xmm0
 #else
        movd    %eax, %xmm0
-       punpcklbw %xmm0, %xmm0
        pshufd  $0, %xmm0, %xmm0
 #endif
        testl   $0xf, %edx
@@ -261,7 +250,7 @@ L(not_aligned_16):
        ALIGN (4)
 L(aligned_16):
        cmp     $128, %ecx
-       jge     L(128bytesormore)
+       jae     L(128bytesormore)
 
 L(aligned_16_less128bytes):
        BRANCH_TO_JMPTBL_ENTRY (L(table_16_128bytes))
@@ -273,7 +262,7 @@ L(128bytesormore):
        mov     $SHARED_CACHE_SIZE, %ebx
 #else
 # ifdef SHARED
-       call    __i686.get_pc_thunk.bx
+       SETUP_PIC_REG(bx)
        add     $_GLOBAL_OFFSET_TABLE_, %ebx
        mov     __x86_shared_cache_size@GOTOFF(%ebx), %ebx
 # else
@@ -284,17 +273,20 @@ L(128bytesormore):
        cmp     %ebx, %ecx
        jae     L(128bytesormore_nt_start)
 
-       
+
 #ifdef DATA_CACHE_SIZE
        POP (%ebx)
+# define RESTORE_EBX_STATE CFI_PUSH (%ebx)
        cmp     $DATA_CACHE_SIZE, %ecx
 #else
 # ifdef SHARED
-       call    __i686.get_pc_thunk.bx
+#  define RESTORE_EBX_STATE
+       SETUP_PIC_REG(bx)
        add     $_GLOBAL_OFFSET_TABLE_, %ebx
        cmp     __x86_data_cache_size@GOTOFF(%ebx), %ecx
 # else
        POP (%ebx)
+#  define RESTORE_EBX_STATE CFI_PUSH (%ebx)
        cmp     __x86_data_cache_size, %ecx
 # endif
 #endif
@@ -312,7 +304,7 @@ L(128bytesormore_normal):
        movdqa  %xmm0, 0x60(%edx)
        movdqa  %xmm0, 0x70(%edx)
        lea     128(%edx), %edx
-       jl      L(128bytesless_normal)
+       jb      L(128bytesless_normal)
 
 
        sub     $128, %ecx
@@ -325,10 +317,10 @@ L(128bytesormore_normal):
        movdqa  %xmm0, 0x60(%edx)
        movdqa  %xmm0, 0x70(%edx)
        lea     128(%edx), %edx
-       jge     L(128bytesormore_normal)
+       jae     L(128bytesormore_normal)
 
 L(128bytesless_normal):
-       lea     128(%ecx), %ecx
+       add     $128, %ecx
        BRANCH_TO_JMPTBL_ENTRY (L(table_16_128bytes))
 
        ALIGN (4)
@@ -345,12 +337,13 @@ L(128bytes_L2_normal):
        movaps  %xmm0, 0x60(%edx)
        movaps  %xmm0, 0x70(%edx)
        add     $128, %edx
-       cmp     $128, %ecx      
-       jge     L(128bytes_L2_normal)
+       cmp     $128, %ecx
+       jae     L(128bytes_L2_normal)
 
 L(128bytesless_L2_normal):
        BRANCH_TO_JMPTBL_ENTRY (L(table_16_128bytes))
 
+       RESTORE_EBX_STATE
 L(128bytesormore_nt_start):
        sub     %ebx, %ecx
        ALIGN (4)
@@ -368,7 +361,7 @@ L(128bytesormore_shared_cache_loop):
        movdqa  %xmm0, 0x70(%edx)
        add     $0x80, %edx
        cmp     $0x80, %ebx
-       jge     L(128bytesormore_shared_cache_loop)
+       jae     L(128bytesormore_shared_cache_loop)
        cmp     $0x80, %ecx
        jb      L(shared_cache_loop_end)
        ALIGN (4)
@@ -384,7 +377,7 @@ L(128bytesormore_nt):
        movntdq %xmm0, 0x70(%edx)
        add     $0x80, %edx
        cmp     $0x80, %ecx
-       jge     L(128bytesormore_nt)
+       jae     L(128bytesormore_nt)
        sfence
 L(shared_cache_loop_end):
 #if defined DATA_CACHE_SIZE || !defined SHARED