summaryrefslogtreecommitdiff
path: root/sysdeps/i386/i686/memset.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/i386/i686/memset.S')
-rw-r--r--sysdeps/i386/i686/memset.S22
1 files changed, 8 insertions, 14 deletions
diff --git a/sysdeps/i386/i686/memset.S b/sysdeps/i386/i686/memset.S
index b6dbf2a56d..9d1c1739f8 100644
--- a/sysdeps/i386/i686/memset.S
+++ b/sysdeps/i386/i686/memset.S
@@ -1,6 +1,6 @@
/* memset/bzero -- set memory area to CH/0
Highly optimized version for ix86, x>=6.
- Copyright (C) 1999-2015 Free Software Foundation, Inc.
+ Copyright (C) 1999-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
@@ -21,11 +21,8 @@
#include <sysdep.h>
#include "asm-syntax.h"
-/* BEWARE: `#ifdef memset' means that memset is redefined as `bzero' */
-#define BZERO_P (defined memset)
-
#define PARMS 4+4 /* space for 1 saved reg */
-#if BZERO_P
+#ifdef USE_AS_BZERO
# define DEST PARMS
# define LEN DEST+4
#else
@@ -36,7 +33,7 @@
#endif
.text
-#if defined PIC && IS_IN (libc) && !BZERO_P
+#if defined SHARED && IS_IN (libc) && !defined USE_AS_BZERO
ENTRY_CHK (__memset_chk)
movl 12(%esp), %eax
cmpl %eax, 16(%esp)
@@ -50,7 +47,7 @@ ENTRY (memset)
cfi_adjust_cfa_offset (4)
movl DEST(%esp), %edx
movl LEN(%esp), %ecx
-#if BZERO_P
+#ifdef USE_AS_BZERO
xorl %eax, %eax /* fill with 0 */
#else
movzbl CHR(%esp), %eax
@@ -74,7 +71,7 @@ ENTRY (memset)
2: movl %ecx, %edx
shrl $2, %ecx
andl $3, %edx
-#if !BZERO_P
+#ifndef USE_AS_BZERO
imul $0x01010101, %eax
#endif
rep
@@ -84,22 +81,19 @@ ENTRY (memset)
stosb
1:
-#if !BZERO_P
+#ifndef USE_AS_BZERO
movl DEST(%esp), %eax /* start address of destination is result */
#endif
popl %edi
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
-#if BZERO_P
- ret
-#else
ret
-#endif
END (memset)
libc_hidden_builtin_def (memset)
-#if defined PIC && IS_IN (libc) && !BZERO_P
+#if defined SHARED && IS_IN (libc) && !defined __memset_chk \
+ && !defined USE_AS_BZERO
strong_alias (__memset_chk, __memset_zero_constant_len_parameter)
.section .gnu.warning.__memset_zero_constant_len_parameter
.string "memset used with constant zero length parameter; this could be due to transposed parameters"