This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] PowerPC: optimized strcspn for POWER7
- From: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- To: libc-alpha at sourceware dot org
- Date: Tue, 04 Mar 2014 17:44:34 -0300
- Subject: Re: [PATCH] PowerPC: optimized strcspn for POWER7
- Authentication-results: sourceware.org; auth=none
- References: <53146958 dot 30406 at linux dot vnet dot ibm dot com>
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