diff options
Diffstat (limited to 'sysdeps/x86_64/strspn.S')
-rw-r--r-- | sysdeps/x86_64/strspn.S | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/sysdeps/x86_64/strspn.S b/sysdeps/x86_64/strspn.S index 2911da2aa5..bd3be8ad6a 100644 --- a/sysdeps/x86_64/strspn.S +++ b/sysdeps/x86_64/strspn.S @@ -25,6 +25,12 @@ .text ENTRY (strspn) +#ifdef __CHKP__ + bndcl (%rdi), %bnd0 + bndcu (%rdi), %bnd0 + bndcl (%rsi), %bnd1 + bndcu (%rsi), %bnd1 +#endif movq %rdi, %rdx /* Save SRC. */ @@ -50,21 +56,34 @@ ENTRY (strspn) have a correct zero-extended 64-bit value in %rcx. */ .p2align 4 -L(2): movb (%rax), %cl /* get byte from stopset */ +L(2): +#ifdef __CHKP__ + bndcu (%rax), %bnd1 +#endif + movb (%rax), %cl /* get byte from stopset */ testb %cl, %cl /* is NUL char? */ jz L(1) /* yes => start compare loop */ movb %cl, (%rsp,%rcx) /* set corresponding byte in stopset table */ +#ifdef __CHKP__ + bndcu 1(%rax), %bnd1 +#endif movb 1(%rax), %cl /* get byte from stopset */ testb $0xff, %cl /* is NUL char? */ jz L(1) /* yes => start compare loop */ movb %cl, (%rsp,%rcx) /* set corresponding byte in stopset table */ +#ifdef __CHKP__ + bndcu 2(%rax), %bnd1 +#endif movb 2(%rax), %cl /* get byte from stopset */ testb $0xff, %cl /* is NUL char? */ jz L(1) /* yes => start compare loop */ movb %cl, (%rsp,%rcx) /* set corresponding byte in stopset table */ +#ifdef __CHKP__ + bndcu 3(%rax), %bnd1 +#endif movb 3(%rax), %cl /* get byte from stopset */ addq $4, %rax /* increment stopset pointer */ movb %cl, (%rsp,%rcx) /* set corresponding byte in stopset table */ @@ -85,18 +104,30 @@ L(1): leaq -4(%rdx), %rax /* prepare loop */ .p2align 4 L(3): addq $4, %rax /* adjust pointer for full loop round */ +#ifdef __CHKP__ + bndcu (%rax), %bnd0 +#endif movb (%rax), %cl /* get byte from string */ testb %cl, (%rsp,%rcx) /* is it contained in skipset? */ jz L(4) /* no => return */ +#ifdef __CHKP__ + bndcu 1(%rax), %bnd0 +#endif movb 1(%rax), %cl /* get byte from string */ testb %cl, (%rsp,%rcx) /* is it contained in skipset? */ jz L(5) /* no => return */ +#ifdef __CHKP__ + bndcu 2(%rax), %bnd0 +#endif movb 2(%rax), %cl /* get byte from string */ testb %cl, (%rsp,%rcx) /* is it contained in skipset? */ jz L(6) /* no => return */ +#ifdef __CHKP__ + bndcu 3(%rax), %bnd0 +#endif movb 3(%rax), %cl /* get byte from string */ testb %cl, (%rsp,%rcx) /* is it contained in skipset? */ jnz L(3) /* yes => start loop again */ |