This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2 2/2] aarch64: Optimized memcpy and memmove for Kunpeng processor
- From: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- To: Yikun Jiang <yikunkero at gmail dot com>, Xuelei Zhang <zhangxuelei4 at huawei dot com>
- Cc: "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>, nd <nd at arm dot com>, Siddhesh Poyarekar <siddhesh at gotplt dot org>, "jiangyikun at huawei dot com" <jiangyikun at huawei dot com>, Szabolcs Nagy <Szabolcs dot Nagy at arm dot com>
- Date: Fri, 18 Oct 2019 15:50:07 +0000
- Subject: Re: [PATCH v2 2/2] aarch64: Optimized memcpy and memmove for Kunpeng processor
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+7GZcSGkH6qiKupZpJY3/VE8rJk7Wote4gzAPBH8e84=; b=SVROQXQqVQfWGt0UEyPG58g+T9Nw9SaPg0eSW4a27X6W6tNISzi0CWNVJui/K8GTgZg5c0jYLBhbTmoPryGib4YOVkW9OJfsT4gLxOCVenjghvjWu/V7NkVnmkBWERCWlL4A2gM7XLql0IqS40CaW2kAWWfrmUIZFtWSvGPe0XSV8IQAsum5l5yqpO7RAfIr/JZsnv9UCBHeq1672bYX7hmbewM/6ARtrHp3IhYZc+dnwN1GiccmgO83yqdNaNWPCGzlfSRZxgRC4H8T8WJiWObgzrN+ZS3OC6N2nU835PMYUbjs1IE+DY4fzR9+3R+roXuNuTCx+8d67jE7pKiBjA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HcbthNeiRFtwl02LYQrV1nl6Sa9FmBGQq9uQJ+6STaXLTGFJqhXkJwpD5j/GLpDZAYtmHfoeuzDIWgUWxWR6mk75RZje5UZE64ei98xDD/uzTtWHhoaoKA2LjV1PcjMIgztUpCP3YnhZjIK8PcWFOLiR4fu/BTRBQt1mBjVD5UC2HMb7b6yL7yDhrjrW5LeymzXj5vzOpp+WXzL3Ddclm33xz1UIiZlcOD1VFTYF2geyKoJOKSAd41rFixY37qg73CxcjvLvmbn4ssYSD/N/MTjGeH460dnPRPT7oNsCWjC03hP4Rq9eN3TwX9EEuJm168dwAgGWSSeTbC0UiYCZzQ==
- Original-authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wilco dot Dijkstra at arm dot com;
- References: <20191017131548.10808-1-zhangxuelei4@huawei.com>,<CAArz_dBiA_boCQmyuQLkK+8--U-Mxn9G9HHpjupEFn28k8SnSg@mail.gmail.com>
Hi Yikun,
>> Btw do you have any plans to post other string functions that you can discuss here? If so, would these
>> add more ifuncs or improve the generic versions?
>
> Yes, memcmp, strlen, strnlen, strcpy, memrchr will be included, we will summited the patch and test results as soon as possible.
>
>We have submitted the patches of string functions, see below:
Thanks, that makes it easier to discuss in more detail. So in almost all cases these
patches add new ifuncs. There are general issues with ifuncs which make adding
lots of similar ifuncs a bad idea. The key problem is that ifuncs are not used inside
GLIBC itself. For example the strstr implementation benefits from a fast memcmp
but it always uses the generic memcmp, so it won't get any gains from the Kunpeng
optimized one.
So this makes it highly desirable to improve the generic versions of string functions.
>From what I see, all of the changes are fairly simple and generic improvements, so
can be done easily to the generic versions. I think it would be a very bad idea to add
lots of ifunc variants which are almost identical to existing versions and differ in
minor details like unrolling.
For example strlen and memcmp add unrolling to existing code. Note that memchr_strlen
significantly outperforms the fastest strlen on sizes larger than 256, so I don't think that
using uminv to test for zeroes is the fastest approach.
Cheers,
Wilco