This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] aarch64: optimize the unaligned case of memcmp
- From: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- To: Sebastian Pop <s dot pop at samsung dot com>, "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>
- Cc: Marcus Shawcroft <Marcus dot Shawcroft at arm dot com>, "maxim dot kuvyrkov at linaro dot org" <maxim dot kuvyrkov at linaro dot org>, Ramana Radhakrishnan <Ramana dot Radhakrishnan at arm dot com>, "ryan dot arnold at linaro dot org" <ryan dot arnold at linaro dot org>, "adhemerval dot zanella at linaro dot org" <adhemerval dot zanella at linaro dot org>, "sebpop at gmail dot com" <sebpop at gmail dot com>, nd <nd at arm dot com>
- Date: Mon, 26 Jun 2017 19:00:53 +0000
- Subject: Re: [PATCH] aarch64: optimize the unaligned case of memcmp
- Authentication-results: sourceware.org; auth=none
- Authentication-results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com;
- Nodisclaimer: True
- References: <CGME20170622233226uscas1p213aefedba5fe47e520aac1226a731162@uscas1p2.samsung.com> <1498174226-16525-1-git-send-email-s.pop@samsung.com> <637cf51c-160d-172f-6520-bba51058f85e@samsung.com> <AM5PR0802MB26106339AAEF3DABB5ACE56F83D80@AM5PR0802MB2610.eurprd08.prod.outlook.com>,<19ed586c-9724-cdc4-177f-174f880864a4@samsung.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
Sebastian Pop wrote:
> On 06/23/2017 04:28 PM, Wilco Dijkstra wrote:
>
> > Where is the setup of limit_wd and limit???
>
> You are right, my patch was not quite correct: I was missing the
> initialization of limit_wd, like so:
>
> lsr limit_wd, limit, #3
>
> limit is the number of bytes to be compared passed in as a parameter to
> memcmp.
You're still missing the setting of limit. Your current version will do the
words up to limit - (limit & 7), and then do byte by byte using the original
value of limit, so it's going well outside its bounds...
Wilco