mirror of git://sourceware.org/git/glibc.git
i686: Remove bzero optimizations
The symbol is not present in current POSIX specification and compiler already generates memset call.
This commit is contained in:
parent
dbf37d6d0e
commit
0f88a5c66e
|
@ -1,5 +0,0 @@
|
||||||
#define USE_AS_BZERO
|
|
||||||
#define memset __bzero
|
|
||||||
#include "memset.S"
|
|
||||||
|
|
||||||
weak_alias (__bzero, bzero)
|
|
|
@ -1,4 +0,0 @@
|
||||||
#define USE_AS_BZERO
|
|
||||||
#define memset __bzero
|
|
||||||
#include <sysdeps/i386/i586/memset.S>
|
|
||||||
weak_alias (__bzero, bzero)
|
|
|
@ -23,15 +23,11 @@
|
||||||
#define PARMS 4+4 /* space for 1 saved reg */
|
#define PARMS 4+4 /* space for 1 saved reg */
|
||||||
#define RTN PARMS
|
#define RTN PARMS
|
||||||
#define DEST RTN
|
#define DEST RTN
|
||||||
#ifdef USE_AS_BZERO
|
#define CHR DEST+4
|
||||||
# define LEN DEST+4
|
#define LEN CHR+4
|
||||||
#else
|
|
||||||
# define CHR DEST+4
|
|
||||||
# define LEN CHR+4
|
|
||||||
#endif
|
|
||||||
|
|
||||||
.text
|
.text
|
||||||
#if defined SHARED && IS_IN (libc) && !defined USE_AS_BZERO
|
#if defined SHARED && IS_IN (libc)
|
||||||
ENTRY (__memset_chk)
|
ENTRY (__memset_chk)
|
||||||
movl 12(%esp), %eax
|
movl 12(%esp), %eax
|
||||||
cmpl %eax, 16(%esp)
|
cmpl %eax, 16(%esp)
|
||||||
|
@ -46,15 +42,11 @@ ENTRY (memset)
|
||||||
movl DEST(%esp), %edi
|
movl DEST(%esp), %edi
|
||||||
cfi_rel_offset (edi, 0)
|
cfi_rel_offset (edi, 0)
|
||||||
movl LEN(%esp), %edx
|
movl LEN(%esp), %edx
|
||||||
#ifdef USE_AS_BZERO
|
|
||||||
xorl %eax, %eax /* we fill with 0 */
|
|
||||||
#else
|
|
||||||
movb CHR(%esp), %al
|
movb CHR(%esp), %al
|
||||||
movb %al, %ah
|
movb %al, %ah
|
||||||
movl %eax, %ecx
|
movl %eax, %ecx
|
||||||
shll $16, %eax
|
shll $16, %eax
|
||||||
movw %cx, %ax
|
movw %cx, %ax
|
||||||
#endif
|
|
||||||
cld
|
cld
|
||||||
|
|
||||||
/* If less than 36 bytes to write, skip tricky code (it wouldn't work). */
|
/* If less than 36 bytes to write, skip tricky code (it wouldn't work). */
|
||||||
|
@ -100,10 +92,8 @@ L(2): shrl $2, %ecx /* convert byte count to longword count */
|
||||||
rep
|
rep
|
||||||
stosb
|
stosb
|
||||||
|
|
||||||
#ifndef USE_AS_BZERO
|
|
||||||
/* Load result (only if used as memset). */
|
/* Load result (only if used as memset). */
|
||||||
movl DEST(%esp), %eax /* start address of destination is result */
|
movl DEST(%esp), %eax /* start address of destination is result */
|
||||||
#endif
|
|
||||||
popl %edi
|
popl %edi
|
||||||
cfi_adjust_cfa_offset (-4)
|
cfi_adjust_cfa_offset (-4)
|
||||||
cfi_restore (edi)
|
cfi_restore (edi)
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
#define USE_AS_BZERO
|
|
||||||
#define memset __bzero
|
|
||||||
#include <sysdeps/i386/i686/memset.S>
|
|
||||||
weak_alias (__bzero, bzero)
|
|
|
@ -21,18 +21,13 @@
|
||||||
#include "asm-syntax.h"
|
#include "asm-syntax.h"
|
||||||
|
|
||||||
#define PARMS 4+4 /* space for 1 saved reg */
|
#define PARMS 4+4 /* space for 1 saved reg */
|
||||||
#ifdef USE_AS_BZERO
|
#define RTN PARMS
|
||||||
# define DEST PARMS
|
#define DEST RTN
|
||||||
# define LEN DEST+4
|
#define CHR DEST+4
|
||||||
#else
|
#define LEN CHR+4
|
||||||
# define RTN PARMS
|
|
||||||
# define DEST RTN
|
|
||||||
# define CHR DEST+4
|
|
||||||
# define LEN CHR+4
|
|
||||||
#endif
|
|
||||||
|
|
||||||
.text
|
.text
|
||||||
#if defined SHARED && IS_IN (libc) && !defined USE_AS_BZERO
|
#if defined SHARED && IS_IN (libc)
|
||||||
ENTRY_CHK (__memset_chk)
|
ENTRY_CHK (__memset_chk)
|
||||||
movl 12(%esp), %eax
|
movl 12(%esp), %eax
|
||||||
cmpl %eax, 16(%esp)
|
cmpl %eax, 16(%esp)
|
||||||
|
@ -46,11 +41,7 @@ ENTRY (memset)
|
||||||
cfi_adjust_cfa_offset (4)
|
cfi_adjust_cfa_offset (4)
|
||||||
movl DEST(%esp), %edx
|
movl DEST(%esp), %edx
|
||||||
movl LEN(%esp), %ecx
|
movl LEN(%esp), %ecx
|
||||||
#ifdef USE_AS_BZERO
|
|
||||||
xorl %eax, %eax /* fill with 0 */
|
|
||||||
#else
|
|
||||||
movzbl CHR(%esp), %eax
|
movzbl CHR(%esp), %eax
|
||||||
#endif
|
|
||||||
jecxz 1f
|
jecxz 1f
|
||||||
movl %edx, %edi
|
movl %edx, %edi
|
||||||
cfi_rel_offset (edi, 0)
|
cfi_rel_offset (edi, 0)
|
||||||
|
@ -70,9 +61,7 @@ ENTRY (memset)
|
||||||
2: movl %ecx, %edx
|
2: movl %ecx, %edx
|
||||||
shrl $2, %ecx
|
shrl $2, %ecx
|
||||||
andl $3, %edx
|
andl $3, %edx
|
||||||
#ifndef USE_AS_BZERO
|
|
||||||
imul $0x01010101, %eax
|
imul $0x01010101, %eax
|
||||||
#endif
|
|
||||||
rep
|
rep
|
||||||
stosl
|
stosl
|
||||||
movl %edx, %ecx
|
movl %edx, %ecx
|
||||||
|
@ -80,9 +69,7 @@ ENTRY (memset)
|
||||||
stosb
|
stosb
|
||||||
|
|
||||||
1:
|
1:
|
||||||
#ifndef USE_AS_BZERO
|
|
||||||
movl DEST(%esp), %eax /* start address of destination is result */
|
movl DEST(%esp), %eax /* start address of destination is result */
|
||||||
#endif
|
|
||||||
popl %edi
|
popl %edi
|
||||||
cfi_adjust_cfa_offset (-4)
|
cfi_adjust_cfa_offset (-4)
|
||||||
cfi_restore (edi)
|
cfi_restore (edi)
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
ifeq ($(subdir),string)
|
ifeq ($(subdir),string)
|
||||||
gen-as-const-headers += locale-defines.sym
|
gen-as-const-headers += locale-defines.sym
|
||||||
sysdep_routines += bzero-sse2 memset-sse2 memcpy-ssse3 mempcpy-ssse3 \
|
sysdep_routines += memset-sse2 memcpy-ssse3 mempcpy-ssse3 \
|
||||||
memmove-ssse3 memcpy-ssse3-rep mempcpy-ssse3-rep \
|
memmove-ssse3 memcpy-ssse3-rep mempcpy-ssse3-rep \
|
||||||
memmove-ssse3-rep \
|
memmove-ssse3-rep \
|
||||||
memset-sse2-rep bzero-sse2-rep strcmp-ssse3 \
|
memset-sse2-rep strcmp-ssse3 \
|
||||||
strcmp-sse4 strncmp-c strncmp-ssse3 strncmp-sse4 \
|
strcmp-sse4 strncmp-c strncmp-ssse3 strncmp-sse4 \
|
||||||
memcmp-ssse3 memcmp-sse4 varshift \
|
memcmp-ssse3 memcmp-sse4 varshift \
|
||||||
strlen-sse2 strlen-sse2-bsf strncpy-c strcpy-ssse3 \
|
strlen-sse2 strlen-sse2-bsf strncpy-c strcpy-ssse3 \
|
||||||
|
@ -21,7 +21,7 @@ sysdep_routines += bzero-sse2 memset-sse2 memcpy-ssse3 mempcpy-ssse3 \
|
||||||
memcpy-sse2-unaligned \
|
memcpy-sse2-unaligned \
|
||||||
mempcpy-sse2-unaligned memmove-sse2-unaligned \
|
mempcpy-sse2-unaligned memmove-sse2-unaligned \
|
||||||
strcspn-c strpbrk-c strspn-c \
|
strcspn-c strpbrk-c strspn-c \
|
||||||
bzero-ia32 rawmemchr-ia32 \
|
rawmemchr-ia32 \
|
||||||
memchr-ia32 memcmp-ia32 memcpy-ia32 memmove-ia32 \
|
memchr-ia32 memcmp-ia32 memcpy-ia32 memmove-ia32 \
|
||||||
mempcpy-ia32 memset-ia32 strcat-ia32 strchr-ia32 \
|
mempcpy-ia32 memset-ia32 strcat-ia32 strchr-ia32 \
|
||||||
strrchr-ia32 strcpy-ia32 strcmp-ia32 strcspn-ia32 \
|
strrchr-ia32 strcpy-ia32 strcmp-ia32 strcspn-ia32 \
|
||||||
|
|
|
@ -1,37 +0,0 @@
|
||||||
/* bzero optimized for i686.
|
|
||||||
Copyright (C) 2017-2022 Free Software Foundation, Inc.
|
|
||||||
This file is part of the GNU C Library.
|
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Lesser General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
The GNU C Library is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
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, see
|
|
||||||
<https://www.gnu.org/licenses/>. */
|
|
||||||
|
|
||||||
#include <sysdep.h>
|
|
||||||
|
|
||||||
#if IS_IN (libc)
|
|
||||||
# define __bzero __bzero_ia32
|
|
||||||
|
|
||||||
# ifdef SHARED
|
|
||||||
# undef libc_hidden_builtin_def
|
|
||||||
/* IFUNC doesn't work with the hidden functions in shared library since
|
|
||||||
they will be called without setting up EBX needed for PLT which is
|
|
||||||
used by IFUNC. */
|
|
||||||
# define libc_hidden_builtin_def(name) \
|
|
||||||
.globl __GI___bzero; __GI___bzero = __bzero
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# undef weak_alias
|
|
||||||
# define weak_alias(original, alias)
|
|
||||||
|
|
||||||
# include <sysdeps/i386/i686/bzero.S>
|
|
||||||
#endif
|
|
|
@ -1,3 +0,0 @@
|
||||||
#define USE_AS_BZERO
|
|
||||||
#define __memset_sse2_rep __bzero_sse2_rep
|
|
||||||
#include "memset-sse2-rep.S"
|
|
|
@ -1,3 +0,0 @@
|
||||||
#define USE_AS_BZERO
|
|
||||||
#define __memset_sse2 __bzero_sse2
|
|
||||||
#include "memset-sse2.S"
|
|
|
@ -1,32 +0,0 @@
|
||||||
/* Multiple versions of bzero.
|
|
||||||
All versions must be listed in ifunc-impl-list.c.
|
|
||||||
Copyright (C) 2017-2022 Free Software Foundation, Inc.
|
|
||||||
This file is part of the GNU C Library.
|
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Lesser General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
The GNU C Library is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
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, see
|
|
||||||
<https://www.gnu.org/licenses/>. */
|
|
||||||
|
|
||||||
/* Define multiple versions only for the definition in libc. */
|
|
||||||
#if IS_IN (libc)
|
|
||||||
# define bzero __redirect_bzero
|
|
||||||
# include <string.h>
|
|
||||||
# undef bzero
|
|
||||||
|
|
||||||
# define SYMBOL_NAME bzero
|
|
||||||
# include "ifunc-memset.h"
|
|
||||||
|
|
||||||
libc_ifunc_redirected (__redirect_bzero, __bzero, IFUNC_SELECTOR ());
|
|
||||||
|
|
||||||
weak_alias (__bzero, bzero)
|
|
||||||
#endif
|
|
|
@ -36,14 +36,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
|
||||||
|
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
|
|
||||||
/* Support sysdeps/i386/i686/multiarch/bzero.S. */
|
|
||||||
IFUNC_IMPL (i, name, bzero,
|
|
||||||
IFUNC_IMPL_ADD (array, i, bzero, CPU_FEATURE_USABLE (SSE2),
|
|
||||||
__bzero_sse2_rep)
|
|
||||||
IFUNC_IMPL_ADD (array, i, bzero, CPU_FEATURE_USABLE (SSE2),
|
|
||||||
__bzero_sse2)
|
|
||||||
IFUNC_IMPL_ADD (array, i, bzero, 1, __bzero_ia32))
|
|
||||||
|
|
||||||
/* Support sysdeps/i386/i686/multiarch/memchr.S. */
|
/* Support sysdeps/i386/i686/multiarch/memchr.S. */
|
||||||
IFUNC_IMPL (i, name, memchr,
|
IFUNC_IMPL (i, name, memchr,
|
||||||
IFUNC_IMPL_ADD (array, i, memchr, CPU_FEATURE_USABLE (SSE2),
|
IFUNC_IMPL_ADD (array, i, memchr, CPU_FEATURE_USABLE (SSE2),
|
||||||
|
|
|
@ -32,16 +32,10 @@
|
||||||
#define PUSH(REG) pushl REG; CFI_PUSH (REG)
|
#define PUSH(REG) pushl REG; CFI_PUSH (REG)
|
||||||
#define POP(REG) popl REG; CFI_POP (REG)
|
#define POP(REG) popl REG; CFI_POP (REG)
|
||||||
|
|
||||||
#ifdef USE_AS_BZERO
|
#define DEST PARMS
|
||||||
# define DEST PARMS
|
#define CHR DEST+4
|
||||||
# define LEN DEST+4
|
#define LEN CHR+4
|
||||||
# define SETRTNVAL
|
#define SETRTNVAL movl DEST(%esp), %eax
|
||||||
#else
|
|
||||||
# define DEST PARMS
|
|
||||||
# define CHR DEST+4
|
|
||||||
# define LEN CHR+4
|
|
||||||
# define SETRTNVAL movl DEST(%esp), %eax
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PIC
|
#ifdef PIC
|
||||||
# define ENTRANCE PUSH (%ebx);
|
# define ENTRANCE PUSH (%ebx);
|
||||||
|
@ -78,7 +72,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
.section .text.sse2,"ax",@progbits
|
.section .text.sse2,"ax",@progbits
|
||||||
#if defined SHARED && IS_IN (libc) && !defined USE_AS_BZERO
|
#if defined SHARED && IS_IN (libc)
|
||||||
ENTRY (__memset_chk_sse2_rep)
|
ENTRY (__memset_chk_sse2_rep)
|
||||||
movl 12(%esp), %eax
|
movl 12(%esp), %eax
|
||||||
cmpl %eax, 16(%esp)
|
cmpl %eax, 16(%esp)
|
||||||
|
@ -89,16 +83,12 @@ ENTRY (__memset_sse2_rep)
|
||||||
ENTRANCE
|
ENTRANCE
|
||||||
|
|
||||||
movl LEN(%esp), %ecx
|
movl LEN(%esp), %ecx
|
||||||
#ifdef USE_AS_BZERO
|
|
||||||
xor %eax, %eax
|
|
||||||
#else
|
|
||||||
movzbl CHR(%esp), %eax
|
movzbl CHR(%esp), %eax
|
||||||
movb %al, %ah
|
movb %al, %ah
|
||||||
/* Fill the whole EAX with pattern. */
|
/* Fill the whole EAX with pattern. */
|
||||||
movl %eax, %edx
|
movl %eax, %edx
|
||||||
shl $16, %eax
|
shl $16, %eax
|
||||||
or %edx, %eax
|
or %edx, %eax
|
||||||
#endif
|
|
||||||
movl DEST(%esp), %edx
|
movl DEST(%esp), %edx
|
||||||
cmp $32, %ecx
|
cmp $32, %ecx
|
||||||
jae L(32bytesormore)
|
jae L(32bytesormore)
|
||||||
|
@ -228,12 +218,8 @@ L(write_3bytes):
|
||||||
/* ECX > 32 and EDX is 4 byte aligned. */
|
/* ECX > 32 and EDX is 4 byte aligned. */
|
||||||
L(32bytesormore):
|
L(32bytesormore):
|
||||||
/* Fill xmm0 with the pattern. */
|
/* Fill xmm0 with the pattern. */
|
||||||
#ifdef USE_AS_BZERO
|
|
||||||
pxor %xmm0, %xmm0
|
|
||||||
#else
|
|
||||||
movd %eax, %xmm0
|
movd %eax, %xmm0
|
||||||
pshufd $0, %xmm0, %xmm0
|
pshufd $0, %xmm0, %xmm0
|
||||||
#endif
|
|
||||||
testl $0xf, %edx
|
testl $0xf, %edx
|
||||||
jz L(aligned_16)
|
jz L(aligned_16)
|
||||||
/* ECX > 32 and EDX is not 16 byte aligned. */
|
/* ECX > 32 and EDX is not 16 byte aligned. */
|
||||||
|
|
|
@ -32,16 +32,10 @@
|
||||||
#define PUSH(REG) pushl REG; CFI_PUSH (REG)
|
#define PUSH(REG) pushl REG; CFI_PUSH (REG)
|
||||||
#define POP(REG) popl REG; CFI_POP (REG)
|
#define POP(REG) popl REG; CFI_POP (REG)
|
||||||
|
|
||||||
#ifdef USE_AS_BZERO
|
#define DEST PARMS
|
||||||
# define DEST PARMS
|
#define CHR DEST+4
|
||||||
# define LEN DEST+4
|
#define LEN CHR+4
|
||||||
# define SETRTNVAL
|
#define SETRTNVAL movl DEST(%esp), %eax
|
||||||
#else
|
|
||||||
# define DEST PARMS
|
|
||||||
# define CHR DEST+4
|
|
||||||
# define LEN CHR+4
|
|
||||||
# define SETRTNVAL movl DEST(%esp), %eax
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PIC
|
#ifdef PIC
|
||||||
# define ENTRANCE PUSH (%ebx);
|
# define ENTRANCE PUSH (%ebx);
|
||||||
|
@ -78,7 +72,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
.section .text.sse2,"ax",@progbits
|
.section .text.sse2,"ax",@progbits
|
||||||
#if defined SHARED && IS_IN (libc) && !defined USE_AS_BZERO
|
#if defined SHARED && IS_IN (libc)
|
||||||
ENTRY (__memset_chk_sse2)
|
ENTRY (__memset_chk_sse2)
|
||||||
movl 12(%esp), %eax
|
movl 12(%esp), %eax
|
||||||
cmpl %eax, 16(%esp)
|
cmpl %eax, 16(%esp)
|
||||||
|
@ -89,16 +83,12 @@ ENTRY (__memset_sse2)
|
||||||
ENTRANCE
|
ENTRANCE
|
||||||
|
|
||||||
movl LEN(%esp), %ecx
|
movl LEN(%esp), %ecx
|
||||||
#ifdef USE_AS_BZERO
|
|
||||||
xor %eax, %eax
|
|
||||||
#else
|
|
||||||
movzbl CHR(%esp), %eax
|
movzbl CHR(%esp), %eax
|
||||||
movb %al, %ah
|
movb %al, %ah
|
||||||
/* Fill the whole EAX with pattern. */
|
/* Fill the whole EAX with pattern. */
|
||||||
movl %eax, %edx
|
movl %eax, %edx
|
||||||
shl $16, %eax
|
shl $16, %eax
|
||||||
or %edx, %eax
|
or %edx, %eax
|
||||||
#endif
|
|
||||||
movl DEST(%esp), %edx
|
movl DEST(%esp), %edx
|
||||||
cmp $32, %ecx
|
cmp $32, %ecx
|
||||||
jae L(32bytesormore)
|
jae L(32bytesormore)
|
||||||
|
@ -228,12 +218,8 @@ L(write_3bytes):
|
||||||
/* ECX > 32 and EDX is 4 byte aligned. */
|
/* ECX > 32 and EDX is 4 byte aligned. */
|
||||||
L(32bytesormore):
|
L(32bytesormore):
|
||||||
/* Fill xmm0 with the pattern. */
|
/* Fill xmm0 with the pattern. */
|
||||||
#ifdef USE_AS_BZERO
|
|
||||||
pxor %xmm0, %xmm0
|
|
||||||
#else
|
|
||||||
movd %eax, %xmm0
|
movd %eax, %xmm0
|
||||||
pshufd $0, %xmm0, %xmm0
|
pshufd $0, %xmm0, %xmm0
|
||||||
#endif
|
|
||||||
testl $0xf, %edx
|
testl $0xf, %edx
|
||||||
jz L(aligned_16)
|
jz L(aligned_16)
|
||||||
/* ECX > 32 and EDX is not 16 byte aligned. */
|
/* ECX > 32 and EDX is not 16 byte aligned. */
|
||||||
|
|
|
@ -30,15 +30,11 @@
|
||||||
#define POP(REG) popl REG; CFI_POP (REG)
|
#define POP(REG) popl REG; CFI_POP (REG)
|
||||||
|
|
||||||
#define STR1 8
|
#define STR1 8
|
||||||
#ifdef USE_AS_BZERO
|
|
||||||
#define N STR1+4
|
|
||||||
#else
|
|
||||||
#define STR2 STR1+4
|
#define STR2 STR1+4
|
||||||
#define N STR2+4
|
#define N STR2+4
|
||||||
#endif
|
|
||||||
|
|
||||||
.text
|
.text
|
||||||
#if defined SHARED && IS_IN (libc) && !defined USE_AS_BZERO
|
#if defined SHARED && IS_IN (libc)
|
||||||
ENTRY (__memset_chk)
|
ENTRY (__memset_chk)
|
||||||
movl 12(%esp), %eax
|
movl 12(%esp), %eax
|
||||||
cmpl %eax, 16(%esp)
|
cmpl %eax, 16(%esp)
|
||||||
|
@ -49,20 +45,12 @@ ENTRY (memset)
|
||||||
PUSH (%edi)
|
PUSH (%edi)
|
||||||
movl N(%esp), %ecx
|
movl N(%esp), %ecx
|
||||||
movl STR1(%esp), %edi
|
movl STR1(%esp), %edi
|
||||||
#ifdef USE_AS_BZERO
|
|
||||||
xor %eax, %eax
|
|
||||||
#else
|
|
||||||
movzbl STR2(%esp), %eax
|
movzbl STR2(%esp), %eax
|
||||||
mov %edi, %edx
|
mov %edi, %edx
|
||||||
#endif
|
|
||||||
rep stosb
|
rep stosb
|
||||||
#ifndef USE_AS_BZERO
|
|
||||||
mov %edx, %eax
|
mov %edx, %eax
|
||||||
#endif
|
|
||||||
POP (%edi)
|
POP (%edi)
|
||||||
ret
|
ret
|
||||||
END (memset)
|
END (memset)
|
||||||
|
|
||||||
#ifndef USE_AS_BZERO
|
|
||||||
libc_hidden_builtin_def (memset)
|
libc_hidden_builtin_def (memset)
|
||||||
#endif
|
|
||||||
|
|
Loading…
Reference in New Issue