]>
Commit | Line | Data |
---|---|---|
99710781 LD |
1 | /* strcat with SSE2 |
2 | Copyright (C) 2011 Free Software Foundation, Inc. | |
3 | Contributed by Intel Corporation. | |
4 | This file is part of the GNU C Library. | |
5 | ||
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. | |
10 | ||
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. | |
15 | ||
16 | You should have received a copy of the GNU Lesser General Public | |
59ba27a6 PE |
17 | License along with the GNU C Library; if not, see |
18 | <http://www.gnu.org/licenses/>. */ | |
99710781 LD |
19 | |
20 | #ifndef NOT_IN_libc | |
21 | ||
22 | # include <sysdep.h> | |
23 | ||
24 | # ifndef STRCAT | |
25 | # define STRCAT __strcat_sse2_unaligned | |
26 | # endif | |
27 | ||
28 | # define USE_AS_STRCAT | |
29 | ||
30 | .text | |
31 | ENTRY (STRCAT) | |
32 | mov %rdi, %r9 | |
33 | # ifdef USE_AS_STRNCAT | |
34 | mov %rdx, %r8 | |
35 | # endif | |
36 | ||
37 | # define RETURN jmp L(StartStrcpyPart) | |
38 | # include "strlen-sse2-pminub.S" | |
39 | # undef RETURN | |
40 | ||
41 | L(StartStrcpyPart): | |
42 | lea (%r9, %rax), %rdi | |
43 | mov %rsi, %rcx | |
44 | mov %r9, %rax /* save result */ | |
45 | ||
46 | # ifdef USE_AS_STRNCAT | |
47 | test %r8, %r8 | |
48 | jz L(ExitZero) | |
49 | # define USE_AS_STRNCPY | |
50 | # endif | |
51 | ||
52 | # include "strcpy-sse2-unaligned.S" | |
53 | #endif |