12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- #include "_glibc_inc.h"
- #define MEMPCPY_P (defined memcpy)
- .text
- #if defined __PIC__ && !defined NOT_IN_libc && defined __UCLIBC_HAS_FORTIFY__
- ENTRY (__memcpy_chk)
- cmpq %rdx, %rcx
- jb HIDDEN_JUMPTARGET (__chk_fail)
- END (__memcpy_chk)
- #endif
- ENTRY (BP_SYM (memcpy))
-
- cmpq $32, %rdx
- movq %rdx, %rcx
- #if !MEMPCPY_P
- movq %rdi, %r10
- #endif
-
- cld
- jbe 1f
-
- movq %rdi, %rax
- negq %rax
- andq $7, %rax
- subq %rax, %rcx
- xchgq %rax, %rcx
- rep; movsb
- movq %rax, %rcx
- subq $32, %rcx
- js 2f
-
- .p2align 4,,11
- 3:
-
- subq $32, %rcx
- movq (%rsi), %rax
- movq 8(%rsi), %rdx
- movq 16(%rsi), %r8
- movq 24(%rsi), %r9
- movq %rax, (%rdi)
- movq %rdx, 8(%rdi)
- movq %r8, 16(%rdi)
- movq %r9, 24(%rdi)
- leaq 32(%rsi), %rsi
- leaq 32(%rdi), %rdi
- jns 3b
-
- 2: addq $32, %rcx
- 1: rep; movsb
- #if MEMPCPY_P
- movq %rdi, %rax
- #else
- movq %r10, %rax
-
- #endif
- ret
- END (BP_SYM (memcpy))
- #if !MEMPCPY_P
- libc_hidden_def(memcpy)
- #endif
|