File: [Development] / linux-2.6-xfs / arch / x86_64 / lib / Attic / memset.S (download)
Revision 1.3, Mon Dec 5 21:19:08 2005 UTC (11 years, 10 months ago) by nathans.longdrop.melbourne.sgi.com
Branch: MAIN
Changes since 1.2: +0 -94
lines
Merge up to 2.6.15-rc5.
Merge of 2.6.x-xfs-melb:linux:24672a by kenmcd.
|
/* Copyright 2002 Andi Kleen, SuSE Labs */
/*
* ISO C memset - set a memory block to a byte value.
*
* rdi destination
* rsi value (char)
* rdx count (bytes)
*
* rax original destination
*/
.globl __memset
.globl memset
.p2align 4
memset:
__memset:
movq %rdi,%r9
movl %edx,%r8d
andl $7,%r8d
movl %edx,%ecx
shrl $3,%ecx
/* expand byte value */
movzbl %sil,%esi
movabs $0x0101010101010101,%rax
mulq %rsi /* with rax, clobbers rdx */
rep
stosq
movl %r8d,%ecx
rep
stosb
movq %r9,%rax
ret