about summary refs log tree commit diff
path: root/sysdeps/x86_64/strrchr.S
diff options
context:
space:
mode:
authorLiubov Dmitrieva <ldmitrie@sourceware.org>2013-08-30 18:37:28 +0400
committerLiubov Dmitrieva <ldmitrie@sourceware.org>2013-10-23 23:51:44 +0400
commit029183a4ca3f765f63e7b64bc260622f02b04539 (patch)
treec7f6912d9575e27f691f219ad9437e9af39e016e /sysdeps/x86_64/strrchr.S
parent01d5454d13d2c21b9a08b28441d37a7ddce089a6 (diff)
downloadglibc-ldmitrie/intel_mpx.tar.gz
glibc-ldmitrie/intel_mpx.tar.xz
glibc-ldmitrie/intel_mpx.zip
Implemented bound check support for string/memory routines for x86_64. ldmitrie/intel_mpx
TODO: Fix bound check support in strcmp-sse2 and implement in strspn, strstr and strcspn.
Diffstat (limited to 'sysdeps/x86_64/strrchr.S')
-rw-r--r--sysdeps/x86_64/strrchr.S13
1 files changed, 12 insertions, 1 deletions
diff --git a/sysdeps/x86_64/strrchr.S b/sysdeps/x86_64/strrchr.S
index e413b07438..0bd3405b6b 100644
--- a/sysdeps/x86_64/strrchr.S
+++ b/sysdeps/x86_64/strrchr.S
@@ -22,6 +22,10 @@
 
 	.text
 ENTRY (strrchr)
+# ifdef __CHKP__
+	bndcl	(%rdi), %bnd0
+	bndcu	(%rdi), %bnd0
+# endif
 	movd	%esi, %xmm1
 	movq	%rdi, %rcx
 	punpcklbw %xmm1, %xmm1
@@ -46,7 +50,11 @@ ENTRY (strrchr)
 	orl	%ecx, %esi
 	jnz	1f
 
-2:	movdqa	(%rdi), %xmm0
+2:
+# ifdef __CHKP__
+	bndcu	(%rdi), %bnd0
+# endif
+	movdqa	(%rdi), %xmm0
 	leaq	16(%rdi), %rdi
 	movdqa	%xmm0, %xmm3
 	pcmpeqb	%xmm1, %xmm0
@@ -73,6 +81,9 @@ ENTRY (strrchr)
 	bsrl	%edx, %edx
 	jz	4f
 	leaq	-16(%rdi,%rdx), %rax
+# ifdef __CHKP__
+	bndcu	(%rax), %bnd0
+# endif
 4:	ret
 END (strrchr)