2 Copyright (C) 2010 Free Software Foundation, Inc.
3 Contributed by Intel Corporation.
4 This file is part of the GNU C Library.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, write to the Free
18 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
23 #if !defined NOT_IN_libc \
25 || defined USE_AS_MEMMOVE \
26 || !defined USE_MULTIARCH)
28 #include "asm-syntax.h"
31 # define MEMCPY __memcpy_ssse3
32 # define MEMCPY_CHK __memcpy_chk_ssse3
45 #define CFI_PUSH(REG) \
46 cfi_adjust_cfa_offset (4); \
47 cfi_rel_offset (REG, 0)
49 #define CFI_POP(REG) \
50 cfi_adjust_cfa_offset (-4); \
53 #define PUSH(REG) pushl REG; CFI_PUSH (REG)
54 #define POP(REG) popl REG; CFI_POP (REG)
57 # define PARMS 8 /* Preserve EBX. */
58 # define ENTRANCE PUSH (%ebx);
59 # define RETURN_END POP (%ebx); ret
60 # define RETURN RETURN_END; CFI_PUSH (%ebx)
61 # define JMPTBL(I, B) I - B
63 /* Load an entry in a jump table into EBX and branch to it. TABLE is a
64 jump table with relative offsets. INDEX is a register contains the
65 index into the jump table. SCALE is the scale of INDEX. */
66 # define BRANCH_TO_JMPTBL_ENTRY(TABLE, INDEX, SCALE) \
67 /* We first load PC into EBX. */ \
68 call __i686.get_pc_thunk.bx; \
69 /* Get the address of the jump table. */ \
70 addl $(TABLE - .), %ebx; \
71 /* Get the entry and convert the relative offset to the \
72 absolute address. */ \
73 addl (%ebx,INDEX,SCALE), %ebx; \
74 /* We loaded the jump table. Go. */ \
77 # define BRANCH_TO_JMPTBL_ENTRY_VALUE(TABLE) \
78 addl $(TABLE - .), %ebx
80 # define BRANCH_TO_JMPTBL_ENTRY_TAIL(TABLE, INDEX, SCALE) \
81 addl (%ebx,INDEX,SCALE), %ebx; \
82 /* We loaded the jump table. Go. */ \
85 .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
86 .globl __i686.get_pc_thunk.bx
87 .hidden __i686.get_pc_thunk.bx
89 .type __i686.get_pc_thunk.bx,@function
90 __i686.get_pc_thunk.bx:
96 # define RETURN_END ret
97 # define RETURN RETURN_END
98 # define JMPTBL(I, B) I
100 /* Branch to an entry in a jump table. TABLE is a jump table with
101 absolute offsets. INDEX is a register contains the index into the
102 jump table. SCALE is the scale of INDEX. */
103 # define BRANCH_TO_JMPTBL_ENTRY(TABLE, INDEX, SCALE) \
104 jmp *TABLE(,INDEX,SCALE)
106 # define BRANCH_TO_JMPTBL_ENTRY_VALUE(TABLE)
108 # define BRANCH_TO_JMPTBL_ENTRY_TAIL(TABLE, INDEX, SCALE) \
109 jmp *TABLE(,INDEX,SCALE)
112 .section .text.ssse3,"ax",@progbits
113 #if defined SHARED && !defined NOT_IN_libc && !defined USE_AS_BCOPY
117 jb HIDDEN_JUMPTARGET (__chk_fail)
124 movl DEST(%esp), %edx
126 #ifdef USE_AS_MEMMOVE
129 je L(fwd_write_0bytes)
132 jmp L(bk_write_less32bytes_2)
144 L(fwd_write_less32bytes):
145 #ifndef USE_AS_MEMMOVE
151 BRANCH_TO_JMPTBL_ENTRY (L(table_48bytes_fwd), %ecx, 4)
152 #ifndef USE_AS_MEMMOVE
154 BRANCH_TO_JMPTBL_ENTRY (L(table_48_bytes_bwd), %ecx, 4)
158 /* ECX > 32 and EDX is 4 byte aligned. */
171 #ifdef SHARED_CACHE_SIZE_HALF
172 cmp $SHARED_CACHE_SIZE_HALF, %ecx
175 call __i686.get_pc_thunk.bx
176 add $_GLOBAL_OFFSET_TABLE_, %ebx
177 cmp __x86_shared_cache_size_half@GOTOFF(%ebx), %ecx
179 cmp __x86_shared_cache_size_half, %ecx
188 BRANCH_TO_JMPTBL_ENTRY (L(shl_table), %edi, 4)
199 movdqa (%eax, %edi), %xmm0
200 movdqa 16(%eax, %edi), %xmm1
202 movdqa %xmm0, (%edx, %edi)
203 movdqa %xmm1, 16(%edx, %edi)
207 movdqa (%eax, %edi), %xmm0
208 movdqa 16(%eax, %edi), %xmm1
210 movdqa %xmm0, (%edx, %edi)
211 movdqa %xmm1, 16(%edx, %edi)
215 movdqa (%eax, %edi), %xmm0
216 movdqa 16(%eax, %edi), %xmm1
218 movdqa %xmm0, (%edx, %edi)
219 movdqa %xmm1, 16(%edx, %edi)
223 movdqa (%eax, %edi), %xmm0
224 movdqa 16(%eax, %edi), %xmm1
226 movdqa %xmm0, (%edx, %edi)
227 movdqa %xmm1, 16(%edx, %edi)
235 BRANCH_TO_JMPTBL_ENTRY (L(table_48bytes_fwd), %ecx, 4)
239 #ifdef DATA_CACHE_SIZE_HALF
240 cmp $DATA_CACHE_SIZE_HALF, %ecx
243 call __i686.get_pc_thunk.bx
244 add $_GLOBAL_OFFSET_TABLE_, %ebx
245 cmp __x86_data_cache_size_half@GOTOFF(%ebx), %ecx
247 cmp __x86_data_cache_size_half, %ecx
253 jge L(shl_0_gobble_mem_loop)
254 L(shl_0_gobble_cache_loop):
256 movdqa 0x10(%eax), %xmm1
257 movdqa 0x20(%eax), %xmm2
258 movdqa 0x30(%eax), %xmm3
259 movdqa 0x40(%eax), %xmm4
260 movdqa 0x50(%eax), %xmm5
261 movdqa 0x60(%eax), %xmm6
262 movdqa 0x70(%eax), %xmm7
266 movdqa %xmm1, 0x10(%edx)
267 movdqa %xmm2, 0x20(%edx)
268 movdqa %xmm3, 0x30(%edx)
269 movdqa %xmm4, 0x40(%edx)
270 movdqa %xmm5, 0x50(%edx)
271 movdqa %xmm6, 0x60(%edx)
272 movdqa %xmm7, 0x70(%edx)
275 jge L(shl_0_gobble_cache_loop)
276 L(shl_0_gobble_cache_loop_tail):
279 jl L(shl_0_cache_less_64bytes)
283 movdqa 0x10(%eax), %xmm1
286 movdqa %xmm1, 0x10(%edx)
288 movdqa 0x20(%eax), %xmm0
289 movdqa 0x30(%eax), %xmm1
292 movdqa %xmm0, 0x20(%edx)
293 movdqa %xmm1, 0x30(%edx)
295 L(shl_0_cache_less_64bytes):
297 jl L(shl_0_cache_less_32bytes)
300 movdqa 0x10(%eax), %xmm1
303 movdqa %xmm1, 0x10(%edx)
305 L(shl_0_cache_less_32bytes):
307 jl L(shl_0_cache_less_16bytes)
313 L(shl_0_cache_less_16bytes):
316 BRANCH_TO_JMPTBL_ENTRY (L(table_48bytes_fwd), %ecx, 4)
320 L(shl_0_gobble_mem_loop):
321 prefetcht0 0x1c0(%eax)
322 prefetcht0 0x280(%eax)
323 prefetcht0 0x1c0(%edx)
326 movdqa 0x10(%eax), %xmm1
327 movdqa 0x20(%eax), %xmm2
328 movdqa 0x30(%eax), %xmm3
329 movdqa 0x40(%eax), %xmm4
330 movdqa 0x50(%eax), %xmm5
331 movdqa 0x60(%eax), %xmm6
332 movdqa 0x70(%eax), %xmm7
336 movdqa %xmm1, 0x10(%edx)
337 movdqa %xmm2, 0x20(%edx)
338 movdqa %xmm3, 0x30(%edx)
339 movdqa %xmm4, 0x40(%edx)
340 movdqa %xmm5, 0x50(%edx)
341 movdqa %xmm6, 0x60(%edx)
342 movdqa %xmm7, 0x70(%edx)
345 jge L(shl_0_gobble_mem_loop)
348 jl L(shl_0_mem_less_64bytes)
352 movdqa 0x10(%eax), %xmm1
355 movdqa %xmm1, 0x10(%edx)
357 movdqa 0x20(%eax), %xmm0
358 movdqa 0x30(%eax), %xmm1
361 movdqa %xmm0, 0x20(%edx)
362 movdqa %xmm1, 0x30(%edx)
364 L(shl_0_mem_less_64bytes):
366 jl L(shl_0_mem_less_32bytes)
369 movdqa 0x10(%eax), %xmm1
372 movdqa %xmm1, 0x10(%edx)
374 L(shl_0_mem_less_32bytes):
376 jl L(shl_0_mem_less_16bytes)
382 L(shl_0_mem_less_16bytes):
385 BRANCH_TO_JMPTBL_ENTRY (L(table_48bytes_fwd), %ecx, 4)
390 BRANCH_TO_JMPTBL_ENTRY_VALUE(L(table_48bytes_fwd))
399 movdqa 16(%eax, %edi), %xmm2
401 movdqa 32(%eax, %edi), %xmm3
403 palignr $1, %xmm2, %xmm3
404 palignr $1, %xmm1, %xmm2
406 movdqa %xmm2, -32(%edx, %edi)
407 movdqa %xmm3, -16(%edx, %edi)
411 movdqa 16(%eax, %edi), %xmm2
413 movdqa 32(%eax, %edi), %xmm3
415 palignr $1, %xmm2, %xmm3
416 palignr $1, %xmm4, %xmm2
418 movdqa %xmm2, -32(%edx, %edi)
419 movdqa %xmm3, -16(%edx, %edi)
427 lea 1(%edi, %eax), %eax
429 BRANCH_TO_JMPTBL_ENTRY_TAIL(L(table_48bytes_fwd), %ecx, 4)
433 BRANCH_TO_JMPTBL_ENTRY_VALUE(L(table_48bytes_fwd))
442 movdqa 16(%eax, %edi), %xmm2
444 movdqa 32(%eax, %edi), %xmm3
446 palignr $2, %xmm2, %xmm3
447 palignr $2, %xmm1, %xmm2
449 movdqa %xmm2, -32(%edx, %edi)
450 movdqa %xmm3, -16(%edx, %edi)
454 movdqa 16(%eax, %edi), %xmm2
456 movdqa 32(%eax, %edi), %xmm3
458 palignr $2, %xmm2, %xmm3
459 palignr $2, %xmm4, %xmm2
461 movdqa %xmm2, -32(%edx, %edi)
462 movdqa %xmm3, -16(%edx, %edi)
470 lea 2(%edi, %eax), %eax
472 BRANCH_TO_JMPTBL_ENTRY_TAIL(L(table_48bytes_fwd), %ecx, 4)
476 BRANCH_TO_JMPTBL_ENTRY_VALUE(L(table_48bytes_fwd))
485 movdqa 16(%eax, %edi), %xmm2
487 movdqa 32(%eax, %edi), %xmm3
489 palignr $3, %xmm2, %xmm3
490 palignr $3, %xmm1, %xmm2
492 movdqa %xmm2, -32(%edx, %edi)
493 movdqa %xmm3, -16(%edx, %edi)
497 movdqa 16(%eax, %edi), %xmm2
499 movdqa 32(%eax, %edi), %xmm3
501 palignr $3, %xmm2, %xmm3
502 palignr $3, %xmm4, %xmm2
504 movdqa %xmm2, -32(%edx, %edi)
505 movdqa %xmm3, -16(%edx, %edi)
513 lea 3(%edi, %eax), %eax
515 BRANCH_TO_JMPTBL_ENTRY_TAIL(L(table_48bytes_fwd), %ecx, 4)
519 BRANCH_TO_JMPTBL_ENTRY_VALUE(L(table_48bytes_fwd))
528 movdqa 16(%eax, %edi), %xmm2
530 movdqa 32(%eax, %edi), %xmm3
532 palignr $4, %xmm2, %xmm3
533 palignr $4, %xmm1, %xmm2
535 movdqa %xmm2, -32(%edx, %edi)
536 movdqa %xmm3, -16(%edx, %edi)
540 movdqa 16(%eax, %edi), %xmm2
542 movdqa 32(%eax, %edi), %xmm3
544 palignr $4, %xmm2, %xmm3
545 palignr $4, %xmm4, %xmm2
547 movdqa %xmm2, -32(%edx, %edi)
548 movdqa %xmm3, -16(%edx, %edi)
556 lea 4(%edi, %eax), %eax
558 BRANCH_TO_JMPTBL_ENTRY_TAIL(L(table_48bytes_fwd), %ecx, 4)
562 BRANCH_TO_JMPTBL_ENTRY_VALUE(L(table_48bytes_fwd))
571 movdqa 16(%eax, %edi), %xmm2
573 movdqa 32(%eax, %edi), %xmm3
575 palignr $5, %xmm2, %xmm3
576 palignr $5, %xmm1, %xmm2
578 movdqa %xmm2, -32(%edx, %edi)
579 movdqa %xmm3, -16(%edx, %edi)
583 movdqa 16(%eax, %edi), %xmm2
585 movdqa 32(%eax, %edi), %xmm3
587 palignr $5, %xmm2, %xmm3
588 palignr $5, %xmm4, %xmm2
590 movdqa %xmm2, -32(%edx, %edi)
591 movdqa %xmm3, -16(%edx, %edi)
599 lea 5(%edi, %eax), %eax
601 BRANCH_TO_JMPTBL_ENTRY_TAIL(L(table_48bytes_fwd), %ecx, 4)
606 BRANCH_TO_JMPTBL_ENTRY_VALUE(L(table_48bytes_fwd))
615 movdqa 16(%eax, %edi), %xmm2
617 movdqa 32(%eax, %edi), %xmm3
619 palignr $6, %xmm2, %xmm3
620 palignr $6, %xmm1, %xmm2
622 movdqa %xmm2, -32(%edx, %edi)
623 movdqa %xmm3, -16(%edx, %edi)
627 movdqa 16(%eax, %edi), %xmm2
629 movdqa 32(%eax, %edi), %xmm3
631 palignr $6, %xmm2, %xmm3
632 palignr $6, %xmm4, %xmm2
634 movdqa %xmm2, -32(%edx, %edi)
635 movdqa %xmm3, -16(%edx, %edi)
643 lea 6(%edi, %eax), %eax
645 BRANCH_TO_JMPTBL_ENTRY_TAIL(L(table_48bytes_fwd), %ecx, 4)
649 BRANCH_TO_JMPTBL_ENTRY_VALUE(L(table_48bytes_fwd))
658 movdqa 16(%eax, %edi), %xmm2
660 movdqa 32(%eax, %edi), %xmm3
662 palignr $7, %xmm2, %xmm3
663 palignr $7, %xmm1, %xmm2
665 movdqa %xmm2, -32(%edx, %edi)
666 movdqa %xmm3, -16(%edx, %edi)
670 movdqa 16(%eax, %edi), %xmm2
672 movdqa 32(%eax, %edi), %xmm3
674 palignr $7, %xmm2, %xmm3
675 palignr $7, %xmm4, %xmm2
677 movdqa %xmm2, -32(%edx, %edi)
678 movdqa %xmm3, -16(%edx, %edi)
686 lea 7(%edi, %eax), %eax
688 BRANCH_TO_JMPTBL_ENTRY_TAIL(L(table_48bytes_fwd), %ecx, 4)
692 BRANCH_TO_JMPTBL_ENTRY_VALUE(L(table_48bytes_fwd))
701 movdqa 16(%eax, %edi), %xmm2
703 movdqa 32(%eax, %edi), %xmm3
705 palignr $8, %xmm2, %xmm3
706 palignr $8, %xmm1, %xmm2
708 movdqa %xmm2, -32(%edx, %edi)
709 movdqa %xmm3, -16(%edx, %edi)
713 movdqa 16(%eax, %edi), %xmm2
715 movdqa 32(%eax, %edi), %xmm3
717 palignr $8, %xmm2, %xmm3
718 palignr $8, %xmm4, %xmm2
720 movdqa %xmm2, -32(%edx, %edi)
721 movdqa %xmm3, -16(%edx, %edi)
729 lea 8(%edi, %eax), %eax
731 BRANCH_TO_JMPTBL_ENTRY_TAIL(L(table_48bytes_fwd), %ecx, 4)
735 BRANCH_TO_JMPTBL_ENTRY_VALUE(L(table_48bytes_fwd))
744 movdqa 16(%eax, %edi), %xmm2
746 movdqa 32(%eax, %edi), %xmm3
748 palignr $9, %xmm2, %xmm3
749 palignr $9, %xmm1, %xmm2
751 movdqa %xmm2, -32(%edx, %edi)
752 movdqa %xmm3, -16(%edx, %edi)
756 movdqa 16(%eax, %edi), %xmm2
758 movdqa 32(%eax, %edi), %xmm3
760 palignr $9, %xmm2, %xmm3
761 palignr $9, %xmm4, %xmm2
763 movdqa %xmm2, -32(%edx, %edi)
764 movdqa %xmm3, -16(%edx, %edi)
772 lea 9(%edi, %eax), %eax
774 BRANCH_TO_JMPTBL_ENTRY_TAIL(L(table_48bytes_fwd), %ecx, 4)
778 BRANCH_TO_JMPTBL_ENTRY_VALUE(L(table_48bytes_fwd))
787 movdqa 16(%eax, %edi), %xmm2
789 movdqa 32(%eax, %edi), %xmm3
791 palignr $10, %xmm2, %xmm3
792 palignr $10, %xmm1, %xmm2
794 movdqa %xmm2, -32(%edx, %edi)
795 movdqa %xmm3, -16(%edx, %edi)
799 movdqa 16(%eax, %edi), %xmm2
801 movdqa 32(%eax, %edi), %xmm3
803 palignr $10, %xmm2, %xmm3
804 palignr $10, %xmm4, %xmm2
806 movdqa %xmm2, -32(%edx, %edi)
807 movdqa %xmm3, -16(%edx, %edi)
815 lea 10(%edi, %eax), %eax
817 BRANCH_TO_JMPTBL_ENTRY_TAIL(L(table_48bytes_fwd), %ecx, 4)
821 BRANCH_TO_JMPTBL_ENTRY_VALUE(L(table_48bytes_fwd))
830 movdqa 16(%eax, %edi), %xmm2
832 movdqa 32(%eax, %edi), %xmm3
834 palignr $11, %xmm2, %xmm3
835 palignr $11, %xmm1, %xmm2
837 movdqa %xmm2, -32(%edx, %edi)
838 movdqa %xmm3, -16(%edx, %edi)
842 movdqa 16(%eax, %edi), %xmm2
844 movdqa 32(%eax, %edi), %xmm3
846 palignr $11, %xmm2, %xmm3
847 palignr $11, %xmm4, %xmm2
849 movdqa %xmm2, -32(%edx, %edi)
850 movdqa %xmm3, -16(%edx, %edi)
858 lea 11(%edi, %eax), %eax
860 BRANCH_TO_JMPTBL_ENTRY_TAIL(L(table_48bytes_fwd), %ecx, 4)
864 BRANCH_TO_JMPTBL_ENTRY_VALUE(L(table_48bytes_fwd))
873 movdqa 16(%eax, %edi), %xmm2
875 movdqa 32(%eax, %edi), %xmm3
877 palignr $12, %xmm2, %xmm3
878 palignr $12, %xmm1, %xmm2
880 movdqa %xmm2, -32(%edx, %edi)
881 movdqa %xmm3, -16(%edx, %edi)
885 movdqa 16(%eax, %edi), %xmm2
887 movdqa 32(%eax, %edi), %xmm3
889 palignr $12, %xmm2, %xmm3
890 palignr $12, %xmm4, %xmm2
892 movdqa %xmm2, -32(%edx, %edi)
893 movdqa %xmm3, -16(%edx, %edi)
901 lea 12(%edi, %eax), %eax
903 BRANCH_TO_JMPTBL_ENTRY_TAIL(L(table_48bytes_fwd), %ecx, 4)
907 BRANCH_TO_JMPTBL_ENTRY_VALUE(L(table_48bytes_fwd))
916 movdqa 16(%eax, %edi), %xmm2
918 movdqa 32(%eax, %edi), %xmm3
920 palignr $13, %xmm2, %xmm3
921 palignr $13, %xmm1, %xmm2
923 movdqa %xmm2, -32(%edx, %edi)
924 movdqa %xmm3, -16(%edx, %edi)
928 movdqa 16(%eax, %edi), %xmm2
930 movdqa 32(%eax, %edi), %xmm3
932 palignr $13, %xmm2, %xmm3
933 palignr $13, %xmm4, %xmm2
935 movdqa %xmm2, -32(%edx, %edi)
936 movdqa %xmm3, -16(%edx, %edi)
944 lea 13(%edi, %eax), %eax
946 BRANCH_TO_JMPTBL_ENTRY_TAIL(L(table_48bytes_fwd), %ecx, 4)
950 BRANCH_TO_JMPTBL_ENTRY_VALUE(L(table_48bytes_fwd))
959 movdqa 16(%eax, %edi), %xmm2
961 movdqa 32(%eax, %edi), %xmm3
963 palignr $14, %xmm2, %xmm3
964 palignr $14, %xmm1, %xmm2
966 movdqa %xmm2, -32(%edx, %edi)
967 movdqa %xmm3, -16(%edx, %edi)
971 movdqa 16(%eax, %edi), %xmm2
973 movdqa 32(%eax, %edi), %xmm3
975 palignr $14, %xmm2, %xmm3
976 palignr $14, %xmm4, %xmm2
978 movdqa %xmm2, -32(%edx, %edi)
979 movdqa %xmm3, -16(%edx, %edi)
987 lea 14(%edi, %eax), %eax
989 BRANCH_TO_JMPTBL_ENTRY_TAIL(L(table_48bytes_fwd), %ecx, 4)
994 BRANCH_TO_JMPTBL_ENTRY_VALUE(L(table_48bytes_fwd))
1003 movdqa 16(%eax, %edi), %xmm2
1005 movdqa 32(%eax, %edi), %xmm3
1007 palignr $15, %xmm2, %xmm3
1008 palignr $15, %xmm1, %xmm2
1010 movdqa %xmm2, -32(%edx, %edi)
1011 movdqa %xmm3, -16(%edx, %edi)
1015 movdqa 16(%eax, %edi), %xmm2
1017 movdqa 32(%eax, %edi), %xmm3
1019 palignr $15, %xmm2, %xmm3
1020 palignr $15, %xmm4, %xmm2
1022 movdqa %xmm2, -32(%edx, %edi)
1023 movdqa %xmm3, -16(%edx, %edi)
1031 lea 15(%edi, %eax), %eax
1033 BRANCH_TO_JMPTBL_ENTRY_TAIL(L(table_48bytes_fwd), %ecx, 4)
1037 L(fwd_write_44bytes):
1038 movl -44(%eax), %ecx
1039 movl %ecx, -44(%edx)
1040 L(fwd_write_40bytes):
1041 movl -40(%eax), %ecx
1042 movl %ecx, -40(%edx)
1043 L(fwd_write_36bytes):
1044 movl -36(%eax), %ecx
1045 movl %ecx, -36(%edx)
1046 L(fwd_write_32bytes):
1047 movl -32(%eax), %ecx
1048 movl %ecx, -32(%edx)
1049 L(fwd_write_28bytes):
1050 movl -28(%eax), %ecx
1051 movl %ecx, -28(%edx)
1052 L(fwd_write_24bytes):
1053 movl -24(%eax), %ecx
1054 movl %ecx, -24(%edx)
1055 L(fwd_write_20bytes):
1056 movl -20(%eax), %ecx
1057 movl %ecx, -20(%edx)
1058 L(fwd_write_16bytes):
1059 movl -16(%eax), %ecx
1060 movl %ecx, -16(%edx)
1061 L(fwd_write_12bytes):
1062 movl -12(%eax), %ecx
1063 movl %ecx, -12(%edx)
1064 L(fwd_write_8bytes):
1067 L(fwd_write_4bytes):
1070 L(fwd_write_0bytes):
1071 #ifndef USE_AS_BCOPY
1072 # ifdef USE_AS_MEMPCPY
1075 movl DEST(%esp), %eax
1081 L(fwd_write_5bytes):
1086 #ifndef USE_AS_BCOPY
1087 # ifdef USE_AS_MEMPCPY
1090 movl DEST(%esp), %eax
1096 L(fwd_write_45bytes):
1097 movl -45(%eax), %ecx
1098 movl %ecx, -45(%edx)
1099 L(fwd_write_41bytes):
1100 movl -41(%eax), %ecx
1101 movl %ecx, -41(%edx)
1102 L(fwd_write_37bytes):
1103 movl -37(%eax), %ecx
1104 movl %ecx, -37(%edx)
1105 L(fwd_write_33bytes):
1106 movl -33(%eax), %ecx
1107 movl %ecx, -33(%edx)
1108 L(fwd_write_29bytes):
1109 movl -29(%eax), %ecx
1110 movl %ecx, -29(%edx)
1111 L(fwd_write_25bytes):
1112 movl -25(%eax), %ecx
1113 movl %ecx, -25(%edx)
1114 L(fwd_write_21bytes):
1115 movl -21(%eax), %ecx
1116 movl %ecx, -21(%edx)
1117 L(fwd_write_17bytes):
1118 movl -17(%eax), %ecx
1119 movl %ecx, -17(%edx)
1120 L(fwd_write_13bytes):
1121 movl -13(%eax), %ecx
1122 movl %ecx, -13(%edx)
1123 L(fwd_write_9bytes):
1128 L(fwd_write_1bytes):
1129 movzbl -1(%eax), %ecx
1131 #ifndef USE_AS_BCOPY
1132 # ifdef USE_AS_MEMPCPY
1135 movl DEST(%esp), %eax
1141 L(fwd_write_46bytes):
1142 movl -46(%eax), %ecx
1143 movl %ecx, -46(%edx)
1144 L(fwd_write_42bytes):
1145 movl -42(%eax), %ecx
1146 movl %ecx, -42(%edx)
1147 L(fwd_write_38bytes):
1148 movl -38(%eax), %ecx
1149 movl %ecx, -38(%edx)
1150 L(fwd_write_34bytes):
1151 movl -34(%eax), %ecx
1152 movl %ecx, -34(%edx)
1153 L(fwd_write_30bytes):
1154 movl -30(%eax), %ecx
1155 movl %ecx, -30(%edx)
1156 L(fwd_write_26bytes):
1157 movl -26(%eax), %ecx
1158 movl %ecx, -26(%edx)
1159 L(fwd_write_22bytes):
1160 movl -22(%eax), %ecx
1161 movl %ecx, -22(%edx)
1162 L(fwd_write_18bytes):
1163 movl -18(%eax), %ecx
1164 movl %ecx, -18(%edx)
1165 L(fwd_write_14bytes):
1166 movl -14(%eax), %ecx
1167 movl %ecx, -14(%edx)
1168 L(fwd_write_10bytes):
1169 movl -10(%eax), %ecx
1170 movl %ecx, -10(%edx)
1171 L(fwd_write_6bytes):
1174 L(fwd_write_2bytes):
1175 movzwl -2(%eax), %ecx
1177 #ifndef USE_AS_BCOPY
1178 # ifdef USE_AS_MEMPCPY
1181 movl DEST(%esp), %eax
1187 L(fwd_write_47bytes):
1188 movl -47(%eax), %ecx
1189 movl %ecx, -47(%edx)
1190 L(fwd_write_43bytes):
1191 movl -43(%eax), %ecx
1192 movl %ecx, -43(%edx)
1193 L(fwd_write_39bytes):
1194 movl -39(%eax), %ecx
1195 movl %ecx, -39(%edx)
1196 L(fwd_write_35bytes):
1197 movl -35(%eax), %ecx
1198 movl %ecx, -35(%edx)
1199 L(fwd_write_31bytes):
1200 movl -31(%eax), %ecx
1201 movl %ecx, -31(%edx)
1202 L(fwd_write_27bytes):
1203 movl -27(%eax), %ecx
1204 movl %ecx, -27(%edx)
1205 L(fwd_write_23bytes):
1206 movl -23(%eax), %ecx
1207 movl %ecx, -23(%edx)
1208 L(fwd_write_19bytes):
1209 movl -19(%eax), %ecx
1210 movl %ecx, -19(%edx)
1211 L(fwd_write_15bytes):
1212 movl -15(%eax), %ecx
1213 movl %ecx, -15(%edx)
1214 L(fwd_write_11bytes):
1215 movl -11(%eax), %ecx
1216 movl %ecx, -11(%edx)
1217 L(fwd_write_7bytes):
1220 L(fwd_write_3bytes):
1221 movzwl -3(%eax), %ecx
1222 movzbl -1(%eax), %eax
1225 #ifndef USE_AS_BCOPY
1226 # ifdef USE_AS_MEMPCPY
1229 movl DEST(%esp), %eax
1236 movdqu (%eax), %xmm1
1238 movdqu %xmm0, (%esi)
1239 movntdq %xmm1, (%edx)
1242 lea -0x90(%ecx), %ecx
1245 movdqu (%eax), %xmm0
1246 movdqu 0x10(%eax), %xmm1
1247 movdqu 0x20(%eax), %xmm2
1248 movdqu 0x30(%eax), %xmm3
1249 movdqu 0x40(%eax), %xmm4
1250 movdqu 0x50(%eax), %xmm5
1251 movdqu 0x60(%eax), %xmm6
1252 movdqu 0x70(%eax), %xmm7
1253 lea 0x80(%eax), %eax
1256 movntdq %xmm0, (%edx)
1257 movntdq %xmm1, 0x10(%edx)
1258 movntdq %xmm2, 0x20(%edx)
1259 movntdq %xmm3, 0x30(%edx)
1260 movntdq %xmm4, 0x40(%edx)
1261 movntdq %xmm5, 0x50(%edx)
1262 movntdq %xmm6, 0x60(%edx)
1263 movntdq %xmm7, 0x70(%edx)
1264 lea 0x80(%edx), %edx
1265 jae L(large_page_loop)
1267 lea 0x80(%ecx), %ecx
1268 jl L(large_page_less_64bytes)
1270 movdqu (%eax), %xmm0
1271 movdqu 0x10(%eax), %xmm1
1272 movdqu 0x20(%eax), %xmm2
1273 movdqu 0x30(%eax), %xmm3
1274 lea 0x40(%eax), %eax
1276 movntdq %xmm0, (%edx)
1277 movntdq %xmm1, 0x10(%edx)
1278 movntdq %xmm2, 0x20(%edx)
1279 movntdq %xmm3, 0x30(%edx)
1280 lea 0x40(%edx), %edx
1282 L(large_page_less_64bytes):
1284 jl L(large_page_less_32bytes)
1285 movdqu (%eax), %xmm0
1286 movdqu 0x10(%eax), %xmm1
1287 lea 0x20(%eax), %eax
1288 movntdq %xmm0, (%edx)
1289 movntdq %xmm1, 0x10(%edx)
1290 lea 0x20(%edx), %edx
1292 L(large_page_less_32bytes):
1296 BRANCH_TO_JMPTBL_ENTRY (L(table_48bytes_fwd), %ecx, 4)
1300 L(bk_write_44bytes):
1303 L(bk_write_40bytes):
1306 L(bk_write_36bytes):
1309 L(bk_write_32bytes):
1312 L(bk_write_28bytes):
1315 L(bk_write_24bytes):
1318 L(bk_write_20bytes):
1321 L(bk_write_16bytes):
1324 L(bk_write_12bytes):
1334 #ifndef USE_AS_BCOPY
1335 movl DEST(%esp), %eax
1336 # ifdef USE_AS_MEMPCPY
1337 movl LEN(%esp), %ecx
1344 L(bk_write_45bytes):
1347 L(bk_write_41bytes):
1350 L(bk_write_37bytes):
1353 L(bk_write_33bytes):
1356 L(bk_write_29bytes):
1359 L(bk_write_25bytes):
1362 L(bk_write_21bytes):
1365 L(bk_write_17bytes):
1368 L(bk_write_13bytes):
1380 #ifndef USE_AS_BCOPY
1381 movl DEST(%esp), %eax
1382 # ifdef USE_AS_MEMPCPY
1383 movl LEN(%esp), %ecx
1390 L(bk_write_46bytes):
1393 L(bk_write_42bytes):
1396 L(bk_write_38bytes):
1399 L(bk_write_34bytes):
1402 L(bk_write_30bytes):
1405 L(bk_write_26bytes):
1408 L(bk_write_22bytes):
1411 L(bk_write_18bytes):
1414 L(bk_write_14bytes):
1417 L(bk_write_10bytes):
1426 #ifndef USE_AS_BCOPY
1427 movl DEST(%esp), %eax
1428 # ifdef USE_AS_MEMPCPY
1429 movl LEN(%esp), %ecx
1436 L(bk_write_47bytes):
1439 L(bk_write_43bytes):
1442 L(bk_write_39bytes):
1445 L(bk_write_35bytes):
1448 L(bk_write_31bytes):
1451 L(bk_write_27bytes):
1454 L(bk_write_23bytes):
1457 L(bk_write_19bytes):
1460 L(bk_write_15bytes):
1463 L(bk_write_11bytes):
1470 movzwl 1(%eax), %ecx
1474 #ifndef USE_AS_BCOPY
1475 movl DEST(%esp), %eax
1476 # ifdef USE_AS_MEMPCPY
1477 movl LEN(%esp), %ecx
1484 .pushsection .rodata.ssse3,"a",@progbits
1486 L(table_48bytes_fwd):
1487 .int JMPTBL (L(fwd_write_0bytes), L(table_48bytes_fwd))
1488 .int JMPTBL (L(fwd_write_1bytes), L(table_48bytes_fwd))
1489 .int JMPTBL (L(fwd_write_2bytes), L(table_48bytes_fwd))
1490 .int JMPTBL (L(fwd_write_3bytes), L(table_48bytes_fwd))
1491 .int JMPTBL (L(fwd_write_4bytes), L(table_48bytes_fwd))
1492 .int JMPTBL (L(fwd_write_5bytes), L(table_48bytes_fwd))
1493 .int JMPTBL (L(fwd_write_6bytes), L(table_48bytes_fwd))
1494 .int JMPTBL (L(fwd_write_7bytes), L(table_48bytes_fwd))
1495 .int JMPTBL (L(fwd_write_8bytes), L(table_48bytes_fwd))
1496 .int JMPTBL (L(fwd_write_9bytes), L(table_48bytes_fwd))
1497 .int JMPTBL (L(fwd_write_10bytes), L(table_48bytes_fwd))
1498 .int JMPTBL (L(fwd_write_11bytes), L(table_48bytes_fwd))
1499 .int JMPTBL (L(fwd_write_12bytes), L(table_48bytes_fwd))
1500 .int JMPTBL (L(fwd_write_13bytes), L(table_48bytes_fwd))
1501 .int JMPTBL (L(fwd_write_14bytes), L(table_48bytes_fwd))
1502 .int JMPTBL (L(fwd_write_15bytes), L(table_48bytes_fwd))
1503 .int JMPTBL (L(fwd_write_16bytes), L(table_48bytes_fwd))
1504 .int JMPTBL (L(fwd_write_17bytes), L(table_48bytes_fwd))
1505 .int JMPTBL (L(fwd_write_18bytes), L(table_48bytes_fwd))
1506 .int JMPTBL (L(fwd_write_19bytes), L(table_48bytes_fwd))
1507 .int JMPTBL (L(fwd_write_20bytes), L(table_48bytes_fwd))
1508 .int JMPTBL (L(fwd_write_21bytes), L(table_48bytes_fwd))
1509 .int JMPTBL (L(fwd_write_22bytes), L(table_48bytes_fwd))
1510 .int JMPTBL (L(fwd_write_23bytes), L(table_48bytes_fwd))
1511 .int JMPTBL (L(fwd_write_24bytes), L(table_48bytes_fwd))
1512 .int JMPTBL (L(fwd_write_25bytes), L(table_48bytes_fwd))
1513 .int JMPTBL (L(fwd_write_26bytes), L(table_48bytes_fwd))
1514 .int JMPTBL (L(fwd_write_27bytes), L(table_48bytes_fwd))
1515 .int JMPTBL (L(fwd_write_28bytes), L(table_48bytes_fwd))
1516 .int JMPTBL (L(fwd_write_29bytes), L(table_48bytes_fwd))
1517 .int JMPTBL (L(fwd_write_30bytes), L(table_48bytes_fwd))
1518 .int JMPTBL (L(fwd_write_31bytes), L(table_48bytes_fwd))
1519 .int JMPTBL (L(fwd_write_32bytes), L(table_48bytes_fwd))
1520 .int JMPTBL (L(fwd_write_33bytes), L(table_48bytes_fwd))
1521 .int JMPTBL (L(fwd_write_34bytes), L(table_48bytes_fwd))
1522 .int JMPTBL (L(fwd_write_35bytes), L(table_48bytes_fwd))
1523 .int JMPTBL (L(fwd_write_36bytes), L(table_48bytes_fwd))
1524 .int JMPTBL (L(fwd_write_37bytes), L(table_48bytes_fwd))
1525 .int JMPTBL (L(fwd_write_38bytes), L(table_48bytes_fwd))
1526 .int JMPTBL (L(fwd_write_39bytes), L(table_48bytes_fwd))
1527 .int JMPTBL (L(fwd_write_40bytes), L(table_48bytes_fwd))
1528 .int JMPTBL (L(fwd_write_41bytes), L(table_48bytes_fwd))
1529 .int JMPTBL (L(fwd_write_42bytes), L(table_48bytes_fwd))
1530 .int JMPTBL (L(fwd_write_43bytes), L(table_48bytes_fwd))
1531 .int JMPTBL (L(fwd_write_44bytes), L(table_48bytes_fwd))
1532 .int JMPTBL (L(fwd_write_45bytes), L(table_48bytes_fwd))
1533 .int JMPTBL (L(fwd_write_46bytes), L(table_48bytes_fwd))
1534 .int JMPTBL (L(fwd_write_47bytes), L(table_48bytes_fwd))
1538 .int JMPTBL (L(shl_0), L(shl_table))
1539 .int JMPTBL (L(shl_1), L(shl_table))
1540 .int JMPTBL (L(shl_2), L(shl_table))
1541 .int JMPTBL (L(shl_3), L(shl_table))
1542 .int JMPTBL (L(shl_4), L(shl_table))
1543 .int JMPTBL (L(shl_5), L(shl_table))
1544 .int JMPTBL (L(shl_6), L(shl_table))
1545 .int JMPTBL (L(shl_7), L(shl_table))
1546 .int JMPTBL (L(shl_8), L(shl_table))
1547 .int JMPTBL (L(shl_9), L(shl_table))
1548 .int JMPTBL (L(shl_10), L(shl_table))
1549 .int JMPTBL (L(shl_11), L(shl_table))
1550 .int JMPTBL (L(shl_12), L(shl_table))
1551 .int JMPTBL (L(shl_13), L(shl_table))
1552 .int JMPTBL (L(shl_14), L(shl_table))
1553 .int JMPTBL (L(shl_15), L(shl_table))
1556 L(table_48_bytes_bwd):
1557 .int JMPTBL (L(bk_write_0bytes), L(table_48_bytes_bwd))
1558 .int JMPTBL (L(bk_write_1bytes), L(table_48_bytes_bwd))
1559 .int JMPTBL (L(bk_write_2bytes), L(table_48_bytes_bwd))
1560 .int JMPTBL (L(bk_write_3bytes), L(table_48_bytes_bwd))
1561 .int JMPTBL (L(bk_write_4bytes), L(table_48_bytes_bwd))
1562 .int JMPTBL (L(bk_write_5bytes), L(table_48_bytes_bwd))
1563 .int JMPTBL (L(bk_write_6bytes), L(table_48_bytes_bwd))
1564 .int JMPTBL (L(bk_write_7bytes), L(table_48_bytes_bwd))
1565 .int JMPTBL (L(bk_write_8bytes), L(table_48_bytes_bwd))
1566 .int JMPTBL (L(bk_write_9bytes), L(table_48_bytes_bwd))
1567 .int JMPTBL (L(bk_write_10bytes), L(table_48_bytes_bwd))
1568 .int JMPTBL (L(bk_write_11bytes), L(table_48_bytes_bwd))
1569 .int JMPTBL (L(bk_write_12bytes), L(table_48_bytes_bwd))
1570 .int JMPTBL (L(bk_write_13bytes), L(table_48_bytes_bwd))
1571 .int JMPTBL (L(bk_write_14bytes), L(table_48_bytes_bwd))
1572 .int JMPTBL (L(bk_write_15bytes), L(table_48_bytes_bwd))
1573 .int JMPTBL (L(bk_write_16bytes), L(table_48_bytes_bwd))
1574 .int JMPTBL (L(bk_write_17bytes), L(table_48_bytes_bwd))
1575 .int JMPTBL (L(bk_write_18bytes), L(table_48_bytes_bwd))
1576 .int JMPTBL (L(bk_write_19bytes), L(table_48_bytes_bwd))
1577 .int JMPTBL (L(bk_write_20bytes), L(table_48_bytes_bwd))
1578 .int JMPTBL (L(bk_write_21bytes), L(table_48_bytes_bwd))
1579 .int JMPTBL (L(bk_write_22bytes), L(table_48_bytes_bwd))
1580 .int JMPTBL (L(bk_write_23bytes), L(table_48_bytes_bwd))
1581 .int JMPTBL (L(bk_write_24bytes), L(table_48_bytes_bwd))
1582 .int JMPTBL (L(bk_write_25bytes), L(table_48_bytes_bwd))
1583 .int JMPTBL (L(bk_write_26bytes), L(table_48_bytes_bwd))
1584 .int JMPTBL (L(bk_write_27bytes), L(table_48_bytes_bwd))
1585 .int JMPTBL (L(bk_write_28bytes), L(table_48_bytes_bwd))
1586 .int JMPTBL (L(bk_write_29bytes), L(table_48_bytes_bwd))
1587 .int JMPTBL (L(bk_write_30bytes), L(table_48_bytes_bwd))
1588 .int JMPTBL (L(bk_write_31bytes), L(table_48_bytes_bwd))
1589 .int JMPTBL (L(bk_write_32bytes), L(table_48_bytes_bwd))
1590 .int JMPTBL (L(bk_write_33bytes), L(table_48_bytes_bwd))
1591 .int JMPTBL (L(bk_write_34bytes), L(table_48_bytes_bwd))
1592 .int JMPTBL (L(bk_write_35bytes), L(table_48_bytes_bwd))
1593 .int JMPTBL (L(bk_write_36bytes), L(table_48_bytes_bwd))
1594 .int JMPTBL (L(bk_write_37bytes), L(table_48_bytes_bwd))
1595 .int JMPTBL (L(bk_write_38bytes), L(table_48_bytes_bwd))
1596 .int JMPTBL (L(bk_write_39bytes), L(table_48_bytes_bwd))
1597 .int JMPTBL (L(bk_write_40bytes), L(table_48_bytes_bwd))
1598 .int JMPTBL (L(bk_write_41bytes), L(table_48_bytes_bwd))
1599 .int JMPTBL (L(bk_write_42bytes), L(table_48_bytes_bwd))
1600 .int JMPTBL (L(bk_write_43bytes), L(table_48_bytes_bwd))
1601 .int JMPTBL (L(bk_write_44bytes), L(table_48_bytes_bwd))
1602 .int JMPTBL (L(bk_write_45bytes), L(table_48_bytes_bwd))
1603 .int JMPTBL (L(bk_write_46bytes), L(table_48_bytes_bwd))
1604 .int JMPTBL (L(bk_write_47bytes), L(table_48_bytes_bwd))
1608 #ifdef USE_AS_MEMMOVE
1613 lea (%ecx,%edx,1),%edx
1614 lea (%ecx,%esi,1),%esi
1620 jge L(bk_write_more64bytes)
1622 L(bk_write_64bytesless):
1624 jl L(bk_write_less32bytes)
1626 L(bk_write_more32bytes):
1627 /* Copy 32 bytes at a time. */
1633 movl -12(%esi), %eax
1634 movl %eax, -12(%edx)
1635 movl -16(%esi), %eax
1636 movl %eax, -16(%edx)
1637 movl -20(%esi), %eax
1638 movl %eax, -20(%edx)
1639 movl -24(%esi), %eax
1640 movl %eax, -24(%edx)
1641 movl -28(%esi), %eax
1642 movl %eax, -28(%edx)
1643 movl -32(%esi), %eax
1644 movl %eax, -32(%edx)
1648 L(bk_write_less32bytes):
1653 L(bk_write_less32bytes_2):
1654 BRANCH_TO_JMPTBL_ENTRY (L(table_48_bytes_bwd), %ecx, 4)
1659 jle L(bk_write_less32bytes)
1661 /* We get here only if (EDX & 3 ) != 0 so if (EDX & 1) ==0,
1662 then (EDX & 2) must be != 0. */
1682 L(bk_write_more64bytes):
1683 /* Check alignment of last byte. */
1685 jz L(bk_ssse3_cpy_pre)
1687 /* EDX is aligned 4 bytes, but not 16 bytes. */
1696 jz L(bk_ssse3_cpy_pre)
1705 jz L(bk_ssse3_cpy_pre)
1713 L(bk_ssse3_cpy_pre):
1715 jl L(bk_write_more32bytes)
1721 movdqu 0x30(%esi), %xmm3
1722 movdqa %xmm3, 0x30(%edx)
1723 movdqu 0x20(%esi), %xmm2
1724 movdqa %xmm2, 0x20(%edx)
1725 movdqu 0x10(%esi), %xmm1
1726 movdqa %xmm1, 0x10(%edx)
1727 movdqu (%esi), %xmm0
1728 movdqa %xmm0, (%edx)
1731 jmp L(bk_write_64bytesless)