summaryrefslogtreecommitdiff
path: root/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/x86_64/multiarch/memcpy-ssse3-back.S')
-rw-r--r--sysdeps/x86_64/multiarch/memcpy-ssse3-back.S29
1 files changed, 21 insertions, 8 deletions
diff --git a/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S b/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S
index 08b41e9e5a..3cd1123326 100644
--- a/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S
+++ b/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S
@@ -1,5 +1,5 @@
/* memcpy with SSSE3 and REP string
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -19,16 +19,15 @@
#include <sysdep.h>
-#if IS_IN (libc) \
- && (defined SHARED \
- || defined USE_AS_MEMMOVE \
- || !defined USE_MULTIARCH)
+#if IS_IN (libc)
#include "asm-syntax.h"
#ifndef MEMCPY
# define MEMCPY __memcpy_ssse3_back
# define MEMCPY_CHK __memcpy_chk_ssse3_back
+# define MEMPCPY __mempcpy_ssse3_back
+# define MEMPCPY_CHK __mempcpy_chk_ssse3_back
#endif
#define JMPTBL(I, B) I - B
@@ -40,10 +39,23 @@
lea TABLE(%rip), %r11; \
movslq (%r11, INDEX, SCALE), INDEX; \
lea (%r11, INDEX), INDEX; \
- jmp *INDEX; \
+ _CET_NOTRACK jmp *INDEX; \
ud2
.section .text.ssse3,"ax",@progbits
+#if !defined USE_AS_MEMPCPY && !defined USE_AS_MEMMOVE
+ENTRY (MEMPCPY_CHK)
+ cmpq %rdx, %rcx
+ jb HIDDEN_JUMPTARGET (__chk_fail)
+END (MEMPCPY_CHK)
+
+ENTRY (MEMPCPY)
+ movq %rdi, %rax
+ addq %rdx, %rax
+ jmp L(start)
+END (MEMPCPY)
+#endif
+
#if !defined USE_AS_BCOPY
ENTRY (MEMCPY_CHK)
cmpq %rdx, %rcx
@@ -66,6 +78,7 @@ ENTRY (MEMCPY)
BRANCH_TO_JMPTBL_ENTRY (L(table_144_bytes_bwd), %rdx, 4)
L(copy_forward):
#endif
+L(start):
cmp $144, %rdx
jae L(144bytesormore)
@@ -112,7 +125,7 @@ L(144bytesormore):
sub $0x80, %rdx
movslq (%r11, %r9, 4), %r9
add %r11, %r9
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
.p2align 4
@@ -142,7 +155,7 @@ L(copy_backward):
sub $0x80, %rdx
movslq (%r11, %r9, 4), %r9
add %r11, %r9
- jmp *%r9
+ _CET_NOTRACK jmp *%r9
ud2
.p2align 4