[PATCH] powerpc64: strrchr optimization for power8
Gabriel F. T. Gomes
gftg@linux.vnet.ibm.com
Thu Feb 9 15:26:00 GMT 2017
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.
More information about the Libc-alpha
mailing list