This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] powerpc64: strrchr optimization for power8
- From: "Gabriel F. T. Gomes" <gftg at linux dot vnet dot ibm dot com>
- To: Rajalakshmi Srinivasaraghavan <raji at linux dot vnet dot ibm dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 9 Feb 2017 13:25:56 -0200
- Subject: Re: [PATCH] powerpc64: strrchr optimization for power8
- Authentication-results: sourceware.org; auth=none
- References: <1486616454-14704-1-git-send-email-raji@linux.vnet.ibm.com>
Hi,
I have a few cosmetic comments...
On Thu, 9 Feb 2017 10:30:54 +0530
Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com> wrote:
> +/* int [r3] strrchr (char *s [r3], int c [r4]) */
~~~
Should it be char *, instead?
> +#define MTVRD(v,r) .long (0x7c000167 | ((v)<<(32-11)) | ((r)<<(32-16)))
> +#define MFVRD(r,v) .long (0x7c000067 | ((v)<<(32-11)) | ((r)<<(32-16)))
> +#define VBPERMQ(t,a,b) .long (0x1000054c \
> + | ((t)<<(32-11)) \
> + | ((a)<<(32-16)) \
> + | ((b)<<(32-21)) )
~~~~~~~~~~~~~~~~~~~~~~~~
Eight spaces should be replaced with tabs.
> +#define VCLZD(r,v) .long (0x100007c2 | ((r)<<(32-11)) | ((v)<<(32-21)))
> +#define VPOPCNTD(r,v) .long (0x100007c3 | ((r)<<(32-11)) | ((v)<<(32-21)))
> +#define VADDUQM(t,a,b) .long (0x10000100 \
> + | ((t)<<(32-11)) \
> + | ((a)<<(32-16)) \
> + | ((b)<<(32-21)) )
~~~~~~~~~~~~~~~~~~~~~~~~
Likewise.
> + /* r4 is changed now ,if its passed as more chars
^
now, if
> + li r5, 16
> + vspltb v1, v1, 7
> + /* Compare 32 bytes in each loop. */
~~~~~~~~
Eight spaces should be replaced with tabs.
> + blt cr6, L(match)
> +
> + /* One (or both) of the quadwords contains c/null. */
~~~~~~~~
Likewise.
> +
> +L(match):
> + /* One (or both) of the quadwords contains a match. */
~~~~~~~~
Likewise.
> + vslb v10, v11, v10
> + li r5, 16
> + /* Compare 32 bytes in each loop. */
~~~~~~~~
Likewise.