This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Rewritten v9/64-bit sparc strcmp.
- From: David Miller <davem at davemloft dot net>
- To: aurelien at aurel32 dot net
- Cc: libc-alpha at sourceware dot org
- Date: Wed, 30 Apr 2014 13:36:16 -0400 (EDT)
- Subject: Re: [PATCH] Rewritten v9/64-bit sparc strcmp.
- Authentication-results: sourceware.org; auth=none
- References: <20140429095339 dot GA31556 at hall dot aurel32 dot net> <20140429 dot 224046 dot 1363822337091646659 dot davem at davemloft dot net> <20140430160933 dot GC17797 at hall dot aurel32 dot net>
From: Aurelien Jarno <aurelien@aurel32.net>
Date: Wed, 30 Apr 2014 18:09:33 +0200
> That said as the patch needs to test the mask byte by byte, I do wonder
> if overall it wont be easier to directly test byte by byte the string
> word loaded in the register. My SPARC assembly knowledge is relatively
> limited, so I am not sure it is actually the case.
There is also the possibility to do divide-and-conquer, for example
determining that the low 32-bits have not bits set and then just
checking the high 32-bits.
But all such schemes add branches, and the whole idea of this code
is for it to be straight line and branchless, thus avoiding thread
switching on Niagara.
Anyways, thanks for testing I'll get this fix merged.