2 Copyright (C) 2011-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
19 #include <isa-level.h>
21 /* MINIMUM_X86_ISA_LEVEL <= 2 because there is no V2 implementation
22 so we need this to build for ISA V2 builds. */
23 #if ISA_SHOULD_BUILD (2)
29 # define STRCAT __strcat_sse2_unaligned
32 # define USE_AS_STRCAT
37 # ifdef USE_AS_STRNCAT
39 /* Clear the upper 32 bits. */
45 /* Inline corresponding strlen file, temporary until new strcpy
46 implementation gets merged. */
78 pcmpeqb 16(%rax), %xmm0
83 pcmpeqb 32(%rax), %xmm1
88 pcmpeqb 48(%rax), %xmm2
93 pcmpeqb 64(%rax), %xmm3
98 pcmpeqb 80(%rax), %xmm0
104 pcmpeqb 32(%rax), %xmm1
109 pcmpeqb 48(%rax), %xmm2
114 pcmpeqb 64(%rax), %xmm3
119 pcmpeqb 80(%rax), %xmm0
125 pcmpeqb 32(%rax), %xmm1
130 pcmpeqb 48(%rax), %xmm2
135 pcmpeqb 64(%rax), %xmm3
140 pcmpeqb 80(%rax), %xmm0
146 pcmpeqb 32(%rax), %xmm1
151 pcmpeqb 48(%rax), %xmm2
156 pcmpeqb 64(%rax), %xmm3
164 pcmpeqb 80(%rax), %xmm0
173 pcmpeqb 16(%rax), %xmm1
182 pcmpeqb 16(%rax), %xmm2
191 pcmpeqb 16(%rax), %xmm3
201 pminub 16(%rax), %xmm4
202 movaps 32(%rax), %xmm5
203 pminub 48(%rax), %xmm5
211 pcmpeqb -64(%rax), %xmm0
217 pcmpeqb 32(%rax), %xmm1
222 pcmpeqb 48(%rax), %xmm2
227 pcmpeqb 64(%rax), %xmm3
233 jmp L(StartStrcpyPart)
241 jmp L(StartStrcpyPart)
249 jmp L(StartStrcpyPart)
257 jmp L(StartStrcpyPart)
265 jmp L(StartStrcpyPart)
276 lea (%r9, %rax), %rdi
278 mov %r9, %rax /* save result */
280 # ifdef USE_AS_STRNCAT
283 # define USE_AS_STRNCPY
286 # include "strcpy-sse2-unaligned.S"