This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PowerPC: optimized strcspn for POWER7


On 03-03-2014 08:36, Adhemerval Zanella wrote:
> +	/* First the table should be cleared and to avoid unaligned accesses
> +	   when using the VSX stores the table address is aligned to 16
> +	   bytes.  */
> +	xxlxor	v0,v0,v0
> +	addi 	r9,r1,-272	/* Allocates ALIGN(256 + 15, 8) bytes  */

Following strpbrk I realized this stack allocation is wrong. Below is a correct modification:

@@ -34,7 +33,12 @@ EALIGN (strcspn, 4, 0)
           when using the VSX stores the table address is aligned to 16
           bytes.  */
        xxlxor  v0,v0,v0
-       addi    r9,r1,-272      /* Allocates ALIGN(256 + 15, 8) bytes  */
+
+       /* PPC64 ELF ABI stack is aligned to 8 bytes, so allocates 264 bytes
+          (256 for the the table plus 8), and aligned it to 16 bytes.  */
+       addi    r9,r1,-264
+       rldicr  r9,r9,0,59
+
        li      r8,48
        li      r5,16
        li      r6,32


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]